while true; do nc -l -p 80 -q 1 < error.html; done
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html; } | nc -l 8080; done
python2 -m SimpleHTTPServer 8080
python3 -m http.server 8080
twistd -n web –path .
php -S localhost:8080
pandoc -s -f markdown -t html =(curl https://raw.github.com/cyberhouse/doc/master/README.md) | lynx -stdin
pandoc -s -f markdown -t html doc/README.md | lynx -stdin
curl -d @$HOME/.credentials --cookie-jar /tmp/cjar -k https://example.com/?do=login; curl -k --cookie /tmp/cjar --cookie-jar /tmp/cjar https://example.com/foo|lynx -stdin
curl -s -w "%{http_code}\\n" http://www.cyberhouse.at -o /dev/null
# Add -L if you intend to follow location responses
lsof +D /var/log
nmap -sn 172.16.35.0/24 --script ip-forwarding --script-args="target=www.google.com"
ssh server1 tcpdump -i eth3 -U -s0 -w - 'tcp port 80' | wireshark -k -w /tmp/gw.cap -b filesize:50000 -b files:10 -i -
ssh server1 'tshark -f "port !22" -w -' | wireshark -k -i -
diff .ssh/config <(ssh trillian 'cat .ssh/config')
crontab -l > /tmp/$(whoami)-crontab
echo '* * * * * www-data /var/www/html/typo3/cli_dispatch.phpsh scheduler' >> /tmp/$(whoami)-crontab
crontab /tmp/$(whoami)-crontab
rm /tmp/$(whoami)-crontab
socat TCP4-LISTEN:1234,fork TCP4:192.168.1.1:22' forwards your port 1234 to another machine's port 22. Very useful for quick NAT red
sar -o /tmp/sarlog -A 5 >/dev/null 2>&1
LANG=C; S_TIME_FORMAT="%T; sar -f /tmp/sarlog|les
chattr +i /etc/shadow; lsattr /etc/shadow
chattr -i /etc/shadow; lsattr /etc/shadow
dd if=/dev/zero of=/path/to/swapfile count=2097152 # create 1 G file
mkswap /path/to/swapfile
swapon -p 32767 /path/to/swapfile # use with lowest priority possible
Optionally create an /etc/fstab
entry:
/path/to/swapfile none swap sw,pri=32767 0 0
Add 1
(after one blank space) or S
or Single
to the kernel boot parameter to start in single mode. Reset password with passwd
check if SELinux is disabled if it does not work (setenforce 0
). If single user mode does not work ther is an alternative: Append init=/bin/bash
to the boot options, remounting the root partition is necessary (mount -o remount,rw /
).
cutter 10.10.0.45
parted /dev/sda # Get the disk size first
dd if=/dev/sda | pv -s 60022480896 | pigz --fast > /media/myExternalDrive/myBackup.img
IMAGE=archlinux-2014.04.01-dual.iso && dd bs=1m if=$IMAGE | /opt/local/bin/pv -s $(wc -c $IMAGE) | dd of=/dev/disk1
tune2fs -l $(df -lh / |(read; awk '{print $1; exit}')) | grep -i created
ps aux|grep /usr/sbin/httpd|grep -v grep|awk '{print"-p " $2}'|xargs strace -s 10000 -f -t -r -o /tmp/strace-$(date +%F-%H%M%S)
echo 1 > /proc/sys/vm/block_dump
ps auxww | sort -nk6
# or
ps auxww --sort +rss
ps auxwwef
# or to avoid line wraps
ps auxef
hdparm -Tt /dev/sda
stress --vm-bytes $(awk '/MemFree/{printf "%d\n", $2 * 0.9;}'< /proc/meminfo)k --vm-keep -m 1
top -b -i -d 10 >> /tmp/log/top
/bin/bash -c "echo >/dev/tcp/144.76.8.201/443 && echo 'open'"