Skip to content

Instantly share code, notes, and snippets.

Andrew Starr-Bochicchio andrewsomething

Block or report user

Report or block andrewsomething

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andrewsomething
andrewsomething / main.tf
Last active Dec 12, 2018
Terraform + DigitalOcean Kubernetes = <3
View main.tf
provider "digitalocean" {}
// Create a cluster on DigitalOcean
resource "digitalocean_kubernetes_cluster" "example" {
name = "example"
region = "nyc1"
version = "1.12.3-do.1"
node_pool {
name = "wokers"
View tf.diff
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"
@andrewsomething
andrewsomething / main.go
Last active Mar 15, 2019
Report download statistics for GitHub release assets
View main.go
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"strings"
"text/tabwriter"
@andrewsomething
andrewsomething / BACKUP.md
Last active Dec 21, 2018
Backup GitLab to DigitalOcean Spaces
View BACKUP.md

Backup GitLab to DigitalOcean Spaces

GitLab uses Fog to communicate with various object storage services when running backups. Fog works with S3 as well as S3-compatible services like Spaces. The key difference is that you need to explictly set the endpoint for non-S3 services. If you are using the "ominbus" GitLab packages, you would need to add the following to /etc/gitlab/gitlab.rb:

gitlab_rails['backup_upload_connection'] = {
@andrewsomething
andrewsomething / hacktoberfest-label.py
Last active Sep 27, 2019
This script will add the "hacktoberfest" label to any issue that also has one of the following labels applied: 'help wanted', 'first-timers-only', 'up-for-grabs'
View hacktoberfest-label.py
#!/usr/bin/env python3
import os
import sys
import requests
import json
LABELS = ['help wanted', 'help-wanted', 'first-timers-only', 'up-for-grabs',
'good first issue']
API_BASE = 'https://api.github.com/'
@andrewsomething
andrewsomething / get_snapshots.go
Created Nov 18, 2016
List DigitalOcean snapshots using godo
View get_snapshots.go
package main
import "os"
import "fmt"
import "golang.org/x/oauth2"
import "github.com/digitalocean/godo"
type TokenSource struct {
AccessToken string
}
@andrewsomething
andrewsomething / handlers.yml
Last active May 20, 2017
My "first five minutes" on a server
View handlers.yml
---
- name: Restart sshd
service:
name: ssh
state: restarted
become: yes
View keybase.md

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 / doctl.sh
Created Jul 12, 2016
Bash completion file generated for doctl 1.3.0
View doctl.sh
# 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
View gist:3b3a237d9b2d1d64f234ddab6b5f7e7e
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
You can’t perform that action at this time.