Cogito, ergo sum

Here's hoping my musings can help you out!

Archive for the ‘Computers and Internet’ Category

Installing Windows 7 (Gateway GT5628)

Posted by mnshankar on August 19, 2009

I just finished doing a fresh install of Windows 7 (X64) on my desktop computer.. Let me tell you, it was quite a struggle! Click here to view the specs of my workstation.

At first, the install process seemed fairly routine.. I restarted the computer after putting in the DVD and booting from it (fresh install). The Win 7 splash screen came up, and I was prompted to select the language. Next, a big “Install” button was displayed on the screen. On clicking the install button, the following cryptic error message was displayed:

“A required CD/DVD drive device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now”

Now, GT5628 uses an IDE/ATAPI Sony DVD/RW drive, and I have not had any problems it.. The message did not make much sense since the install was from the DVD and the drive seemed to boot and load Windows 7 normally.

A Google search took me to this informative site:

http://www.sevenforums.com/drivers/4872-cd-dvd-driver-missing-install.html

I tried all suggested remedies:

  1. Burn another DVD at a slower speed – did not help
  2. Set the jumper on the DVD drive to “Master” – did not help
  3. Replaced the dvd drive with another working IDE drive – Still no luck
  4. Replace the DVD drive with a SATA DVD – THIS IS THE SOLUTION THAT WORKED! It seems to me that the Win 7 installer is unable to work with a system that uses a combination of a SATA hard drive and an ATAPI DVD drive (Microsoft, are you listening?). Strange.. Vista installed on it without any problems!

Once the DVD issue was sorted out, the install process completed quite smoothly. I then put back my IDE DVD drive and it works without any issues.

It feels so much snappier. The boot time (and resume time) are substantially smaller. The graphics and fonts are crisper too. Well worth the struggle!

The second problem that I encountered was due to a missing – “PCI Simple Communications Controller” in the “Device Manager” (All other 64 bit drivers were installed perfectly.. Kudos to Microsoft for bringing 64 bit OS into the mainstream). After a little searching around, I was able to isolate the missing driver to be “Intel® ME: Management Engine Driver“.

The latest version of this driver can be downloaded from the Intel website.

Extract the contents on your hard drive. Launch the “Setup” app. This will immediately throw an error that the operating system is incorrect. Win 7 then automagically detects the correct settings and prompts whether you want to install it using “Compatibility settings”.. Go ahead and click on that option. Watch the “Yellow bang” disappear from the device manager!

I hope my experience with this installation helps you out!

Posted in Computers and Internet | Tagged: , , , , | 6 Comments »

Acer Ferrari 3400 Compatible With Windows 7

Posted by mnshankar on August 15, 2009

Microsoft provides an application to check whether your computer is capable of running Windows 7 without issues. You can download it from here.
 
Hmm.. So, my Acer Ferrari 3400 (that I purchased way back in 2003) is actually Windows 7 ready! Woo hoo.. I might just upgrade to the latest and best version of Windows.. The report generated by the app is pasted below:
 
There are some issues you should take a look at before installing Windows 7.

System Requirements
Upgrade

Backup system first
You’ll need to perform a custom installation of Windows 7 and then reinstall your programs. Make sure to back up your files before you begin. Go online to get important information about installing Windows 7.
CPU speed

2.01 GHz
Your CPU meets the 1 GHz minimum requirement.
RAM

2.00 GB
Your system memory meets the 1 GB requirement for 32-bit Windows 7 and the 2 GB requirement for 64-bit Windows 7.
Hard Drive Free Space

41.47 GB
Your hard disk meets the minimum requirement of 16 GB free space for 32-bit Windows 7 and 20 GB free space for 64-bit Windows 7.
Windows Aero

Capable
Your system can run Windows Aero.
Devices
ATI MOBILITY RADEON 9700
ATI Technologies Inc.

