snipt

Ctrl+h for KB shortcuts

Bash

Restart of SSH Connections

pstree -cpal | egrep [s]shd | perl -lne '($i)=(/(\d+)/); `kill -1 $i`'
https://snipt.net/embed/8f8b6190734e8065fec2cd0b33808997/
/raw/8f8b6190734e8065fec2cd0b33808997/
8f8b6190734e8065fec2cd0b33808997
bash
Bash
1
2019-07-21T05:02:57
True
False
False
Dec 20, 2012 at 05:53 AM
/api/public/snipt/52131/
restart-of-ssh-connections
<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>pstree -cpal <span class="p">|</span> egrep <span class="o">[</span>s<span class="o">]</span>shd <span class="p">|</span> perl -lne <span class="s1">&#39;($i)=(/(\d+)/); `kill -1 $i`&#39;</span> </span></pre></div> </td></tr></table>
restart, ssh, unix

Python

nginx restart

/etc/init.d/nginx restart
https://snipt.net/embed/f0f76c1162973cd7c347453e45c40b6d/
/raw/f0f76c1162973cd7c347453e45c40b6d/
f0f76c1162973cd7c347453e45c40b6d
python
Python
1
2019-07-22T22:00:24
True
False
False
/api/public/snipt/31290/
nginx-restart
<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="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">init</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">nginx</span> <span class="n">restart</span> </span></pre></div> </td></tr></table>
nginx, restart

Python

netcat automatic reconnect

1
2
3
4
5
6
#!/usr/bin/env python2

import subprocess

while True:
    subprocess.call(['nc', 'localhost', '5206'])
https://snipt.net/embed/ba861c3055173a51f226e9a0cb10657d/
/raw/ba861c3055173a51f226e9a0cb10657d/
ba861c3055173a51f226e9a0cb10657d
python
Python
6
2019-07-22T10:07:39
True
False
False
/api/public/snipt/26983/
netcat-automatic-reconnect
<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><span class="ch">#!/usr/bin/env python2</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="kn">import</span> <span class="nn">subprocess</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="k">while</span> <span class="bp">True</span><span class="p">:</span> </span><span id="L-6"><a name="L-6"></a> <span class="n">subprocess</span><span class="o">.</span><span class="n">call</span><span class="p">([</span><span class="s1">&#39;nc&#39;</span><span class="p">,</span> <span class="s1">&#39;localhost&#39;</span><span class="p">,</span> <span class="s1">&#39;5206&#39;</span><span class="p">])</span> </span></pre></div> </td></tr></table>
nc, netcat, python, reconnect, restart

Bash

Mediatemple (dv) server - Plesk & Apache restart

/usr/local/psa/admin/sbin/websrvmng -a -v
https://snipt.net/embed/64a52bf658113ac80b0e6ed360972556/
/raw/64a52bf658113ac80b0e6ed360972556/
64a52bf658113ac80b0e6ed360972556
bash
Bash
1
2019-07-21T03:27:31
True
False
False
/api/public/snipt/9993/
restart-mediatemple-dv-pleskapache
<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>/usr/local/psa/admin/sbin/websrvmng -a -v </span></pre></div> </td></tr></table>
apache, dv, mediatemple, plesk, restart

Bash

Restart Plesk Spamassassin

/etc/init.d/psa-spamassassin restart
https://snipt.net/embed/acecf429ee0ae920215e9ade1113b3f1/
/raw/acecf429ee0ae920215e9ade1113b3f1/
acecf429ee0ae920215e9ade1113b3f1
bash
Bash
1
2019-07-20T17:56:57
True
False
False
/api/public/snipt/2936/
restart-plesk-spamassassin
<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>/etc/init.d/psa-spamassassin restart </span></pre></div> </td></tr></table>
plesk, restart, spamassassin

Bash

Restart nginx

/etc/init.d/nginx restart
https://snipt.net/embed/5ee954c6bfee5f2e8bac2f7b972a13f1/
/raw/5ee954c6bfee5f2e8bac2f7b972a13f1/
5ee954c6bfee5f2e8bac2f7b972a13f1
bash
Bash
1
2019-07-18T08:07:34
True
False
False
/api/public/snipt/2792/
restart-nginx
<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>/etc/init.d/nginx restart </span></pre></div> </td></tr></table>
nginx, restart