February 24, 2011

Git, Unfuddle and How to Use Multiple Key Files with SSH

Filed under: Uncategorized — Tags: , — yasi8h @ 1:16 pm

<rant> Unfuddle is a grate application. I use it daily. But one thing i really hate about it is that it requires you to use unique public keys. So you can’t use the same public key in two user accounts. Its all OK until you get work in a client’s unfuddle project. Where you will have a different account on the client’s unfuddle app. Boom! now you got to use another different key file just to work with any repo hosted in the client’s unfuddle app. This sucks big time. But the solution is not that complicated. </rant>

To use multiple key files with SSH (Git uses ssh internally),

  • Login to the machine/server from where you want to use git/ssh
  • Generate a key file (if you don’t already have one generated. But keep in mind you need a key file per account with unfuddle).
    • ssh-keygen
    • enter a name for the key
    • remember the name you entered!
  • Edit the ssh client config file
    • nano ~/.ssh/config
    • enter in the following lines (without the bullets of course!)
      • Host
      • IdentityFile=/path/to/your/key/file
    • The key file you specify in the Identity File directive is the private key (ie: not the key file with .pub extension).
  • Enter you public key to unfuddle
    • you can add your key in “Personal Settings”
    • your public key is the key that has a “pub” extension

Hope this helps. Even if no one else benifit from this i know i will someday 😀


February 23, 2011

Custom Server Density Plugin to Watch Processes on a *nix Server

Filed under: Uncategorized — Tags: , — yasi8h @ 3:42 am

Wrote this down recently to keep a watch on some processors. You can look at a list of running processes in SD without the need for any additional pulgins. However if you need to be alerted when a process goes down you would need to (as David has pointed out in the comments section, you don’t need a custom plugin to do this. However i am keeping this post here… as a sample of a plugin or just because i wrote it :D) write something custom. This plugin will be sending a value of 80 or 0 for a given process. 80 indicates that its running while 0 indicates that its not running.


import sys
import os
import subprocess
import re

class ProcessWatch:
  def __init__(self, agentConfig, checksLogger, rawConfig):
    self.agentConfig = agentConfig
    self.checksLogger = checksLogger
    self.rawConfig = rawConfig

  def run(self):
    data = {}
    for p in ["delayed_job", "thin"]: # put whatever process names you wish to monitor here
      if self.isThisRunning(p) == False:
        data[p] = 0 # not running
        data[p] = 80 # running!

    return data

  def findThisProcess(self, process_name):
    ps = subprocess.Popen("ps -eaf | grep "+process_name+" | grep -v grep", shell=True, stdout=subprocess.PIPE)
    output =

    return output

  # This is the function you can use
  def isThisRunning(self, process_name):
    output = self.findThisProcess(process_name)

    if''+process_name, output) is None:
      return False
      return True

You can grab the plugin from github at

The return output looks like the following. So you can set this up to watch as many processes as you want. Internally it just executes a ps and grep the output. So just keep that it mind.

data = {‘delayed_job’: 80, ‘thin’: 80}

The above output is when the plugin is watching two processes (thin and delayed_job).

Customize the array in the 14th line of the plugin to include whatever processes you need to watch

["delayed_job", "thin"] # for watching delayed_job and thin

Just keep in mind that this is the first time i am writing something in Python :D. Hope this helps someone.

February 16, 2011

Google TV

Filed under: Uncategorized — Tags: , — yasi8h @ 1:42 pm








Google was so generous to send our company a free device. Its awsome!

February 14, 2011


Filed under: Uncategorized — Tags: — yasi8h @ 3:47 pm

This is a post that i wrote for my company blog. It was originally posted on Tropical Software Observation Blog on 04 Feb 2011.

Google is getting ready to launch Android 3.0, aka Honeycomb, the latest version of the Android OS that is aimed at tablets. It has a lot of new goodies that will radically change the way we will design and develop applications, especially user interfaces.

After going through some articles and documents that were sourced from the Internet, I am compiling this blog post as an overview of the main UI changes introduced in the 3.0 API. And to see how this might help application developers like you and me write applications that could potentially (nobody knows for sure whether honeycomb will run on smartphones or not. But it seems to support smaller screen sizes as well. I am been optimistic here! ) run on smart phone and tablet devices. Even if this is possible it might not be a reality in the near future. As google is yet to announce any smartphones with the new branch of the OS.

Ouch! it seems that is not going to be true anytime soon: Google Says Honeycomb Will Not Come To Smartphones.

Honeycomb is the first release of the 3.x branch. Right now, Google seems to be reserving the 3.x branch for tablets and the 2.x branch for smartphones. As for the 2.x branch, Android 2.4 (Ice Cream) will be the next release. Given that maintaining two platform-specific versions of the OS doesn’t seem like a long-term strategy, convergence will probably happen at some point in the future.


