Skip to content

Instantly share code, notes, and snippets.

#!/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:

# 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
@artbikes
artbikes / lvsnapshot.sh
Created November 11, 2015 22:55 — forked from bcarpio/lvsnapshot.sh
lvsnapshot.sh
#!/bin/bash
DATE=`date +"%a"`
DVOLNAME=datalv
LVOLNAME=journallv
VOLGR=datavg
DVOLPATH=/dev/$VOLGR/$DVOLNAME
LVOLPATH=/dev/$VOLGR/$LVOLNAME
DSNAME=`echo ${DVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'`
LSNAME=`echo ${LVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'`
@artbikes
artbikes / gist:c46f284807118cfff48217a3ca8e9df0
Created July 20, 2016 19:12 — forked from jkeiser/gist:7244532
Adventures With Chef: Ghost #1

Installing My Blog

I want to install Ghost as my blog. I want the web server, ghost, and OS, all to receive security updates on a regular schedule without me having to muck with it. (I am willing for the blog to sometimes go down because of this.)

I'll eventually want monitoring and alerting, and backups of the blog entries; uploads of the static site to my web hosting company; automatic DNS configuration; updates of the base OS. But for now I'm modest, I just want Ghost and I want updates.

I want to do this all with Chef. I want to write the Ghost cookbook myself, not because the existing Ghost cookbook is bad, but because I want to get a real feel for how these get written.

Getting Started: Test Kitchen

@artbikes
artbikes / notifier.go
Created July 29, 2016 18:52 — forked from zankich/notifier.go
Santa Monica Golang
package main
import (
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/goiot/devices/piglow"
"golang.org/x/exp/io/i2c"
@artbikes
artbikes / one-liners.md
Created July 29, 2016 18:55 — forked from KL-7/one-liners.md
Ruby one-liners

One-liners

Reverse every line:

Input file:

$ cat foo
qwe
123

bar