Merge pull request #110 from TiTi/master

Add cheatsheets (lsof, netstat, nmap, pdftk, ps, sam2p [new])
This commit is contained in:
Chris Lane 2013-10-08 16:58:43 -07:00
commit f5a7c30dc4
7 changed files with 33 additions and 1 deletions

View File

@ -63,6 +63,22 @@ Clone this repository and `cd` into it, then run
mkdir ~/.cheat mkdir ~/.cheat
cp cheatsheets/* ~/.cheat cp cheatsheets/* ~/.cheat
### Testing
After installing for all users or in your home directory, try `cheat tar` for instance.
### Troubleshooting
In case you got an error such as:
> ImportError: No module named argparse
You're probably using python < 2.7 and you need to manually install the argparse module.
You can do this easily with pip:
```bash
sudo apt-get python-pip
sudo pip install argparse
```
Other methods: https://pypi.python.org/pypi/argparse
Modifying Cheatsheets Modifying Cheatsheets
===================== =====================

View File

@ -1,3 +1,6 @@
# List all ipv4 network files
sudo lsof -i4
# To find listening ports: # To find listening ports:
lsof -Pnl +M -i4 lsof -Pnl +M -i4

View File

@ -9,3 +9,5 @@ netstat -pln | grep <port> | awk '{print $NF}'
Example output: 1507/python Example output: 1507/python
# Fast display of ipv4 tcp listening programs
sudo netstat -vtlnp --listening -4

View File

@ -31,3 +31,6 @@ nmap -traceroute [target]
# TCP ACK ping: -PA # TCP ACK ping: -PA
# UDP ping: -PU # UDP ping: -PU
# ARP ping: -PR # ARP ping: -PR
# Example: Ping scan all machines on a class C network
nmap -sP 192.168.0.0/24

View File

@ -1,6 +1,9 @@
# Concatenate all pdf files into one: # Concatenate all pdf files into one:
pdftk *.pdf cat output all.pdf pdftk *.pdf cat output all.pdf
# Concatenate specific pdf files into one:
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
# Concatenate pages 1 to 5 of first.pdf with page 3 of second.pdf # Concatenate pages 1 to 5 of first.pdf with page 3 of second.pdf
pdftk A=fist.pdf B=second.pdf cat A1-5 B3 output new.pdf pdftk A=fist.pdf B=second.pdf cat A1-5 B3 output new.pdf

View File

@ -1,6 +1,9 @@
# To list every process on the system: # To list every process on the system:
ps aux ps aux
# To list a process tree
ps axjf
# To list every process owned by foouser: # To list every process owned by foouser:
ps -aufoouser ps -aufoouser

2
cheatsheets/sam2p Normal file
View File

@ -0,0 +1,2 @@
# Concatenate all pdf files into one:
sam2p *.pdf out.pdf