Tuesday, November 29, 2011

RubyCLI: A Ruby Command Line Application Module

Download ruby_cli, a Ruby gem I wrote to help create Ruby command line interface programs.

Here is an example program which uses ruby_cli.

 require 'rubygems'  
 require 'ruby_cli'  
 class App  
  include RubyCLI  
  def command  
   puts "Hello World"  
 app = App.new(ARGV, __FILE__)  

Running the program:

Running the program with the help option.

Wednesday, March 2, 2011

Connect to MySQL via SSH Tunnel

I have set up a MySQL server and want to connect to it from different machines.  However, I do not want to open it up to the public.  To secure my connection, I will not allow external connections to the MySQL server.  I will simply set up a SSH tunnel and connect to it that way.  My local MySQL commands are forwarded to the remote host.


  1. You can SSH into the remote host.
  2. If you are like me, you are not running a MySQL on your local host.

Setting up the SSH tunnel:
  1. ssh -f -L 3306:localhost:3306 user@host -N
  2. Enter password:
Connect to MySQL
  1. mysql -h -u user -p
  2. Enter password:
You should be see the MySQL prompt.

Tuesday, January 25, 2011

Samsung Gravity T USB Connection on Mac

To connect your Samsung Gravity T to your Macbook go to
Menu > Settings > Phone Settings > PC Connection > Mass Storage
The USB cable must be unplugged and the phone must be on the idle/home screen.