RSS

Capture desktop or webcam video remotely

0 Comments | This entry was posted on Mar 18 2012

For a screenshot of desktop:

Listen:
while true; do import -window root /tmp/image.jpeg; nc -l 1337 < /tmp/image.jpeg; done

Receive:
nc 1337

For a picture from webcam:

Listen:
while true; do streamer -o /tmp/image.jpeg; nc -l 1337 < /tmp/image.jpeg; done

Receive:

nc 1337

Every time you connect will send the picture it took previously and take a new one

SSH port Forwarding

0 Comments | This entry was posted on Sep 23 2010

This may come in handy when you want to acces a server:port from outside the network it is sitting on. If there is another server on the same network that you can access via ssh this is what you do.

Server1 = server with ssh port open
Port1 = ssh port of Server1

Server2 = server you want to access
port2 = port of server 2 you want to access

ssh -L 8080:server2:port2 -P port1 account@server1

now you can access server2:port2 on your localhost:8080

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

UPDATE:

-r Use local port 137 for scans. Win95 boxes respond to this only. You need to be root to use this option.

it might be that the nmbd daemon holds the 137 port already and you will get an error message. If you dont need to find win95 hosts just omit the -r. Otherwise…well kill the daemon first

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'

if the url has parameters separated by & enclose it in quotes

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