Tuesday, February 17, 2009

My TODO list in SMS

Update: Twe2 is shutting down :-( so this will no longer work.

Great news,
There's a new website called Twe2 that lets you get Twitter notifications by SMS outside the US (their business model is to add a short ad message to the end of each SMS).

I've been using remember the milk for quite some time now but a lot of tasks were overdue, either because I'm too lazy or because the notifications by mail or even by the gadget I added to my Gmail account were not prominent enough.

So to try and eliminate at least one of the reasons for my tasks not getting done, I set up remember the milk to send my task notifications to twitter and then with the help of Twe2 I get reminded by SMS.

Still have to work on eliminating the other problem though :-)

Saturday, January 10, 2009

Cool applications I will probably never have time to write

Here is a list of ideas of web services that would be helpful but I would probably have no time to write. Maybe someone else would...
I'll add future ideas to this page. If you have some of your own, I'd be happy to add them. Even better if you know of a service like this that already exists let me know.

4. Software libraries release tracker (2009-01-10).
A web based tool where I can list all the third party libraries I use for my projects and can be notified (email / RSS) when a library I'm using released a new version. It would also be nice if I could upload a CSV file with my libraries and the current versions I'm using and get a report of what I need to upgrade.
Advanced feature: test libraries transitive dependencies and warn me about possible collisions. For instance, Hibernate is dependent on Log4J version x.y.1 and Spring is dependent on Log4J version x.y.2 - Since I use both Hibernate and Spring I want to be warned about possible incompatibilities I may encounter.
(note to implementer: maven has support for something like this so maybe use it as the core for this)

3. Contact name ring tone (2008-12-20).
When your friends call you they don't introduce themselves because they assume you have caller ID. Now, what if you use a bluetooth earphone? Your phone is sometimes tucked away in your bag (for instance when you drive). When people call and immediately start talking - it sometimes takes a while before you figure out who it is.
The solution is to have your phone figure out you're using an earphone and play the name of the caller instead of the regular ring tone. I guess it would do that by doing text-to-speech on the name in the phonebook entry.

2. An online log collector (2008-12-13).
The logs of your application are sent to this website (by HTTP, JMS, whatever) - You have a simple UI where you can view and query these logs.
What is it good for?
When you have a lot of servers you start finding all kind of weird ways or heavy weight solutions for collecting your logs - I'm looking for something simple.
Update: we created something like this for HiveSight: http://code.google.com/p/appenginelogger/

1. An online job scheduler (2008-12-13).
You have a form where you enter your job's schedule - it could be a simple input field where you enter a cron expression or if you want something more advanced look at the recurring meeting dialog of MS Outlook.
Then let me select from a dropdown list an action to execute (do an HTTP request, call a webservice, run a yahoo pipe, run a simple shell script, etc.).
These jobs will be run according to you schedule schedule.
What is it good for?
For various repetitive automation tasks, monitoring of web servers, anything you can do with crontab, you get the idea.

Wednesday, December 10, 2008

No such thing: "no vendor lock-in"

Every self-respecting framework or service always claim there is "no vendor lock-in" if you use their technology. I think there's no such thing.

What is a vendor lock-in? Can you measure that?
I think the best way to measure vendor lock-in is to estimate the amount of work it would take to switch from one vendor to its competitor or alternative.
For instance, switching from Tomcat to Jetty involves changing a few deployment descriptors. So vendor lock-in is not that big. What about the tweaking and tuning you did for your Tomcat, can you immediately do that for Jetty? I guess not. It will take some time before you fluently "speak" the Jetty language, so vendor lock-in is bigger. What about QA? your software was tested and working perfectly on Tomcat, how much time do you need to spend to make sure everything works on Jetty? So vendor lock-in is even bigger.

Another good example is the Spring framework or Hibernate. They both claim that your code is not dependent on their frameworks - it's true, you can write a Spring backed application with very little dependency on Spring in your code (unless you use annotations of course) but can you pull out Spring and replace it with something else? Can you replace Hibernate with another ORM solution that easily? No way - you're very strongly locked into Spring and Hibernate. In Spring they call it "dependency injection" - you can read it as "You don't have to write any code and we inject the dependency on the Spring framework automatically" :-)

