Ruby provides an ‘etc’ class designed to interface with /etc directory on Unix like systems. This can provide more information than traditional $user or $home variable calls. >> require ‘etc’ >> Etc.sysconfdir() => "/Users/username/.rbenv/versions/2.0.0-p247/etc" or login = Etc.getlogin info = Etc.getpwnam(login) => #<struct Struct::Passwd name="username", passwd="********", uid=501, gid=20, gecos="BrettU", dir="/Users/username", shell="/bin/zsh", change=0, uclass="", expire=0> Boom, a ton of system user info without leaving your Ruby app. :)

Ruby scripts can become expensive quickly and this handy method can let you know if something is getting out of control. This script will read out of the %cpu on a OSX system. def cpu_usage cpu = `ps -o %cpu #{$$}` cpu.strip.gsub(/\n/, ":") end   p cpu_usage #=> "%CPU: 0.0"   (0..25000).each do |int| p cpu_usage end   #=> %CPU: 34.7" #=> %CPU: 35.1" #=> … There are many other ps commands you could place here that should help to gain an understanding of how the system is reacting to you code. :)

Similar to my tip #56 regarding environment variables. This method is becoming more popular for setting up application configurations for Ruby applications that depend on each other. 1) Create a ~/.client_name directory in your home directory. You can name it anything you want. I will choose .balboa_park/ for my example. Then create a globals.yml in this directory.   ➜ .balboa_park pwd /Users/username/.balboa_park ➜ .balboa_park ls total 0 drwxr-xr-x 3 bweikulrich staff 102B May 1 09:29 . drwxr-xr-x+ 114 bweikulrich staff 3.8K May 1 09:29 .. -rw-r–r– 1 bweikulrich staff 0B May 1 09:28 globals.yml 2) Now fill the YAML file with application names, ports and domain endpoints. My configuration is for managing a series of applications around a popular zoo[…]