Skip to content

Commit 88c9812

Browse files
Port listening on localhost
1 parent 9c7e75a commit 88c9812

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
# Configures an Ubuntu server as follows:
3+
# - localhost resolves to 127.0.0.2
4+
# - facebook.com resolves to 8.8.8.8
5+
6+
cp /etc/hosts ~/hosts.new
7+
sed -i 's/127.*$/127.0.0.2 localhost\n8.8.8.8 facebook.com/' ~/hosts.new
8+
cp -f ~/hosts.new /etc/hosts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# Displays all acive IPv4 addresses.
3+
4+
ifconfig | grep -Eo "inet (addr:)?([0-9]*\.){3}[0-9]*" | cut -b 11-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
# listens on port 98 on localhost.
3+
nc -l localhost 98

0 commit comments

Comments
 (0)