This seems to be one of the most exciting new features of Honeycomb. The API documentation defines a Fragment as “…a piece of an application’s user interface or behavior that can be placed in an Activity”. Fragments are basically small units or modules that can together make up an Activity. Perhaps the coolest thing is that you can change them dynamically at runtime!

Modularity is almost always good! (caveat: only if used with some common sense). You can create different layouts by mixing up Fragments. An Activity can be broken down into different regions and then designed separately. It also allows developers to create interfaces that let users choose among different layouts at runtime. Because Fragments can be added in or removed dynamically, this should be fairly easy to do.

Google has cited another use for Fragments: changing the layout of an application depending on the orientation of the screen. So you can create UIs that will make maximum use of screen space depending on the screen orientation. For example, if a given device has a lower resolution than a tablet, a developer can decide to use a Fragment (or a set of Fragments) that are designed to better fit a smaller screen size and resolution. Or, if the device that you are using has a larger, higher resolution screen, you can conditionally use a different set of Fragments or simply a different mix of Fragments to optimize the interface. I have not really tried using Fragments in a real world application, but I think they could be very helpful in making applications more adaptable to different device form factors and somewhat independent of hardware platforms. However, we should not expect this to be a perfect solution to make apps device and resolution independent, as it will involve many other considerations such as sizing and resolution of embedded image assets and other content types.

Back Stack

Fragments that are displayed one after another can be added to a stack by modifying the Fragment inside a transaction. This will help users go back to whatever Fragment they came from by using the standard back button. Such UI statefulness can greatly improve user experience.


One can argue that the space taken by the title bar is a waste on small handheld devices like tablets or smartphones. The action bar replaces the title bar and displays the title for a window while harbouring various other widgets, menus, and tool buttons.

Browsing through the API documentation for ActionBar, you can see some interesting classes and constants like ActionBar.Tab andNAVIGATION_MODE_LIST that suggest the ActionBar can be used for navigation and can contain embedded menus, buttons, and tabs. When used with methods such as setCustomView() to set a custom view to appear inside the ActionBar, this can be used to implement things like a search function for an eBook reader app.

A breakdown of some other highlights:

  • Multi-select, clipboard, and drag-and-drop
  • Richer notifications
  • Live HTTP streaming
  • New APIs for Bluetooth A2DP and HSP
  • Hardware accelerated rendering
    • New animation framework (new android.animation package)
    • Hardware-accelerated OpenGL renderer for 2D graphics
    • A new 3D rendering engine called Renderscript (new android.renderscript package)
  • Ability to leverage multi-core processors
  • DRM framework (new android.drm package)

Playing with the SDK
There is no substitute for playing with the SDK yourself. You can get it here.If you already have a previous version of an Android SDK installed, you can install Honeycomb via the Android SDK manager. Look for Android ‘Honeycomb’ Preview SDK along with the documentation bits. Have fun!


  • Android 3 Highlights – Google
  • First look: Honeycomb APIs power tablet-friendly Android apps –Ars Technica
  • Google posts Android 3.0 Honeycomb SDK preview – intomobile


Fixing: /irb/completion.rb:9:in `require’: no such file to load — readline (LoadError) on rvm

Filed under: Uncategorized — Tags: , , , , , — yasi8h @ 10:25 am

Got this error to in one of the staging servers:

$ rails c production

/home/jooolaesa/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/irb/completion.rb:9:in `require’: no such file to load — readline (LoadError)
from /home/jooolaesa/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/irb/completion.rb:9:in `’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands/console.rb:3:in `require’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands/console.rb:3:in `’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands.rb:20:in `require’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands.rb:20:in `’
from script/rails:6:in `require’
from script/rails:6:in `’

It will appear if your ruby installation is not compiled with readline library. The solution is to recompile it with readline. If you are using RVM to manage your ruby installations you would go about doing it like this.

rvm package install readline

rvm remove 1.9.2 # note that 1.9.2 must be replaced with whatever ruby installation that you are going to recompile with readline support

rvm install 1.9.2 –with-readline-dir=$rvm_path/usr

Thats it!


February 7, 2011

Find all (locally and remotely) available versions of a ruby gem

Filed under: Uncategorized — Tags: , — yasi8h @ 12:29 pm

This one took about 10 mins for me to find out. Shame oh shame…

If you are looking for all versions of rails thats been released and can be installed as a gem:

gem list rails -all -r

be warned that this will list all gems that have the word rails in it and all versions of them! just filter it out.

February 4, 2011

Hacking Beans

Filed under: Uncategorized — Tags: , — yasi8h @ 11:54 am









No i am a food blogger and no beans is not another framework iether 😉

Blog at