Skip to content

Instantly share code, notes, and snippets.

@thewebfellas
thewebfellas / nginx.conf
Created January 28, 2009 16:19
sample nginx.conf for thin
user nginx;
worker_processes 5;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@danmackinlay
danmackinlay / supervisord.sh
Created August 27, 2009 07:07
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@gautamrege
gautamrege / gist:725020
Created December 2, 2010 09:14
VIM - presentation. Most frequently uses VIM shortcuts.
1. Why use VIM?
VIM rocks!
VI or VIM?
I hate the mouse!
I am a text person
I love touch-typing (huh - what is touch typing% again..)
You have production server with only SSH access!
2. Vim -- you already knew
Command mode & Insert mode
@dalecaru
dalecaru / innobackupex-restore.sh
Created April 20, 2011 13:42
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@nukemberg
nukemberg / knife.sh
Created June 28, 2011 07:51 — forked from ches/knife
bash completion for Chef's knife command (updated for 0.10)
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
@tankchintan
tankchintan / gist:1335220
Last active November 30, 2019 00:17
Procedure for installing and setting Sun JDK Java on Default Amazon Linux AMI
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
# Install Java
@kirbysayshi
kirbysayshi / mass-aggregation-change.sh
Created November 23, 2011 17:14
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
@smukkejohan
smukkejohan / nagios
Created February 6, 2012 19:07
Nagios with Nginx configuration
server {
listen 80;
server_name nagios.example.tld;
access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log info;
expires 31d;
root /usr/share/nagios3/htdocs;
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@hmalphettes
hmalphettes / ubuntu-12.04-gems.erb
Created March 14, 2012 04:27
Chef bootstrap With root-only rvm and ruby 1.9.2 on ubuntu 12.04
bash -c '
echo "boostrap chef on a ubuntu VM. Install ruby via rvm sandbox it for the root user: does not install rvm system wide."
echo "Example VM already booted: knife bootstrap 192.168.122.165 -x ubuntu -P ubuntu -d ubuntu-12.04-gems --node-name my_node --run-list role[intalio_micro_all] --environment intalio-CF --sudo"
echo "Example EC2 with knife-ec2: knife bootstrap ec2-122-248-197-139.ap-southeast-1.compute.amazonaws.com -i ~/.ec2/hmalphettes-ap.pem -x ubuntu -d ubuntu-12.04-gems i --run-list \"role[intalio_micro_all]\" --environment intalio-CF --no-host-key-verify --sudo"
echo "Example EC2 with knife-ec2: knife ec2 server create -I $UBUNTU_AMI -f m1.large -x ubuntu -d ubuntu-12.04-gems -i $EC2_KEYPAIR_PEM \"--run-list role[intalio_micro_all]\" -G http-https-ssh-smtp-vmreg -N ec2-ubuntu-new --region $EC2_REGION --availability-zone ap-southeast-1b --ebs-size $SIZE --no-host-key-verify --environment intalio-CF"
echo "Example HP Cloud with knife-hp: knife hp server create --flavor 103 --image 5579 --ssh-