Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# Kill processes orphaned by Jenkins
# Work around Java's use of SIGTERM rather than SIGKILL and
# Jenkins's lack of any workaroud in the box.
# Suggested usage:
#
# $ crontab -l
@jeffbeard
jeffbeard / randomthumbs.rb
Created April 23, 2012 12:40 — forked from psobot/randomthumbs.rb
Random Image Thumbnailer
# Hacky random image thumbnailer.
# by Peter Sobot, April 21, 2012
# Based heavily on code by Michael Macias
# (https://gist.github.com/a54cd41137b678935c91)
require 'rmagick'
images = Dir.glob(ARGV[0] ? ARGV[0]
: '-default-input-paths-')
output_dir = (ARGV[1] ? ARGV[1]
@jeffbeard
jeffbeard / varnish
Created September 5, 2011 16:27
varnish config
NFILES=131072
MEMLOCK=82000
INSTANCE=$(uname -n)
DAEMON_OPTS="-a YOUR_IP_ADDR:80 \
-T localhost:6082 \
-f /etc/varnish/wordpress.vcl \
-S /etc/varnish/secret \
-s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
@jeffbeard
jeffbeard / foohost-nginx-config
Created September 5, 2011 15:48
nginx virtual host file
server {
listen 8080;
server_name foo.com www.foo.com;
root /var/www;
index index.php;
access_log /var/log/nginx/foo.access.log;
error_log /var/log/nginx/foo.error.log;
@jeffbeard
jeffbeard / foohost-nginx-config
Created September 5, 2011 15:48
nginx virtual host file
server {
listen 8080;
server_name foo.com www.foo.com;
root /var/www;
index index.php;
access_log /var/log/nginx/foo.access.log;
error_log /var/log/nginx/foo.error.log;
@jeffbeard
jeffbeard / wordpress.vcl
Created September 5, 2011 15:42
varnish wordpress config
backend default {
.host = "127.0.0.1";
.port = "8080";
}
acl purge {
"localhost";
}
sub vcl_recv {
@jeffbeard
jeffbeard / php5-fpm.conf
Created September 5, 2011 15:35
PHP-FPM config file
[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log
[www]
listen = /var/run/php5-fpm.sock
user = www-data
group = www-data
pm = static
pm.max_children = 10
@jeffbeard
jeffbeard / nginx.conf
Created September 5, 2011 15:26
nginx configuration file
user www-data;
worker_processes 5;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}