snipt

Ctrl+h for KB shortcuts

Bash

monitor space usage in real time - by partition and with total

watch 'df -P / /var /mnt/* | tail -n +2 | ( total=0; while read dev blocks used rest; do total=$(($total+$used)) ; echo $used $dev; done; echo -----; echo $total )'
https://snipt.net/embed/92caf508218f539ff6f88c9340ce1e0f/
/raw/92caf508218f539ff6f88c9340ce1e0f/
92caf508218f539ff6f88c9340ce1e0f
bash
Bash
1
2019-08-22T14:01:52
True
False
False
/api/public/snipt/5160/
monitor-space-usage-in-real-time-by-partition-and-with-total
<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>watch <span class="s1">&#39;df -P / /var /mnt/* | tail -n +2 | ( total=0; while read dev blocks used rest; do total=$(($total+$used)) ; echo $used $dev; done; echo -----; echo $total )&#39;</span> </span></pre></div> </td></tr></table>
bash, df, disk, monitor, partition, space

Bash

add ubuntu ppa keys to the apt keyring

1
2
3
4
5
6
7
8
# if you get this when doing apt-get update:
#
# W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn't be verified because the public key is not available:
# NO_PUBKEY XXXXXXXXXXXXXXXX
#
# do this:

$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXXXXXXXXXXXX
https://snipt.net/embed/221dc1a8d12b81d9fd74728a8f99c2bb/
/raw/221dc1a8d12b81d9fd74728a8f99c2bb/
221dc1a8d12b81d9fd74728a8f99c2bb
bash
Bash
8
2019-08-20T19:41:13
True
False
False
/api/public/snipt/4574/
add-ubuntu-ppa-keys-to-the-apt-keyring
<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> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># if you get this when doing apt-get update:</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">#</span> </span><span id="L-3"><a name="L-3"></a><span class="c1"># W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn&#39;t be verified because the public key is not available:</span> </span><span id="L-4"><a name="L-4"></a><span class="c1"># NO_PUBKEY XXXXXXXXXXXXXXXX</span> </span><span id="L-5"><a name="L-5"></a><span class="c1">#</span> </span><span id="L-6"><a name="L-6"></a><span class="c1"># do this:</span> </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXXXXXXXXXXXX </span></pre></div> </td></tr></table>
apt, bash, gpg, ppa, ubuntu

Bash

sort installed debian packages by size

dpkg-query -W -f='${Installed-Size} ${Package}\n' | sort -n
https://snipt.net/embed/328c1af5ed831137641d4d19e9f5853c/
/raw/328c1af5ed831137641d4d19e9f5853c/
328c1af5ed831137641d4d19e9f5853c
bash
Bash
1
2019-08-20T16:09:45
True
False
False
/api/public/snipt/4246/
sort-installed-debian-packages-by-size
<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>dpkg-query -W -f<span class="o">=</span><span class="s1">&#39;${Installed-Size} ${Package}\n&#39;</span> <span class="p">|</span> sort -n </span></pre></div> </td></tr></table>
bash, deb, dpkg