snipt

Ctrl+h for KB shortcuts

Bash

command line mail

1
2
3
4
5
6
sudo aptitude install mailx
sudo echo "smtp.comcast.com mailhost" >> /etc/hosts
echo "blah" | mail -s test [email protected]

sudo aptitude install sharutils
cat myFile.txt | uuencode myAttachment.bash | mail -s mySubject [email protected]
https://snippets.siftie.com/embed/a60a241107de50b8e6d3fbd576b2a36c/
/raw/a60a241107de50b8e6d3fbd576b2a36c/
a60a241107de50b8e6d3fbd576b2a36c
bash
Bash
7
2019-03-22T21:20:23
True
False
False
/api/public/snipt/5695/
command-line-mail
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>sudo aptitude install mailx </span><span id="L-2"><a name="L-2"></a>sudo <span class="nb">echo</span> <span class="s2">&quot;smtp.comcast.com mailhost&quot;</span> &gt;&gt; /etc/hosts </span><span id="L-3"><a name="L-3"></a><span class="nb">echo</span> <span class="s2">&quot;blah&quot;</span> <span class="p">|</span> mail -s <span class="nb">test</span> [email protected] </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>sudo aptitude install sharutils </span><span id="L-6"><a name="L-6"></a>cat myFile.txt <span class="p">|</span> uuencode myAttachment.bash <span class="p">|</span> mail -s mySubject [email protected] </span></pre></div> </td></tr></table>
email, mail

Bash

change vcpu limit in esx

esxcfg-advcfg -s (num) /Misc/RunningVCpuLimit
esxcfg-advcfg -g /Misc/RunningVCpuLimit
https://snippets.siftie.com/embed/ea40df630e1645bff0b0c410eb25b8bb/
/raw/ea40df630e1645bff0b0c410eb25b8bb/
ea40df630e1645bff0b0c410eb25b8bb
bash
Bash
3
2019-03-19T19:07:44
True
False
False
/api/public/snipt/5694/
change-vcpu-limit-in-esx
<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>esxcfg-advcfg -s <span class="o">(</span>num<span class="o">)</span> /Misc/RunningVCpuLimit </span><span id="L-2"><a name="L-2"></a>esxcfg-advcfg -g /Misc/RunningVCpuLimit </span></pre></div> </td></tr></table>
esx

Bash

esx mount nfs

1
2
3
4
service firewall stop
chkconfig portmap on
service portmap start
mount -t nfs host:/folder /mnt/folder
https://snippets.siftie.com/embed/e8525b57fcbf9366829cc976cfd17f58/
/raw/e8525b57fcbf9366829cc976cfd17f58/
e8525b57fcbf9366829cc976cfd17f58
bash
Bash
5
2019-03-06T15:03:29
True
False
False
/api/public/snipt/5693/
esx-mount-nfs
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>service firewall stop </span><span id="L-2"><a name="L-2"></a>chkconfig portmap on </span><span id="L-3"><a name="L-3"></a>service portmap start </span><span id="L-4"><a name="L-4"></a>mount -t nfs host:/folder /mnt/folder </span></pre></div> </td></tr></table>
esx, nfs

Bash

fix hostd

service mgmt-vmware restart
https://snippets.siftie.com/embed/ddc5a812b72ad7c5c746be834ac1b09d/
/raw/ddc5a812b72ad7c5c746be834ac1b09d/
ddc5a812b72ad7c5c746be834ac1b09d
bash
Bash
2
2019-03-19T19:22:19
True
False
False
/api/public/snipt/5692/
fix-hostd
<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>service mgmt-vmware restart </span></pre></div> </td></tr></table>
esx

Text only

terminal server commands

taskkill
qwinsta
https://snippets.siftie.com/embed/a584476c26c64142758730df5085e7f7/
/raw/a584476c26c64142758730df5085e7f7/
a584476c26c64142758730df5085e7f7
text
Text only
2
2019-03-19T18:55:14
True
False
False
/api/public/snipt/5691/
terminal-server-commands
<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>taskkill </span><span id="L-2"><a name="L-2"></a>qwinsta </span></pre></div> </td></tr></table>
windows

Bash

bash integer padding

printf "%03d\n" 12
https://snippets.siftie.com/embed/04bc98ec58e2bda85e1a50b34079b762/
/raw/04bc98ec58e2bda85e1a50b34079b762/
04bc98ec58e2bda85e1a50b34079b762
bash
Bash
1
2019-03-22T20:29:29
True
False
False
/api/public/snipt/5690/
bash-integer-padding
<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">printf</span> <span class="s2">&quot;%03d\n&quot;</span> 12 </span></pre></div> </td></tr></table>
bash, printf

Bash

bash variable in awk

awk '{print "'"$VAR1"'", "'"$VAR2"'"}'
https://snippets.siftie.com/embed/bbb94c56e594a4e17168303d9e7402b8/
/raw/bbb94c56e594a4e17168303d9e7402b8/
bbb94c56e594a4e17168303d9e7402b8
bash
Bash
1
2019-03-19T18:44:07
True
False
False
/api/public/snipt/5689/
bash-variable-in-awk
<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>awk <span class="s1">&#39;{print &quot;&#39;</span><span class="s2">&quot;</span><span class="nv">$VAR1</span><span class="s2">&quot;</span><span class="s1">&#39;&quot;, &quot;&#39;</span><span class="s2">&quot;</span><span class="nv">$VAR2</span><span class="s2">&quot;</span><span class="s1">&#39;&quot;}&#39;</span> </span></pre></div> </td></tr></table>
awk, bash