Sunday, December 26, 2010

Use apt-get behind a proxy

Acquire::http::Proxy "http://x.x.x.x:port";

Friday, December 03, 2010

nautilus-script to hide files.


file=`echo $i|grep -oE '[^/]+$'`
path=`echo $i|grep -oE '^.+[/]'`
mv "${path}${file}" "${path}.${file}"

Thursday, October 07, 2010

Using a proxy server for internet in the command prompt

Either type into the prompt. or put at the end of .bashrc file:

export http_proxy=
export ftp_proxy=

Saturday, August 28, 2010

automate taking screencaps

Scenario: You want to take screen-shots of an application at regular intervals ( every 5 minutes ) and save it in a folder. The files are renamed with the current date and time.
There are many uses of this. If you want to archive graphs, or if you want to to monitor usage of the applications etc.

First you need to get the window-ID of the application window that you want to monitor:


this will create a crosshair cursor,which when you click on the application will extract the ID.

Pass this window id into the following script. i have given 0x3a000, which is the windowID of the application i wanted to monitor.

Linux makes your life easy.

while [ 1 ]; do sleep 600;import -window 0x3a0004c -quality 40 /home/ishu/snaps/`date +%Y_%m_%d_%H_%M_%S`.jpg; done