Purchased new home

Well I purchased a new home for myself @ sazwqa.com

& the garage belongs to blog now, access here – sazwqa.com/blog

 

Consider this as the last post from here… See you there :)

Finding Django version number

Simple to find, yet its needed sometimes. Posting just for reference: Open python and do type the following:

import django
django.VERSION

How to find different environment configurations in rails

While working with a multiple-database application I came across the point where I had to juggle between different environment configurations.

I had to pass connection hash to ActiveRecord::Base.establish_connection, something like this:

ActiveRecord::Base.establish_connection
(
  :adapter=>"mysql",
  :host=>"localhost",
  :username=>"myuser",
  :password=>"mypass",
  :database => "somedatabase"
)

This connection can be easily retrieved from ActiveRecord::Base.configurations, this is currently undocumented.

Using ActiveRecord::Base.configurations, the above can be simply written as:

ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['production'])

Running Multiple Versions of Firefox on Windows

I hope this is a trivial problem and googling it around gave me no trivial solution :(

Faced by many web-developers around the world, this context switching issue is definitely a time-sucker ! You lose the session, the cookies, the password, the settings, the plugins and a lot more than that, the time.

Coming to solution, I use portable firefox personally (if you don’t know what this, check out ProtableApps).

To run parallel firefox versions you just need to make a few changes in the configuration.

1. Goto folder \Other\Source and copy FirefoxPortable.ini to your firefox portable root, where the FireFoxPortable.exe is located.

2. Open the file in editor and change the following line:

AllowMultipleInstances=true

(Basically we are allowing multiple instances of FireFox)

PS1: If you have installed both version of firefox as portable you need to make changes in both the installations. (Simply copy the same FirefoxPortable.ini to other folder.)

Untitled

Adding new programs to Default Programs

For a week I was facing problem while associating files to open with
some application. Though I was able to locate the application, yet it
didn’t showed up on the open with dialog, like this:

1

(Here, I browsed for the application. yet it is not appearing here.)

I stumbled across this solution:

http://windowsxp.mvps.org/openwithadd.htm

This nifty utility allows you to add programs to the default programs list thereby allowing you to associate your files with the application of your choice.

Installing Ubuntu 8.04 server on VirtualBox

If you are getting the following error on installing Ubuntu 8.04 server on VirtualBox:

The kernel requires the following features not present on the CPU 0:6
Unable to boot - please use a kernel appropriate for your CPU

Then, you need to enable the PAE support for the virtual machine.

Follow the screens:

1. Open the settings for the machine (Ctrl + S).

2. Check the Enable PAE/NX bit.

The computer did not resync because the required time change was too big

Microsoft Windows Vista has a built-in feature to synchronize your machine’s time automatically with global time servers around the world. The service can be scheduled to run automatically and works like charm keeping your system time up-to date, but there’s a tiny catch in here.

If your computer’s clock is async for more than 15 hours, this service will not work for you saying “An error occurred”.

Copy the following code and save it as .reg file, apply it and re-run the synchronization. It will work !

Windows Registry Editor Version 5.00  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config] 
"MaxNegPhaseCorrection"=dword:ffffffff 
"MaxPosPhaseCorrection"=dword:ffffffff

The above code is also available in pastie @ http://pastie.caboo.se/179732.

Follow

Get every new post delivered to your Inbox.