Skip to content

Instantly share code, notes, and snippets.

Nathaniel nathanielks

Block or report user

Report or block nathanielks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.md

CloudFormation -> Terraform Import Helpers

I wrote these scripts to help faciliate batch import of our CloudFormation templates into Terraform Configuration.

region-batch.sh

This script is a light wrapper around batch.sh. It simply iterates over the list of regions provided, exports expected variables, creates required directories, and calls batch.sh.

BASE_DIR=/path/to/dir EXCLUDE_REGEX="(some-stack-production|some-stack-staging)" ./region-batch.sh us-east-1 us-west-1
@nathanielks
nathanielks / https-setup.md
Last active Jan 17, 2017 — forked from indolering/https-setup.md
Shell script to generate TLS certificates for local development (.test, .example, etc)
View https-setup.md
@nathanielks
nathanielks / delete_expired_sessions.sql
Created Sep 29, 2016
SQL query to delete expired WooCommerce Sessions.
View delete_expired_sessions.sql
delete from t1, t2
using wp_options t1
join wp_options t2 on t2.option_name = replace(t1.option_name, '_expires', '')
where (t1.option_name like '\_wc\_session\_expires\_%')
and t1.option_value < UNIX_TIMESTAMP(NOW())
View personal-vnc.conf
# /etc/init/personal-vnc.conf
# Use the service command:
# sudo service personal-vnc {start,stop,restart,status}
#
description "Manages VNC connection. Runs on boot"
start on runlevel [2345]
stop on runlevel [06]
View PACKER_LOG
# $ cat template.json | PACKER_LOG=1 packer build -debug -
2016/03/12 13:23:31 [INFO] Packer version: 0.9.0 a643faae672ec8b8424352476d2b91b7a7f7b06e+CHANGES
2016/03/12 13:23:31 Packer Target OS/Arch: darwin amd64
2016/03/12 13:23:31 Built with Go Version: go1.6
2016/03/12 13:23:31 Detected home directory from env var: /Users/aang
2016/03/12 13:23:31 Using internal plugin for vmware-vmx
2016/03/12 13:23:31 Using internal plugin for docker
2016/03/12 13:23:31 Using internal plugin for parallels-pvm
2016/03/12 13:23:31 Using internal plugin for qemu
View __name__Route.js
// polyfill webpack require.ensure
if (typeof require.ensure !== 'function') require.ensure = (d, c) => c(require)
export default <% if (addStore) { %>(store) => (<% } %>{
path: '<%= camelEntityName %>',
getComponents (location, cb) {
require.ensure([
'views/<%= pascalEntityName %>View/<%= pascalEntityName %>View'
], (require) => {
let view = require('views/<%= pascalEntityName %>View/<%= pascalEntityName %>View').default
@nathanielks
nathanielks / calc.js
Created Nov 27, 2015
Super simple way to calculate how long an egghead.io course is
View calc.js
var seconds = 0;
$('.table.table-condensed .info-line small.duration').each(function(){
var s = this.innerText.split(':');
seconds += s[0] * 60;
seconds += s[1] * 1;
});
console.log(seconds/60);
@nathanielks
nathanielks / README.md
Last active Mar 14, 2018
Simple wrapper around terraform to manage multiple environments
View README.md

This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:

main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
View keybase.md

Keybase proof

I hereby claim:

  • I am nathanielks on github.
  • I am nathanielks (https://keybase.io/nathanielks) on keybase.
  • I have a public key whose fingerprint is E5F6 FFB4 3651 D39A 25B9 1DAD FE02 07A3 8BD5 4DC4

To claim this, I am signing this object:

@nathanielks
nathanielks / Vagrantfile
Created Sep 26, 2014
Improved bedrock-ansible Vagrantfile
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.box = 'roots/bedrock'
# Required for NFS to work, pick any local IP
config.vm.network :private_network, ip: '192.168.50.5'
You can’t perform that action at this time.