Browse > Home / Archive: December 2008

| Subcribe via RSS

Wifi Extender, Xbox360 and Netflix

December 23rd, 2008 | No Comments | Posted in Networking, Technology

My current home network setup had a Linksys WRT54G as the primary wifi access point.  It was running DD-WRT.  I increased the transmission signal to 100 and I get wifi coverage throughout all 3 floors of the house even though the wifi access point is in my office, which is upstairs.  Recently, Netflix announced that it is possible to watch the Instant Play movies using an Xbox 360 that has internet access.  I didn’t want to run an ethernet cable from my office to the basement where the XBox and TV are located.  Also, I didn’t want to shell out the money to buy the wireless adapter for the XBox 360.  Instead, I bought a second Linksys WRT54GL and installed DD-WRT.  I then used the built-in capability for WDS (Wirelss Distribution System) so that wifi in the basement is just a bridge.  Initially, I had read that a lot of other people were having trouble getting the wifi configured with WPA and had to use WEP.  This is wholly inadequate.  After a couple of hours of experimenting, I got WPA2 working on it without a hitch.  It has been running stably runnig for the last 2 days.  I signed up for a trial XBox Live account and now I can watch all fo the Netflix Instant Play movies, which is pretty amazing.  Pretty soon, Netflix will offer their whole catalog over the internet.

Now that the network connectivity is set up in the basement, I need to build my NAS server in my office so that I can stream all media from my office to the basement TV.

Here is what the network looks like now:

WordPress Comments & Spam

December 22nd, 2008 | No Comments | Posted in Technology

A few months ago I turned off the setting in WordPress to notify me every time someone posted a comment on my blog.  Recently, I checked the comments tab on WordPress and there were over 18,000 comments awaiting moderation.  Yikes!  Obviously, this is probably all spam and I don’t have the time to manually delete them, so SQL to the rescue.  A quick Google search of "comments wordpress mass delete" yielded this site, which said to execute this delete statement and voila, comments are gone.

SELECT *FROM wp_comments WHERE comment_approved ="0"

DELETE FROM  wp_comments WHERE comment_approved ="0"

Since I was messing around with the comment management within WordPress, I re-enabled Akismet, which should definitely block a lot of the spam.  I also decided to implement a CAPTCHA system using re-Captchca, which  should bring the spam down to 0.

Kiran

December 21st, 2008 | 2 Comments | Posted in Personal

One year ago today was the saddest day of my life and probably for everyone else in my family.  It was the day that I lost a niece and my son lost his eldest female cousin.  It has been difficult and painful to even think about what has taken place, but yet I do for to not think about her is to forget her and that would be wrong.  One year ago, we all watched as the last breaths faded away from Kiran, our precocious 10 year old.  She was my mother’s first grand-daughter and indeed held a special place in all of our hearts.  As she was growing up, all of us, her aunts and uncles, were bewildered that she acted the age of someone twice her age.  In fact, we all wondered whether she was growing up too quick.  Sadly, we will never know.  There aren’t many reassuing words or thoughts one can express about the loss of her; I can’t say that she went to a "better place" or that she is "no longer suffering".  I can’t even say that she was in the "prime of her life", because she hadn’t even experienced that.  No, for she was only 10 years old and had the best of her life to look forward to.  I can only mourn, and mourn I shall.

Book: Girl With the Dragon Tattoo

December 19th, 2008 | No Comments | Posted in Books

Just finished reading The Girl With the Dragon Tattoo by Stieg Larsson.

It was a real page turner.  It isn’t "serious" fiction, but the plot is intricate and the characters are well developed.  What makes this a good book is that the reader has the sense that they are solving the mystery along with the protagonist.  The protagonist does not "know" more about what will transpire than the reader.  Also, I suppose that the somewhat "exotic" setting of Sweden makes this into a more high-brow book than it would be if it were set in New York city, for example.

This would be a great book to read over the holidays.  Highly recommended.

Subversion on Bluehost Using svn+ssh

December 18th, 2008 | No Comments | Posted in Technology

Since I started writing some Python code again, I figured it would be a good idea to use a source code repository.  Obviously, I thought of using Subversion on my hosting provider, Bluehost.  After getting it installed correctly, I created a repository.  I did an initial import of my code and it all looks pretty good.  I then also setup public-key authentication so that I would not be prompted for a password when SSH’ing into the environment.  I needed to create some scripts as wrappers around the ssh+svn commands, because they are not very user friendly.  For example, the script to do a checkout looks like this:

#!/bin/bash

function usage {
echo " "
echo " Usage: svn_co.sh <Path_On_SVN> <Local_Dir>"
echo " Example: svn_co.sh python/gae gae"
echo " "
exit
}

if [ -z "$2" ]; then
usage
fi

svn co svn+ssh://dhruvrao@dhruvrao.com/home/dhruvrao/repos/$1 $2

This will make it a lot easier to use SVN with this environment.

Macbook Sleep/Hibernation Tip

December 16th, 2008 | No Comments | Posted in Macbook

Very useful tip on how to speed up the already super-fast sleep/hibernation of the Macbook.

