Moving to Ruby 1.9

I’ve been using the Ruby 1.8.6 on my CentOS box and Ruby 1.8.7 on my Ubuntu and OS X computers, for a couple of years now; I’ve never payed much attention on continuing to hack Ruby code using these versions of Ruby. However, in reading DHH’s tweet stating that Ruby 1.8X series is now considered […]

Ruby cli_mailer

After much nights of Ruby programming and many revisions, I finally manage to have an beta release of Ruby cli_mailer. I originally planned on writing a full mail (Unix command line email client) like program in Ruby. Though I was able to have an almost identical console interface to mail’s reading, viewing, and deleting emails, […]

Phusion Passenger = good stuff

While mod_ruby is perfect to serve dynamic Ruby web pages, the project looks like its long dead; given that it hasn’t been updated for over 4 years now. Now the de facto way to deploy Ruby on Rails applications is Phusion Passenger. Compared to mod_ruby, configuring the Phusion Passenger (mod_rails) Apache module is ridiculously easy […]

RDoc: Documenting Ruby scripts

RDoc makes documenting Ruby scripts be really simple. RDoc is fairly simple to use, as it has a straight forward SimpleMarkup syntax which the RDoc utility uses to traverse the entire Ruby script and automatically generate pretty html documentation pages. Now I have documentation for the dead simple Ruby script that I wrote to encode […]

What’s in my bookshelf?

I finally finished reading my first book on Ruby programming. Ruby: Visual QuickStart Guide, by Larry Ullman has to be the perfect introduction book for anyone trying to learn the Ruby programming language, even though sadly it only has 3 five star reviews on Amazon. The author writing thoroughly explains the concepts in a friendly […]

Re-enabling mod_ruby on perlninja.pl

I finally managed to re-enable mod_ruby on my server once again. This time around, I had a hard time enabling eRuby to work in Apache. New Apache configuration file: AddType text/html .rhtml LoadModule ruby_module modules/mod_ruby.so #<IfModule mod_ruby.c> RubyRequire apache/ruby-run RubyRequire apache/eruby-run <Files *.rb> Options +ExecCGI SetHandler ruby-object RubyHandler Apache::RubyRun.instance </Files> <Files *.rhtml> SetHandler ruby-object RubyHandler […]

Speed up shell scripting

Once again the book Practical Ruby for System Administration by Ben Hamou taught me some pretty clever Ruby sysadmin scripting tricks. One of the scripts that the author used was to automatically populate the path to the Ruby interpreter, update the permissions to 755, and open the script in vi, all during the same process. […]

watch command line utility for alternative for Mac OS X

I recently purchased the book Practical Ruby for System Administration by Ben Hamou and one of the cool Ruby one-liner command line expressions is one that mimics the watch command. ruby -e ‘system “clear; df -h” while sleep 1′ Just like the author, for quite a while I’ve been kind of annoyed by the fact […]

Automating re-encoding for my iPhone

I wrote a short ruby script to fully automate video re-encoding for my iPhone. Given that my media collection is about 35 GBs and that HandBreak is multi-threaded, I’m looking forward on how long the entire process will be if I decided to re-encode all of it at once. The script should work on ruby […]

mod_ruby and eRuby

I finally had some time to install mod_ruby and eRuby on my server. Prerequisites: httpd-devel ruby ruby-devel eruby yum install httpd-devel ruby ruby-devel eruby Installing mod_ruby was pretty confusing, as module default compilation is intended for Apache 1.3 (not why this is the case) If you’re running Apache 2.0 or higher, I managed to successfully […]