Skip to content

Instantly share code, notes, and snippets.

View jamtur01's full-sized avatar
💭
I may be slow to respond.

James Turnbull jamtur01

💭
I may be slow to respond.
View GitHub Profile
var https = require('https');
var util = require('util');
var webhook = '/services/webhook';
var errorMessage = "ERROR";
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {

Given the word list:

word_list = [ "hello", "helicopter", "shaving", "door", "aluminum", "pen" ]
  1. Write a function that prints out the longest word and its length, the shortest word and its length, and the average word length

  2. Reverse the letters of each word in the array and sort from shortest to longest.

@jamtur01
jamtur01 / dash.json
Created January 29, 2017 02:49
Apps - Dashboard JSON
{
"annotations": {
"list": []
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"id": 1,
"links": [],
export DATADOG_API_KEY="..." to run these tests.
export HIPCHAT_SERVER="..." to run these tests.
export HIPCHAT_API_KEY="..." to run these tests.
export HIPCHAT_ALERT_ROOM="..." to run these tests.
export LIBRATO_METRICS_USER="..." to run these tests.
export LIBRATO_METRICS_API_KEY="..." to run these tests.
export OPSGENIE_SERVICE_KEY="..." to run these tests.
export OPSGENIE_RECIPIENTS="..." to run these tests.
export SLACK_API_KEY="..." to run these tests.
export SLACK_ALERT_ROOM="..." to run these tests.
#!/opt/puppetlabs/puppet/bin/ruby
# This mini-webserver is meant to be run as the peadmin user
# so that it can call mcollective from a puppetmaster
# Authors:
# Ben Ford
# Adam Crews
# Zack Smith
# Jeff Malnick
require 'rubygems'
@jamtur01
jamtur01 / c4q_techinterview.md
Last active July 9, 2021 12:48
C4Q Technical Interview Slides

Interviewing for Engineering roles


Workshop timetable

  • 15 mins Introduction

Per interview.

Warning - actual ignitition not guaranteed to occur. No Ben's were harmed during the making of this tweet.
My root partition mounted read only too. To fix, I ran:
blkid
to get the disk's new UUID, and then updated /etc/fstab with the new value:
cp /etc/fstab /run
vim /run/fstab
mount --no-mtab --fstab /run/fstab -o remount,rw /
cp /run/fstab /etc
reboot
* aws_route53_record.riemann_private: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
Please include the following information in your report:
Terraform Version: 0.8.1
Resource ID: aws_route53_record.riemann_private
Mismatch reason: attribute mismatch: records.1515779551
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"ttl":*terraform.ResourceAttrDiff{Old:"", New:"300", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "fqdn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "zone_id":*terraform.ResourceAttrDiff{Old:"", New:"Z2FZI4D6465RDO", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "records.#":*terraform.ResourceAtt
#!/bin/bash
type terraform >/dev/null 2>&1 || { echo >&2 "I require terraform but it's not installed. Quitting sadly."; exit 1; }
REGION="us-east-1"
BUCKET="remote_state"
ENVIRONMENT=${PWD##*/}
STATE_FILE="terraform.tfstate"
ARGS=$*