Skip to content

Instantly share code, notes, and snippets.

@amichaelgrant
amichaelgrant / OS X network optimize.txt
Created June 17, 2019 20:00 — forked from snoby/OS X network optimize.txt
OSX Sierra Network Performance Tweaks
#
# Reboot into recovery mode (cmd +r ) and in the terminal
#
nvram boot-args="serverperfmode=1 ncl=262144"
#reboot
#
# In regular mode
@amichaelgrant
amichaelgrant / nginx-geoip-module.md
Created September 9, 2018 07:29 — forked from VirtuBox/nginx-geoip-module.md
How to configure GeoIP module for Nginx

Create a folder to store the databases :

mkdir -p /usr/share/GeoIP

Download Country IP database

wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
@amichaelgrant
amichaelgrant / nginx.conf
Created October 25, 2017 09:13 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@amichaelgrant
amichaelgrant / supervisor.conf
Created April 21, 2017 23:04 — forked from tsabat/supervisor.conf
Sample supervisor config file
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@amichaelgrant
amichaelgrant / performance.txt
Created April 21, 2017 20:13 — forked from dstroot/performance.txt
Performance Tuning your TCP Stack
#!/bin/bash
echo "*****************************************"
echo " Based on information from Google"
echo " http://dev.chromium.org/spdy/spdy-best-practices"
echo "*****************************************"
sudo su
yum –y update
echo "*****************************************"
echo " Changing initcwnd and initrwnd"
echo " Step 1: check route settings."
@amichaelgrant
amichaelgrant / dispatcher.list
Created July 29, 2016 23:05 — forked from krakatoa/dispatcher.list
Simple Kamailio round-robin configuration
# line format
# id(int,auto) setid(int) destination(string) flags(int) priority(int) attrs(string) description(string)
1 sip:10.0.0.9:5060
1 sip:10.0.0.10:5060
#!/usr/bin/env node
// ./generatelookup -l lookupkey -p somekey* -a attribute
var redis = require('redis').createClient();
var async = require('async');
var opt = require('optimist');
opt.usage('$0 -l lookup -p pattern -a attribute');
opt.demand(['l', 'p', 'a']);
var argv = opt.argv;
var iter = '0';
@amichaelgrant
amichaelgrant / s3.sh
Created February 1, 2016 16:57 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@amichaelgrant
amichaelgrant / supervisord-example.conf
Created January 30, 2016 01:54 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@amichaelgrant
amichaelgrant / Git push deployment in 7 easy steps.md
Created November 1, 2015 09:01 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook