Skip to content

Instantly share code, notes, and snippets.

View kwoods's full-sized avatar

Kevin Woods kwoods

View GitHub Profile
@kwoods
kwoods / ubuntu_unattended_upgrades_gmail.markdown
Last active April 8, 2016 18:52 — forked from dwilkie/ubuntu_unattended_upgrades_gmail.markdown
Setup unattended upgrades on Ubuntu with Gmail

Install the unattended-upgrades package

$ sudo apt-get install unattended-upgrades 

Edit the periodic configuration

$ sudo nano /etc/apt/apt.conf.d/10periodic
@kwoods
kwoods / balls.rb
Last active April 21, 2016 01:31
Odd = Red Ball, Even = Blue Ball
# The adding logic seems to dictate the result. So if you start with 1 ball each (differnt colors / odd),
# you end up with red.
blue_balls = Array.new(17, 'blue')
red_balls = Array.new(17, 'red')
balls = red_balls + blue_balls
balls.shuffle!
puts "Starting Ball List: #{balls}"
@kwoods
kwoods / node_clean_install.sh
Last active April 25, 2016 15:25
Clean Node install on OS X
# filename: install-nvm-npm-node
# author: Lex Sheehan
# purpose: To cleanly install NVM, NODE and NPM
# dependencies: brew
NOW=$(date +%x\ %H:%M:%S)
CR=$'\n'
REV=$(tput rev)
OFF=$(tput sgr0)
@kwoods
kwoods / atom_packages.md
Last active April 25, 2016 15:37
Preferred Atom Packages

ls -1 ~/.atom/packages

README.md
Sublime-Style-Column-Selection
atom-beautify
atom-material-syntax
atom-material-syntax-dark
atom-material-ui
@kwoods
kwoods / teamcity-agent.service
Created May 9, 2016 16:28
TeamCity Build Agent - Systemd service
[Unit]
Description=TeamCity Build Agent
After=network.target
[Service]
Type=forking
PIDFile=$AGENT_HOME/logs/buildAgent.pid
ExecStart=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh start
ExecStop=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh stop
LSCOLORS="exfxFxBxcxbxdxabagacad"
@kwoods
kwoods / gist:adf4ba171d83c1995aa79dc8169a004a
Last active July 17, 2017 11:54 — forked from hummus/gist:8592113
aws cli + jq example
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@kwoods
kwoods / jenkins_jobs.py
Created August 5, 2016 02:11
Jenkins API Access for Querying Job Times
>>> c.connect()
>>> c.request('GET', '/job/test-dsl/17/api/json', headers={'Accept': 'text/json'})
>>> resp = c.getresponse()
>>> jsondata = resp.read()
>>> data = json.loads(jsondata.decode())
>>> print(data['duration'])
@kwoods
kwoods / boto3_hands_on.md
Created November 7, 2016 15:31 — forked from iMilnb/boto3_hands_on.md
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@kwoods
kwoods / client_throttle.py
Created November 8, 2016 03:17 — forked from bblincoe/client_throttle.py
Amazon AWS Client Throttle in Python (boto3)
import boto3
import botocore
from random import randint
from time import sleep
def client_throttle(action, **kwargs):
while True:
try:
return action(**kwargs)
except botocore.exceptions.ClientError as e: