nmap 192.168.1.0/24
: This scans the entire class C rangenmap -p <port ranges>
: This scans specific portsnmap -sP 192.168.1.0/24
: This scans the network/find servers and devices that are runningsudo nmap -sP 192.168.1.0/24
: Using sudo can be necessary on mac to get the MAC Adressnmap -O 192.168.1.1-42
: Scan from port 1 to 42nmap -O 192.168.1.150
:# Os detection with target ipnmap –iflist
: This shows host interfaces and routesnmap –sV 192.168.1.1
: This detects remote services' version numbersnmap –sS 192.168.1.1
: This performs a stealthy TCP SYN scannmap –sO 192.168.1.1
: This scans for the IP protocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /tmp | |
wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20160210_all.deb | |
apt-get install libnewt0.52 whiptail parted triggerhappy lua5.1 alsa_utils | |
dpkg -i raspi-config_20160210_all.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You need a server acessible from the client and server (aws instance for example accessible on port ssh 22 ) | |
# install autossh ( apt-get install autossh) | |
# on the local machine (raspberry pi ) | |
autossh -M 10001 -f -N -R 10000:localhost:22 user@serverip | |
# -n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background | |
# -N Do not execute a remote command. This is useful for just forwarding ports | |
# -T Do not allocate a pseudo-tty on the remote system | |
# -R Set up the tunnel as a reverse tunnel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$SUDO_USER" ]; then | |
echo "$0 must be called from sudo. Try: 'sudo ${0}'" | |
exit 1 | |
fi | |
SCRIPT_LOCATION="/etc/network/if-up.d/reverse_ssh_tunnel" | |
echo "Creating file in $SCRIPT_LOCATION" | |
echo "Installing openssh-server and autossh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
# logging.getLogger(type(self).__name__) if you have a lot of class | |
log = logging.getLogger() # 'root' Logger | |
console = logging.StreamHandler() # logging to console | |
csv_handler = logging.FileHandler('logs.csv') | |
template_log = '%(asctime)s,%(levelname)s,%(processName)s,%(filename)s,%(lineno)s,%(message)s' #csv | |
console.setFormatter(logging.Formatter(template_log)) | |
log.addHandler(console) # prints to console. | |
log.addHandler(csv_handler) # save to csv gile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To include in notebook for inline ggplot with bigger size | |
%matplotlib inline | |
import matplotlib.pyplot as plt | |
plt.rcParams['figure.figsize'] = (12, 8) # bigger figsize | |
plt.style.use('ggplot') # ggplot2 style for matplotlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/ # mount with pi permission |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install powerline # install powerline fonts for ubuntu > 14.04 useful of oh-my-zsh themes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing solorized theme for terminator | |
git clone https://github.com/ghuntley/terminator-solarized.git | |
cd terminator-solarized | |
mkdir -p ~/.config/terminator/ | |
touch ~/.config/terminator/config | |
# if you want to replace current config: | |
cp config ~/.config/terminator |