Hello and welcome to my blog, which will deal with programming and other silly hobbies of mine.

This page has a feed that you can track (if you use Firefox, you may see the feed icon in the location bar)

HTC Desire : Mini review

by hrjhrj 22 Aug 2010 06:09

I just bought the HTC Desire as a gift to someone, but as the undisputed resident-geek of the house I got to play with it for a while.

This is a really quick review of the phone, written for the impatient. Most of the online reviews get distracted with the eye candy while ignoring the important issues. Hoping that this will be useful to someone out there:

The bad
  • You have to associate a Google account with the phone for most of the functionality and to download applications from the Android market! What's more, you can't sign out from the account or associate multiple accounts with the phone. This is ridiculous since you can't just hand over the phone to another person even for a few minutes: your email conversations / private messages will be easily accessible.
  • To sign-out or dissociate your Google account from the phone you have to, drum rolls, RESET the phone to its factory defaults! REE DEE COO LOUS
  • Apparently HTC has updated the Android OS to the much awaited version 2.2 (Froyo or Frodo or something like that). BUT, the update is not available to all phones yet. The update for branded phones has to come from your carrier, but what's worse is that even the unbranded phones don't get the update simultaneously; they are being rolled out selectively according to geography, and no wonder Indian phones haven't got it yet.
  • The browser is great (see below) but there is no support for file uploads. This is apparently fixed in Android 2.2. (And ofcourse, you can download many alternate free browsers from the market).

I am hoping that when my phone gets the 2.2 update, the above problems will be mitigated.

The good
  • As a phone and communication tool, it's a pretty good one. The UI is well optimised in this regard.
  • The speakers are not bad. There are many forum posts about noisy, tinny sound speakers, but I didn't find it that noticeable. To be sure, they leave much to be desired, especially the bass, but they are quite usable.
  • The interface is quite fast.
  • The touch screen is accurate and sensitive, and coupled with a fast interface, it is a pleasure to use.
  • The browser is fast and staying true to the online reviews is quite usable even on such a small screen.
  • The GPS was pretty quick to get a satellite-fix. The tilt sensor is great. There is a demo game included with the phone, in which you tilt the phone to roll a ball along mazes and I was amazed by the realistic simulation and sensitivity.
  • The camera is decent. Useful in a pinch. I don't have very high expectations from a phone-camera, so I am happy with it.
  • In the worst case, "rooting" HTC phones is easier compared to others (or so I have heard) and hence there is always and easy way out from the problems I mentioned.

So, was it worth the 27k INR that I shelled out? Yes, provided the above software problems are fixed. The hardware is an engineering marvel; so many features packed into just a sliver of silicon!


Why Flattr needs to get out of closed beta soon

by hrjhrj 04 Aug 2010 13:58

At the outset let me say that I like Flattr, both its idea and its implementation. That is why I signed up and that is why I put their buttons on my creations.

Flattr works because it is so simple. Compared to Paypal donations or Pledgie, you need to make far fewer money transactions. And because the payout has a cap (or budget) set by you, the user can safely Flattr as many items as he likes, without worrying about over expenditure.

But, Flattr is currently in closed beta, which completely disrupts the above model of simplicity. The user has to go through multiple processes before he can login and by that time he might have forgotten why he signed up to begin with!

One of the purposes of a closed beta is its use as a marketing tool; a closed beta creates interest and gets more users on board. But this is not relevant to Flattr because it gets a lot of back-links through the Flattr buttons, which help publicise it.

To sum up, a closed beta for Flattr is bad because:

  • It creates a bad user-experience for a new user who has clicked on a button because of the bewildering sign up process.
  • It is bad for the site that links to Flattr, because a lot of users will associate the bad user experience with the original site that linked to Flattr.
  • Finally, it is bad for Flattr itself. So, a user has landed on its page. It has a potential paying customer viewing its web page right now! And he is eager to sign up. But there is no way to sign up. What could be worse for a web-site?

So Flattr, please do all of us a favour and quickly open up your excellent web app.


Lauching » A twitter dashboard

by hrjhrj 04 Dec 2009 18:19

Twitter | A ring to bind them all

Lately, I have noticed myself spending quite some time with Twitter. To me, just as to many other Tweeple, Twitter is a unified way of staying in touch with friends and discovering general news, technology updates, and those sort of things.

Google Reader, which still remains my favourite tool for aggregating various feeds, was my previous "eye" for such updates. However, my Twitter client has been complementing Google Reader slowly and surely for "discovering" information. The convenience of a single stream of data triumphs over the sophistication of site-specific RSS feeds in certain contexts.

