Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

Quick find a manufacturer's OUI

grep -i foundry /usr/share/nmap/nmap-mac-prefixes
https://snipt.net/embed/131333932558a7d000ac413f1c48564f/
https://snipt.net/raw/131333932558a7d000ac413f1c48564f/
131333932558a7d000ac413f1c48564f
bash
Bash
1
2016-12-06T05:42:18
True
False
False
/api/public/snipt/7766/
quick-find-a-manufacturers-ouis
<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>grep -i foundry /usr/share/nmap/nmap-mac-prefixes </span></pre></div> </td></tr></table>
macaddr, networking, oui, security

Bash

Forwarding on Linux

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
https://snipt.net/embed/df7de56f7c7886a53aa288cc18ce2abd/
https://snipt.net/raw/df7de56f7c7886a53aa288cc18ce2abd/
df7de56f7c7886a53aa288cc18ce2abd
bash
Bash
2
2016-12-07T04:43:37
True
False
False
/api/public/snipt/3808/
forwarding-on-linux
<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="nb">echo</span> <span class="m">1</span> &gt; /proc/sys/net/ipv4/ip_forward </span><span id="L-2"><a name="L-2"></a>iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE </span></pre></div> </td></tr></table>
bash, linux, networking

Text only

Ping more than one server

("viper1", "viper2", "viper3") % {ping -n 1 $_}
https://snipt.net/embed/042dfd0bff7ba1f21794135d46cbfe50/
https://snipt.net/raw/042dfd0bff7ba1f21794135d46cbfe50/
042dfd0bff7ba1f21794135d46cbfe50
text
Text only
1
2016-12-07T04:42:11
True
False
False
/api/public/snipt/2013/
ping-more-than-one-server
<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>(&quot;viper1&quot;, &quot;viper2&quot;, &quot;viper3&quot;) % {ping -n 1 $_} </span></pre></div> </td></tr></table>
networking, ps

Text only

Ping Range

0..255 | % { $ip = "192.168.2.$_"; "$ip = $(ping-ip $ip)" }
https://snipt.net/embed/0804123d7f3884af8cba897a2a04894c/
https://snipt.net/raw/0804123d7f3884af8cba897a2a04894c/
0804123d7f3884af8cba897a2a04894c
text
Text only
1
2016-12-07T04:42:22
True
False
False
/api/public/snipt/1985/
ping-range
<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>0..255 | % { $ip = &quot;192.168.2.$_&quot;; &quot;$ip = $(ping-ip $ip)&quot; } </span></pre></div> </td></tr></table>
networking, ps

Bash

Restart Network Interface

1
2
3
4
5
6
7
8
#get ip address for ethernet
sudo dhclient eth0

#restart network interfaces
sudo /etc/init.d/networking restart

#scan for wireless networks
iwlist eth1 scanning
https://snipt.net/embed/dea9c47c275fddf1a0b740d47f155e3b/
https://snipt.net/raw/dea9c47c275fddf1a0b740d47f155e3b/
dea9c47c275fddf1a0b740d47f155e3b
bash
Bash
8
2016-12-05T20:57:21
True
False
False
/api/public/snipt/825/
restart-network-interface
<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">#get ip address for ethernet</span> </span><span id="L-2"><a name="L-2"></a>sudo dhclient eth0 </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1">#restart network interfaces</span> </span><span id="L-5"><a name="L-5"></a>sudo /etc/init.d/networking restart </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="c1">#scan for wireless networks</span> </span><span id="L-8"><a name="L-8"></a>iwlist eth1 scanning </span></pre></div> </td></tr></table>
linux, networking

Text only

Unix/Linux Network

1
2
3
4
5
6
ping host – ping host and output results 
whois domain – get whois information for domain
dig domain – get DNS information for domain 
dig -x host – reverse lookup host 
wget file – download file 
wget -c file – continue a stopped download 
https://snipt.net/embed/49cdd87117220efd4222b691cc9a1f83/
https://snipt.net/raw/49cdd87117220efd4222b691cc9a1f83/
49cdd87117220efd4222b691cc9a1f83
text
Text only
6
2016-12-05T20:58:42
True
False
False
/api/public/snipt/819/
unixlinux-network
<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>ping host – ping host and output results </span><span id="L-2"><a name="L-2"></a>whois domain – get whois information for domain </span><span id="L-3"><a name="L-3"></a>dig domain – get DNS information for domain </span><span id="L-4"><a name="L-4"></a>dig -x host – reverse lookup host </span><span id="L-5"><a name="L-5"></a>wget file – download file </span><span id="L-6"><a name="L-6"></a>wget -c file – continue a stopped download </span></pre></div> </td></tr></table>
linux, networking, unix
Copyrighted, illegal, or inappropriate content? Email [email protected].