Skip to content

Instantly share code, notes, and snippets.

Joseph Spurrier josephspurrier

View GitHub Profile
@josephspurrier
josephspurrier / .env
Last active Mar 8, 2020
Sample Makefile and docker-compose file for Go, Docker, and Vue. Source: https://github.com/josephspurrier/govueapp
View .env
APP_VERSION=1.0
MYSQL_CONTAINER=mysql:5.6
MYSQL_ROOT_PASSWORD=password
MYSQL_HOST=db
@josephspurrier
josephspurrier / gitlab_private_api.go
Created Jul 30, 2019
GitLab Private API for Reading Issue Order in a List
View gitlab_private_api.go
// Package main is an example of how to use the GitLab private API.
// Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/43674
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
@josephspurrier
josephspurrier / main.go
Created May 19, 2019
Method Overriding in Go
View main.go
package main
import "fmt"
type foo struct{}
func (f foo) Start() {
fmt.Println("Foo Started")
}
@josephspurrier
josephspurrier / healthcheck.go
Created May 13, 2019
Go AWS ELB Idle Timeout Test
View healthcheck.go
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
mux := http.NewServeMux()
@josephspurrier
josephspurrier / hotreload.go
Last active Mar 17, 2019
Golang HTTP Redirect using JavaScript and Long Polling
View hotreload.go
package main
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"os"
"os/exec"
@josephspurrier
josephspurrier / proxy.go
Last active Oct 3, 2018
Proxy Testing in Go
View proxy.go
package main
import (
"log"
"net/http"
"os"
)
func main() {
os.Setenv("HTTP_PROXY", "127.0.0.1:80")
@josephspurrier
josephspurrier / openswan-aws.md
Last active Sep 22, 2019
Set up VGW on AWS with OpenSwan
View openswan-aws.md

Set up VGW on AWS with OpenSwan

You will need 2 VPCs. The Internet VPC will have the Internet Gateway and the OpenSwan EC2 instance. The Project VPC will have your application or Kubernetes cluster.

Internet VPC

  • VPC CIDR: 10.230.30.0/24
  • Private Subnet: 10.230.30.128/25 - Route Table with 0.0.0.0/0 to NAT
  • Public Subnet: 10.230.30.0/25 - Route Table with 0.0.0.0/0 to IGW, 10.224.36.0/23 to OpenSwan Instance
  • NAT Gateway in the public subnet with an IP of 52.15.61.171
@josephspurrier
josephspurrier / csv.go
Created Mar 23, 2018
Modify CSV in Go
View csv.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"io"
"log"
"os"
"time"
View speedtest.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2016 Matt Martz
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@josephspurrier
josephspurrier / components_note.vue
Created Oct 4, 2017
Notepad in Nuxt using Vue 2.0
View components_note.vue
<template>
<li>
<div class="box">
<div class="content">
<div class="editable">
<input type="text" class="input" v-model="imessage" @keyup="$emit('edit', index, imessage)">
</div>
</div>
<nav class="level is-mobile">
<div class="level-left">
You can’t perform that action at this time.