Twitter | A deluge

However, all the twitter clients I have used present the stream in a mind-boggling linear fashion. There is no way to skip and skim to the tweets that matter most. For example, I like reading @funnyoneliners but only when I have the luxury of time. Other times I like to skip those jokes and just read what my friends have to say (yeah ok, mostly about what they and their dog had for breakfast today).

tDash | A time saver


I am excited to present

It's an experiment, an attempt, to take Google Reader's organisational ability and apply it to Twitter.

It has been designed for Tweeple who continuously read Twitter. I have strove for a minimalistic design and for ease of use. There are keyboard shortcuts for just about everything; no more frequent lunges at the poor mouse.

It is entirely web-based. No need to install anything. For that matter, no need to uninstall anything if you get bored of it. (Hah! Just try not using it for a week, I challenge thee).

Apart from these there are many little gems hidden in tDash. Gems such as,

  • Mark a tweet as Read. As soon as you select a tweet it gets marked as read and then it magically gets out of your the next time you view that folder. (If you still want to read it again, there is an option for that).
  • Support for Twitter Lists. It's a great way to organise them tweeple. Too big to explain here. Go read this tutorial.
  • Login via OAuth Play safe. Enough said.
  • URL shortening. Yeah, well, this one's is a standard accessory.

Keyboard shortcuts

Here is a quick reference to the keyboard shortcuts available to you. What squeak? Oh yes, that was your mouse sighing a relief.

Key Action
Space Select next unread tweet. If nothing to select in current folder, jumps to next folder
n,N,j or J Select next tweet
p,P,k or K Select previous tweet
s, S Enter / edit your status
r, R Reply to currently selected Tweet
f, F Mark currently selected Tweet as favourite
t, T Retweet the currently selected Tweet
u, U Update (fetch new tweets)

The future

Many more features are on the way even as I type this post. Stay tuned.


The prolific Mayank S has been helping me out with code. The keyboard shortcuts were his contribution. And he has many more plans up his sleeves!



by hrjhrj 18 Oct 2009 05:57

As trekkers, in what seems like another lifetime, my wife and I had been eager to go out on a trip/trek for the last 2 years. We were also eager to take our year-old kid along, and so we had to strike a good balance between fun, comfort & safety.

The sunny day started on a lazy note. We had planned to start at 7am, but the taxi arrived much later, and we waved our good-byes only at 8am. By this time we were feeling hungry and had to stop for breakfast. After nibbling on Poori-bhaji, Upma and Idli-wada in the The New Grand hotel, we steered into the Pune-Bangalore highway.

Our first halt was at the Hidkal dam, constructed on the Ghataprabha, a tributary of the Krishna. The actual dam was not visible because of recent restrictions to visitors, but the view of the catchment area was nice. The circuit house has a largish 3D model of North Karnataka terrain, including Malaprabha, Ghataprabha, Krishna and the several dams constructed on them.

We next went to Gokak falls. This was supposed to be the highlight of the trip, but the water flow wasn't at its heaviest. We did have some fun while crossing the hanging bridge on top of the falls and clambering down to the waterfall edge.

The young one was enjoying the trip, but the heat had exhausted us and the music playing in the taxi had a mildly nauseating effect. We hadn't much hope left on our next destination, Hooli, a remote little village near Saundatti. This was a complete blind shot, based only on Uday's blog post.

Given our weak spirits, the PanchlIngEshwara temple in Hooli was a pleasant surprise. It was pretty well maintained by the Archaeological department. The person in charge of maintenance told us that this site seemed like a former Jain-basathi which was converted into a Shiva temple by establishing 5 Shiva-lingams there. There was a shed in the temple premises which was used as a temporary godown for artefacts. Apparently, these were found in the site vicinity by villagers when they dug the ground for construction. There are many other ruins nearby but he advised us not to go there as they weren't being maintained as well as this one.

Our next destination was the Kittur fort. The road from Hooli to Kittur was terrible, the driver was cursing and it was 7.30pm by the time we reached Kittur. The late time of our arrival turned out to be a boon in disguise; there were very few visitors there and we got a special favour from the museum maintainer. There was this new collection of antique armour and weaponry which had been brought to the museum, but wasn't on display yet. We got to not only look at them but also brandished the swords, maces, shields and other devices of violence. Some of the sculptures in the museum were dated circa 2AD and were enticing to watch.

We couldn't see the actual fort because it was too dark to take the kid along.

We took the highway back to Belgaum and were in time for dinner, after a day well spent.



by hrjhrj 17 Oct 2009 04:27

If you are a Twitter user, do checkout

