UNIX And Linux

Useful commands, tricks, or configs!

A list of useful commands(Edit)

I will try to keep the lists organized in categories, but I promess nothing n__n"

Commands for Web(Edit)

  • Crawl website recursively with wget

wget -r --no-parent --reject "index.html*" http://www.example.com 

-r recursive
--no-parent disallow the hierarchy above the beginning directory
--reject "mask" doesn't save if match

Commands for Processes(Edit)

  • Get command line for PID

cat /proc/<pid>/cmdline

Commands for RE (Reverse Engineering), execs and bins(Edit)

  • PE Executables Disassembly with objdump

objdump -x -D the-pe-exe-file.exe | less

Some Automation(Edit)

Restart Network if WLAN cannot connect:(Edit)

Execute using CRON, it performs DOWN/UP for the interface[1]


wlan=`/sbin/ifconfig wlan0 | grep inet\ addr | wc -l`
if [ $wlan -eq 0 ]; then
/sbin/ifdown wlan0 && /sbin/ifup wlan0
echo interface is up

Save file and add +X flag for execution.


*/15 * * * * /bin/bash /home/ubuntu/network_check.sh