Find your LAN/WAN/DHCP addresses

Most often, if you’d like to know what your router IP address is, you need to have access to its interface via a browser, or similar such gadgets. Here’s a few convenient one-liners which will give you that info more easily/conveniently… #get WAN address dig +short myip.opendns.com @resolver1.opendns.com #get DHCP server address(es)… cat /var/lib/dhcp/dhclient*leases \…

*nix shell/terminal in m$-win

If you’re currently a WinX user, and would like to run BASH/ZSH type commands, BUT, you are NOT keen to go the w10 route with its built in ubuntu-shell….. There are a few options available to you: msys2 gitbash this was initially my preferred choice, but I had some compatibility issues with SSH/GPG, so I…

Some useful vi keystrokes/cheatsheet

A couple of useful keystrokes for vi command mode / search (down) n=next occurance (down) ? search (up) N=next occurance (up) dd delete line(s) 5dd delete 5 line(s) u undo delete . repeat command yy copy line(s) 5yy copy 5 line(s) p paste line(s) edit mode i INSERT (mode) :r FILENAME insert contents of FILENAME…

*nix script snippets that are useful/clever

For the record – these are lookups – NOT my creations. I will add more as I go #Backup & clear history DATE=`date +%Y%m%d-%H%M` mv ~/.zsh_history{,.$DATE} cat /dev/null > ~/.zsh_history #HDD space (without clutter) df -h | grep -v “tmp\|udev” #send contents into a file (you need to \escape any \$variables within the CONTENTS+COMMANDS) cat