get haproxy stats/informations via socat
HAProxy exposes runtime status through a Unix socket; socat can query version, connections, backend and frontend statistics, errors, and open sessions.
what to do if nova's iptables rules are missing
OpenStack hosts can lose iptables filter rules after a reboot while NAT remains active, often when nova services start in the wrong order. Restarting nova-compute usually repopulates the missing rules.
ping with timestamps
Timestamp each ping reply to correlate network latency with exact times and log connectivity events more easily.
How to deal with "invalid %-encoding" error in application for malformed uri
Malformed request URIs can raise invalid %-encoding and break the app before routing. A middleware can return 400 Bad Request instead of ArgumentError or ActionController::BadRequest.
Gemspecs must not list the same gem as both runtime and development dependency
Duplicating a gem in both runtime and development dependencies breaks gemspec validation and can make Bundler ignore the package. Put test-only version pins in the Gemfile instead.
Reverse-proxying web applications with nginx
Apache can be awkward for reverse proxying, especially with Digest Authentication and HTTPS passthrough; nginx offers a simpler setup for forwarding requests to another host.
Ruby: How to update all values of a Hash
Update every entry in a Ruby Hash with a concise merge! trick when each key needs a new computed value.
Latency Numbers Every Programmer Should Know
Common I/O operations differ by orders of magnitude, making hardware latency easy to underestimate and performance bottlenecks hard to diagnose.
PostgreSQL: Expanded display and other command line features
\x enables expanded query output in PostgreSQL, making wide SELECT * results readable on the command line.
AngularJS: How to force Content-Type on GET and DELETE requests
AngularJS strips Content-Type from blank-body GET and DELETE requests, which can break APIs that require it. Decorating $httpBackend can restore the header selectively.
Shrine - A file upload toolkit
CarrierWave is no longer maintained, and Shrine offers a maintained alternative for file uploads.
Thunderbird: How to compose an HTML e-mail (when plain-text messages are your default)
HTML e-mails can still be needed even when plain text is the default. In Thunderbird, holding Shift while clicking compose or reply opens a message in HTML format.
Designing a landing page that sells
Iterative landing page design improves conversion by refining a single page through multiple visual and content variations.
Remove Rubygems deprecation warnings
Rubygems deprecation warnings can clutter terminal output when they cannot be fixed. Setting Deprecate.skip and Gem::Deprecate.skip in the Gemfile suppresses them.
Count number of existing objects in Ruby
Count live Ruby objects in the current process using ObjectSpace to inspect memory use and object distribution.
Configure RSpec to raise an error when stubbing a non-existing method
RSpec 3.3+ can reject stubbing or mocking methods that do not exist, preventing non-verified partial doubles from masking test mistakes.
Ruby will get a safe navigation operator: '.?'
Ruby gains a safe navigation operator for calling methods only when an object is present, avoiding nil checks and andand-style chaining.
Sending TCP keepalives in Ruby
TCP sockets can stay half-open when the remote side disappears silently; enabling keepalive probes helps clients detect dead connections and time out sooner.
Check SSL certificates
Missing intermediate certificates can make HTTPS connections fail with trust and issuer-chain errors in browsers, curl, and OpenSSL.
grosser/parallel
Utility methods for parallel iteration and mapping across multiple threads or processes, useful when single-threaded work is too slow.
How to repair a corrupt PDF
Broken PDFs can fail to render or embed in tools like xelatex; pdftk can rewrite them into a usable file.
Fix "subprocess installed post-removal script returned error exit status ..." when installing/removing/updating a package with apt
APT package operations can fail when maintainer scripts return exit status 78, often because postinst, postrm, or prerm scripts hit leftover files or mounted directories.
Show or hide a jQuery element given a condition
Conditional element visibility in jQuery can be shortened by using toggle(condition) instead of separate show() and hide() calls.
Test downstream bandwidth of Internet connection
Check whether an internet uplink can sustain 1GE or 10GE throughput by pushing traffic internally or from many public mirrors.