Difference between revisions of "JSON Beautifier"

From RHS Wiki
Jump to navigation Jump to search
m
Tag: visualeditor
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
=== Python ===
 +
<syntaxhighlight lang="bash">
 +
echo '{"test1": 1, "test2": "win"}' | python -m json.tool
 +
</syntaxhighlight>
 +
 +
 +
 +
 
[https://github.com/ddopson/underscore-cli underscore-cli]<br />
 
[https://github.com/ddopson/underscore-cli underscore-cli]<br />
== Requirements ==  
+
==Description==
 +
Underscore provides a CLI JSON Beautifier this document describes how to install underscore or any other npm package with proxy and without it.
 +
 
 +
==Requirements==  
 
npm<br />
 
npm<br />
  
== Install with internet access ==
+
==Install with internet access==
 
  curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
 
  curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
 
  sudo bash nodesource_setup.sh
 
  sudo bash nodesource_setup.sh
 
  sudo apt install nodejs
 
  sudo apt install nodejs
  
== Install behind Proxy SOCS5 ==
+
==Install behind Proxy SOCS5==
 
  <nowiki>proxychains curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
 
  <nowiki>proxychains curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
proxychains sudo bash nodesource_setup.sh
+
proxychains sudo bash nodesource_setup.sh
sudo proxychains apt install nodejs</nowiki>
+
sudo proxychains apt install nodejs</nowiki>
  
 
NPM does not support Socks5 proxy so you will have to install an HTTP proxy (polipo) and connect it to your socs5 proxy
 
NPM does not support Socks5 proxy so you will have to install an HTTP proxy (polipo) and connect it to your socs5 proxy
 
  sudo proxychains apt install polipo
 
  sudo proxychains apt install polipo
 
/etc/polipo/config
 
/etc/polipo/config
  <nowiki>socksParentProxy = 10.0.8.xxx:1337
+
  <nowiki>socksParentProxy = 20.1.40.109:1337
socksProxyType = socks5
+
socksProxyType = socks5
proxyAddress = ::0
+
proxyAddress = ::0
proxyPort = 8123</nowiki>
+
proxyPort = 8123</nowiki>
  
 
  sudo service polipo restart
 
  sudo service polipo restart
  
 
Start your SOCKS5 proxy:
 
Start your SOCKS5 proxy:
   ssh -fN -D1337 user@server
+
   ssh -fN -D 20.1.40.109:1337 user@server
  
 
Setup npm to use Proxy
 
Setup npm to use Proxy

Latest revision as of 11:16, 28 July 2021

Python[edit]

echo '{"test1": 1, "test2": "win"}' | python -m json.tool



underscore-cli

Description[edit]

Underscore provides a CLI JSON Beautifier this document describes how to install underscore or any other npm package with proxy and without it.

Requirements[edit]

npm

Install with internet access[edit]

curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs

Install behind Proxy SOCS5[edit]

proxychains curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
 proxychains sudo bash nodesource_setup.sh
 sudo proxychains apt install nodejs

NPM does not support Socks5 proxy so you will have to install an HTTP proxy (polipo) and connect it to your socs5 proxy

sudo proxychains apt install polipo

/etc/polipo/config

socksParentProxy = 20.1.40.109:1337
 socksProxyType = socks5
 proxyAddress = ::0
 proxyPort = 8123
sudo service polipo restart

Start your SOCKS5 proxy:

 ssh -fN -D 20.1.40.109:1337 user@server

Setup npm to use Proxy

npm config set proxy http://127.0.0.1:8123
npm config set https-proxy http://127.0.0.1:8123
sudo npm install -g underscore-cli

npm behind SOCKS5 proxy