Action recommended
Run Windows Update after installing Windows 7 to make this device compatible.
Realtek AC’97 Audio for VIA (R) Audio Controller
Realtek

Action recommended
Run Windows Update after installing Windows 7 to make this device compatible.
Texas Instruments OHCI Compliant IEEE 1394 Host Controller
Texas Instruments

Compatible
This device is compatible with Windows 7.
Texas Instruments PCI-4510 CardBus Controller
Texas Instruments

Compatible
This device is compatible with Windows 7.
VIA Bus Master IDE Controller
VIA Technologies, Inc.

Compatible
This device is compatible with Windows 7.
VIA Rev 5 or later USB Universal Host Controller
VIA Technologies

Compatible
This device is compatible with Windows 7.
Agere Systems AC’97 Modem
Agere

Compatible
This device is compatible with Windows 7.
VIA USB Enhanced Host Controller
VIA Technologies

Compatible
This device is compatible with Windows 7.
Broadcom NetXtreme Gigabit Ethernet
Broadcom

Compatible
This device is compatible with Windows 7.
WLAN 802.11g mini-PCI Module
Broadcom

Compatible
This device is compatible with Windows 7.
USB Mass Storage Device
Compatible USB storage device

Compatible
This device is compatible with Windows 7.
Programs
McAfee VirusScan Enterprise
version 8.6.0
McAfee, Inc.

Minor issues
You might experience minor issues using this program while running Windows 7. For more information, go online to the manufacturer’s website.
Synaptics Pointing Device Driver

Minor issues
You might experience minor issues using this program while running Windows 7. For more information, go online to the manufacturer’s website.

Posted in Computers and Internet | 3 Comments »

Portable Software (U3) on my USB

Posted by mnshankar on August 8, 2009

I recently purchased a Sandisk Cruzer Micro (4GB) USB drive. It comes with U3 on it, and I absolutely love this little piece of software! Now, I do realize that it is a windows-only option, proprietary code, yada, yada, yada.. but for my requirements (and a vast majority of you, I’m sure), it is a great fit.

U3 drives are specially formatted and they actually contain a partition that separates the drive into two – A normal storage area, and a read-only part that emulates a CD containing the U3 code. CD emulation (ISO) is used on the partition to ‘trick’ the windows host into launching the ‘autorun’ file and displaying the launchpad GUI.

What this effectively means is that you cannot buy a normal USB drive and force it to run U3 by installing a program. You do have the option of deleting U3 from your drive though.

PortableApps is a competing open-source, free technology and has a similar feature set – Any application built for PortableApps can be very easily converted to be U3 compliant

When you load the U3 drive, it automatically opens the U3 launcher applet (after authentication of course.. another feature that I think is absolutely necessary in a tiny device with a huge potential to fall into the wrong hands). This is what my U3 launcher looks like:

image

 

Over the months, I have collected a bunch of (mostly freeware) programs on my USB drive that I highly recommend:

Please read my earlier post regarding how you can easily make any portable/self contained application U3 compatible.

  1. KeePass 2.08: This is an excellent password management suite. Definitely a must-have if you want to avoid sticking post-its all over your workplace :-)
  2. Pidgin: A free universal chat client. Connects to a whole gamut of talk services. I use it to chat on AIM, Yahoo, Google, and our company XMPP chat.
  3. Irfanview: Awesome, lightweight image editing software. Great for cropping, reducing file size, adjusting brightness/contrast etc. I use this all the time for resizing/resampling images produced by my 10 MP camera into a more manageable 70 KB before emailing :-)
  4. Chrome: Blazing fast Internet browser (loads much faster than FireFox). It has been converted to a portable format by a programmer in Denmark. It also includes an updater that you can use to download the latest and greatest version of Chrome (sweet!). Here is a tip: When you are creating the U3 software using PackageFactory, use IncognitoLoader.exe instead of the ChromeLoader.exe. This will ensure that your drive space is conserved. Chrome has no mechanism for setting a ceiling on the cache size.. So, it can very easily flood your USB drive (Of course you can clear your cache often, but using incognito mode is so much cleaner and easier!). Also, since there is no file caching in incognito mode, browsing speed is noticeably improved.
  5. Windows Live writer: The best blogging software. Period. Seamlessly connects to my WordPress account and helps me create draft blogs offline.
  6. VLC Media player : I have yet to come across a file format that VLC player has refused to play!
  7. uTorrent : Tiny tiny program which does a lot! Prior to using this 600KB program, I was using Azureus, a 50 MB behemoth!
  8. Notepad++: Offers color formatting for most code.. Love the easily extensible plugin architecture (especially HexEditor)
  9. PackageFactory: Easily make apps U3 compatible.
  10. CoreFTP: Full featured light-weight GUI FTP client with support for SSL

