snipt

Ctrl+h for KB shortcuts

Bash

Iptables map port 8080 to privileged port 80

sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -A OUTPUT -p tcp -m tcp -d $HOST --dport 80 -j REDIRECT --to-ports 8080
https://snipt.net/embed/d35d44e9e9b2cd48611ec5068f81015d/
/raw/d35d44e9e9b2cd48611ec5068f81015d/
d35d44e9e9b2cd48611ec5068f81015d
bash
Bash
2
2019-07-19T13:12:43
True
False
False
/api/public/snipt/17274/
map-port-8080-to-privileged-port-80
<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>sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport <span class="m">80</span> -j REDIRECT --to-ports 8080 </span><span id="L-2"><a name="L-2"></a>sudo iptables -t nat -A OUTPUT -p tcp -m tcp -d <span class="nv">$HOST</span> --dport <span class="m">80</span> -j REDIRECT --to-ports 8080 </span></pre></div> </td></tr></table>
iptables, linux, nat

Bash

Install VMWare Tools on Debian

1
2
3
4
5
# Make sure you have contrib and non-free in /etc/apt/sources.list
# Then:

apt-get install module-assistant
m-a a-i open-vm
https://snipt.net/embed/116fd929cfe58fdab62909700bc896ef/
/raw/116fd929cfe58fdab62909700bc896ef/
116fd929cfe58fdab62909700bc896ef
bash
Bash
5
2019-07-18T01:33:31
True
False
False
/api/public/snipt/6408/
install-vmware-tools-on-debian
<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="c1"># Make sure you have contrib and non-free in /etc/apt/sources.list</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># Then:</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>apt-get install module-assistant </span><span id="L-5"><a name="L-5"></a>m-a a-i open-vm </span></pre></div> </td></tr></table>
admin, debian, linux, server, vmware

Bash

Change Linux hostname without reboot

1
2
3
vim /etc/hostname
vim /etc/hosts
hostname new-hostname
https://snipt.net/embed/88ab7887b6637d9446fd791c21d5e134/
/raw/88ab7887b6637d9446fd791c21d5e134/
88ab7887b6637d9446fd791c21d5e134
bash
Bash
3
2019-06-29T23:54:13
True
False
False
/api/public/snipt/6407/
change-linux-hostname-without-reboot
<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>vim /etc/hostname </span><span id="L-2"><a name="L-2"></a>vim /etc/hosts </span><span id="L-3"><a name="L-3"></a>hostname new-hostname </span></pre></div> </td></tr></table>
admin, bash, linux