Change / Update SSL certificate for Amazon Elastic Load Balancer

Rotating an Amazon ELB SSL certificate requires IAM server certificate upload and attaching the new ARN to the load balancer listener.

How to fix: Gems are unavailable although they are installed

Rails or Rake can report missing gems even when they are installed; wrong Bundler configuration or release-directory leftovers often redirect gem lookup to the wrong place.

Use a Ruby method like a block or lambda

Ruby methods can behave like blocks by turning them into callables with Object#method and passing them via & to block-taking methods.

Remove duplicate lines from a text file

Duplicate line removal in text files can be done with uniq -u, which writes only unique lines to an output file.

Runaway Regular Expressions: Catastrophic Backtracking

Certain regular expressions can take extremely long to match because nested repetition triggers catastrophic backtracking, as in (x+x+)+y.

Git: List remote branches

Remote branch names are useful for pulling, checking out, or merging work from another repository. git branch -r lists remote branches; git branch -a shows all branches.

The Skinny on CSS AttributeĀ Selectors

CSS selectors can target elements by attribute values, enabling styling without extra classes or IDs and useful hooks for forms, links, and data attributes.

How Non-negotiable Features Kill Software Products

Pre-sold requirements with no room to renegotiate create unnecessary complexity and lock clients into needs that change over time.

Truncate files to zero length

Set existing files to 0 bytes with truncate -s0; missing files are created, which makes log-file clearing and bulk file reset fast.

Selenium WebDriver 2.5.0, 2.6.0 fails when selecting options from select boxes

selenium-webdriver versions after 2.5.0 can make Capybara fail to choose <select> options even when the option is present, affecting Firefox tests.

Couldn't create database for ...

rake db:create fails when MySQL access or credentials are wrong, often because the configured user lacks permission to create the development database.

Solving "cannot remove Object::ClassMethods"

rake can fail with a misleading cannot remove Object::ClassMethods error when a hidden boot-time exception triggers Rails cleanup instead of the real cause.

Fixing Homebrew "Permission denied" issues

Homebrew can fail on first install when it cannot access /usr/local directories. Fixing ownership lets brew install run normally.

Dealing with Solr's "404 Not Found" response

Solr can start normally yet still return 404 Not Found when its log directory is not writable for the runtime user.

When Rails does not recognize Rake tasks in lib/tasks

Rake tasks in lib/tasks are ignored when the filename ends in .rb; Rails and Rake load them only from .rake files.

What's My DNS? Global DNS Propagation Checker

Check a hostname’s current IP address and DNS records against name servers worldwide to verify DNS propagation after zone changes.

Disable output when using cURL

curl still prints progress information when the response body is redirected; --silent suppresses all output for background jobs and scripts.

Make an HTTP request to a machine but fake the hostname

Send an HTTP 1.1 request to a specific machine while presenting a different host name, using curl --resolve or a manual Host header.

sstephenson/execjs - GitHub

Run JavaScript from Ruby without choosing a runtime manually; ExecJS automatically selects an available engine and returns results as Ruby objects.

We forked craken

Newer rake versions can break craken:install with a "can't convert Hash into String" error during deployments.

gpg encrypted backup fails in crontab

gpg backups can fail in cron jobs when they try to access /dev/tty, leaving empty backup files. Enabling --no-tty avoids the terminal prompt error.

Fixing "Lock obtain timed out: SimpleFSLock" for Solr

Solr update requests can fail with 500 errors when a stale Lucene write lock remains in the data directory, often from incorrect file ownership.

A few git tips you didn't know about

Advanced git commands and lesser-known workflows can speed up common tasks and reduce mistakes for experienced users.

Line wrap text from a Ubuntu Linux terminal

Wrap long terminal text at a fixed width with fold, echoing pasted input or writing wrapped output to a file.