If you have any questions regarding any of the U3 apps described above, please drop me a line.

Posted in Computers and Internet | Tagged: , , , , , , , , , , , | Leave a Comment »

Bloom Filter

Posted by mnshankar on August 7, 2009

The Bloom Filter was invented by Burton Bloom in 1970 . The central intent of the algorithm is to answer one seemingly simple question:

“Is needle contained in haystack?”

Hmm.. how about using a linear search, binary search or hash search algorithm you ask ?? Well.. all are valid methods.. but the Bloom Filter stands out in that it is super efficient at answering this question (especially if the set you are searching is really large).

There is another important difference. Most other search data structures store the data elements themselves.. A Bloom filter DOES NOT STORE DATA! This makes it incredibly space efficient. It only stores an array of bits – 0’s and 1’s. One caveat is that the bloom filter might return incorrect answers – also known as a false positives. If needle is present in haystack, it will definitely return ‘true’ .. however, if we query for a non existent element, it might incorrectly return ‘true’. Obviously, for applications that make use of the Bloom filter, that degree of error is acceptable.

Google makes ample use of Bloom Filters.. For example, they are used

  • In Google’s BigTable distributed file system to minimize disk lookups
  • In Google cache routing algorithms for knocking precious milliseconds off their retrieval time
  • In Google Chrome browser for implementing “Safe browsing”

Click here for an informative YouTube video on the Google Tech Talks channel.

Bloom filters basically support two operations:

void bloom_add(“foo”);
bool bloom_contains(“foo”);

Initially, the filter is set to an array of ‘m’ bits (say 20) all initialized to 0 (the actual value of ‘m’ is quite critical to the funtioning of the bloom filter and is dependant on the number of elements in the haystack, and the acceptable degree of errors/false positives)

Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Bitmap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Internally, hash functions are used to map added elements to indices into the filter array. It is important to use high-quality hash functions in the filter to guarantee that output is equally distributed over the entire index space.

Lets say that we use 3 hash functions (h1, h2 and h3) inside our algorithm each of which generates numbers in the range (1..m-1) which is 0 to 19 in our case. There is some math and probability calculation that goes into determining the number of hash passes required and the optimal filter size.. but we can skip that for the purposes of this tutorial.

(From an implementation perspective, note that libraries already exist for generating high quality hash values, and running multiple hash functions simply means using different salts/initialization values in a loop)

Further, let us assume that the following hash values are returned:

h1(“foo”)=5
h2(“foo”)=7
h3(“foo”)=7

Now, the bits at each of these positions/indexes is set to ‘1′ like so:

Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Bitmap 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0

Note : A particular bit may be set to 1 multiple times due to hash collisions (like position 7 above.. both h2 and h3 map into it).. but that is ok.

A query is positive if and only if ALL bits returned by the hash functions are 1. If any of them is 0, then certainly the search term is not contained in the set.

For example, to check the existance of “bar” in our set:
Compute the 3 hashes of “bar”, and say, we get values of 1, 4 and 5. Checking the bit at position 1 in the array, we see that it is a ‘0′. So, “bar” CANNOT be present. We can return with the value “FALSE”.. There is no need to check other bits.

