Skip to content

Instantly share code, notes, and snippets.

View daxmc99's full-sized avatar

Dax McDonald daxmc99

View GitHub Profile
@daxmc99
daxmc99 / rioStart.sh
Last active January 24, 2020 01:10
rioStart.sh
#!/bin/bash
#set -x
#set -e
name='rio'
k3d delete --name=$name
k3d create -n $name --image rancher/k3s:v1.0.0 --publish 80:80 --publish 443:443 --publish 9443:9443 --publish 9080:9080 \
--server-arg --no-deploy=traefik
declare -i i; i=0
until k3d get-kubeconfig --name='rio'
do
@daxmc99
daxmc99 / docker-for-mac.md
Last active November 4, 2019 20:06 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


apiVersion: v1
kind: ConfigMap
metadata:
annotations:
linkerd.io/created-by: linkerd/cli stable-2.6.1
labels:
linkerd.io/control-plane-component: prometheus
linkerd.io/control-plane-ns: linkerd
name: linkerd-prometheus-config
namespace: linkerd
@daxmc99
daxmc99 / iterm2-solarized.md
Created February 21, 2020 05:26 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@daxmc99
daxmc99 / README.md
Created March 4, 2020 17:49
Debugging go programs

Per https://blog.golang.org/debugging-what-you-deploy

Make sure to compile your Go program with inlining and optimizations disabled

Also this is targetted towards delve

go build -gcflags "all=-N -l" /my/go/program

(delve on the commandline does this automatically, not sure if Goland does)

@daxmc99
daxmc99 / tmux-cheatsheet.markdown
Created March 26, 2020 17:42 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@daxmc99
daxmc99 / wsl.md
Last active May 29, 2020 22:05
Setting up WSL2 for dev

Due to some issues with shipping at the moment my Macbook is delayed in getting to me and I will using Windows as my dev machine. These are the steps I took to set it up

Enable WSL 2 (basically required for good performance in most dev work)

Decide between Scoop & Chocolately

Install Ubuntu 20.04

Enable VS Code remote work

@daxmc99
daxmc99 / .gitconfig
Created May 6, 2020 16:05 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .
@daxmc99
daxmc99 / cloud_sql_read_only.sql
Last active October 29, 2025 16:23
Make a user read-only after its created via the Google api (ie via Terraform)
-- CREATE read-only user when the user was created via the Google Cloud API (ie terraform)
-- GOOGLE CLOUD by default give fairly broad permissions
-- Prior reading https://stackoverflow.com/questions/13497352/error-permission-denied-for-relation-tablename-on-postgres-while-trying-a-selec
-- https://www.digitalocean.com/docs/databases/postgresql/how-to/modify-user-privileges/
REVOKE ALL ON DATABASE db FROM "dev-readonly";
-- This next line is important
REVOKE cloudsqlsuperuser FROM "dev-readonly";
GRANT USAGE ON SCHEMA public TO "dev-readonly";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO "dev-readonly";
@daxmc99
daxmc99 / shellscript.jsonc
Last active August 6, 2021 22:49
VSCode Snippet
{
// Place your snippets for shellscript 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": [
// "console.log('$1');",