https://github.com/derekargueta/sysadmin-cheatsheet
personal notes on cool commands I find around the web
https://github.com/derekargueta/sysadmin-cheatsheet
Last synced: 3 months ago
JSON representation
personal notes on cool commands I find around the web
- Host: GitHub
- URL: https://github.com/derekargueta/sysadmin-cheatsheet
- Owner: derekargueta
- Created: 2017-01-20T00:54:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-18T08:34:25.000Z (about 8 years ago)
- Last Synced: 2025-01-16T01:34:42.529Z (5 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sysadmin-cheatsheet
personal notes on cool commands I find around the web##### List all incoming ICMP echo requests
(i.e. see real-time _incoming_ pings)```bash
sudo tcpdump -i ethX icmp and icmp[icmptype]=icmp-echo
```
where ethx is the device you want to listen to. Such as `en0`.##### List all listening ports
```bash
lsof -Pni4 | grep LISTEN
```##### Find out what DNS provider someone is using
```bash
dig +short ns <<>> | xargs -n1 dig +short | xargs -n1 whois | grep OrgName | tr -s ' ' | cut -c10- | sort -u
```##### Determine what version of BIND a DNS server is using (if applicable)
```bash
dig -t txt -c chaos VERSION.BIND @<<>>
```##### Count number of lines recursively in directory
```bash
find . -name '*.php' | xargs wc -l
```##### Get plain diff with subset files
```bash
diff -ibwB --unchanged-line-format= --old-line-format= --new-line-format='%L' --suppress-common-lines file1 file2 > file2
```
file3 will only contain the items that are in file2 but not in file1 assuming that file1 is a sorted subset of file2