Skip to content

Instantly share code, notes, and snippets.

View ghostsquad's full-sized avatar

Wes McNamee ghostsquad

View GitHub Profile
git config --local user.email ghost.squadron@gmail.com
git config --local user.signingkey 1C08DB44DEC7CAFC
git config --local core.sshCommand "ssh -i ~/.ssh/id_rsa_ghostsquad"
git --no-pager config --local --list
#!/usr/bin/env bash
# Start SSH Agent if not already started
# https://stackoverflow.com/questions/18880024/start-ssh-agent-on-login
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
#!/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 / EffectiveIssueAnatomy.md
Last active May 22, 2023 16:16
Anatomy of an Effective Issue

Anatomy of an Effective Issue (or how to ask questions)

A Brief and Actionable Subject/Title

The brief subject line or title is the most important part of any issue that you write. It’s the first thing folks will see, and it gives the entire request context. Spend some time mastering this, just like you would a commit message.

The title should include verbs like "fix", "create", "give access to", etc which demonstrate the desired outcome. An action like "consider" has an ambiguous outcome, and should be avoided. Here are some examples of good and bad subject lines:

@ghostsquad
ghostsquad / .zshrc
Created October 14, 2022 02:13
zshrc - oldmac
# zmodload zsh/zprof
# printf "%-10s" "start:"
# printf "%s\n" "$(/usr/local/bin/gdate +%s%N)"
# If you come from bash you might have to change your $PATH.
export PATH="$HOME/bin:$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
@ghostsquad
ghostsquad / aliases.sh
Last active August 31, 2023 04:54
aliases.sh
# Docker
alias drd='docker rmi $(docker images -f "dangling=true" -q)'
alias dre='docker rm $(docker ps -a -f status=exited -q)'
alias drc='docker rm $(docker ps -a -f status=created -q)'
alias dps='docker ps --format '\''table {{ .ID }}\t{{ .Image }}\t{{ .Names }}\t{{ .Ports }}'\'''
alias dpsa='docker ps -a --format '\''table {{ .ID }}\t{{ .Image }}\t{{ .Names }}\t{{ .Ports }}'\'''
# Git
# https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git-extras/git-extras.plugin.zsh