This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

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, then other, and English (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.

  1. Start capturing tcpdump -i any -w /tmp/http.log &
  2. Do your thing
  3. Stop Capturing killall tcpdump
  4. 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

NameWhat
AlbertConfigurable Launcher (Alfred replacement)
PeekRecord screen to make gifs
Gnome TweaksBetter control of gnome extensions/user prefs
BoostnoteNotetaking
ChromiumWeb Browser
SpotifyIf you have to ask…
MailspringMail

Gnome Extenions

NameWhat
AlternateTabWindows like alt + tab
Battery PercentageDisplay Batter Percentage
CaffeineAmphetamine replacment
Clipboard IndicatorClipboard history access
Docker IntegrationDocker toolbar
Drop Down TerminalHot key accessable terminal
Pixel SaversMore 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