Skip to content

Instantly share code, notes, and snippets.

View olliebun's full-sized avatar
⌨️
IC

Oliver Hassett olliebun

⌨️
IC
View GitHub Profile
@olliebun
olliebun / keybase.md
Last active July 1, 2021 00:32
keybase.md

Keybase proof

I hereby claim:

  • I am olliebun on github.
  • I am olliebun (https://keybase.io/olliebun) on keybase.
  • I have a public key ASAjjZIyF7TmBDF2OsiWhfvRHNXlHZO4mcn1d4ezjjCedAo

To claim this, I am signing this object:

@olliebun
olliebun / crash.log
Last active July 4, 2019 03:50
terraform crash on 2019-07-04
2019/07/04 13:45:32 [INFO] Terraform version: 0.12.3
2019/07/04 13:45:32 [INFO] Go runtime version: go1.12.4
2019/07/04 13:45:32 [INFO] CLI args: []string{"/home/cera/bin/terraform-0.12", "apply"}
2019/07/04 13:45:32 [DEBUG] Attempting to open CLI config file: /home/cera/.terraformrc
2019/07/04 13:45:32 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/07/04 13:45:32 [INFO] CLI command args: []string{"apply"}
2019/07/04 13:45:32 [TRACE] Meta.Backend: built configuration for "gcs" backend with hash value 1107044854
2019/07/04 13:45:32 [TRACE] Preserving existing state lineage "b41022b0-a419-6f05-ec45-2e695e7fa747"
2019/07/04 13:45:32 [TRACE] Preserving existing state lineage "b41022b0-a419-6f05-ec45-2e695e7fa747"
2019/07/04 13:45:32 [TRACE] Meta.Backend: working directory was previously initialized for "gcs" backend
@olliebun
olliebun / cloud_nat.md
Created April 18, 2019 00:05
My write-up of Cloud NAT from some investigations at GreenSync.

I spend some time looking into Cloud NAT. Unfortunately, it doesn't look like we can use it short of migrating to private clusters.

The example GKE Setup document specifies a private cluster in its walkthrough, but doesn't really make it clear that it's a hard requirement.

This passage from the Cloud NAT Overview document's section on cases where NAT is not performed actually implies that it's usable on some non-private clusters:

Regular (non-private) GKE clusters assign each node an external IP address, so such clusters cannot use Cloud NAT to send packets from the node's primary interface. Pods can still use Cloud NAT if they send packets with source IP addresses set to the pod IP.

The wording there implies that we can use Cloud NAT if we can rely on the source IP being the pod IP, which some people - myself included - took to suggest it should work in a public cluster as long as VPC-native

@olliebun
olliebun / gometalinter-install.sh
Created October 16, 2018 09:43
gometalinter tips
# install gometalinter
go get -u github.com/alecthomas/gometalinter/...
LearnosityAmd.define([
'underscore',
'jquery',
'/question/flash-card-template.js'
],
function (_, $, template) {
var questions = {};
var audios = {};
@olliebun
olliebun / test_asyncio.py
Last active March 7, 2023 09:32
Simple python asyncio example.
"""
This program defines a run_all function which will retrieve two
URLs and run a shell subcommand, all concurrently, using asyncio.
What stands out in this example is the readability of the get() and cmd()
functions, and the usefulness of asyncio.gather().
An excerpt from the program output shows the way they are interleaved:
Start: http://google.com
@olliebun
olliebun / consumers-test.sh
Created December 14, 2015 00:08
Script to create a vhost that simulates Consumers API index from a static file.
# create and symlink the vhost
cat > /etc/nginx/sites-available/consumers-test <<EOF
server {
listen 80; ssl off;
listen 443 ssl;
server_name consumers-test;
ssl_certificate /etc/ssl/certs/2018-07-08-star.staging.learnosity.com.chain;
@olliebun
olliebun / keybase.md
Created March 8, 2015 09:19
keybase.md

Keybase proof

I hereby claim:

  • I am DanielBryan on github.
  • I am ceralena (https://keybase.io/ceralena) on keybase.
  • I have a public key whose fingerprint is C6F0 A26A 8D39 2C24 C11F CF5F 0099 C12C B33D 366C

To claim this, I am signing this object:

@olliebun
olliebun / Vagrantfile
Last active August 29, 2015 14:04
Vagrantfile to run Trusty at Pycon 2014
Vagrant.configure("2") do |config|
config.vm.define "main" do |config|
config.vm.box = "trusty"
config.vm.synced_folder "~/salt", "/salt"
config.vm.provider :virtualbox do |v|
v.customize ['modifyvm', :id, '--cpus', 2]
v.customize ['modifyvm', :id, '--memory', 1024]
end
end
end
@olliebun
olliebun / gist:32564a9f2a3bc30d9463
Created July 8, 2014 06:19
apache conf to rewrite all HTTP traffic to HTTPS
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.example.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>