My VPS

I have a VPS for development/staging as well as small apps through PowerVPS. I have their minimal VPS plan for $24.95/mo that only comes with CentOS 4.4 and Webmin. It’s cheaper than anything else out there and offers more bandwidth. I also had rather pleasant experience with PowerVPS with my other VPS.

So, what did I do this weekend? I decided to completely reconfigure and install everything from the source code, making it distro-independent.

Here’s the spec:

1. Apache 2.2.4
2. Ruby 1.8.6
3. Rails 1.2.3
4. Latest gems

The way it is configured, it uses Apache’s mod_proxy_balancer and a mongrel cluster. I still can’t figure out Capistrano, and therefore I install Rails apps manually, but I’m getting help from my tutor today to resolve this issue. It’s hard when you’re as dumb as I am.

It took me a day to do this and I learned what’s really happening behind the scene. If you’d like to do this and want me to help, please contact me at joon at rubyhead dot com.

Populating Development DB With Fixtures

rake db:fixtures:load [FIXTURES=x,y,z]

It was even on my cheat sheets all along.

Ruby on Debian

I love Debian Linux. It’s the cleanest Linux distro and captures the essence of what Linux is all about. That’s why it hurts me when my favorite “apt-get install ruby” gives me version 1.8.5 when I develop using 1.8.6. On top of that, I get funky errors everywhere.

What’s my solution?

Compile everything from the source code and build my own, forget apt-get.

For some reason, Wordpress is crapping out on me when I post with codes, so I put it into a text file and here it is.

rubyondebian.txt

In a nutshell, Debian and distros derived from it has curses and readline issues. Before configuring, compiling, and installing Ruby, I’m installing readline, curses, and zlib from source code. This recipe works for me since my servers are installed this way.

Just drop me a line at *joon at rubyhead dot com* if you’re having any issues with installing the latest and the greatest on your Debian server. Please be warned that I reserve the right to publish your email on this blog if I use the material for blog postings or tutorials.

My Favorite TextMate Keyboard Shortcuts

I’ve seen so many people wondering how those in screencasts type so fast in TextMate. When I was attending the RailStudio, people were constantly asking Dave and Mike what the keyboard shortcuts were. I’m in the process of creating a cheatsheet and here’s a first list of TextMate shortcuts I use everyday.

method name => shift+enter // nicely puts def..end with arguments highlighted
ctrl+shift+. // <%= %> and you can even toggle with or without =
vp => tab // puts validates_presence_of
vu => tab // puts validates_uniqueness_of
bt => tab // puts belongs_to
rp => tab // puts render

This is it for now and I’ll post more in the future.

Congratulations Brian!

Brian Mariani of mirRoRplacement.com, the recruiter I blogged about before, just became a father again to a little boy.

Ruby on Rails Commercial

Funny stuff…

Learning to Migrate

I really didn’t value the database migration in Rails until I became enlightened in Rails Studio. I manually created the database and let Rails get the schema. This is the reason why you’ll see that my primary keys in databases are not named “id” but includes the table name.

The primary reason for not doing migration was I still am not willing to learn a new ways of doing things. I didn’t really trust this whole ORM thing and it made me nervous. I see the benefits now that I opened my eyes. When I create a model, I now do:

script/generate model some_table field1:string field2:integer
rake db:migrate

I still check the database to see if everything has been created out of habit, but I like the fact that I can now have a version control and truly use ORM.

Next Page »