It's my newest pet project, a dynamic visualisation of Twitter contacts. There also suggestions offered about new contacts which might be of interest to you.




Pythagoras Tree

by hrjhrj 31 May 2009 14:25

While casually browsing the net I came across this implementation of Pythagoras tree in F#. Just for fun, I have recreated this in Scala.

The Pythagoras Tree is a fractal constructed by geometric methods. It is rather easy to program since no substitution is involved. You can just pile on the newly created squares onto the existing ones, since they don't overlap immediately.

Eye candy

Here is the output of my Scala script:

Depth=10, No Skew


Depth=14, Skew = 0.8


The source code


This script is a bit more configurable than the F# one linked above, and hence is a bit more lengthy. I was quite happy with the script and the end result.

tags: fun pythagoras scala script tree


by hrjhrj 24 May 2009 18:01


After several weeks of development and alpha testing by friends and family, we are releasing a stable version of a website I have been working on recently.

Ladies and gentlemen, please point your browsers to

What is ?

A simple website to post classifieds online for free. It has been exclusively created for Indian users, and covers all districts in the country (600+).

Everything about the site is geared towards simplicity, including:

  • the look — very few graphics + dynamic interface
  • the operational model — zero intervention between seller and buyer is our policy.

What is it not ?

While making the site, one path we have not treaded (nor intend to tread) is social networking. We will likely add more features in the future to facilitate collaboration between groups of users. But we don't expect it to become a core feature of the site.

The reason is — to keep things simple for everyone, especially novice internet users.

A brief walk-through of

Here are some of the features of



Every Ad has to be given a category at creation. This helps viewers to easily find what they need.

Ads that offer and Ads that want


Broadly speaking, every Ad has either something to offer to the viewer, or wants something from the viewer. This too is specified at creation time of the Ad, and helps viewers to find exactly what they need.

Specifying the location


Viewers can choose to filter their Ads

  • by city
  • or by state

They may also see results for All Locations in India.



We are very concerned about the privacy of users of our site.

There is a built-in method to contact users, without needing to divulge either the seller's or buyer's contact information until each party voluntarily chooses to do so.


While viewing the website is possible for all, membership is needed to post a new Ad.

Membership is free, and to become a member you just need to confirm your email address and choose a profile-name.

Stay tuned

Thanks for reading through!

Please use the site whenever you need to buy / sell anything, and send us your feedback!

We will stay tuned :)


Howto Redmine on Fedora with Postgresql DB

by hrjhrj 17 May 2009 09:54


I have been using Trac for my last two projects. It works mostly as expected and the integration of Wiki+Ticketing+Subversion saves a lot of time. I have been fairly satisfied with it.

Satisfied, that is, until now.

As our projects started growing, it became tedious to install and use a different version of Trac for every new project.

So, I decided to try out Redmine, which is an application very similar to Trac, but boasts of several more features, prominent among them being:

  • Support for multiple projects
  • Role based access system
  • Project Scheduling (Gantt charts, etc)
  • Ajax interface

The catch: It is written in Ruby, and most distributions don't have ready-made bundles for it (Redmine).

Nevertheless, I decided I would be brave and go where all wise men have been before. To search on The search yielded an excellent tutorial

The Howto

The Howto linked above was written for CentOs5 / RHEL5, but I found it equally valid on Fedora Core 10. Further, that Howto suggests the use of MySQL, but I altered some steps to make it work for Postgresql DB.

Here is the modified version.


  • This HOWTO is written for Fedora core 10 (might also work on CentOS and RHEL)
  • Replace [FQDN] with either your IP address or the hostname (or FQDN) which you’ll be using to access the interface.
  • Replace [user] with the username under whose home directory the Subversion repository database will be located. e.g. /home/[user]/svn-repos
  • This HOWTO will make the following assumptions:
    • You already have the “httpd” (apache) package installed
    • You will be running apache as the user ‘apache’
    • The subversion repository root folder will be under /home/[user]/subversion/
    • The vhost’s folder locationg will be /var/www/svn
    • The subversion repository to be created will be called ‘example-repo’

Install and setup Subversion

Strictly speaking, this step is optional, since many features of Redmine don't require integration with an SCM. However, I am assuming that in most cases, users would want SCM integration.

yum install mod_dav_svn subversion

Add the group [user] to the user apache and make the subversion base URL readable and writable…

usermod -aG [user] apache
chmod g+x /home/[user]
mkdir /home/[user]/subversion
chmod g+rwx /home/[user]/subversion
chown -R [user]:[user] /home/[user]/subversion

Make the web directory:

