Darwin says hit and run

Last night, I was coming back from a party at my friends. It was a lonely road so I was little casual. (anyways, my current speed limit is 60kmph…so out of control was really out of question).
Suddenly I saw a  pot hole and tried to turn around it and braked a bit. What I failed to do was look in the rear view mirror that there was someone else coming. That guy also responded fine (there was no collision). But he had a lady sitting on the pillion with legs on one side. She lost balance in the act and fell down.
I saw it, stopped and went to help them out. I got her some water. Some inspection of her head revealed that it was a small bump. Though she seemed to be in too much agony for that (anyways, overacting is not part of this post :) )
The guy said that they too were coming from a party and there is a car coming. She can then travel on the car. I really had no hurry so thought that I should stop until the car comes and see them off well.
A couple of minutes later they arrived and the scene didn’t turn out to be anywhere closer to what I expected. The guy (who was on the bike) was talking well until now suddenly started complaining vehemently to his brother about how I was driving. And even before I could get what was happening I was under shower of blows. Well good thing that it didn’t last long.
But post that session they simply asked for money and got all I had in my wallet. And then everyone went their own way as if nothing had happened.

Now, I don’t really care about the blows or the monetary loss. But I don’t think that I would ever be able to stop for helping anyone anymore. Whats the point after all — self salvation? I am better off with couple of bucks and more self-respect left to me.

Powered by ScribeFire.

Posted in blog, society | 2 Comments

OS installation

Have you ever wondered what happens when a software (MS Office, gimp, etc) are being installed on a system? Even a couple of moments thought would suggest that it would install(copy at a specific location) a couple (at times a lot) of binary (or script) files which can be executed. It would also copy certain configuration items that are useful for its execution and that can be used for changing the way it executes.

What comes up as a later realization that almost all programs don’t have everything they need to run in their installer packages. These things are generally known as dependencies.
Dependencies have a very big pro that if multiple programs share the same dependency then even after installing all those programs you just have 1 copy of the dependency i.e. unnecessary code bloat is avoided. (of course it does also mean that installer package is smaller…but I think one-time pains don’t count as much as living eternally with 2 copies)
But this also leads to a con. Breaking the dependency mean breaking 2 things at once. That is the reason you might hear someone saying this is very core component. Core component would inadvertently mean that it is being used at a lot of places (this _might_ also mean that it is doing something very important….but that is usually a secondary concern).
Also, dependencies mean that there would have to be installer program that executes and checks the target system if the dependencies are already there or not. After that its upto this installer program to maybe provide the dependency (programs) on its own (download it….or may be unpack it from its own body). This makes installer programs so useful and complicated (of course you can have installer which just copy the application and don’t care about dependencies…but then either you have to be smart enough to prepare your system or the program would simply not work)

Now imagine a program which doesn’t have *any* dependency, it has to be the simplest one to be installed. All it needs is a copy of its executables at particular places and a copy of its configuration at another set of particular places.
Notice I said imagine…but such programs do exist and I bet you are using at least one of them right now…the Operating System — its the most important piece of software that would be running on your system right now but still it is a stand-alone giant (well mostly….there can pluggable thing in OS as well….but those usually don’t render it useless in their absence).
Now moving our discussion of installers forward, OS installations have to be the simplest one to do. After all it just needs some hard disk space and some files to be kept on that place on the hard disk (and an initial config of bootloader to push the start button….but for now we’ll forget the boot-loader).
But thats not the picture of OS installer that is usually painted. I am sure you would have seen OS installers which feel too supreme in their own rights and always ask you to boot from the installation media (woah!! funky name ). They are now becoming lenient and allow you to start installation from an already running OS but even then the job is half done. Most of the OS installation still runs stand-alone.

