Skip to content

Instantly share code, notes, and snippets.

View sideshow's full-sized avatar

Adam Jones sideshow

  • Wellington, New Zealand
View GitHub Profile
@sideshow
sideshow / mountEBSvol.sh
Created August 14, 2011 02:44
Mount EBS Volume (see: http://bit.ly/EsrqQ)
#!/bin/sh
#
# /etc/init.d/mountebsvol
#
# chkconfig: 234 20 50
# description: Assigns an EC2 EBS Volume to a device and mounts the device
#
# To add this as a service run:
# /sbin/chkconfig --add mountec2vol
#
@sideshow
sideshow / mongod
Created August 31, 2011 02:05
mongod - Startup script for mongod
#!/bin/bash
# mongod - Startup script for mongod
# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongod
# config: /etc/mongod.conf
# pidfile: /var/run/mongo/mongo.pid
@sideshow
sideshow / nginx
Created September 1, 2011 05:48
nginx init.d script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 86 14
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@sideshow
sideshow / redis
Created September 1, 2011 23:02
redis init.d script
#!/bin/sh
#
# redis this script starts and stops the redis daemon
#
# chkconfig: - 85 15
REDISPORT=6379
EXEC=/usr/local/bin/redis-server
PIDFILE=/var/run/redis.pid
@sideshow
sideshow / redis-server
Created November 14, 2012 20:56
Redis 2.6 init script Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@sideshow
sideshow / redis.conf
Created November 14, 2012 21:07
Redis 2.6 redis.conf
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@sideshow
sideshow / redis-server
Last active December 11, 2015 02:59
Redis 2.6 init script for ubuntu based on redis sample init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@sideshow
sideshow / redis-server.monitrc
Created January 15, 2013 00:46
redis-server monitrc file for ubuntu
check process redis-server
with pidfile "/var/run/redis.pid"
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 500 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then timeout
@sideshow
sideshow / es.sh
Last active December 12, 2015 09:38
elasticsearch 0.20.4 ubuntu with wrapper service
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.4.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
:#!/bin/bash
# Script Created by Christopher Silvertooth. Inspiration from Clay Caviness.
# http://musings.silvertooth.us
# Version 2.0 Mountain Lion compatibility
# 2.0.1 added verify disk check
# 2.0.2 added Retina Macbook Pro and 2012 Air check
# 2.0.3 Fixed bug in OS detection. Reported by Steve Silvertooth.
# 2.0.4 Fixed diskutil check so that it doesn't break with multiple drives.
# 2.0.5 Bug fixes. Wrong recovery partition added.