Skip to content

Instantly share code, notes, and snippets.

# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user forge;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
@adamvduke
adamvduke / build.sh
Created September 29, 2011 21:21 — forked from jonah-williams/build.sh
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@adamvduke
adamvduke / encrypt_openssl.txt
Created September 13, 2018 21:23 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@adamvduke
adamvduke / service-checklist.md
Last active May 8, 2017 05:11 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@adamvduke
adamvduke / .zshrc
Last active November 22, 2016 19:01 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@adamvduke
adamvduke / nginx.conf
Created November 14, 2013 21:11 — forked from plentz/nginx.conf
#don't send the nginx version number in error pages and Server header
server_tokens off;
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
set func_call_user NilOrNotNSNull
indent_align_string=false
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=false
indent_extern=false
indent_class=false
indent_class_colon=false
@adamvduke
adamvduke / install-graphite-ubuntu-10.04.sh
Created April 30, 2012 04:13 — forked from garethr/install-graphite-ubuntu-10.04.sh
Install Graphite 0.9.9 on Ubuntu 10.04
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Updated by Gareth Rushgrove (http://morethanseven.net)
# Last tested & updated 8th April 2012
####################################
sudo apt-get update
sudo apt-get upgrade
#!/bin/sh
#uncrustify -l OC -c ~/.uncrustify --no-backup $(find -x -E $SRCROOT -not -regex '.*/\.?External/*.*' -name "*.[mh]")
if [ $# -ne 1 ]; then
echo "Please pass the name of the directory to format"
exit 1;
fi
if [ ! -d $1 ]; then
echo "$1 is not a directory"
#!/usr/bin/env ruby
# Seems a bit silly to have a script to run redcloth considering you can just run
# $ redcloth inputfile.textile > outputfile.html
# but whatever
class Textilize
require 'rubygems'
require 'redcloth'