Life

Police report against Al-Islam

Sigh. Never thought I’d bog about this.

Can’t people just live together?

Henotheism (Greek εἷς θεός heis theos “one god”) is a term coined by Max Müller, to mean worshiping a single god while accepting the existence or possible existence of other deities.

Fully explained here, in the one & only Wikipedia. :)

The Obama-natar

Yes, apparently being the president of one of the most powerful countries in the world requires leet fly swatting relfexes that may put Mr. Miyagi to shame. Check it out :)

The Obama-nator

F*** my life via bash the pythonic way

Being a little bored today, I decided to surf around. Thanks to my friend Thaweesak, I got this site called F*** My Life.

A few hilarious stories and minutes later, I realised they had a web api. Thats when I got an epiphany!!! Why not get a random story from here to cheer me up on demand? And for a linux junkie, what better way than through a terminal?

Since I have been experimenting with python for awhile, what better way to practice a new language than something fun?

Here’s my script:-

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
# Ugly script to get a random quote from www.fmylife.com
# Yeah, so ugly I dont even bother catching exceptions
#
# Meant to run on python 2.5++ as I'm using the inbuilt ElementTree package
#
 
import urllib
import xml.etree.ElementTree as ET
import cStringIO
 
FML_SITE_RANDOM = 'http://api.betacie.com/view/random'
paramsDict = { 'language':'en', 'key':'readonly'}
encodedParams = urllib.urlencode(paramsDict)
 
try:
	fmldata = urllib.urlopen(FML_SITE_RANDOM, encodedParams).read()
	fmldata = ET.XML(fmldata)
	author = fmldata.findtext('items/item/author').strip()
	if len(author) == 0:
		author = 'anonymous'
 
	peopleAgreed = fmldata.findtext('items/item/agree').strip()
	peopleDisagreed = fmldata.findtext('items/item/deserved').strip()
	story = fmldata.findtext('items/item/text').strip()
 
	print "Think your life sucks?\n"
	print 'This happened to ' + author + '.'
	print ''
	print story + '\n'
	print peopleAgreed + ' reader(s) agreed'
	print peopleDisagreed + ' reader(s) have seen worse. '
	print
	print 'F*** My Life'
	print 'http://www.fmylife.com'
 
 
except:
	msg = '''Whoops!!! Some error, probably your connection. I guess
	your life sucks after all.... :('''
	print msg

Just chmod 755 it and place it in your ~/bin directory. Then just type in fml in your terminal for some random F*** ups.

Assuming you have Fedora 10 or Python 2.5++ installed, it should work perfectly.

Here’s a shot of it running:-

My F*** My Life script in action.

My F*** My Life script in action.

Sources I used to create this program:-

The wonders of Open Source Technology. w00t!!! :)

Create Multiple Firefox Profiles For Different Uses

Ever had a problem where your Firefox crashes during development because you were browsing multiple tabs in another window?

Or using the latest Firefox beta always messed up your current extensions / settings?

Use Profile Manager.

This keeps separate instances of firefox running, so one crash won’t affect the other windows.

To access the Profile Manager, first open Firefox as usual, then from the your os command prompt, launch the profile manager by typing the following command:-

firefox -profilemanager -no-remote

My FireFox Profile Manager

As you can see, I have created 3 profiles here, my default profile, a Development profile as well as another beta profile for me to test the latest firefox beta, Minefield (www.mozilla.org/projects/minefield/). I set the default profile as my default (duh!), for normal web browsing.

The ‘-no-remote’ option allows you to start a new Firefox process that is invisible to the first process.

The ‘-P’ option allows you to specify which profile to start. Look at your profile manager for the names in case you forgot ;)

I then created some scripts in my ~/bin directory to launch the Development & Beta profiles seperately.

Here’s a sample script, note that I piped all of ‘em ugly error messages to /dev/null and made sure the process ran in the background. This frees up your terminal for more important things.

1
2
3
#!/bin/bash
echo "Starting devfox ;)"
/usr/bin/firefox -P "Development" -no-remote > /dev/null 2>&1 &

Another tip, getting confused with which profile(s) you have open? Use Themes to differentiate them ;)

For more information, read on the following links:-

Opening Firefox With Another Profile
Firefox Profile Manager

Other uses for this include, your own ‘incognito’ mode for firefox, ala Chrome.

Hope you find this helpful ;)

Crime & Passion

Holy Cow!!! I just saw this on youtube. I had to post this, anyone who grew up as an 80’s SBC child will instantly recognize this. One of their locally produced cops & thieves dramas, with an uber-catchy theme song. The one posted on youtube is the mandarin (?) dub, but either way its definitely worth a listen.

Of Alco, Nicotine & Retarded Bets..

Finally back from my vacation. 6 days in Langkawi really was refreshing. Being a beach bum surrounded by tax free alco helps refresh the mind.

I discovered that Malibu tastes excellent when mixed with pineapple, which in turn made me do a few retarded bets. Alcohol and cameras don’t mix well either, as the latter captures incriminating evidence :P

The problem with long vacations is the natural reluctance to go back to work thats comes once you reach home. Then you just look at the bills piling up on your desk and realise someone’s got to pay them and drag yourself back (to work).

Will blog later on once my mind starts working. Till then, goodbye.