Installing Rails on a fresh system

Setting up Rails on Ubuntu needs Ruby, Bundler, and the right development packages; repository RubyGems often causes problems, and project gems should be installed with bundle install.

CPU limit

cpulimit caps a process's CPU usage by percentage, making batch jobs less greedy and adapting quickly to system load.

Disable Dell U2410 beeping sound

Persistent monitor button beeps on the Dell U2410 can be turned off through the on-screen display, avoiding an annoying sound every time a control is pressed.

Fix slow specs using SOLR

Specs can stall for 30+ seconds when SOLR connections are left open and the pool is exhausted. Lowering the old-connection timeout reduces the delay.

Getting non-Aero toolbars for Thunderbird 5 on Windows 7

Thunderbird 5 on Windows 7 can use translucent Aero toolbars and menubars; a userChrome.css tweak restores solid backgrounds.

Traverse large XML files with Nokogiri

Large XML files can exhaust memory when parsed at once; Nokogiri’s XML::Reader streams nodes one at a time for lower-memory processing.

The challenging setup of an offshore project

Offshore agile projects demand more project-management discipline, risk handling, and trade-off decisions, while local client work relies more on relationships and expectation management.

Check whether an element is visible or hidden with Javascript

Visibility checks can differ between DOM APIs and libraries, causing elements to be misclassified as shown or hidden. jQuery, jQuery 3, and Prototype use different rules.

console-for opens a Rails console remotely on a Capistrano deployment target

console-for opens a remote Rails console on a Capistrano deployment target with one command, so staging and other environments can be accessed quickly.

Be careful when closing expanded stories in Pivotal Tracker

Closing an expanded Pivotal Tracker story with the top-left arrow saves changes and can overwrite edits made by others. Use Cancel, Esc, or hover preview to avoid accidental data loss.

Install the SQLite 3 gem for Ruby under Ubuntu

Install the SQLite driver for Ruby on Ubuntu when sqlite3-ruby cannot be used without the SQLite development libraries.

How to fix zero-byte downloads with Rails 3 and Apache / Passenger

Zero-byte downloads in Rails 3 behind Apache/Passenger often come from missing X-Sendfile support, leaving file responses empty.

Test that a string of text is (not) linked in Webrat or Capybara

Cucumber step definitions for asserting whether visible link text is present or absent in Webrat or Capybara using selector-based matchers.

Using Dropbox on Ubuntu

Dropbox can be integrated into Nautilus on Ubuntu for automatic file synchronization without using the web interface. The .deb package installs the client and keeps it updated through an APT source.

Build vs. Buy

Choosing between custom software and a packaged solution depends on whether the supported process is a competitive advantage. Core processes often justify building; others usually fit a standard package better.

How to build the perfect number of blank records for a nested form

Nested forms need enough blank rows for new entries and a sensible minimum total for first-time input; build_nested_records balances both with configurable thresholds.

Force SSH client to use password authentication instead of public key

Password authentication can be tested by forcing SSH to skip public key login and prefer passwords. The same options also work with scp for file copies.

Run Selenium tests in Chrome instead of Firefox

Switching Selenium from Firefox to Chrome requires a matching chromedriver and Capybara driver configuration. Older Capybara versions need a manual Selenium WebDriver setup.

Change the name of your Ubuntu machine

Renaming an Ubuntu machine requires updating /etc/hostname and /etc/hosts; the new hostname takes effect after reboot or with hostname your.hostname.

Linux: Refer to all arguments of a script call

Shell scripts often need to forward every command-line argument without hardcoding positions. $@ expands to all parameters in both sh and bash.

mysqltuner.pl

Perl script for diagnosing MySQL databases and suggesting configuration changes to improve performance.

Hack of the day: A reverse for Rails' &:

Ruby has a reverse of Rails' each(&:method) shorthand for calling an object method with each element: each(&object.method(:call)).

Change the timestamp of a file in Ruby

Set a file's modification time in Ruby with FileUtils.touch; it can create missing files and update multiple paths at once.

See which Rails applications are being served by your Passenger

passenger-memory-stats lists Passenger processes with application directories and memory usage, making it easy to identify which Rails apps are currently served.