This is the multi-page printable view of this section. Click here to print.
Docker
1 - Centos 7
Useful Commands for Centos 7
- Disable GUI on Startup -
systemctl set-default multi-user.target
- Enable GUI on Startup -
systemctl set-default graphical.target
2 - Firewall
General
On most distributions these runs need to be run as root. Remember that there should be multiple layers of protection between your app and the internet and you may need to adjust the configuration of other layers of defense to allow traffic through.
Centos/RHEL 7
- Install firewalld -
yum install firewalld
- Enable firewalld -
systemctl enable firewalld
- Start firewalld -
systemctl start firewalld
- Check current rules -
firewall-cmd --list-all
- Open port -
firewall-cmd --zone=public --add-port=[number]/[protocol] --permanent && firewall-cmd --reload
Ubuntu
- Enable/Disable Firewall -
ufw [enable/disable]
- Open/Close port -
ufw [allow/deny] [port]/[protocol]
- Allow/Deny from a specific IP -
ufw [allow/deny] [ip]
- Allow/Deny a specific service -
ufw [allow/deny] [service-name]
3 - PI Setup Tips
Password
Default is pi/raspberry
Use passwd
to change
Keyboard
Default is brittish, we gotta fix that shit
sudo dpkg-reconfigure keyboard-configuration
hit enter on the first screen, thenother
, andEnglish (US)
Wifi
Configure - /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK NAME"
psk="NETWORK PASSWORD"
}
Also Configure - /etc/network/interfaces
source-directory /etc/network/interfaces.d
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Raspotify
Allows you to use your raspberry pi as a spotify connect client
- Install
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
- Configure
/etc/default/raspotify
4 - scp
scp
makes it easy to transfer files to/from a remote host.
Useful Commands
- Copy from remote to local -
scp [user]@[remote]:[remote file path] [local file path]
- Copy from local to remote -
scp [local file path] [user]@[remote]:[remote file path]
5 - tcpdump
tcpdump
is simple but powerful tool for analyzing network traffic.
- Start capturing
tcpdump -i any -w /tmp/http.log &
- Do your thing
- Stop Capturing
killall tcpdump
- Check it out
tcpdump -A -r /tmp/http.log | less
Filtering
To make your data easier to view you can scope the traffic tcpdump is capturing to only get what you are interested in.
Filter traffic going to a specific port tcpdump dst port $PORT
.
Filter traffic going to a specific ip tcpdump dst $IP
.
Filter traffic going to a specific interface tcpdump -i $INTERFACE
.
6 - Ubuntu
Ubuntu 18.04 - things to install
Applications
Name | What |
---|---|
Albert | Configurable Launcher (Alfred replacement) |
Peek | Record screen to make gifs |
Gnome Tweaks | Better control of gnome extensions/user prefs |
Boostnote | Notetaking |
Chromium | Web Browser |
Spotify | If you have to ask… |
Mailspring |
Gnome Extenions
Name | What |
---|---|
AlternateTab | Windows like alt + tab |
Battery Percentage | Display Batter Percentage |
Caffeine | Amphetamine replacment |
Clipboard Indicator | Clipboard history access |
Docker Integration | Docker toolbar |
Drop Down Terminal | Hot key accessable terminal |
Pixel Savers | More efficient window control layout |
7 - Wireshark
tshark -f “host 1.1.1.1 and tcp port 10101” -i any -w nhlDEV.01032019.pcap -F libpcap