It is easy to see that the probability of false positives is directly proportional to the number of elements that are added to the set – As elements are added to the set, more bits are flipped.. which then makes it more likely that all hashes on a non-existant value will map to cells containing a ‘1′, thus resulting in false positives.. It is therefore imperative to estimate the size of the data set properly during initialization.

Posted in Computers and Internet | Tagged: , | Leave a Comment »

Create Your Own U3 Apps!

Posted by mnshankar on August 6, 2009

It turns out, it is “really-really-ridiculously” easy to create your own U3 applications! The good folks at eure.ca have made available a tiny application named “PackageFactory” that does this magic (free of cost!).

Note that the application you are trying to convert to U3 must be self contained. i.e., It should not depend on the registry and/or be tied to absolute directories. Applications that are built for PortableApps are therefore excellent candidates for conversion to U3.

(Please be aware that you can create a “thinstall” of ANY application.. and then convert the resulting .exe file into a U3p file using PackageFactory!).

Here’s an example of how you can use PackageFactory to create a U3 version of the wildly popular password storage tool KeePass:

1. Download and install PackageFactory

2. Download the Zip package of the latest version of KeePass (ver 2.08 as of this writing) from the KeePass website

3. Extract all the contents of the downloaded zip file into a folder on your computer:

image

4. Launch PackageFactory :

image 

5. Drag and drop the KeePass.exe file from the downloaded folder into the area marked for the purpose on the PackageFactory screen. Add/Edit the Program name and description fields as required, and then click on the “Create” arrow:

image

6. The program then creates a .u3p file and prompts for a location to store the newly created file.. Select your desktop, and hit the “Save” button.

image

7. Click on the U3 icon on your taskbar. Then, click on “Add Programs” and select “Install from my Computer”:

image

8. In the “Open File” dialog box that pops up, select the keepass.u3p file that you created (Step 6)

9. This will create the necessary scaffolding on the portable/USB device for “Keepass” … note that the application is still not ready to launch .. We have not yet added the required support files.

10. Navigate to the System/Apps folder on your U3 device, and locate the folder containing the KeePass.u3p file(This is a hidden folder.. so, you may need to update your folder options to show hidden files). It should look like:

image

11. Copy the remaining KeePass support files from the extracted Zip file into the “Data” subfolder (K:\System\Apps\60F08E21-C250-4FDD-A804-CA25DD2892E2\Data in my case). Finally, the folder should contain ALL the files (and folders) that were present in the Un-Zipped (step 3 above):

image

That’s it! You should now be able to launch KeePass from your U3 Launch applet!

Tip: You can actually convert the PackageFactory application into a U3 file using the same process and keep it handy on your USB device for future projects :-)

Posted in Computers and Internet | Tagged: , , , , , | 1 Comment »

Windows Experience Index

Posted by mnshankar on May 19, 2009

Here is a screenshot of Vista experience Index on my PC. What these numbers mean

image

My computer specs (Gateway GT5628):

Intel® Core™2 Quad Q6600 quad core processor with VT
RAM Installed: 4096 MB DDR2, 667 MHz (4*1GB)
NVIDIA® GeForce® 8500GT With 256MB onboard video memory
500 GB, 7200 RPM, SATA II hard drive
OS: Windows Vista 32bit SP1

Posted in Computers and Internet | Tagged: , , , | Leave a Comment »

Securing Netgear WPN824V3 Wireless G Router

Posted by mnshankar on April 26, 2009

The Netgear WPN824V3 is an excellent wireless router and has tons of features to ensure safe wireless access. It also boasts an enhanced range radio so your wireless signal can be accessed from the farthest points of your home.

The recommendations below summarize the steps that you should take to protect the security of data on your wireless network. The key idea is to use Defense in Depth so you make it harder for a potential hacker to compromise your network.