No metter what frameworks you choose you're locked into it. So the only course of action is to make sure you choose the right ones that will not disappear any time soon.

Thursday, December 04, 2008

R&D Lab - You pay for your mistakes

I made a big mistake a few months ago. I bought a few servers for us to use in our office - you know, it's important to have a few machines at your disposal so you can run intensive tasks on them or run all kind of different tests you couldn't otherwise do on your single development machine.

Makes sense right? Well, not in term of ROI and here is why:

I bought a fairly good machine with 4GB of RAM and an AMD 6400+ X2 CPU - that cost me about $1000. Let's assume the machine is utilized for about 8 hours a day (in reality I guess most lab machines are used much less). Assuming 250 work days a year that's 2000 CPU hours a year. Let's say the life expectancy of this machine is 3 years so for 6000 hours I paid $1000. That's about $0.16 a machine hour.

Now let's compare this to a machine I can rent from Amazon EC2 (prices). Assuming Moore's law will hold true for the next three years (limits of Moore's law) today's EC2 large instance (m1.large) will be equivalent to two of the machines I bought for my office (I'm assuming that Amazon are nice enough to lower prices for a given hardware configuration as it becomes older). Add to my in-house investment the electricity / cooling / management (as in personnel) and it will make my (already) bad investment even worse. Oh, and for my in-house machine I had to put the money upfront and not "pay as I go".

Now what happens If I need more machines at one time (for isntance, to do some tests before a release) and none at another time (like every night). Having these machines hosted on EC2 gives me the flexibility to use as many machines as I need and then don't pay for the time they sit idle.

The bottom line - If you're a small startup - don't buy lab machine. If you're a big company you could probably save thousands of dollars every month by hosting your lab on EC2.

Monday, June 16, 2008

Twitter as a notifications hub

In HiveSight we're trying to keep eyes on our production environment as well as the status of services we need for development such as our continuous integration server and various other long running automation scripts we run on Amazon AWS.

We were looking for a way to easily see all the notifications as a single stream of data - so here is what we did:

First, we created a Twitter account where all the messages will go.
Then we made sure all notifications will be sent to the HiveSight Twitter account.
Now we can become followers of that account to receive updates.

Here are a few examples of what we used it for:

For continuous integration we're using Hudson - build results are sent to the twitter account using a plugin that was written by the Hudson community.

For production servers monitoring we're using nagios. Nagois is very easy to extend so we're using the twitter JSON API to update our account using the Linux curl command:
curl --basic --user "username:password" --data-ascii "status=Nagios: $NOTIFICATIONTYPE$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" http://twitter.com/statuses/update.json
We use the same method to send notifications from various EC2 automation scripts.

We also wrote a twitter-log4j extension that allows us to log errors from our applications directly to twitter. We open-sourced it so you can find it here

Now that we have all the messages in Twitter, we developed a very simple Ruby script that is executed every few minutes, checks if there are new messages that require immediate attention and sends and SMS if there are.

Sunday, December 09, 2007

Maven repository on S3

Spring are hosting their development sub-projects Maven repositories on S3.
This is a great idea if you are hosting a project that's likely to have downloads here and there and don't want to pay for what you don't use - which is what you'd be doing if you hosted it on a regular hosting plan.
(On a side note - if you're working on an open source project you may just as well host it on SourceForge or Google Code for free - even if your working on a commercial closed-source project there are free solutions - more on that in a future post)

The nice thing is that Maven has its own support for S3. Maven has a subproject that's responsible for the transport of artifacts called "Wagon". It allows maven to transparently work with repositories that reside on File, HTTP, FTP and other locations.
Wagon also has an extension that allows it to work with repositories on S3 - so it makes Spring's choice even better.

Browse Spring's Java Config project on S3:

Wagon-S3 artifact for Maven:

Sunday, December 02, 2007

Computer Randomly Plays Classical Music

Look at this: http://support.microsoft.com/default.aspx?scid=kb;en-us;261186
This is the funniest error (feature) I've ever seen. The programmer who did this is a genius :-)

(got this from Elad)