snipt

Ctrl+h for KB shortcuts

Bash

run banshee from ssh session

1
2
3
4
5
#!/bin/sh
# run banshee from ssh session & auto play queque

export DISPLAY=:0
dbus-launch /usr/bin/banshee --play
https://snipt.net/embed/119b892a633c54572755819b9c61fa10/
/raw/119b892a633c54572755819b9c61fa10/
119b892a633c54572755819b9c61fa10
bash
Bash
6
2019-07-21T20:39:58
True
False
False
/api/public/snipt/9327/
run-banshee-from-ssh-session
<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/sh</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># run banshee from ssh session &amp; auto play queque</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="nb">export</span> <span class="nv">DISPLAY</span><span class="o">=</span>:0 </span><span id="L-5"><a name="L-5"></a>dbus-launch /usr/bin/banshee --play </span></pre></div> </td></tr></table>
dbus, run, ssh

Bash

Mailbox Plesk Diskusage

cd /var/qmail/mailnames/; du -sh */*
https://snipt.net/embed/5579f5673c604c8640459ca9841a2554/
/raw/5579f5673c604c8640459ca9841a2554/
5579f5673c604c8640459ca9841a2554
bash
Bash
1
2019-07-18T16:51:07
True
False
False
/api/public/snipt/9209/
mailbox-plesk-diskusage
<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">cd</span> /var/qmail/mailnames/<span class="p">;</span> du -sh */* </span></pre></div> </td></tr></table>
diskusage, mailnames, plesk, ssh

Ruby

ssh port forwarding

#This forwards all localhost:1234 connections to google.com:80 through gimli
ssh -L 1234:google.com:80 gimli.cs.berkeley.edu
https://snipt.net/embed/554defb67545e7a2885fa8560c668925/
/raw/554defb67545e7a2885fa8560c668925/
554defb67545e7a2885fa8560c668925
rb
Ruby
2
2019-07-19T14:47:54
True
False
False
/api/public/snipt/8832/
ssh-port-forwarding
<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><span class="c1">#This forwards all localhost:1234 connections to google.com:80 through gimli</span> </span><span id="L-2"><a name="L-2"></a><span class="n">ssh</span> <span class="o">-</span><span class="n">L</span> <span class="mi">1234</span><span class="ss">:google</span><span class="o">.</span><span class="n">com</span><span class="p">:</span><span class="mi">80</span> <span class="n">gimli</span><span class="o">.</span><span class="n">cs</span><span class="o">.</span><span class="n">berkeley</span><span class="o">.</span><span class="n">edu</span> </span></pre></div> </td></tr></table>
forwarding, mysql, server, shell, ssh

Bash

ssh rate limit iptables

1
2
3
$/usr/sbin/iptables -I INPUT -p tcp --dport 22 -i eth1 -m state --state NEW -m recent --set

$/usr/sbin/iptables -I INPUT -p tcp --dport 22 -i eth1 -m state --state NEW -m recent --update --seconds 1000 --hitcount 2 -j DROP
https://snipt.net/embed/e31f05eff395c197ab8ae5ca3e9eb9fb/
/raw/e31f05eff395c197ab8ae5ca3e9eb9fb/
e31f05eff395c197ab8ae5ca3e9eb9fb
bash
Bash
3
2019-07-20T03:14:03
True
False
False
/api/public/snipt/8774/
ssh-rate-limit-iptables
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$/usr/sbin/iptables -I INPUT -p tcp --dport <span class="m">22</span> -i eth1 -m state --state NEW -m recent --set </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>$/usr/sbin/iptables -I INPUT -p tcp --dport <span class="m">22</span> -i eth1 -m state --state NEW -m recent --update --seconds <span class="m">1000</span> --hitcount <span class="m">2</span> -j DROP </span></pre></div> </td></tr></table>
security, ssh, sysadmin

Bash

ssh login auf port 1234 als user auf rechner 192.168.0.1

ssh -p 1234 [email protected]
https://snipt.net/embed/75f86aefc81c938a8057e6c4b840c7e2/
/raw/75f86aefc81c938a8057e6c4b840c7e2/
75f86aefc81c938a8057e6c4b840c7e2
bash
Bash
1
2019-07-20T13:55:59
True
False
False
/api/public/snipt/8177/
ssh-login-auf-port-1234-als-user-auf-rechner-19216801
<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>ssh -p <span class="m">1234</span> [email protected] </span></pre></div> </td></tr></table>
bash, ssh