Skip to content

Instantly share code, notes, and snippets.

haproxy.conf
============
frontend spdy
mode tcp
bind xxx.xxx.xxx.xxx:443 ssl crt /etc/haproxy/ssl.pem crt /etc/haproxy/certs.d npn spdy/3.1,http/1.1 ciphers AES256+EECDH:AES256+EDH:AES128+EDH:EECDH:!aNULL:!eNULL:!LOW:!DES:!3DES:!RC4; no-sslv3
option tcplog
log global
# route to nginx

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@artbikes
artbikes / album.sh
Last active August 29, 2015 14:17
Plot your CD ripping progress
cat > album.gnu << EOF
set terminal png size 900, 300
set output "album-chart.png"
set xdata time
set timefmt "%Y%m%d"
set xrange ["20130101":"20150330"]
set grid
set xtics format "%b %d %y"
set xtics "201303105", 29030400, "20150330"
plot [:][:] '< cat -' using 1:2 title "Albums Ripped"
#!/bin/bash
set -e
sudo rm -f /etc/update-motd.d/10-help-text
sudo rm -f /etc/update-motd.d/51-cloudguest
sudo rm -f /etc/update-motd.d/91-release-upgrade
echo -e "[sysinfo]\nexclude_sysinfo_plugins = LandscapeLink" | sudo tee /etc/landscape/client.conf
echo deb https://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is also explained at the Nginx ngx_http_fastcgi_module page document page.

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (it's not shared).

The related Nginx options are:

function weather(){
curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=metric" | \
jq .main.temp | \
awk '{$1 = (9/5*$1+32)} 1'| \
figlet -kcf big
}
# Build dependencies for OpenResty.
sudo apt-get install build-essential libpcre3-dev libssl-dev libgeoip-dev
# Install standard Nginx first so that you get the relevant service scripts installed too
sudo apt-get install nginx
# If you want to access Postgres via Nginx
sudo apt-get install libpq-dev

Puppet with Jenkins

Setup Jenkins

With Puppet:

puppet module install rtyler-jenkins

puppet apply -v -e "include jenkins"

@artbikes
artbikes / .gitignore
Last active August 29, 2015 14:27 — forked from karmi/.gitignore
Three Nodes and One Cluster: Demo of ElasticSearch's Distributed Features
.DS_Store
logs/
data/
*.html
@artbikes
artbikes / vpc
Created October 27, 2015 19:04 — forked from chrishaessig/vpc
#! /usr/bin/env python
import argparse
import logging
import sys
import time
from itertools import islice
import boto3