Skip to content

Instantly share code, notes, and snippets.

View ghostsquad's full-sized avatar

Wes McNamee ghostsquad

View GitHub Profile
#!/usr/bin/env bash
envfile="$HOME/.gnupg/gpg-agent.env"
if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then
eval "$(cat "$envfile")"
else
eval "$(gpg-agent --daemon --enable-ssh-support)"
fi
export GPG_AGENT_INFO # the env file does not contain the export statement
export SSH_AUTH_SOCK # enable gpg-agent for ssh
@ghostsquad
ghostsquad / yaml_json_cheatsheet.sh
Last active June 24, 2020 17:30
Yaml/Json Cheatsheet
brew install jq
brew install yq
# render a helm chart to it's yaml parts
helm fetch --repo https://containous.github.io/traefik-helm-chart --untar --untardir ./charts traefik
helm template --output-dir ./manifests ./charts/traefik
# OR
helm template --output-dir ./loki-fluent-bit loki/fluent-bit
@ghostsquad
ghostsquad / alignment_testing.go
Created August 11, 2020 20:53
emoji and character alignment
package main
import (
"fmt"
"strings"
"unicode/utf8"
"github.com/mattn/go-runewidth"
"github.com/rivo/uniseg"
)
@ghostsquad
ghostsquad / secrets.seal.sh
Created August 28, 2020 17:49
secrets.seal.sh
#! /usr/bin/env bash
set -Eeuo pipefail
scripts_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
source "${scripts_dir}/functions.sh"
test_jq
test_yq
test_kubeseal
@ghostsquad
ghostsquad / DummyTaskfile.yaml
Created February 20, 2022 02:38
dummy-taskfile.yaml
version: 3
tasks:
dummy:
cmds:
- echo "dummy"
@ghostsquad
ghostsquad / ping-with-timestamp.ps1
Last active October 17, 2022 05:36
powershell-ping-timestamp
ping.exe -t 172.217.14.238 | Foreach{"{0} - {1}" -f (Get-Date),$_} | Tee-Object -Append -FilePath internet-test.log
@ghostsquad
ghostsquad / .gitignore
Created November 30, 2022 20:26
global git ignore
# https://raw.githubusercontent.com/github/gitignore/main/Global/Diff.gitignore
*.patch
*.diff
# https://github.com/github/gitignore/blob/main/Global/Dropbox.gitignore
# Dropbox settings and caches
.dropbox
.dropbox.attr
.dropbox.cache
@ghostsquad
ghostsquad / .gacprc
Created October 19, 2022 21:07
.gacprc - newmac
{
"emoji": "emoji",
"add": false,
"editor": true
}
@ghostsquad
ghostsquad / .tool-versions
Created October 19, 2022 21:07
.tool-versions - newmac
kubectl 1.21.14
awscli 2.7.25
golang 1.19
nodejs 18.7.0
@ghostsquad
ghostsquad / iterm2-profile.json
Created October 19, 2022 21:06
iterm2-profile - newmac
{
"Ansi 3 Color" : {
"Red Component" : 0.9424901008605957,
"Color Space" : "Calibrated",
"Blue Component" : 0.54832202196121216,
"Alpha Component" : 1,
"Green Component" : 0.98275065422058105
},
"Tags" : [