snipt

Ctrl+h for KB shortcuts

Text only

How to pretty-print JSON from the command line?

1
2
3
python -mjson.tool ugly.json > pretty.json

via http://stackoverflow.com/questions/352098/how-to-pretty-print-json-from-the-command-line
https://snipt.net/embed/98d63046e6e88ff075e961afa0d94441/
https://snipt.net/raw/98d63046e6e88ff075e961afa0d94441/
98d63046e6e88ff075e961afa0d94441
text
Text only
3
2016-09-21T13:01:42
True
False
False
May 20, 2013 at 06:27 AM
/api/public/snipt/61774/
how-to-pretty-print-json-from-the-command-line
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>python -mjson.tool ugly.json &gt; pretty.json </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>via http://stackoverflow.com/questions/352098/how-to-pretty-print-json-from-the-command-line </span></pre></div> </td></tr></table>
command-line, json, pretty-print, python, unix

Text only

Mysql dump using SSH

mysqldump --opt -u [dbuser] -p [dbname]> [filename].sql
https://snipt.net/embed/93535cce40c45c2f80c726e5c078f6a7/
https://snipt.net/raw/93535cce40c45c2f80c726e5c078f6a7/
93535cce40c45c2f80c726e5c078f6a7
text
Text only
1
2016-09-22T03:03:29
True
False
False
Jan 15, 2014 at 08:56 PM
/api/public/snipt/43134/
mysql-dump-using-ssh
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>mysqldump --opt -u [dbuser] -p [dbname]&gt; [filename].sql </span></pre></div> </td></tr></table>
cmd, command-line, console, linux, mysql, mysqldump, server, ssh

Text only

Transfer a filer from server to server over SCP in Linux

scp filename.zip user@server:path
https://snipt.net/embed/ff844d5c726639a4ee4f4c8b228bba06/
https://snipt.net/raw/ff844d5c726639a4ee4f4c8b228bba06/
ff844d5c726639a4ee4f4c8b228bba06
text
Text only
1
2016-09-22T02:50:29
True
False
False
Jan 15, 2014 at 08:55 PM
/api/public/snipt/41169/
transfer-a-filer-from-server-to-server-overscp-in-linux
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>scp filename.zip user@server:path </span></pre></div> </td></tr></table>
command-line, console, linux, scp, server

Text only

Zip a folder and subfolders using SSH

zip -r -q [NAME].zip *
https://snipt.net/embed/dd0ca3e1c292ed2dd73a7f376ba510cc/
https://snipt.net/raw/dd0ca3e1c292ed2dd73a7f376ba510cc/
dd0ca3e1c292ed2dd73a7f376ba510cc
text
Text only
1
2016-09-30T03:41:34
True
False
False
/api/public/snipt/40113/
zip-a-folder-and-subfolders-using-ssh
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>zip -r -q [NAME].zip * </span></pre></div> </td></tr></table>
cmd, command-line, linux, server, ssh, zip

Text only

Solve "hidden files and folders" or folders as links, caused by virus

1
2
3
4
5
6
7
Click on "Start" -> Run -> type cmd and click on OK.

Enter this command replacing "g:" with your drive letter.

attrib -h -r -s /s /d g:\*.*

Press "Enter".
https://snipt.net/embed/32cac1e356f4788dbaaf297164dbf0d2/
https://snipt.net/raw/32cac1e356f4788dbaaf297164dbf0d2/
32cac1e356f4788dbaaf297164dbf0d2
text
Text only
7
2016-09-30T18:04:37
True
False
False
/api/public/snipt/39868/
solve-hidden-files-and-folders-or-folders-as-links-caused-by-virus
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Click on &quot;Start&quot; -&gt; Run -&gt; type cmd and click on OK. </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>Enter this command replacing &quot;g:&quot; with your drive letter. </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>attrib -h -r -s /s /d g:\*.* </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>Press &quot;Enter&quot;. </span></pre></div> </td></tr></table>
DOS, cmd, command-line, virus, windows

Text only

player rlz

1
2
3
// Mais uma noite
cd ~i4k/musics
mpg123 *.mp3 &
https://snipt.net/embed/4add96d55f78efbb0e44581ee8f4308c/
https://snipt.net/raw/4add96d55f78efbb0e44581ee8f4308c/
4add96d55f78efbb0e44581ee8f4308c
text
Text only
3
2016-09-30T18:57:29
True
False
False
/api/public/snipt/6399/
player-rlz
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>// Mais uma noite </span><span id="L-2"><a name="L-2"></a>cd ~i4k/musics </span><span id="L-3"><a name="L-3"></a>mpg123 *.mp3 &amp; </span></pre></div> </td></tr></table>
command-line, linux, mpg123, player
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.