A Place for my head

On Ruby, Rails, Concurrency and fiction

Archive for December, 2007

Posted in : Uncategorized, ruby | 7 comments

Update: Mysql official bindings has been ported to 1.9, look into comments for details
For those who want to stay on the edge, here is modified set of mysql C bindings for Ruby 1.9. Works perfectly well in my small tests.

To compile it:

$ ruby2 extconf.rb
$ make
$ sudo make install

Mysql C bindings for Ruby 1.9

Although its been quite sometime since 1.0 release of BackgrounDRb has been out in the wild, yet a belated post mentioning its features is nonetheless welcome.

Although README document available at, http://backgroundrb.rubyforge.org is quite comprehensive and there is precious little I can add, yet I shall try.

  • BackgrounDRb is a Ruby job server and scheduler. Its main intent is to be
    used with Ruby on Rails applications for offloading long-running tasks. However unlike other libraries BackgrounDRb offers tight integration with Rails and hence you can check status of your workers, pass data to workers and get response back, register status of your workers, dynamically start or stop workers from rails and stuff like that.
  • BackgrounDRb doesn’t have any DRb in its skin now. Its based on networking library packet, (http://packet.googlecode.com)
  • Its stable.
  • It has support for thread_pools, storing of results in MemCache clusters
  • It comes with its own scheduler and hence you don’t need to muck around with crontab anymore

A Quick overview of installation:

  • Get the plugin using:
     piston import http://svn.devjavu.com/backgroundrb/trunk/ backgroundrb
  • Remove or backup older backgroundrb scripts/config files in your rails root directory
  • Run following command from root directory of your rails app:
     rake backgroundrb:setup
  • Have a look at generated config file, RAILS_ROOT/config/backgroundrb.yml and see if there is anything you would like to change.
  • Generate a new worker using :
     ./script/generate worker foo
  • Read the detail documentation about writing workers and stuff on http://backgroundrb.rubyforge.org
  • Start your BackgrounDRb server with:
    ./script/backgroundrb start
  • Stop your BackgrounDRb server with:
    ./script/backgroundrb stop
Posted in : pim, ruby | 7 comments

Updates
Getting gtk-ruby installed is a bit tricky, look into the comments for getting it installed. Also, you don’t necessarily need Emacs to use this application.

Another important thing is, it stores your todos and metadata files in a directory called, ~/snippets, so make sure you have that directory. Although newer version of app, automatically checks for the directory. I put up lots of bug fixes, and a tab for viewing completed tasks too, So make sure you are using latest version. Thanks.

Version 1.0.2 of Swat App

Install it with:

sudo gem install swat-1.0.2.gem

Hey there,

Curse me for making this app if you will. But the truth is all the todo applications in GNU/Linux suck, then I thought ok, may be they do not suck enough. So, with some ruby skills at my disposal, I wrote a todo application in Gtk Ruby.

swat App Small

So whats swat?

Swat is a todo list manager for Gnome & Emacs.

Heck : Emacs?

Features:

  • Manage your todos, add them according to priority and category.
  • Move your todos to wish list, when not feeling like working on them.
  • libtomboy bindings for global shortcut(Alt-F11).
  • Nice stats for number of tasks finished and added.
  • All your todos are in a .org file and hence can be managed from Emacs as well.
  • System tray integration.

KeyBindings:

  • Alt-F11 : from anywhere, brings the todo window to front.
  • Esc : to dismiss todo window.
  • Control-N : to add a todo.

Installation :

  • sudo gem install swat

Code:

  • http://packet.googlecode.com/svn/branches/swat/