I was always under the same impression that OS installation is a big thing until 2 weeks back when I planned to install another OS on my phone (yes, you read it right–on my phone…this is one of the coolest thing that I can do on my phone *without* voiding any warranties). Anyways, mostly I connect my phone on my laptop and do stuff because typing on small screen for long time is a real mess. But this time I was out of luck. This is when I got this crazy idea to do it all on my phone itself. When I started to think about it, I was able to enumerate exactly 4 steps in which this could be done:
* Make place on SD card
* download OS files
* copy them on the card
* configure boot-loader
* reboot (well this is fifth step but I don’t want to count it:)
I was perplexed that can it really be this simple? And it turned out that it was. I just connect my phone to Wifi at home, browsed to shr-unstable, downloaded the latest OS image (a simple .tar.gz…but for people on Windows, its something similar to a zip file). Then I fired up a shell (on my phone), created a partition, copied the the tar image to that partition and un-tarred (unzipped) it there.
For my case telling the boot-loader to load this OS was pretty easy, I just had to put a file named noboot-GTA02 on the first partition (from where the phone was currently running). Next step reboot and I was on.

BTW, I am over-simplifying the OS installation process a little bit here. In my case the hardware was fixed (the image of the OS is specifically built for my phone). But even then the steps of installing it on any modern machine has to be similar. All the installer can optimize upon is copying only specific files (depending upon the current platform). Nothing that cannot be done on an already running system.
I have heard that Debian with debootstrap and Gentoo do it already as Linux distributions. I know there are ways to make bootable pen-drives on fedora/ubuntu so I am pretty sure that method can be hacked to install fedora/ubuntu on another hard disk. I wonder when would Microsoft do it (I think they have already started doing most of the copying [copy all the media] and setup bootloader to reboot machine in OS installer from existing intallation). I don’t expect this to be done by Apple (they have their heads held too high to even think of these kind of petty stuff which excite the people in a geeky way).

To conclude, given the installation media (yes, I also use the grand terms :), one should be able to boot it right up to install on a bare system or do a manual copy kind of install.

PS: A note on bootloaders. I had (intentionally) skipped the complexity of boot-loaders for 3 reasons:
* they are not part of OS
* even including them doesn’t complicate the process so much that installers can’t do it.
* the discussion could have diluted the essence of the original topic

Powered by ScribeFire.

Posted in mobile, openmoko, tech | Leave a comment

Freerunner software structure

For around 2 weeks now, I have not been using my Freerunner and its not because I have started to like my older phone over it, but because I tried zhone+FSO+Debian and now I literally can’t go to Om2008.9. FSO is not complete yet, which is why I really don’t want to use it right now.
Anyways that gives me some time to jot down the Freerunner’s s/w structure.

This para is dedicated to the way I moved with different s/w on my phone. You can skip this para completely.
Freerunner ships with Om2007.2 which, although stable, has a completely unusable UI. It was so unusable that I didn’t hold onto it for long. IIRC, it was 1.5 days that I had switched to Qtopia. Even qtopia didn’t impress me much and then along came ASU (Om2008.8) which held onto my phone the longest. I gave FSO a try at each of their milestone but it didn’t look nice enough to go along. But this time they got enlightenment in. That is when I was impressed enough to not to go back to ASU. This time I tried Debian and installed xfce which I couldn’t get to work and was hit upon by this post which explained how to get enlightenment on debian. That worked like a charm. So, come to think of it, I got a setup where I had the whole repo of Debian (which is powered by FSO) and then enlightenment was also in. Of course the things missing in FSO are still missing, I can’t really start using it. But to me the setup looks really promising.

Hmm…so there are lots of terminologies in the previous paragraph (in case you read it). Lets see what it all means.
To start with, Freerunner essentially runs on mainstream linux kernel and the filesystem is also similar to any regular linux desktop installation. Its not loaded with infinite modules as it really doesn’t have as much resource as usual desktops have.
Then there are device nodes which applications use to access things like modem or gsm antenna. And there is really no defined way of accessing these in a shared way. Or should I say there are multiple ways of doing it and thats where the diversity is.
Lets say that there are a bunch of of softwares which assist in this shared access and this bunch forms a software stack.
Then there is the usual linux window-manager/X concept which is responsible of managing multiple windows (showing title bar, z-ordering, alt+tabing, etc).
These 2 basically form the system and rest all is done by applications. All this, as a complete package make up a distribution.

Now, lets look at some distributions and how they manage these stuff.

