This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compose() { | |
$fxns = func_get_args(); | |
$outer = function($identity) { return $identity; }; | |
while($f = array_pop($fxns)) { | |
if ( !is_callable($f) ) { | |
throw new \Exception('This should be a better exception.'); | |
} | |
$outer = function() use($f, $outer) { | |
return $f(call_user_func_array($outer, func_get_args())); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$safeHome = preg_quote(getenv('HOME'), '/'); | |
$path = preg_replace("/^$safeHome(.*)$/", '~$1', getcwd()); | |
$delim = "\xe2\x8b\xaf"; // ⋯ | |
$maxlen=5; | |
$abbreviator = function($component) use ($delim, $maxlen) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"REPORT_TITLE": "Report for the month of xyz", | |
"QUOTE": { | |
"TYPE": "zipcode", | |
"DRIVERS": [ | |
{ | |
"Age": "30", | |
"Sex": "Female", | |
"Good_Student": "Yes", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! -x /usr/local/bin/ngrok ]]; then | |
TMPFILE=`tempfile` | |
curl -s 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip' -o "$TMPFILE.zip" | |
sudo unzip -f "$TMPFILE.zip" ngrok -d /usr/local/bin/ | |
rm -f "$TMPFILE.zip" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require "logstash/filters/base" | |
require "logstash/namespace" | |
# Filter plugin for logstash to parse the PHP severity field from a php error log | |
# message embdeeded in a syslog (RFC3164) message, and adjust the standard syslog | |
# PRI field accordingly. | |
# | |
# This is necessary because PHP by default logs all syslog messages at priority | |
# "notice", even things like fatal errors! This makes it impossible to do any alerting |
OlderNewer