Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Spurrier josephspurrier

View GitHub Profile
@josephspurrier
josephspurrier / values_pointers.go
Last active Nov 24, 2020
Golang - Asterisk and Ampersand Cheatsheet
View values_pointers.go
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@josephspurrier
josephspurrier / etc-init.d-hello-world
Last active Nov 9, 2020
/etc/init.d Script for Go Application
View etc-init.d-hello-world
#!/bin/bash
#
# chkconfig: 35 95 05
# description: Hello world application.
# Run at startup: sudo chkconfig hello-world on
# Load functions from library
. /etc/init.d/functions
@josephspurrier
josephspurrier / ticker.go
Last active Oct 29, 2020
Ticker on the Minute
View ticker.go
package main
import (
"log"
"time"
)
func main() {
log.Println("Started ticker")
@josephspurrier
josephspurrier / openswan-aws.md
Last active Oct 21, 2020
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 / aescmd.go
Created Dec 23, 2014
Golang - Encrypt, Decrypt, File Read, File Write, Readline
View aescmd.go
package main
import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@josephspurrier
josephspurrier / sshclient.go
Last active Sep 29, 2020
Golang SSH Client
View sshclient.go
package main
import (
"bufio"
"io/ioutil"
"os/signal"
//"syscall"
"fmt"
"log"
"os"
@josephspurrier
josephspurrier / extensions.json
Last active Aug 30, 2020
Visual Studio Code Settings
View extensions.json
{
"recommendations": [
"dbaeumer.vscode-eslint",
"golang.go",
"yzhang.markdown-all-in-one",
"equinusocio.vsc-material-theme-icons",
"gruntfuggly.todo-tree",
"redhat.vscode-yaml"
]
}
@josephspurrier
josephspurrier / sshremote.go
Last active Aug 20, 2020
Golang Remote Execution
View sshremote.go
package main
/*
// Example
sci := ServerConnInfo{
"127.0.0.1",
"22",
"ubuntu",
`key.pem`,
}
@josephspurrier
josephspurrier / controls.stories.ts
Last active Aug 20, 2020
Using Controls in Storybook with Mithril (TypeScript)
View controls.stories.ts
import m from "mithril";
export default {
title: "Example/Controls",
};
interface Args {
list: number[];
toggle: boolean;
numberBox: number;
@josephspurrier
josephspurrier / .bash_profile
Last active Aug 5, 2020
macOS Bash Profile
View .bash_profile
#################################################################################
#
# Bash Configurations and Aliases for OS X
#
# Latest: https://gist.github.com/josephspurrier/acf7327726df6587a56ff2c2062314fa
# This was modified so it can be included in your ~/.zshrc file with the command:
# source ~/.bash_profile
#
# It's recommended to use oh-my-zsh:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
You can’t perform that action at this time.