Skip to content

Instantly share code, notes, and snippets.

Avatar

Ian Winter ianwinter

View GitHub Profile
@ianwinter
ianwinter / dynapi_lowercase_googlemx.rb
Last active Aug 29, 2015
Quick script to call Dyn's API to (optionally) remove Postini MX records and add lowercased Google Mail MX records.
View dynapi_lowercase_googlemx.rb
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
View 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 / nginx.build.sh
Last active Aug 29, 2015
nginx build options
View nginx.build.sh
#!/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 / 0_reuse_code.js
Created Oct 22, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View MySQL bulk alter table
mk-find -uroot wld --engine MyISAM --tblregex '^payment' --exec "alter table %D.%N engine=InnoDB" --print
@ianwinter
ianwinter / gist:142401
Created Jul 7, 2009
Basic array creation in ColdFusion for use with sphinx
View gist:142401
<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)>
@ianwinter
ianwinter / sed_replace.sh
Last active Aug 30, 2015
Replace string using sed
View sed_replace.sh
sed -i 's/old/new/g' file.txt
# freebsd
# sed -i '' 's/old/new/g' file.txt
You can’t perform that action at this time.