Skip to content

Instantly share code, notes, and snippets.

View andrewsomething's full-sized avatar

Andrew Starr-Bochicchio andrewsomething

View GitHub Profile
@andrewsomething
andrewsomething / main.tf
Last active December 12, 2018 23:19
Terraform + DigitalOcean Kubernetes = <3
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"
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 August 29, 2022 16:19
Report download statistics for GitHub release assets
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"strings"
"text/tabwriter"
@andrewsomething
andrewsomething / BACKUP.md
Last active March 28, 2023 08:30
Backup GitLab to DigitalOcean Spaces

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 October 20, 2022 16:16
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'
#!/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 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
}
@andrewsomething
andrewsomething / handlers.yml
Last active September 15, 2020 18:13
My "first five minutes" on a server
---
- name: Restart sshd
service:
name: ssh
state: restarted
become: yes

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 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
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