1. Disable SSID (Service Set Identifier) broadcast

By default, your router constantly broadcasts its SSID to ALL wireless devices in range. SSID’s are alphanumeric characters (max 32 chars). The first measure that you can take to improve network security is to disable this. Click on the ‘Wireless Settings’ option and uncheck the ‘Enable SSID Broadcast’ option.

image

2. Setup a wireless access list

Every wireless device has a  unique identifier called a MAC (Media Access Control) address. The idea is to restrict the router to allow connections ONLY from devices you recognize. Note that this is just one more barrier in our ‘Defense in Depth’ technique to protect the wireless network and can be broken by a hacker.

Under Wireless Settings, click on ‘Setup Access List’ (figure above) to reveal the wireless access list. Check the ‘Turn Access Control On’ option to enable the filter. Note that when you add subsequent devices to your home network, you will need to get back to this page and add the MAC addresses.

image

3. Restrict (Or turn off) DHCP

The DHCP service (Dynamic Host Configuration Protocol) running on your router is responsible for assigning valid IP addresses to devices. By default, an IP address is assigned to each device. You can restrict this to the number of devices that you know you will connect (or better yet assign static addresses to your devices and disable this service altogether)

image

Click on the ‘LAN Setup’ option and change the ‘Ending IP Address’ field. The above setting allows for a maximum of 5 devices.

4. Turn on Encryption

Without encryption, all data in your home wireless network is transmitted in clear text. Anyone with a laptop and network detection software (Ex. Kismet)  can view all data transmitted!

The WPN824V3 supports the strongest encryption system available today – WPA2. Note that ALL your wireless devices that connect to the router should have drivers capable of WPA2 encryption feature in order for this to work (Win XP users may need to download an update to make this happen)

Please be aware that earlier encryption methods -WEP (Wired Equivalent Privacy) and WPA (Wi FI Protected Access) have been cracked using simple tools.

There is an overhead associated with encryption but modern WI FI devices have dedicated hardware that handle the encryption and decryption.. The slight overhead is therefore a very minor tradeoff for the security offered.

image

The WPN824V3 has a combination setting that allows clients using either WPA-PSK [TKIP] or WPA2-PSK [AES]. This is a backwards-compatible mode to allow devices that dont support WPA2 – An excellent feature. Key in the passphrase and hit the ‘Apply’ button (You will need to enter both the SSID and the shared passphrase in your wireless devices).

In case you are using linux on your wireless devices, check out my post on WICD.. Works great for me!

5. Change the default password on your router

Last but not the least, be sure to change the router’s default password to a very secure password!

The default userid (admin) and the default password (password) is general knowledge and available in the user manual. If your router is compromised, all the above settings are useless and your network can be modified at will by the hacker.

Click on the ‘Set Password’ menu item to change the default password.

image

Posted in Computers and Internet | Tagged: , , , , | 1 Comment »

WICD on Ubuntu (Intrepid)

Posted by mnshankar on April 19, 2009

I was having the hardest time using wireless on my laptop (running Ubuntu 8.10).
My wireless router is configured to use WEP and the Network Manager applet on Ubuntu by default manages the WEP key  using the ‘Seahorse’ keyring manager.
Everytime during startup, the keyring manager would prompt for password in order to connect to the internet. Surprisingly, even the correct admin password would not work sometimes.. Now this was a real pain.
After reading countless message boards, I found out that the way to wireless bliss on Ubuntu is to switch from Network Manager to WICD (Pronounced ‘Wicked’).
Within about 5 minutes of fiddling with Wicd (and uninstalling Network Manager), I was connected to my wireless! And no annoying prompts on boot up! It works perfectly (even after suspend/hibernate!)
WICD does not use Seahorse.. The key is instead stored in a file /etc/wicd/wireless-settings.conf (Ofcourse with permissions set at 600). It is really lightweight and has no GNOME dependencies. I strongly recommend WICD to anyone having wireless problems with NM.

