Skip to content

Instantly share code, notes, and snippets.

View ianwinter's full-sized avatar

Ian Winter ianwinter

View GitHub Profile
@ianwinter
ianwinter / nginx.build.sh
Last active August 29, 2015 14:04
nginx build options
#!/bin/bash
# Author: Ian Winter
# Warranty: None. Here be dragons and krakens.
# Base System: CentOS release 6.5 (Final)
# Notes: This is my own build sciprt, works for me - use at your own risk!
BUILD_DATE=`date +'%Y%m%d_%H%M%S'`
BUILD_BASE_PATH="/root/build_new"
BUILD_SRC_PATH="${BUILD_BASE_PATH}/src"
BUILD_CURRENT="${BUILD_BASE_PATH}/nginx/${BUILD_DATE}"
@ianwinter
ianwinter / keybase.md
Created September 24, 2014 14:46
keybase.md

Keybase proof

I hereby claim:

  • I am ianwinter on github.
  • I am ian_winter (https://keybase.io/ian_winter) on keybase.
  • I have a public key whose fingerprint is 5314 9836 4AEA 326B 8049 6C8F 4161 671A A1B9 889B

To claim this, I am signing this object:

@ianwinter
ianwinter / dynapi_lowercase_googlemx.rb
Last active August 29, 2015 14:07
Quick script to call Dyn's API to (optionally) remove Postini MX records and add lowercased Google Mail MX records.
require 'dyn-rb'
# usage: ruby ./lowercase_google_mx.rb domain.com
# 1: set up the connection
dyn = Dyn::Traffic::Client.new('CUSTOMER_NAME', 'USERNAME', 'PASSWORD')
# 2: set the zone
zone = ARGV[0].to_s
dyn.zone = zone
@ianwinter
ianwinter / sed_replace.sh
Last active August 30, 2015 13:04
Replace string using sed
sed -i 's/old/new/g' file.txt
# freebsd
# sed -i '' 's/old/new/g' file.txt
@ianwinter
ianwinter / gist:142401
Created July 7, 2009 21:36
Basic array creation in ColdFusion for use with sphinx
<cfset variables.sphinx = createobject("java", "org.sphx.api.SphinxClient").init()>
<cfset variables.sphinx.SetLimits(0, 10)>
<cfset variables.arrObj = createobject("java", "java.lang.reflect.Array")>
<cfset variables.jClass = createobject("java", "java.lang.Integer").TYPE>
<cfset variables.jArr = variables.arrObj.newInstance(variables.jClass, 2)>
<cfset variables.arrObj.setInt(variables.jArr, 0, 100)>
<cfset variables.arrObj.setInt(variables.jArr, 1, 200)>
<cfset variables.sphinx.SetFilter("tag", variables.jArr, FALSE)>
mk-find -uroot wld --engine MyISAM --tblregex '^payment' --exec "alter table %D.%N engine=InnoDB" --print
gem sources -a http://gems.github.com
@ianwinter
ianwinter / 0_reuse_code.js
Created October 22, 2013 13:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console