mkdir /var/www/svn
chown apache.apache /var/www/svn

Put the following into /etc/httpd/conf.d/svn.conf (this is for a subversion repository called ‘example-repo’)

NameVirtualHost *:80
<VirtualHost *:80>
        DocumentRoot "/var/www/svn"
        ServerName [FQDN]
        <Location /example-repo>
                DAV svn
                SVNPath /home/[user]/subversion/example-repo
                AuthType Basic
                AuthName "Subversion repo"
                AuthUserFile /var/www/passwd
                Require valid-user

        <Directory "/var/www/svn">
        allow from all
        Options +Indexes

Add an HTTP auth user…

htpasswd -cm /var/www/passwd [user]

Create a proper SVN repository

cd /home/[user]/subversion
su [user] -c "svnadmin create example-repo"

(This creates a blank repository, which is enough for the purpose of this tutorial)

Install Ruby on Rails

Let’s get Ruby up and running first. The original Howto recommends disabling SELinux.

yum install httpd httpd-devel apr make gcc-c++ postgresql postgresql-server ruby-postgres ruby ruby-devel ruby-docs ruby-ri \
ruby-libs ruby-mode ruby-tcltk ruby-irb ruby-rdoc fcgi fcgi-devel mod_fcgid rubygems subversion-ruby

Now we’ll install passenger (aka mod_rails)

gem install passenger

Create and insert this text into /etc/httpd/conf.d/rails.conf (or alternatively edit the existing svn.conf created when we set up subversion)

The below configuration is specific to the installation of redmine (hence the DocumentRoot)

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2
   PassengerRuby /usr/bin/ruby

NameVirtualHost *:80

   <VirtualHost *:80>
     DocumentRoot /var/www/rails/redmine/public

Now on to Redmine itself

Get Redmine 0.8.x from here

Assuming you downloaded the Redmine package into ~/Dowload/redmin-0.8.x.tar.gz

mkdir /var/www/rails/
cd /var/www/rails/
tar xzf ~/Download/redmine-0.8.x.tar.gz
mv redmine-0.8.x redmine
chown -R apache.apache redmine
cd redmine

If this is the first time you have installed Postgresql, initialise the database:

service postgresql initdb

You should now setup the password for user 'postgres'. The exact steps depend on how you want to setup authentication. I found this link useful.

Now start postgresql

service postgresql restart

Before proceeding, check if you are able to login to postgres server with user-name=postgres and your chosen password.

psql -U postgres

Now, create a database for redmine:

psql -U postgres
create database redmine;
create user redmine;
grant all on database redmine to redmine;
alter user redmine with password 'red';

Copy the example database file to the “live” location

cd /var/www/rails/redmine
cp config/database.yml.example config/database.yml

Enter the appropriate settings for the [production] section ensuring that host is set to

vim /var/www/rails/redmine/config/database.yml

Set up email

cd /var/www/rails/redmine
cp config/email.yml.example config/email.yml

Enter the appropriate settings for the [production] section ensuring that “address” is set to the IP address of the SMTP host
vim /var/www/rails/redmine/config/email.yml

Install rails and postgresql connector for redmine using gem…

cd /var/www/rails/redmine/app/
gem install -v=2.1.2 rails
gem install activerecord-postgresql-adapter

Import the redmine database into the live database specified in the above config file

cd /var/www/rails/redmine/app/
rake db:migrate RAILS_ENV="production"

Install default configuration data in database (this is entirely optional, but recommended).

cd /var/www/rails/redmine/app/
rake redmine:load_default_data RAILS_ENV="production"

Bring up the testing webserver, once loaded check your config by browsing to http://[FQDN]:3000
cd /var/www/rails/redmine/
ruby script/server -e production

Make sure your apache config file edits are ok and that the services will start at boot by doing:

service httpd configtest
service httpd restart
chkconfig httpd on
chkconfig mysqld on

Taking Backups (entirely optional)

Add the following to your crontab which will create a database backup in the /home/[user] directory

pg_dump -i -h -p 5432 -U postgres --format=plain -C -D -v "redmine" | gzip > /home/[user]/redmine_`date +%y_%m_%d`.gz

Email using Gmail and other secure servers

Out of the box, Redmine doesn't support Gmail's SMTP server (or any other secure SMTP server with TLS).

A workaround is here.

I am paraphrasing those tips here.

Install the action_mailer_optional_tls plugin

The action_mailer_optional_tls_plugin adds a TLS option to Redmine's emailing library, ActionMailer. TLS is a version of SSL which is required by GMail in order to send email.

