List sizes of MySQL databases

MySQL database directories can misrepresent real storage use when ibdata1 holds the data; querying information_schema.TABLES reveals per-database size in MB.

Grep the number of occurences in a file, counting multiple hits per line

grep -c counts matching lines, not repeated hits on the same line. Inserting line breaks with sed makes every occurrence count.

Solarized color scheme for Rubymine

Solarized support in RubyMine requires importing an IntelliJ port, and selecting a scheme can reset the editor font.

Fix: FreeBSD is not able to connect to the network

FreeBSD systems can fail to get network access even when rc.conf enables DHCP. Starting dhclient manually or rebooting can restore connectivity.

How to change the font in Sublime Text 2

Sublime Text 2 font appearance can be customized through user settings, including typeface and size, with changes applied immediately after saving.

Solve issues with Samsung TV as computer screen

Samsung TVs used as monitors can have audio routing problems, input lag, and oversharp text, and store settings only after leaving store-demo mode.

Create RAID on Amazon EC2 EBS volumes

Software RAID on Amazon EC2 EBS volumes improves I/O for database and other intensive workloads. mdadm creates the array and preserves it across reboots.

Solarized

A 16-color palette for terminal and GUI apps with calibrated lightness and hue relationships, built to stay readable across varied displays and lighting.

Marry Date::Performance and Spreadsheet gems

Date::Performance speeds up Ruby date methods but breaks Spreadsheet because Date.ajd_to_jd is missing from the C implementation.

"The certificate is not trusted because no issuer chain was provided." Error with SSL + Nginx

SSL connections fail when the certificate chain is incomplete. Appending the intermediate certificate to the server certificate lets Nginx present a trusted chain.

Capistrano: Delete old releases automatically

Capistrano keeps recent release folders on the server for rollback, and the retention count can be lowered with set :keep_releases, 3.

Resque + God + Capistrano

Capistrano deployment for a Resque app with God process monitoring and restart hooks, running under the deployment user without a system service.

How to: Store multiple Vim commands in macros and recall them

Vim macros record repeated command sequences for batch editing and reuse. @, @@, numeric prefixes, and . support quick reruns without retyping.

Chosen - makes select boxes better

Long, unwieldy dropdowns become easier to use with Chosen, a JavaScript enhancement available for jQuery and Prototype.

Thunderbird: Confirm encryption absence/presence before sending an e-mail

Prevent accidental leaks of sensitive mail by showing a confirmation before sending unencrypted messages; Enigmail can display whether OpenPGP encryption will be used and which keys apply.

Always store your Paperclip attachments in a separate folder per environment

Paperclip attachments can collide across development, test, and parallel test processes when they share one storage tree. Separate environment-specific paths prevent overwritten files and missing test data.

Nginx Error "413 Request Entity Too Large"

Nginx returns 413 Request Entity Too Large when client_max_body_size is below the upload size limit, often during file uploads.

Check whether a Paperclip attachment exists

Paperclip attachment checks can give false positives because the attribute returns an attachment object. Use exists? to test whether a file is actually attached.

Insert multiple blank rows into an OpenOffice.org/LibreOffice Calc spreadsheet

Insert several empty rows in Calc at once by selecting multiple row headers and using Insert Rows; the new rows inherit the style from above.

How to diff two strings in Ruby

Compute readable differences between two strings in Ruby or Rails with the differ gem, including word, line, and character comparisons plus HTML or color output.

Responding to the OPTIONS HTTP method request in Rails: Getting around the Same Origin Policy

Rails applications can answer browser preflight requests and allow controlled cross-origin access by handling OPTIONS requests with CORS headers.

Cross-Origin Resource Sharing - Wikipedia

Browser requests across domains are blocked by the same-origin policy unless a service allows them with CORS; it replaces JSONP and supports regular XMLHttpRequest and non-GET methods.

JSONP - Wikipedia

Cross-origin web pages cannot normally communicate, but <script> requests can pull executable JavaScript around same-origin limits. JSONP uses this loophole to load dynamic data from other origins.

Web Operations 101 For Developers

Web application developers increasingly need operational knowledge beyond coding, testing, and deploying. Traditional development workflows now overlap with running and maintaining production systems.