Skip to content

Instantly share code, notes, and snippets.

View kwoods's full-sized avatar

Kevin Woods kwoods

  • Scotland, UK
  • 12:53 (UTC +01:00)
View GitHub Profile
@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" \
LSCOLORS="exfxFxBxcxbxdxabagacad"
@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
@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 / 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 / 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 / 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 / batcharge.py
Created March 18, 2016 18:06 — forked from remy/batcharge.py
My zsh set up as of July 25, 2013
#!/usr/bin/env python
# saved to ~/bin/batcharge.py and from
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]
@kwoods
kwoods / Makefile
Created November 17, 2015 20:23 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'