RSS

Watch a log file as it grows

0 Comments | This entry was posted on May 24 2010

To read a log file and keep it open as it grows to see how it changes use -f option of tail

example:

sudo tail -f /var/log/mail.log

Aside Note: I got my first spam comments today!! yeiii! no real human comments yet though

Scan hosts and get their names

0 Comments | This entry was posted on Apr 18 2010

nbtscan -r 192.168.0.1/24

Audit free space in hard drive

0 Comments | This entry was posted on Apr 14 2010

This will give you the top biggest files/folders in /path

du -a /path | sort -n -r | head -n 10

This will show you the available disk space on every mounted HD

df -h

Firefox cache files

0 Comments | This entry was posted on Apr 06 2010

To check location and key of files in the cache type in address bar:

about:cache?device=disk

..handy when you want ex to download a flash video that doesnt pre-load

Scan network for up hosts

0 Comments | This entry was posted on Mar 30 2010

nmap -sP xx.xx.xx.1/24

Track redirects

0 Comments | This entry was posted on Mar 24 2010

To track if you are being redirected and where:

curl -I -L 'http://url.com'

Regular expressions reference

0 Comments | This entry was posted on Mar 19 2010

http://www.regular-expressions.info/reference.html

Maximize/minimize window from command line

0 Comments | This entry was posted on Feb 12 2010

wmctrl -l

will give you the list of windows

wmctrl -r "title of window" -b toggle,fullscreen

will make full screen the window that contains “title of window” in its title.
For maximize, minimize and some other cool stuff:

man wmctrl

Example:

This script will put in full screen the time table for the bus stop Kasperinkuja in Helsinki :)


firefox -URL 'http://www.omatlahdot.fi/omatlahdot/web?stopid=4100&=Hae&command=quicksearch' &
sleep 5
firefox -new-tab 'http://www.omatlahdot.fi/omatlahdot/web?page=pages/fullscreen.htm'
sleep 5
wmctrl -r "Firefox" -b add,fullscreen

Compare two file trees

0 Comments | This entry was posted on Feb 12 2010

To compare two file trees you do:


diff -r -q file/structure1 file/structure2

If the two file structures are checked out from different svn repositories you will get a bunch of differences from the .svn folders so to clean that out you add:


diff -r -q file/structure1 file/structure2 | egrep -v .svn

and you will get just the files that differ from each other file trees, either because the files are different or because they only exists in one of the trees

Keyring password in Ubuntu

0 Comments | This entry was posted on Feb 04 2010

When I change the master password in ubuntu the keyring password remains the same. It gets annoying because then I have to type my old password every time I connect to a wireless network, or connect to a server via ssh or basically any time keyring needs to send out a recorded password.

Solution:


rm ~/.gnome2/keyrings/login.keyring

…and re-boot