Posted in Computers and Internet | Leave a Comment »

Function binding in Javascript

Posted by mnshankar on March 30, 2009

Javascript functions are extremely flexible. Functions that are defined on one object can be called from different objects either directly or indirectly using apply() or call() methods.

So, the use of the ‘this’ keyword during runtime may not be a reference to the intended object. Fixing the value of the ‘this’ reference is referred to as function binding.

By default, a function defined outside any explicit object is bound to the current window object (‘window’). Functions defined inside a specific object have a default binding to the container object.

When you pass a method as an argument to be invoked later. if the invocation does not use its object, the binding is lost! Passing functions as arguments happens a LOT in prototype- esp when using Ajax libraries.

Here is an example of a potential bug that can creep in due to improper function binding:

var myObj={
name:’My object’,
getName:function(){
return this.name;
}
};

window.name=’This is the window object’;

debug.write(myObj.getName());
    //this prints out "my object".as expected

function callFunction(fx){
return fx();
}
callFunction(myObj.getName);
    //this prints out "This is a window object"!!

The first function invocation i.e. myObj.getName() works as expected as the default binding comes into play. Even though there is a window.name defined, the binding occurs within the scope of the object myObj.

The second function invocation is where things get interesting.

callFunction(fx) is a global function that takes a function as an argument and executes it. The ‘this.name’ variable in the getName function now gets bound to the window and displays the value of window.name instead of myObj.name.

The Prototype library provides two methods to remedy this.

  • bind(thisRef)
  • bindAsEventListener(thisRef)

An updated version of the code we just wrote using the bind() function is:

var myObj={
name:’My object’,
getName:function(){
return this.name;
}
};

window.name=’This is the window object’;

debug.write(myObj.getName());
    //this prints out "my object".as expected

function callFunction(fx){
return fx();
}
callFunction(myObj.getName.bind(myObj));
//’My object’.. works as expected!

The bindAsEventListener() method is to be used to properly bind functions when registering events in prototype. The bindAsEventListener() works just like bind() but also preserves the current event as the first argument. So, in your function you can perform tasks with the event such as stopping further event bubbling – Event.stop(e)

Posted in Computers and Internet | Tagged: , , | Leave a Comment »

Removing a Linux installation (dual boot with Vista)

Posted by mnshankar on February 20, 2009

A couple of days ago, I had installed Ubuntu on my computer to see what all the fuss was about. Now that I am done exploring most of the cool themes, effects, compiz/emerald settings etc, I wanted to get rid of it . I was also constantly trying to modify my Ubuntu install to resemble Vista (changing themes, fonts, colors, browser skins etc).  Here are the steps to roll back the Ubuntu install :

Step 1: Removing GRUB

The first step is to remove the “Grand Unified Loader” and put back the vista installer. EasyBCD is a freely available program that makes it a snap. Download the software from here.

Once the install process is complete, Open the application and click on the ‘Manage Bootloader’ button

image

Next, click on the ‘Write MBR’ button (By default,the ‘Reinstall the Vista Bootloader’ radio is selected)

image

Thats it! Now, when you restart your computer, Vista boots normally. We now have to deal with removing the partitions that were created during the linux install process (Swap space and Ext3 partitions). 

Step 2: Removing the unwanted partitions and merging them with the Vista partition.

This is easily accomplished using the Disk manager utility provided in Vista. Right click on the ‘Computer’ icon on your desktop and select ‘Manage’

image

Select ‘Disk Management’ under storage. I have highlighted the partitions occupied by Ubuntu on my computer:

image

Right click and select ‘Delete Volume’. You may need to do this multiple times until the partition shows up as unallocated space as shown below:

image

Next, Right click on your vista partition ‘C’ and select ‘Extend Volume’. Congratulations! you have successfully gone back to your pre-linux configuration!

Posted in Computers and Internet | Leave a Comment »