Posterous theme by Cory Watilo

Installing TOAD for MySQL v5 on Windows 7 64bit

Oddly enough, I've been trying to install TOAD for MySQL v5 for the past couple of months. Each time I would install - it would be the same story. The setup window would disappear halfway into the process.

Then one day, I stumbled upon a fix for this issue. Note, the issue only affects Windows 7 64bit users. The fix is simple. Open a command prompt. Go to the folder with the Toad setup file. Write the Toad setup file name followed by "/quiet" and hit enter. The setup process will start in the background and within 5 mins, Toad for MySQL should be installed on your computer.

Happy grib-bib! :)

Fixing Postgres SHMMAX/SHMMIN issue on x64 systems with more than 4GB RAM

A month back, I upgraded my laptop's RAM from 3GB to 6GB. Ever since, Postgres refuses to start on my machine which is running the amd_x64 flavor of Ubuntu 10.10. Here's the error thrown by it:
$ sudo service postgresql start
* Starting PostgreSQL 8.4 database server
* The PostgreSQL server failed to start. Please check the log output:
2011-02-04 20:26:43 IST FATAL:  could not create shared memory segment: Invalid argument
2011-02-04 20:26:43 IST DETAIL:  Failed system call was shmget(key=5432001, size=37879808, 03600).
2011-02-04 20:26:43 IST HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 37879808 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103). If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for. The PostgreSQL documentation contains more information about shared memory configuration. [fail]

For future reference, I've compiled a quick how-to on how to fix this.

Setting 128mb for shmmax (or 2097152 pages for shmall):
$ sysctl -w kernel.shmmax=134217728
$ sysctl -w kernel.shmall=2097152
To make this permanent, add the respective code (without sysctl -w):
For shmmax, add it in /etc/sysctl.conf 
For shmall, add it in /etc/rc.local

Alternative to sysctl:
$ echo 134217728 >/proc/sys/kernel/shmmax
$ echo 2097152 >/proc/sys/kernel/shmall

Fixing Internal Mix w/ Skype (Aspire Timelinex 4820TG running Ubuntu 10.10)

Making the microphone work

Install Alsa Mixer from the Ubuntu Software center (Applications → Ubuntu Software Center). Once installed, you will find the Gnome Alsa sound mixer in Applications → Sound & Video → Alsa mixer. Use it to push Capture level to maximum. Don't forget to check the Rec check-box under the capture slider. To avoid electrical noise slide the horizontal slider for “capture” completely to the right. The electrical noise seems to come from the lest side. (Check with sound recorder)

If you still experience some problems , you may also install the package “linux-backports-modules-alsa-karmic-generic” with the synaptic package manager and the internal microphone should work. (in the Ubuntu system menu under “System” > “Administration” > “Synaptic Package Manager”).

To use the terminal to achieve the same thing type :

sudo apt-get install linux-backports-modules-alsa-karmic-generic
 
On Ubuntu 10.04 and 10.10, this package doesn't exist. I was able to fix the problem by adding the following line to /etc/modprobe.d/alsa-base.conf:

sudo gedit /etc/modprobe.d/alsa-base.conf

Add the following line at the bottom of the file:

options snd_hda_intel model=basic
 
Making the internal microphone work with Skype

To use the internal mic with Skype, start Skype with

/bin/sh -c "PULSE_SERVER=127.0.0.1 skype" &
 
It can be done automatically by editind the Application menu:
- Right click on the Applications menu (on the upper left side of the screen) and select Edit menus
- Click on Internet in the right panel
- Select Skype
- Click Properties
- Replace skype by /bin/sh -c “PULSE_SERVER=127.0.0.1 skype” &
- Close and check if it works (you need to restart Skype if it was already up and running)

MongoDB, Ubuntu 10.04 and libmozjs.so

I got stuck with a stupid error today while setting up MongoDB on my dev box, which is running Ubuntu 10.04. I solved the issue by using this solution. Thanks to Michael, who's the original author for this!
Putting it here for future reference:

When installing MongoDB under Ubuntu, one could stumble upon the following problem:

mongo: error while loading shared libraries:
libmozjs.so: cannot open shared object file: No such file or directory

This is caused because MongoDB uses XulRunner for it’s operations. (This is also why you see a bunch of X11 programs that are to be installed when using apt-get). XulRunner, however, contains this file, but is not loaded.

Solving the problem:
Make sure you have xulrunner installed (sudo apt-get install xulrunner-1.9.2) and add its path to ldconfig’s configuration files, which are in/etc/ld.so.conf.d. You could create a file, say, /etc/ld.so.conf.d/xulrunner.conf, containing the following line:

/usr/lib/xulrunner-1.9.2.10/

After this, you chould run ldconfig (as root) and that should do the trick. Let me know if you have any problems with this.

 

Some fresh air, please!

Past few months, I've been getting sick of the work I'm doing. It's all about making the moolah. While I've made some moolah, the work keeps becoming more "regular".

There have been a couple of firsts. I've worked on a production level Java project for the first time. But there have also been first hand situations that demanded my time. And when I couldn't give time to the things I wanted to, it hurt bad!

So out of this crisis, I've made a small change in the way I work. Instead of doing just about anything that comes my way, and taking that as a challenge, I'll filter the work. I get a LOT of work requests these days and most of the stuff is quite ordinary.

I wanna do something outside the ordinary. That's led me to dabble a bit into non-regular computer languages like Go and Erlang. Digging deeper into them has fascinated me. The whole challenge of building highly scalable - high-availability web services has fascinated me. I may be a Computer Science grad, but I'm not a very technical guy. I don't like talking about memory addresses. Gives me the goosebumps. I decided long ago I'll get into Windows product development and then my foray into web applications happened, and I haven't looked back since.

Cutting the story short, I wanna dig deeper into the world of imperative programming!

To celebrate that, here's a snippet in Erlang for calculating the factorial for a number:

Ain't that sweet?