Skip to content

Instantly share code, notes, and snippets.

# Modified version of what `composer _completion -g -p composer` generates
# Composer will only load plugins when a valid composer.json is in its working directory,
# so for this hack to work, we are always running the completion command in ~/.composer
function _composercomplete {
export COMP_LINE COMP_POINT COMP_WORDBREAKS;
local -x COMPOSER_CWD=`pwd`
local RESULT STATUS
# Honour the COMPOSER_HOME variable if set
local composer_dir=$COMPOSER_HOME
@jimbocoder
jimbocoder / 14.04-bloat-packages
Created August 10, 2014 20:30
Ubuntu 14.04 Desktop bloat removal package list
# Purge the following packages
account-plugin-aim
account-plugin-facebook
account-plugin-flickr
account-plugin-jabber
account-plugin-salut
account-plugin-twitter
account-plugin-windows-live
account-plugin-yahoo
@jimbocoder
jimbocoder / nonsensical gibberish linux load balancer optimization thoughts
Created March 31, 2014 22:58
some notes and todos for optimizing the linux load balancer project
nginx better with high or low ssl concurrency? high: needs enough to saturate the CPUs, but no point in going higher than that
try high vs low haproxy -> nginx high
try high vs low haproxy -> varnish (this path is only for non-SSL connections, so less important) who cares, but high was better
note: nginx will be limited by the number of connections haproxy sends it, so maybe just set nginx super high, and use haproxy to throttle it. removes that variable from the equation.
dont run irqbalance/ksoftirqd. explicitly assign cpu affinities
net.core.somaxconn is default 128!!!!!!!!!!
do NOT run any firewall
"PRIMARY
stuff
irqs:
@jimbocoder
jimbocoder / gist:5256721
Created March 27, 2013 18:18
Me breaking all the rules.
// This function steganographically (kinda) encodes the iso language code into a gmail email address.
// dot characters are used because gmail ignores these when routing mail, but we can still write gmail filters based on them.
function langemailification($lang) {
global $multiplexer_email; // I'm so sorry. I learned it from watching YOU.
list($user,$host) = split('@', $multiplexer_email);
// Break the user part of the email address into two parts: the first character, and the remainder. Call them A and B.
// We'll insert our dots 1) between A and B, and 2) after B.
// Like so: [email protected]
list($a,$b) = array(
@jimbocoder
jimbocoder / FGT MC Hammer DNS
Created February 10, 2013 20:08
powerdns pipe backend to do unorthodox wildcard A records, with a little mc hammer
#!/usr/bin/perl -w
#
# Jim's evil wildcard dns backend for front gate tickets
#
use strict;
$|=1; # pump a little bit and let em know it's goin on (no output buffering)