My thoughts on DevOPS on the REA Engineering Blog.


It should not be marketed as position to slot one person in, or even rotate people through. A software developer who writes the code should be as concerned about his/her code working in production as he/she is in development. Definitely operations are more experienced with deployment and maintenance of products in production like environments, but that does not mean a developer should not base his software decisions before being aware of implications of deploying it in production, or be unaware of the status of his code after it passes quality assurance. The thinking behind devops is the critical bit of software development.

15 hours. Thats how long it takes for a direct flight from Melbourne to Los Angeles. You can break it down to 8 movies full length, God knows how many glasses of orange juice and packets of peanuts. Add to that about 15 minutes of waiting in the plane after we landed as the customs hall was overflowing with people. Add to that a personal time of one hour trying to clear customs as this was my first time to the United States. This lengthy delay ensured that I missed my flight but managed to get a connecting one to San Francisco and finally arrived at my hotel at about 3:00pm PST. I had had lunch and therefore decided to take a walkabout downtown San Francisco and garner impressions.

It feels different. People open doors for others but no one says thanks. You achieve eye contact but no one smiles. There are lots of people and many of them are lying on the street. There are street evangelists yelling at about everyone loudly, people with signs saying “Need $1 for weed” and what not. Its very different.

It is expensive as well. The Australian dollar is definitely better at the moment but that does not help you escape the fact that things are definitely expensive here. This is based on the one subway and power socket converter I bought. Prices displayed also do not include the GST at times and you are definitely supposed to tip. It is the unwritten rule.

There is a shopping centre close by called “Westfield” and it reminds me of Highpoint. Replace Myers with Bloomingdales, DickSmith with Radio Shack etc and you get the idea. The accent is not that pronounced but then I have not really stuck up conversation with anybody yet, except the people at the hotel while checking in. Who knows, maybe I might strike one up tomorrow at the first day of the conference.

The US Flags on near the hotel.

Went back to my hotel, and I slept, and slept, and slept. Woke up then in the middle of the night, had a cup of coffee and spent about 6 hours browsing the internet on free wifi. At about noon, headed to the conference centre to register in and currently am sitting there using the free attendee wifi provided by Google to do some Android coding on Blamer

To quote Lawrence of Arabia, “It is going to be fun”.

Long time ago, on reddit I had seen this search engine Duck Duck Go and I had thought, “Nice, but I will stick to Google”. Only today, did I ask myself, why! Why am I sticking to Google? What exactly is it about Google that is great! So, comparison time.

The first search I did was for the text “Once upon a midnight dreary”.

Google gives me:

DDG replies with:

Wikipedia features high on google’s list whereas DDG gives preference to the actual words of the search query. To me, this implies that Google probably have more sophisticated contextual search algorithms. The wikipedia page is bound to have links to both the text of the full poem, whereas the links offered by DDG are more related to the text itself. Still, I had wanted the poem itself, not the history! But thats just me.

Second Query is developer concerned and considering my recent work involving iOS, it was for “UIKit”.

Google gives me:

DDG counters with:

Google gives me cocoadev, apple and sourceforge. The most popular, then the official one and then someone from where I can get examples. DDG gives me the holy grail of open source software, github and then cocoadev and other links. Apple’s Developer Site does not even feature in the top three. And frankly, since the whole code documentation is embedded into XCode, I could not care less.

Last, I ask for one of my favourite books, “Bal-E-Jibreel”.

Google finds:

DDG finds:

This was the clincher. Google gave me Wikipedia again and some link to the same text. Look at what DDG gave me! *insert huge smile*.
They gave me links to the wikipedia page for the book, the author and found out some other books by the same author, and unlike Google, did not give me one link which had it all, but categorised the links and presented them to me. And thats what I wanted.

DDG, however, still feels a little bit sluggish compared to Google and the fact that it automagically searches into youtube and other such sites. It does self computation whereas DDG bases itself on wolfram (which might not be a bad thing. Why do something that someone else already does very well!).