Om2007.2: I didn’t really use it for long and hence I don’t know for sure. But it had got different daemons (like gpsd, gsmd, etc) that made up the stack. It had its own desktop app which showed basic button for launching other app, currently running apps, and dialer. It was largely based on X I don’t think it really had a window manager.
Qtopia: This distribution is managed by Qt and comes for lots of systems. Qtopia has a monolithic process (qpe) which handles the stack stuff. Qtopia doesn’t have a X server, it works directly on the framebuffer. Only QT based apps are allowed. The runtime takes care of handling the Qtopia canvas.
ASU (Om2008.8): This is the second distribution from Openmoko itself. Its stack was mainly based on Qtopia and hence had qpe handling all the stuff. What was interesting here was that OM had still gone ahead and used X server. They had a runtime library which exported calls similar to those needed by QT apps. But this library used X server under the hood. Hence, one could have gtk based apps as well. In fact any other app which worked based on X server for UI could be run and QT based app were additional profit. IT also had a window manager — enlightenment and an app illume which showed the current apps. There is actually lots with illume which was never given with OM but was essentially a part of the distribution. Search for ‘Raster keyboard’ for a heated discussion for the keyboard app.
BTW, with updates it has been be renamed to Om2008.9 and Om2008.11 is expected soon.
FSO: The big deal about it is the framework (software stack). The stack is based upon DBus and exports everything at hardware level as service to the apps. All the hardware mangement is done by the framework. For UI, X and illume/enlightenment take care of everything. There is a an app names Zhone (Zen phone) which allows dialling, messaging, contact, etc)
Debian: By default fso makes up the software stack and comes with matchbox installed as window manager. But enlightenment and illume can be easily configured. This makes it as good as FSO but there is a very big additional advantage and that is the availability of all the apps that can be installed on a desktop Debian installation.

This essentially wraps the current distribution on Freerunner. Hope it gives you a fair idea of whats going on in the Freerunner software world. I have left out the links in this post specifically because interested people should rather look at wiki.openmoko.org.

Powered by ScribeFire.

Posted in linux, mobile, open-source, openmoko, tech | 2 Comments

Prism – An interesting firefox extension

I think this one would need a synopsis before the real story because some of you might just be interested in the functionality and not how it works.

So, Prism is a Firefox extension that allows you to make a web application (gmail, gdocs, etc) behave as a desktop app. Essentially it fakes a desktop application that can browse only what you configure it to do. The ‘faking’ app won’t have usual browser controls like back/forward button, address bar, etc….but then thats the idea right from the beginning to make an application and not ‘yet-another-browser-instance’. It would also install shorcuts to invoke ‘the faking app’, so that you can feel right-at-home with our start menu full of your ‘desktop’-apps. BTW, behind the scenes there would actually be an (another–not the one you are using for browsing) instance of firefox which would be running. Although, this instance is just firefox due to its name, it doesn’t share your user profile and hence the cookies, bookmarks, extensions etc are also not shared.

If you are the not-interested-to-know-details type you can essentially stop here.

To give a grounds up, firefox binary knows how to browse and its UI layer is essentially handled by XULRunner. The whole of firefox UI are essentially a bunch of XUL scripts. BTW, there is a reason I said essentially. XULRunner is used by quite a few application — http://en.wikipedia.org/wiki/XULRunner#Uses, but firefox doesn’t use it the same way as all the others do. Firefox, has a copy of XULRunner engine and hence is usually not same as the-xulrunner. With Firefox 3 firefox.exe is now supporting any xulrunner app (configuration), and thats the power Prism is exploiting.

When we say that Prism is creating an app, it essentially writes a small configuration in user’s directory and the shorcuts to the app call firefox.exe with proper command line argument referencing the custom script.

I might have mis-quoted a few facts above and comments are welcome. BTW, further (more interesting) reading can be done here and here.

Powered by ScribeFire.

Posted in tech, tools | Leave a comment

India lands a rover on moon

Some 8 years ago, 14 November was just about getting sweets and a holiday. But from now on, thanks to ISRO, this day would also be marked as a major milestone in India’s tryst with Universe beyond Earth.

Although, our country is a little (some 45 years) late in such mission but we have done it. ISRO’s Chadrayaan 1 is the first of its series, carried more than a dozen sensors to observe the geology of Moon. The lunar orbitter dropped MIP on the lunar surface near Moon’s south pole (I wonder what does that mean…do north and south hold true wrt Earth’s north-south even in space??). The MIP was sort of crash landed (planned) on the surface with just a few rockets to reduce its velocity on its waydown.