“sudo pmset -a hibernatemode 0? = suspend to RAM only (default on desktops)
“sudo pmset -a hibernatemode 1? = suspend to disk only
“sudo pmset -a hibernatemode 3? = suspend to disk + RAM (default on laptops)

To see your current hibernatemode: “pmset -g | grep hibernatemode”.

Data Visualization

December 16th, 2008 | No Comments | Posted in Technology

Very useful article about different data visualization solutions and toolkits.

First App with Google App Engine

December 15th, 2008 | No Comments | Posted in Python

I thought of writing a little application using Google App Engine that performs an HTTP POST to an arbitrary URL.  My thought was that since GAE runs locally, I could build a little HTTP POST utility that I would be able to use for SOAP and REST services.  Instead of creating a thick client application for this purpose, I would just run it in the browser.  I know, I know, this is a lame application and I could just use curl or a ton of other free utilities, but I just wanted to play around with GAE.

GAE was pretty trivial to setup and my posting class worked fine when I executed on its own.  However, whenever I executed it from within the standalone GAE environment on my laptop, it would fail and would give me some exception about the socket module.  After staring at my code for a bit and making sure  that everything was copacetic, I thought maybe the problem lay with the httplib module.  Though this seemed highly unlikely since it is in a built-in module for Python, I decided to also install httplib2 and give it a whirl.  Well, needless to say that also failed with a similar exception.

At this point, I figured I should do the “smart” thing and look at the GAE documentation and lo and behold, it states:

A small percentage of native C python modules, and subsets of native C python modules are not available with Google App Engine. A full list detailing native C Python module support can be found here. The disabled modules fall in to the following categories:

* Libraries that maintain databases on disk are not enabled in Python for Google App Engine
* Sockets are disabled with Google App Engine
* The system does not allow you to invoke subprocesses, as a result some os module methods are disabled
* Threading is not available
* For security reasons, most C-based modules are disabled
* Other features that are limited:
o marshal is disabled
o cPickle is aliased to pickle
o System calls have been disabled

Well, since sockets aren’t allowed, there has to be another means by which HTTP resources can be accessed and then I came across urlfetch:

App Engine applications can communicate with other hosts over the Internet using HTTP requests. The URL fetching API can retrieve data using HTTP and HTTPS URLs.

Urlfetch does support HTTP GET, POST, HEAD, PUT, DELETE, but unfortunately it only works over ports 80 and 443.  Therefore, GAE will not work as a testing utility for performing HTTP POSTs since arbitrary port numbers are a requirement.

Nevertheless, urlfetch is drop-dead simple.  This is the code executing an HTTP POST:

resp = urlfetch.fetch(self.url, self.body, urlfetch.POST, self.headers)

I’ll definitely have to try playing around with GAE more and by the looks of it, it looks to be very simple to create a mashup.

Building a NAS for Home

December 10th, 2008 | 1 Comment | Posted in Personal, Technology

Since I have some free time coming up over the holidays, I’ve decided to finally build a NAS.  I have an oldish PC lying around that has the following specs:

  • Mobo:  Asus A7N8X-X
  • CPU:  AMD Athlon XP 2500+
  • Memory:  1 GB

I also have 4 hard-drives lying around that are in sizes of 30 GB, 40 GB, 80 GB and 300 GB.  I may or may not be able to use these drives.  It all depends on what configuration I end up with.

Since all the new drives are SATA based, I needed to buy a SATA controller, so I bought the PROMISE SATA300 TX4 PCI SATA II Controller Card from Newegg.

I then bought 3 x 1 TB Hitachi hard-drives

I also had to buy a couple of ATX to SATA power adapters since my power supply is legacy.

I will probably go with a RAID5 configuration, so I will get about 2 TB of usable disk space.

So far, the costs are as follows:

  • Hard-drives:  $300
  • SATA Controller:  $60
  • Cables:  $15

Total cost for a 3 TB NAS is $375.

I am still deciding on what NAS software I should use or if I should just use a plain old Linux distro.  The contenders for NAS software are:

  1. FreeNAS
  2. OpenFiler

I installed both of them as a test run.  FreeNAS was definitely easier to setup and I liked that all of the disk management, etc. happens via the GUI.  OpenFiler is definitely closer to the Linux distro itself, but does seem more powerful.

The end goal of this NAS is not only to store photos, videos, etc., but is also to be a streaming server for video content to a HTPC or device like Popcorn Hour, which looks very enticing indeed.

OpenID

December 3rd, 2008 | No Comments | Posted in Technology

Finally spent a little time figuring out how OpenID works.  It basically provides a single sign-on mechanism using a 3rd party identity provider.  The basic flow can be depicted as:

In selecting an identity provider, I just went with myOpenID.  Not sure what feature differences there are between the different identity providers.  I also setup my identity to be within my domain, so that if there is ever an issue with myOpenID I can just switch to using a different backend identity provider.  Another nice security feature that myOpenID has is that you can install an SSL client certificate on the browser so that it uses cryptographic authentication instead of a password.  The limitation to this, of course, is that you need to install the public/private keypair on every machine that will be used to connect to sites that use OpenID.

By the way, my OpenID identification site can be seen here.