Skip to content

Instantly share code, notes, and snippets.

View ajessup's full-sized avatar

Andrew J ajessup

View GitHub Profile
@ajessup
ajessup / Vagrantfile
Last active November 18, 2018 19:45 — forked from lizrice/Vagrantfile
Vagrant file for setting up a single-node Kubernetes cluster that I can access from my desktop. Read more: https://medium.com/@lizrice/kubernetes-in-vagrant-with-kubeadm-21979ded6c63
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This script to install Kubernetes will get executed after we have provisioned the box
$script = <<-SCRIPT
# Install docker (we do this rather than use the vagrant provisioner so we can fetch a specific version)
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
@ajessup
ajessup / query_slack.js
Created February 10, 2016 17:52
Retrieve a list of users from a slack chatroom, count how many messages they sent, put it into a sheet.
var SLACK_TOKEN = "" // Get yours from https://api.slack.com/web
function importUsersFromSlack() {
var sheet_array = ImportJSON("https://slack.com/api/users.list?token="+SLACK_TOKEN,
"/members/name,/members/profile/real_name,/members/profile/email,/members/tz");
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Users");
for(var i=0;i<sheet_array.length;i++){
sheet.appendRow(sheet_array[i]);
}
}
@ajessup
ajessup / mysql_backup.py
Created April 13, 2012 03:37
Simple python script for performing and optionally encrypting a rolling backup a mysql DB
#!/usr/bin/env python
'''
Conduct rolling backups of a mysql DB server.
Daily backups are kept for the previous 7 days,
weekly for the previous 4 weeks, and monthly backups
for the previous 12 months.
Run ./mysql_backup --help for usage instructions
@ajessup
ajessup / Cakefile
Created February 18, 2012 03:32 — forked from tantaman/Cakefile
Cakefile for compiling Coffee and LESS files, optionally compressing them with YUIC
###
Web Toolkit v0.4 (by M@ McCray)
http://gist.github.com/515035
NOTE: This is meant to be used as a Cakefile (Coffee's RAKE equivalent).
###
puts = require("util").puts
@ajessup
ajessup / mysql-backup.sh
Created February 13, 2012 06:37
Quick and dirty shell script designed to take rolling mysqldumps from a server
#! /bin/bash
#
# Quick and dirty shell script designed to take rolling mysqldumps from a
# mysql replica server
#
MYSQL_USERNAME = '<<username>>'
MYSQL_PASSWORD = '<<password>>'