Skip to content

Instantly share code, notes, and snippets.

Shogan /
Created Jun 21, 2020
AWS CodeBuild local docker build launch and configure
function allOSRealPath() {
if isOSWindows
case $1 in
.* ) path="$PWD/${1#./}" ;;
/* ) path="$1" ;;
* ) path="/$1" ;;
Shogan /
Created Dec 8, 2019
install kubernetes components for rpi
sudo tee /etc/apt/sources.list.d/kubernetes.list &>/dev/null <<EOF
deb kubernetes-xenial main
curl -s | sudo apt-key add -
sudo apt-get update
# Pin / install specific versions of the following components
sudo apt-get install -qy kubelet=1.16.2-00 kubectl=1.16.2-00 kubeadm=1.16.2-00 kubernetes-cni=0.7.5-00
Shogan / metallb.yaml
Created Dec 7, 2019
MetalLB kubernetes resources manifest for raspberry pi cluster
View metallb.yaml
apiVersion: v1
kind: Namespace
app: metallb
name: metallb-system
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
Shogan / dnsmasq.conf
Created Nov 17, 2019
Creates a dnsmasq.conf configuration file
View dnsmasq.conf
sudo tee /etc/dnsmasq.conf &>/dev/null <<EOF
# Our DHCP service will be providing addresses over our eth0 adapter
# We will listen on the static IP address we declared earlier
# Pre-allocate a bunch of IPs on the network for the Raspberry Pi nodes
# DHCP will allocate these for 12 hour leases, but will always assign the same IPs to the same Raspberry Pi
# devices, as you'll populate the MAC addresses below with those of your actual Pi ethernet interfaces
Shogan /
Created Sep 15, 2019
tcpdump useful commands

Some useful tcpdump commands

Listen on all interfaces (any) for traffic on port 8080:

tcpdump -vv -x -X -i any 'port 8080'

Listen on eth0 interface for all traffic:

tcpdump -vv -x -X -i eth0


Keybase proof

I hereby claim:

  • I am shogan on github.
  • I am shongololo ( on keybase.
  • I have a public key ASC__OwOlbi7tNQGZyWVkXDzfeQlJgMjKxLwYydvVwz7jAo

To claim this, I am signing this object:

Shogan / aws-vault-terraform-reference.ps1
Last active Nov 8, 2018
aws-vault + terraform useful references
View aws-vault-terraform-reference.ps1
# Using aws-vault with Terraform (to generate secure temporary session credentials in AWS for Terraform to use) can be tricky if you use a persistent session with aws-vault.
# These are the basic terraform workflow commands that work with aws-vault.
# The trick to using aws-vault and avoid session credential issues is to simply instruct aws-vault to not use a session with the --no-session flag.
# List / change TF workspace
aws-vault exec your_profile_name --no-session -- terraform workspace list
aws-vault exec your_profile_name --no-session -- terraform workspace select workspacenamehere
# Plan a change
aws-vault exec your_profile_name --no-session -- terraform plan -out="yourplan.tfplan"
Shogan / ps-oneliners.ps1
Created Nov 8, 2018
Powershell useful one-liners
View ps-oneliners.ps1
# Search command history for specific terms
Get-Content (Get-PSReadlineOption).HistorySavePath | Where { $_ -match "SEARCH TERM HERE" }
Shogan / docker-powershell-one-liners.ps1
Last active Nov 7, 2018
Powershell Docker commands and useful one-liners
View docker-powershell-one-liners.ps1
# Get list of all untagged images with no repository set
docker images --format "{{.ID}}--{{.Repository}}--{{.Tag}}" | Where { $_ -match "<none>--<none>" } | % { $_.Split("--")[0] }
# Remove all untagged / no repository docker images
docker images --format "{{.ID}}--{{.Repository}}--{{.Tag}}" | Where { $_ -match "<none>--<none>" } | % { $_.Split("--")[0] } | % { docker rmi $_ }
# Remove all stopped containers
docker ps -a -q | % { docker rm $_ }
View RandomShrub for Pixel Sprite Generator Unity
using UnityEngine;
using System.Collections;
using PixelSpriteGenerator;
public class RandomShrub : MonoBehaviour {
private PsgMask mask;
private PsgSprite sprite;
private SpriteRenderer sr;
You can’t perform that action at this time.