Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

diskspace one-liner

1
2
3
4
5
#!/bin/bash
df -h | grep disk0s2 | awk '{print "System:", $3, "of", $2, "-", $4, "available"}' | sed 's/Gi/Gb/g';
df -h | grep disk0s3 | awk '{print "UserHD:", $3, "of", $2, "-", $4, "available"}' | sed 's/Gi/Gb/g';

# change disk0s2 and the corresponding name ("System:") as necessary
https://snipt.net/embed/0f14bdd9ccd41db7694b6c4a4413d892/
https://snipt.net/raw/0f14bdd9ccd41db7694b6c4a4413d892/
0f14bdd9ccd41db7694b6c4a4413d892
bash
Bash
5
2016-12-05T17:04:50
True
False
False
/api/public/snipt/3004/
diskspace-one-liner
<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="ch">#!/bin/bash</span> </span><span id="L-2"><a name="L-2"></a>df -h <span class="p">|</span> grep disk0s2 <span class="p">|</span> awk <span class="s1">&#39;{print &quot;System:&quot;, $3, &quot;of&quot;, $2, &quot;-&quot;, $4, &quot;available&quot;}&#39;</span> <span class="p">|</span> sed <span class="s1">&#39;s/Gi/Gb/g&#39;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a>df -h <span class="p">|</span> grep disk0s3 <span class="p">|</span> awk <span class="s1">&#39;{print &quot;UserHD:&quot;, $3, &quot;of&quot;, $2, &quot;-&quot;, $4, &quot;available&quot;}&#39;</span> <span class="p">|</span> sed <span class="s1">&#39;s/Gi/Gb/g&#39;</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1"># change disk0s2 and the corresponding name (&quot;System:&quot;) as necessary</span> </span></pre></div> </td></tr></table>
bash, geektool, monitoring, scripts

Bash

External IP address

echo "External :" `curl --silent http://checkip.dyndns.org | awk '{print $6}' | cut -f 1 -d "<"`
https://snipt.net/embed/e5902772d0a7b90d980f77dfad56c486/
https://snipt.net/raw/e5902772d0a7b90d980f77dfad56c486/
e5902772d0a7b90d980f77dfad56c486
bash
Bash
1
2016-12-09T14:06:37
True
False
False
/api/public/snipt/3002/
external-ip-address
<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><span class="nb">echo</span> <span class="s2">&quot;External :&quot;</span> <span class="sb">`</span>curl --silent http://checkip.dyndns.org <span class="p">|</span> awk <span class="s1">&#39;{print $6}&#39;</span> <span class="p">|</span> cut -f <span class="m">1</span> -d <span class="s2">&quot;&lt;&quot;</span><span class="sb">`</span> </span></pre></div> </td></tr></table>
"ip address", bash, monitoring, network, scripts
Copyrighted, illegal, or inappropriate content? Email [email protected].