I have however decided, in the interests of competition, to use DuckDuckGo from now on. Lets see how this rides goes, and how long it lasts.

Taken from here.

I have been reading every news release on the incident since the earthquake. There has not been one single (!) report that was accurate and free of errors (and part of that problem is also a weakness in the Japanese crisis communication). By “not free of errors” I do not refer to tendentious anti-nuclear journalism – that is quite normal these days. By “not free of errors” I mean blatant errors regarding physics and natural law, as well as gross misinterpretation of facts, due to an obvious lack of fundamental and basic understanding of the way nuclear reactors are build and operated. I have read a 3 page report on CNN where every single paragraph contained an error.

I just realised that simply using Prey would probably put you within some walkable distance of your stolen/lost laptop, but if the place was say a shopping centre, then you would be screwed. Then I remembered this xkcd comic, and decided to do something similar.

SSH into the system using the IP address generated by Prey. Raise the volume to maximum.

[damascus:~] sudo osascript -e “set Volume 10”

And then play some music file.

[damascus:~] afplay ~/Desktop/Symphony_IX_IV.mp3

Hopefully, the music should be loud enough for you to locate the laptop, even if through people’s reaction to a sudden loud orchestra amongst them.

But if you are not satisfied with this, then just use the say to speech synthesise words from the command line after you have raised the volume.

[damascus:~] say “This laptop is stolen! Help! Call the Cops!”

Sometime ago, a friend of mine lost his laptop in a taxi and never saw it again. And today, Humpy showed me this video, and I decided time had come to do something about my laptop and my iPhone.

The iPhone was easy, ever since tracking your iPhone came free with the iOS 4.2 through the Mobile Me subscription. I set up a Mobile Me account on my iPhone, and then simply went to MobileMe and then checked the map for my phone.

I highly approve of the fact that I can send a message, lock and even wipe my phone in case its stolen or lost, but one thing I would have loved, would have been to get a picture of the person holding it. But this is a good start. Onto securing my laptop. I initially thought a daemon running in the background would be enough. And I even wrote a small one :


output=`${PING} -t1`

connected=`echo $output | grep ‘unable’`

if [ “x$connected” = “x” ]; then
ip=`${CURL} -s | sed ‘s/[a-zA-Z/<> :]//g’`
echo “Your IP = $ip” | mail -s “IP on $curr_date” $email_address

And then I realised I am probably not the first person to have thought of securing my laptop and a quick google search proved that. A post on teknobites caught my attention and I was directed onto Prey. Installation was easy and setting up the daemon happened quickly. I went to the panel, logged in and marked my laptop as missing, set report duration and waited patiently.

Lo and Behold 🙂 there was my laptop.

And what the scallywag was doing, and what he was logged in as :

And the best thing, it even takes the picture of the scallywag. 🙂

Me likey!

Hats off to guys at Prey.

Flattening an array is a standard question in interviews, especially for modern languages like python and ruby. I just thought trying to flatten a hash would be much more interesting.

Here is my attempt at converting something like

{“a”=>1, “b”=>{“c”=>3}, “b2″=>{“c2″=>{“d2″=>2, “d3″=>8, “b2″=>9}}}


{“a”=>1, [“b2”, “c2”]=>9, [“b2”, “c2”, “d2”]=>2, [“b2”, “c2”, “d3”]=>8, [“b”, “c”]=>3}

require 'enumerator'
class Hash
 def flat_each(prefix=[], &block)
      each do |key, value|
           if value.is_a?(Hash)
                 value.flat_each(prefix + [key], &block)
                 yield prefix + [key], value

main_hash =
given = {"a"  => 1,"b"  => { "c" => 3 },"b2" => {"c2" => {"d2" => 2,"d3"  => 8,"b2"  => 9}}}
given.to_enum(:flat_each).collect { |k,v| main_hash.merge!({ (k.size == 1) ?  k.first : k.uniq  => v}) }
puts main_hash

Algorithm adapted from Ruby Forum.
Not sure this is what you would call flattening a hash, but this is the best I could rustle up in half an hour.