MIP was painted with Indian tri-color and hence we have something on the Moon which brags for our nation. MIP is now planned to collect data with the dust it blew from its crash and then move on (??? does it have wheels) to search for other data.

This mission is planned to collect a lot of data, most of which I don’t know about. Its also planned to find a suitable place for landing the next rover – Chandrayaan-II planned for 2012 (hmm….4 yrs??)

BTW, on this ocassion Dr. Abdul Kalam said that he wants India to land a man on Moon in 15 years….reminds me of Kennedy‘s promise to US for landing man on moon in a decade. They did it, would we?

Powered by ScribeFire.

Posted in news, rambling | Leave a comment

Relationship and Girlfriends

Disclaimer: My deepest apologies to girls, but I am not trying to be sexist here. The main theme of the post should be equally valid, had the title been Relationship and Boyfriends.

For a fact, I have never been in a relationship ever in my life and I am sure that I have lived more than 25% of my life. The main reason might have been that I was in a catholic school and then joined an engineering college (where sex ratio is amazing).
Anyways, I never had regrets for that and I don’t think it would ever be. Although, I do regret some of the crushes (if thats what they be named) could not be reaped properly.

Of late I had seen that its been getting important for people to get a girlfriend. Its as if that you are big time loser if you can’t even get a girlfriend. Is human relationship getting translated into something to show off? Is it the next upcoming FAD?
I think we should still be able to live a mature and healthy life being single. I know (vicariously although) that relationship is golden and is amazing to be part of, but I still don’t buy the idea of synthetic gold.

The culture is being strengthened more by the pubs as more and more of them make couple entry compulsory. They might have their own business reason to do so (apparently groups of boys get drunk and tend to be more unmanageable as compared to a groups with girls as well). But is that idea not trying to bring somethings artificially into the society?

Anyways, I am not really an expert in sociology. These were just a couple of thoughts about a behavior which I found rather anomalous.

PS: To those who might try to relate. I was thinking to write it down for quite some time. It just so happens that I have done it now!

Powered by ScribeFire.

Posted in blog, rambling | 2 Comments

Finally got over with -Samsung C110- Sony Ericsson w830

Prelude: This post was started a year and a half ago when I was shedding off my SamsungC110 but could never be completed. I am revisiting it again now that I have moved on from my Sony Ericsson as well.
But just to keep the sanctity of my previous post, I would keep a chronological order and divide the post in 2 parts.

Part 1:

Reluctantly and with a blessing of a minor accident, I had to let go my Samsung C100. I had been using this phone for some 2-3 years and had grown an impression that this phone was all I need. After all this phone allowed me to make phone calls, send/receive sms, had phonebook features, a 16bit color display with 128×128 reso, gprs capability, IR port, basic java support. It could show me basic wap based websites and I thought internet on phone is unnecessary anyways.

But then I got my hands on my new phone Sony Ericsson w830i. This phone has all the feature of my previous phone except IR which was substituted by a better way–bluetooth. It flaunts of 262,144 colors with 240x320reso, awesome speaker set (well known for the w-series), first time slider from Sony (and hence the bulk as compared their later releases of the same), FM, 2MP camera with video recording, better java support.
This phone shattered my closed perspective of device convergence. I now just keep on listening to songs that I have loaded onto it (I am not too fond of FM)…I prefer this over television. With better java support I got Opera mini and an unlimited data plan for my connection…to get internet on my fingertips at all times.

Although, I am still of the opinion that sometimes manufacturers try to push too many unrelated things onto phone, but if we apply our needs and available models, we can definitely get something which is not just phone but a device worth carrying at all times as well.

Part 2:

I am still fond of my Sony Ericsson, but a couple of months back I got to know about Openmoko Freerunner. This phone would lose hands down in terms of stability and usability to any phone currently on the market. But what is awesome about this phone is its hardware.
To tell in few lines this is computer powered with AMDv4 processor @400MHz, 128 MB RAM, 256 MB Flash based non-volatile storage. Along with all this it has got, 640×480 touchscreen, 2 push buttons, a pair of 3D accelerometers, GPS (AGPS) chip, Wifi, bluetooth, minimalistic 3D acceleration card, SDHC enabled µSD card slot, and of course a GSM modem with GPRS (no EDGE or 3G). (btw, you might have noticed the absence of camera and FM….but I guess I can live without it).

