snipt

Ctrl+h for KB shortcuts

Bash

monitor system load on unix

tload
https://snipt.net/embed/1d6691830cd5dbbb99bdb20ea526b393/
/raw/1d6691830cd5dbbb99bdb20ea526b393/
1d6691830cd5dbbb99bdb20ea526b393
bash
Bash
1
2019-07-20T12:00:52
True
False
False
/api/public/snipt/676/
monitor-system-load-on-unix
<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></span><span id="L-1"><a name="L-1"></a>tload </span></pre></div> </td></tr></table>
unix

Bash

human readable size of directory

du -sh <dir>
https://snipt.net/embed/46812600d439c87d61acf0de8a1378cb/
/raw/46812600d439c87d61acf0de8a1378cb/
46812600d439c87d61acf0de8a1378cb
bash
Bash
1
2019-07-19T10:26:55
True
False
False
/api/public/snipt/673/
human-readable-size-of-directory
<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></span><span id="L-1"><a name="L-1"></a>du -sh &lt;dir&gt; </span></pre></div> </td></tr></table>
bash, linux, server

Bash

gives you a sorted list of the thigns using the most space

du -s * | sort -n
https://snipt.net/embed/53f475e722d056a863b5d1651c6d6845/
/raw/53f475e722d056a863b5d1651c6d6845/
53f475e722d056a863b5d1651c6d6845
bash
Bash
1
2019-07-17T14:20:52
True
False
False
/api/public/snipt/672/
gives-you-a-sorted-list-of-the-thigns-using-the-most-space
<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></span><span id="L-1"><a name="L-1"></a>du -s * <span class="p">|</span> sort -n </span></pre></div> </td></tr></table>
bash, linux, server

Bash

find and delete all files in www directory ending in LCK

find www -name *.LCK -type f -print | xargs rm
https://snipt.net/embed/f9e719a0ea03053a15292d3fd58dbc59/
/raw/f9e719a0ea03053a15292d3fd58dbc59/
f9e719a0ea03053a15292d3fd58dbc59
bash
Bash
1
2019-07-22T19:15:50
True
False
False
/api/public/snipt/671/
find-and-delete-all-files-in-www-directory-ending-in-lck
<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></span><span id="L-1"><a name="L-1"></a>find www -name *.LCK -type f -print <span class="p">|</span> xargs rm </span></pre></div> </td></tr></table>
bash, linux, server

Bash

find all files in www directory ending in LCK and print them out

find www -name *.LCK -type f -print
https://snipt.net/embed/e852e8ea0a8a8f7a8fb13ac1003be504/
/raw/e852e8ea0a8a8f7a8fb13ac1003be504/
e852e8ea0a8a8f7a8fb13ac1003be504
bash
Bash
1
2019-07-22T17:30:27
True
False
False
/api/public/snipt/670/
find-all-files-in-www-directory-ending-in-lck-and-print-them-out
<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></span><span id="L-1"><a name="L-1"></a>find www -name *.LCK -type f -print </span></pre></div> </td></tr></table>
linux, server

Bash

recursive grep

find /path/ -type f -name "*" | xargs grep
https://snipt.net/embed/e5f9673668c4ec897e1abb201256e871/
/raw/e5f9673668c4ec897e1abb201256e871/
e5f9673668c4ec897e1abb201256e871
bash
Bash
1
2019-07-06T10:09:08
True
False
False
/api/public/snipt/657/
recursive-grep
<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></span><span id="L-1"><a name="L-1"></a>find /path/ -type f -name <span class="s2">&quot;*&quot;</span> <span class="p">|</span> xargs grep </span></pre></div> </td></tr></table>
search, shell

Bash

Actualizar macports

$ sudo port -v selfupdate
$ sudo port upgrade outdated
https://snipt.net/embed/04f5e982a0de25b830677324839194e5/
/raw/04f5e982a0de25b830677324839194e5/
04f5e982a0de25b830677324839194e5
bash
Bash
2
2019-07-21T03:15:53
True
False
False
/api/public/snipt/626/
actualizar-macports
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ sudo port -v selfupdate </span><span id="L-2"><a name="L-2"></a>$ sudo port upgrade outdated </span></pre></div> </td></tr></table>
macports, osx

Perl

Set up proxy for www::mechanize

1
2
3
4
5
my $site = 'http://site';
$ENV{HTTP_PROXY}  = 'http://proxy:8080';
$ENV{HTTPS_PROXY} = 'http://proxy:8080';
my $m = WWW::Mechanize->new( autocheck => 1, stack_depth => 1 );
$m->proxy( ['https'], '' );
https://snipt.net/embed/25fd84aff9be5cd0f6e74dadd8a767ef/
/raw/25fd84aff9be5cd0f6e74dadd8a767ef/
25fd84aff9be5cd0f6e74dadd8a767ef
perl
Perl
5
2019-07-09T00:09:25
True
False
False
/api/public/snipt/616/
set-up-proxy-for-wwwmechanize
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">my</span> <span class="nv">$site</span> <span class="o">=</span> <span class="s">&#39;http://site&#39;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$ENV</span><span class="p">{</span><span class="n">HTTP_PROXY</span><span class="p">}</span> <span class="o">=</span> <span class="s">&#39;http://proxy:8080&#39;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="nv">$ENV</span><span class="p">{</span><span class="n">HTTPS_PROXY</span><span class="p">}</span> <span class="o">=</span> <span class="s">&#39;http://proxy:8080&#39;</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="k">my</span> <span class="nv">$m</span> <span class="o">=</span> <span class="nn">WWW::</span><span class="n">Mechanize</span><span class="o">-&gt;</span><span class="k">new</span><span class="p">(</span> <span class="n">autocheck</span> <span class="o">=&gt;</span> <span class="mi">1</span><span class="p">,</span> <span class="n">stack_depth</span> <span class="o">=&gt;</span> <span class="mi">1</span> <span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="nv">$m</span><span class="o">-&gt;</span><span class="n">proxy</span><span class="p">(</span> <span class="p">[</span><span class="s">&#39;https&#39;</span><span class="p">],</span> <span class="s">&#39;&#39;</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
mechanize, proxy