Skip to content

Instantly share code, notes, and snippets.

View josephspurrier's full-sized avatar

Joseph Spurrier josephspurrier

View GitHub Profile
@josephspurrier
josephspurrier / proxy.go
Last active October 3, 2018 15:29
Proxy Testing in 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 September 27, 2023 12:12
Set up VGW on AWS with OpenSwan

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 March 23, 2018 21:09
Modify CSV in Go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"io"
"log"
"os"
"time"
@josephspurrier
josephspurrier / speedtest.py
Last active November 14, 2017 13:10
CLI Speedtest
#!/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 October 4, 2017 19:33
Notepad in Nuxt using Vue 2.0
<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">
@josephspurrier
josephspurrier / DefaultKeyBinding.Dict
Last active November 17, 2021 16:17
OS X Key Binding for Windows Keyboard
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
List: https://web.archive.org/web/20160314030051/http://osxnotes.net/keybindings.html
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behavior on Windows systems. This particular mapping assumes
that you have also switched the Control and Command keys already.
This key mapping is more appropriate after switching Ctrl for Command in this menu:
Apple->System Preferences->Keyboard & Mouse->Keyboard->Modifier Keys...->
Change Control Key to Command
Change Command key to Control
@josephspurrier
josephspurrier / html.json
Created June 18, 2017 18:08
Visual Studio User Snippets
{
/*
// Place your snippets for HTML here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@josephspurrier
josephspurrier / extensions.json
Last active May 29, 2022 14:15
Visual Studio Code Settings
{
"recommendations": [
"dbaeumer.vscode-eslint",
"golang.go",
"yzhang.markdown-all-in-one",
"equinusocio.vsc-material-theme-icons",
"gruntfuggly.todo-tree",
"redhat.vscode-yaml"
]
}
@josephspurrier
josephspurrier / Microsoft.PowerShell_profile.ps1
Last active April 26, 2019 17:23
Windows PowerShell Profile
# Store this document in the following location:
# C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# You'll have to enabled remote execution first (run as admin): Set-ExecutionPolicy RemoteSigned
# Gist: https://gist.github.com/josephspurrier/636c4226af85970c6f647d35ea1b1be5
# This profile makes it easy to set your GOPATH and modify your PATH environment
# variables easily when switching between Visual Studio workspaces.
# Add the gotools to the path.
$env:Path += "C:\Users\"+$env:username+"\Documents\gotools\bin;"
@josephspurrier
josephspurrier / webserver.go
Created March 21, 2017 04:01
Simple Web Server in Go
package main
import (
"io"
"net/http"
)
func main() {
http.HandleFunc("/", index)
http.ListenAndServe(":8080", nil)