Thats not all, its just not that it has got all this harware. The best part about all this is that the whole design/schematics of the phone are open. The CAD files are available freely and anyone can (and is invited to) change the model and create a phone of their own. I think Koolu is working on the same model.
Moreover, all the chips except glamo (graphics card) and ti’s gsm modem have completely open specification.  Glamo seems like a closed case and that they might not open their chip ever. Although, it seems that they are ready to share their doc under NDA and those NDA’ed guys can publish the doc under their name (Glamo won’t take any responsibility for the doc). With TI, they won’t open the chip’s spec but we do have it respond to standard AT commands and that should be nice. Moreover, TI has agreed to allow the end-user to flash the modem’s firmware to fix the issues.
Whoa, did you really read the last sentence. Did you notice that I just said ‘end-user’ can ‘flash’ ‘modem firmware’. Yeah, I know some of you would say that this should just not be necessary and I am sure it won’t be for later releases. But the main point is the end-user (I) CAN flash modem’s firmware.
To sum up the hardware, I guess we can see the analogy with opensource software working with propritary drivers. In fact freerunner is really about bringing open-source to hardware (Is it the first to do so??? I don’t know).

That was about the hardware, but it just doesn’t end there. The software feel is also cool. Do you remember that I said Freerunner is a computer. Well it is so, and like any other computer I can install other OS (apart from the ones that it shipped with or the ones provided by OEM), I can make it dual-boot. The OS that currently runs on it is of course Linux (current version is 2.6.24…so you see its the real mainline version). There are multiple distributions/sw-stack available and I can choose to get anyone. Did you see one of them is Android. Yes, I can be using Android without shelling $ for T-Mobile connection (that too if I was in US….for me, Freerunner is the only option).

Now, let me come back to the losing-hands-down-on-stability-and-usability part. The hardware for this phone is wonderful. But the software is still heavily under development. The development is so much in progress that sometimes the stable marked images (flashable OS) fail to register to the network. But the developers are not to be blamed for everything there. It rather an outcome of closely developed implementations of the GSM standard by the network providers. The software work fine where the developers are, but it fails to the job everywhere.
Nevertheless, since its all software that causes the stress mostly, it can be easily fixed. I am really optimistic of getting a neighbour’s-envy-owner’s-pride class image soon. In fact Openmoko recent initiative (FSO) have just released their 4th milestone and the community discussion suggest that its really promising. I would spend this weekend on it and see if it really holds for true.

To end up, I guess Freerunner is not really a product that can go on the shelf of a shop so as to be used out-of-the-box. But Openmoko has really convered a lot given its just their second released model.

Powered by ScribeFire.

Posted in linux, mobile, open-source, openmoko, rambling, tech | 1 Comment

Autofs

Have you ever wondered how inconvenient it is to use smb (windows) shares in a linux box. Yeah, I know all contemporary versions are loaded with cifs and all you need is some entries in fstab and you feel the windows share as part of your file-system.

But how can one have entries to all the shares in fstab cuz obviously you can’t know all the smb shares you may access beforehand.

Moreover, there is one more problem with this mount and use workflow. You either mount everything at boottime or you have root access when you need to access the mount.

Autofs comes to rescue for exactly these scenarios. The direct outcome of autofs is to mount when required i.e. as soon as someone accesses an autofs’ed folder, it mounts the pre-configured device. There are configuration about timeout etc when autofs would unmount in case of non-use.

So, autofs has a configuration file which tells is what is to mounted where. But, that is basically the same as lazy-loaded fstab. What about the first problem that we have. Autofs has a very clean solution for this as well. If the configuration file is an executable, autofs would execute it and treat its output as its configuration file.

This link: http://www.greenfly.org/tips/autofs.html details how can you setup your windows server access in a general way.

Moreover, by the end you would realise that this is not restricted to smb, you can basically do a similar stuff to any remote share which can be mounted.

BTW, I used the script given in the site and modified it a bit to suit my purposes. The modified version of the script is:

#!/bin/bash# This file must be executable to work! chmod 755!

mode=”ro”

key=`expr match “$1″ ‘\([^:]*\)’`
argMode=`expr match “$1″ ‘.*:\([^:]*\)’`

[ -z $argMode ] || mode=”$argMode”

