Skip to content

Instantly share code, notes, and snippets.

View andrewsomething's full-sized avatar

Andrew Starr-Bochicchio andrewsomething

View GitHub Profile
Vagrant.configure('2') do |config|
config.ssh.private_key_path = 'sshkey/id_rsa'
config.vm.box ='ubuntu/trusty64'
config.vm.network "forwarded_port", guest: 80, host: 8080
provider_is_do = (!ARGV.nil? && ARGV.join('').include?('provider=digital_ocean'))
config.vm.provision 'shell', inline: <<-SHELL
sudo apt-get update
@andrewsomething
andrewsomething / datehist.py
Created October 9, 2011 17:50 — forked from tkf/datehist.py
Plot a histogram of mailinglist activity
#!/usr/bin/env python
"""
Plot histogram from list of dates
Usage
=====
Point to mbox file.
Ex.1: plot mailinglist activity::
@andrewsomething
andrewsomething / testHook.js
Created September 28, 2015 20:40
My first hook.io microservice
import pprint
print("Hello, this is a Python script.")
print("Hook['params'] is populated with request parameters")
pprint.pprint(Hook['params'])
@andrewsomething
andrewsomething / quickly_project_rename.py
Created September 24, 2012 20:15
Script for renaming a Quickly project
#!/bin/sh
#Rename the project
#Program goes over the files and renames them using bzr
#then it goes inside the file and changes all old names to new name
#
# Copyright (C) Canonical Inc. <Alexander Wolfson> <alex.wolfson@canonical.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
@andrewsomething
andrewsomething / planet-check.py
Last active December 21, 2015 19:39
Check Planet config.ini against Launchpad team membership
#! /bin/python
import os
import ConfigParser
cachedir = os.path.expanduser("~/.launchpadlib/cache")
from launchpadlib.launchpad import Launchpad
launchpad = Launchpad.login_anonymously('planet check', 'production', cachedir)
Config = ConfigParser.ConfigParser()
root@horizon-rethinkdb-on-1404:~/app# hz serve --bind all --dev --debug
App available at http://0.0.0.0:8181
debug: RethinkDB stdout: Recursively removing directory /root/app/rethinkdb_data/tmp
debug: RethinkDB stdout: Initializing directory /root/app/rethinkdb_data
info: RethinkDB Running rethinkdb 2.3.2~0trusty (GCC 4.8.2)...
info: RethinkDB Running on Linux 3.13.0-86-generic x86_64
debug: RethinkDB stdout: Loading data from directory /root/app/rethinkdb_data
error: rethinkdb stderr: warn: Cache size does not leave much memory for server and query overhead (available memory: 845 MB).
info: RethinkDB Listening for intracluster connections on port 40518
info: RethinkDB Listening for client driver connections on port 35129
@andrewsomething
andrewsomething / doctl.sh
Created July 12, 2016 13:55
Bash completion file generated for doctl 1.3.0
# bash completion for doctl -*- shell-script -*-
__debug()
{
if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
fi
}
# Homebrew on Macs have version 1.3 of bash-completion which doesn't include

Keybase proof

I hereby claim:

  • I am andrewsomething on github.
  • I am andrewsomething (https://keybase.io/andrewsomething) on keybase.
  • I have a public key ASCO7zx323E54gqLUqfeLsormSWMqkLVgEf-g31lM8-OXAo

To claim this, I am signing this object:

@andrewsomething
andrewsomething / get_snapshots.go
Created November 18, 2016 17:38
List DigitalOcean snapshots using godo
package main
import "os"
import "fmt"
import "golang.org/x/oauth2"
import "github.com/digitalocean/godo"
type TokenSource struct {
AccessToken string
}
diff --git a/digitalocean/config.go b/digitalocean/config.go
index 96f6785..bc38c31 100644
--- a/digitalocean/config.go
+++ b/digitalocean/config.go
@@ -12,33 +12,63 @@ import (
"github.com/hashicorp/terraform/helper/logging"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
+ "github.com/minio/minio-go"
"golang.org/x/oauth2"