To install this plugin, use the script/plugin command in your Redmine directory:

cd /var/www/rails/redmine/
ruby script/plugin install git://

If you don't have GIT, don't fret:

cd /var/www/rails/redmine/
./script/plugin install

Configure your email.yml

It should now look something like this (note the tls and authentication options)

# File: config/email.yml
  delivery_method: :smtp
    tls: true
    address: ""
    port: '587'
    domain: ""
    authentication: :plain
    user_name: ""
    password: "your_password"

That's it. You are done. Congratulations!

Do let me know via comments, how it worked for you.

tags: fedora howto postgresql redmine trac

Laptop Hard disks are (gonna be) seriously broken

by hrjhrj 23 Apr 2009 15:37

This is a rather technical post; non-techy readers can skip/skim. Also, my knowledge might be half-baked, since I haven't RTFC; just culled the info from mailing lists. You have been warned!

Power saving

It all started with a simple wish: to save power on a server system I am building, by spinning down the HDD when the server has a prolonged idle time.

A quick googling revealed that "hdparm -S" was my friend. It helps set a timeout parameter for the disk to spin down and thus save power. So, I quickly setup a bootup script which does this, and that would have been the end of it, had it worked as expected.


I observed that the option does work for very small timeouts (5 to 10 seconds). But beyond that there is always some activity happening in the system that prevents the disk from spinning down, which was evidently a software configuration problem.

So, I started digging more on this topic, and figured a couple of tools to help pin down what are the exact applications that cause this background activity. (See for example, the Spinup Debugging section here)

But that is a different story. The real story is that I learnt that frequent spinning down was actually bad for the disk, and it was happening by default, without user intervention, on most Linux (and possibly Windoze) systems, on most Hard Drives !!!

The problem

Frequent spin ups & spin downs are bad because they cause wear & tear of the disk head mechanism, which is more than the wear & tear that happens while the disk is spinning.

Some numbers

To find out how many times the drives has been loaded (and hence spun up/down), use the smartctl command:

smartctl  --all /dev/sda | grep Load_Cycle

On my laptop the output was,

smartctl  --all /dev/sda | grep Load_Cycle
193 Load_Cycle_Count        0x0012   066   066   000    Old_age   Always       -       343830

The last number, 343830, gives the number of times my HDD was loaded, and that's a huge number given that it is only 1.5 years old. Typical maximum loads for a laptop HDD are about 600k.

The power on time for my disk is

smartctl  --all /dev/sda | grep Hour
  9 Power_On_Hours          0x0012   093   093   000    Old_age   Always       -       3409

What gives..

The official answer is on the known issues page of the Linux ATA driver website. But this is a rather conservative assessment, IMO.

From my own experience and from what I have seen on various forums, there are many users with various different HDD makes, that are affected by this problem.

The cause for this high number of disk loads, AFAICT, is that most laptop HDDs have factory defaults that maximise power savings (to give longer battery life times). The aggressive power saving settings, however, cause frequent spin downs. And most linux distributions (and perhaps Windozers) don't change the factory settings unless instructed (which is a wise decision IMO).

The ways for avoiding this are also poorly documented.

The end result is that, by default most laptop disks could wear out in about 3 years of regular use.

Possible Solution

One way to reduce the frequency of HDD loads is to use the "hdparm -B" option. A high number for the parameters value will tend to reduce the number of spin downs (and also consequently increase power consumption).

The exact way to do this on your distribution may vary. On my Fedora Box, I modified "/etc/rc.local" and stuck in this:

# prevent aggressive power management (-B 254)
# set spin down timeout to 30 minutes of idle time (-S 241)
hdparm -B 254 -S 241 /dev/sda

This has certainly reduced the number of spin downs for me.

Do let me know via comments if it works for you too.

tags: broken hdd laptop linux technology

Firing up Focault

by hrjhrj 29 Mar 2009 06:23

I finally got off my lazy hind and built a Focault tester.

The mirror holder was the only new thing I had to build. I had a slit and knife edge ready from a previous attempt.

After gazing at the myriad plywood pieces lying around in my balcony, I hit upon an innovative design for the mirror holder. The triangle pieces cut-off for the Dobsonian cradle came in very handy.


The actual Focault test was fun too. Here is a view of the image, with the 50% region at null.


With explanations:


Both the turned-down edge and the central hill don't bother me too much. I have some mirron-on-top polishing to do which should even out those areas.

What really bothers me is the number of scratch marks my mirror is accumulating due to prolonged polishing :(

Anywho, the focault test is a good guide for knowing when to stop polishing!

tags: focault telescope

page 1 of 3123next »