opts=”-fstype=cifs,credentials=/etc/smb.auth,$mode”

for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done

[ -x $SMBCLIENT ] || exit 1

$SMBCLIENT -A /etc/smb.auth -gNL $key 2>/dev/null| awk -v key=”$key” -v opts=”$opts” -F’|’ — ‘
BEGIN { ORS=””; first=1 }
/Disk/ {
if (first)
print opts; first=0
dir = $2
loc = $2
# Enclose mount dir and location in quotes
# Double quote “$” in location as it is special
gsub(/\$$/, “\\$”, loc);
print ” \\\n\t \”/” dir “\””, “\”://” key “/” loc “\””
}
END { if (!first) print “\n”; else exit 1 }

This script when saved to handle your smb would receive $1as the the name of the server. The script would be default declare everything to be mounted read-only. Although, you can prefix the server name with “:rw” to have a read-write mount.

BTW, the motivation to do this was this (http://amarok.kde.org/wiki/Samba) problem with amarok and smb.

Posted in linux, tech | 7 Comments

Blogging with photos

Hmm…the title is basically a misnomer. This post is not about putting one pic in the post. I imagine the whole gallery should be available in the post. Frankly, even I am not sure how the output would be looking in the end.

BTW, the tool that I would be exploiting to do this is SimpleViewer. Its a flash based viewer which keeps info about the pictures in xml files. It also maintains thumbnail version of the pics. The output is (should be…I am yet to see it running) pretty professional. Check out some screenshots here. Live demo can be seen here, here and here.

Actually I had hit upon this software about a year back as well. But as I had mentioned SimpleViewer requires a couple of xml files which are usuallly generated by other softwares. There are loads of them. You can find links to a few of here. I wasn’t interested at all in the desktop solutions at that time. This time around I found WP-SimpleViewer plugin for WordPress. That is when I figured that SimpleViewer needs a shot this time.

OK enough of talk. Lets see how my sample gallery ‘ding’ looks with SimpleViewer:
svgallery=ding

Posted in blog, tools | 2 Comments

No CD Linux installation

As promised in the last post, this post is just to describe my experience with the no CD install for openSUSE 10.3.

The reference that I used was from suse wiki and can be found here. Although, there exist yet another page which is general for any distro.

The suse wiki link was fairly accurate except that I had some hard time to figure out the real-no-CD-but-USB-disk way.

To iterate the steps I had followed:

  1. Download miniboot.iso from suse’s official site or some of it mirror. For openSUSE, I downloaded it from here. Just choose Network install as the Installation medium and then click on Mini CD.
  2. Note down the installation repository in the download page vis-a-vis this and this.
  3. Download the latest version of syslinux from kernel.org.
  4. Then follow the steps detailed in ‘Install without CD/DVD……’ section of the suse wiki link. I shall copy them verbatim here as well just for reference. I won’t be updating them according to my experience (E: means the USB drive…translate according to your env):
    1. Extract miniboot.iso to E: with WinRar such that E:\boot exists
    2. Move E:\boot\x86_64\loader\* to E:\ (The directory x86_64 might be something like i586)
    3. Delete E:\isolinux.bin
    4. Rename E:\isolinux.cfg to E:\syslinux.cfg
    5. Extract syslinux-
    6. CD to c:\syslinux\syslinux
    7. Run syslinux E:(What had worked for me was syslinux -m -e E:).
  5. Boot from the USB stick.
  6. I don’t remember the initial instructions on booting up but they were pretty easy to follow.
  7. The only special thing that you need to do is select Network as the installation media and configure the above-noted repositories. The repository type is HTTP. You would need to type in the IP address of the server and the remaining part of the URL (from ‘/distribution’ to the last ‘/’) as directory.
    • To find the IP just switch to another terminal (press Alt+F2), you should have a shell. Type in ping download.opensuse.org. Find the IP in ‘[]‘. Get back to install screen by Alt+F1.
    • You might have to configure the network manually if DHCP is not configured properly on your network.
  8. From then on the installation is like the normal installation, just a little more time consuming as all the packages were travelling over the wire.
  9. Be sure to not to include your USB disk in the partitioning info. For me it confused the GRUB and I had to manually edit grub’s config to boot up the system.

Hope that would be helpful and spreads the word.

Posted in tech | 1 Comment