- Run the last command as root user.
- Serve current directory tree at http://127.0.0.1:4444 (Listens on all interfaces)
python3 -m http.server 4444
- Get your external internet facing IP
- Mount a temporary RAM partition
mount -t tmpfs tmpfs /mnt -o size=1024m
- List all lisening ports together with the PID of the associated process
sudo lsof -Pan -i tcp -i udp
sudo lsof -Pni4 | grep LISTEN
- SSH network throuput test
yes | pv | ssh $host "cat > /dev/null"
- Print line numbers of terminal output
- Bind a key with a command
scp [local_file] [user]@[host]:[remote_file]
scp [remote_file] [user]@[host]:.
mount /path/to/file.iso /mnt/cdrom -oloop
- List all open files used by process/command
- Sniff network traffic on a given interface (eth0) and display IP addresses of the machines communicating with the current host
sudo tcpdump -i eth0 -n ip | awk '{ print gensub(/(.*)\..*/,"\\1","g",$3), $4, gensub(/(.*)\..*/,"\\1","g",$5) }' | awk -F " > " '{print $1""$2}'
- Look up a word in the dictonary
curl dict://dict.org/d:somthing
- Clone the apt pkgs installed on another Debian based system.
sudo install apt-get install `ssh root@host_you_want_to_clone "dpkg -l | grep ii" | awk '{print $2}'`
- List the /usr/bin folder with explanations on what the pkgs are.
ls /usr/bin | xargs whatis | less
- Generate random string 30 characters long
gpg --gen-random --armor 1 30
- Man page explaining linux file system hierarchy
- Create a html page listing computers hardware
sudo lshw -html > hardware.html