Skip to content

Instantly share code, notes, and snippets.

View sideshow's full-sized avatar

Adam Jones sideshow

  • Wellington, New Zealand
View GitHub Profile
package main
import (
"flag"
"log"
"sync"
"github.com/apple/foundationdb/bindings/go/src/fdb"
)
@sideshow
sideshow / apns.go
Last active July 19, 2023 00:03
apns.go
package main
import (
"log"
"sync"
"github.com/sideshow/apns2"
"github.com/sideshow/apns2/certificate"
)
@sideshow
sideshow / tmux-cheatsheet.markdown
Created March 30, 2016 20:50 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sideshow
sideshow / example.go
Last active March 17, 2016 21:00
apns2 http/2 example
package main
import (
"log"
"sync"
apns "github.com/sideshow/apns2"
"github.com/sideshow/apns2/certificate"
)
@sideshow
sideshow / gist:a1414f68a1337ead9c93
Created January 8, 2016 09:17 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@sideshow
sideshow / gist:7632696
Created November 24, 2013 21:34
updateruby
cd ~/
wget http://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz
tar -xzf ruby-1.9.3-p484.tar.gz
cd ruby-1.9.3-p484
./configure
make
sudo make install
sudo service nginx restart
:#!/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.
@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
@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 / 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