November, 2008

Caching youtube, google, metacity, youporn etc using Squid

This is what i've spent my sunday morning hacking around.

I seem to watch content over and over again on youtube and other websites. This was costing me a lot of bandwidth so, I decided to use my Squid proxy server to cache it.

The requirements are very simple. Had to do a bit of tinkering around to get a basic setup working.

1. Squid >= 2.6
2. Python >= 2.4
3. Python-urlgrabber (urlgrabber module of python)
4. Python-iniparse (iniparse module of python)
5. Apache (httpd) Web Server

You can find those details on http://cachevideos.com/installation

I did mine with lighttpd. Infact you can you use any webserver as long as it can serve files over HTTP.

On Debian

You can install Python-urlgrabber using apt-get. The Python-iniparser you can download of here http://code.google.com/p/iniparse/

Extract it and run the following


cd python-iniparser
python setup.py install

Basically all that fancy setup.py script does it copy files over to /var/lib/python2.4/ directory. So something is really bothering you then you can take things in your own hands.

Flash Motion & Open Flash Charts

Ran in to another interesting google gadget while searching for more interactive charts and visually appealing. You can see it in action on iGoogle spreadsheet
Motion Charts from Google
The real time play gives a very good correlation between certain factors that do or do not effect the trend.

Another open source flash charts I found that you can interact with using ajax. I was going to use these for realtime network bandwidth/load display.

You can see them in action at Open Flash Charts

Locking your OSX

Found this really cool way to lock your mac osx workstation! Any osx experts out there might be able to tell if I can convert this in to a keyboard shortcut or an icon?

Currently I run it using terminal shell script


/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend

Christchurch Webcams

Found these really good web cams in Christchurch. Hosted by Yobbo.co.nz . http://www.yobbo.co.nz/webcams.htm

The locations are pretty good and you can change the view as well. Please don't abuse it and support the guy hosting it.

I herd there was a storm coming in Christchurch. Looking at the yachts might be interesting.

[tags]Webcams, axis, location, geo, location, live, streaming, video, cam, new zealand, christchurch[tags]

Google Font

Want you own little google search engine? Here is how i created mine


shoaib.no-ip.org

Downloading and Uploading files recursively using ncftp

I shamelessly copied this article for my own personal reference from http://www.linux.com/articles/52714 . Instead of having to google all the time.

===================================================================
Author: Peter Leung on March 14, 2006 (8:00:00 AM)

Next, I turned to command-line FTP clients. Again, the standard FTP command doesn't support recursive directory upload. Fortunately, many graphical and command-line FTP clients do, including NcFTP, yafc, and LFTP. I picked NcFTP.

After installing the software, connect to your host anonymously by entering the ncftp command followed by the hostname:

ncftp ftp.somedomain.com

or if you need to log in with a valid username, use the -u and -p parameters:

ncftp -u username -p password ftp.somedomain.com

Windows Games on OSX using CrossOver Games

Very surprising results after installing Crossover Games, on my AMD Hackintosh OSX Leopard. I was able to run Counter Strike Source very effectively! No loss of FPS even in Window mode. I was able to play a movie on the dual screen while playing the game as well.
Counter Strike Source running on Mac OSX using Crossover Games
Pros

  • Less to minimum configuration required
  • Easy install
  • Equivalent graphics rendering to windows
  • Quick launch programs
  • Optimum CPU utilization and memory resource allocation.

Cons

  • Audio didn't work (but thats okay - i play games without audio anyway)
  • Load times were a bit slow
  • A bit laggy when dragging windows
  • Only available for Intel versions of OSX not for G4, G5 or any PPC based hardware