Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / config
Last active February 16, 2024 22:13
~/.config/sccache/config
# https://github.com/mozilla/sccache/blob/main/docs/DistributedQuickstart.md
# https://fy.blackhats.net.au/blog/2020-11-19-deploying-sccache-on-suse/
# export RUSTC_WRAPPER=sccache
# export SCCACHE_CACHE_SIZE=26843545600
# export CC="sccache /usr/bin/gcc"
# export CXX="sccache /usr/bin/g++"
# export CARGO_INCREMENTAL=0
# Stop server to change config
@pythoninthegrass
pythoninthegrass / gen_certbot.sh
Last active May 22, 2024 17:48
Create a certbot letsencrypt cert
#!/usr/bin/env bash
# shellcheck disable=SC2162
# certbot location
UNAME=$(uname -s)
if [ "$UNAME" = "Darwin" ]; then
BREW_PREFIX=$(brew --prefix)
PATH="$BREW_PREFIX/bin:/usr/local/bin:$PATH"
elif [ "$UNAME" = "Linux" ]; then
@pythoninthegrass
pythoninthegrass / really.py
Last active January 31, 2024 02:55
Calculate speedup/slowdown of `time` runs
#!/usr/bin/env python
import argparse
import sys
argparser = argparse.ArgumentParser()
argparser.add_argument('-f', '--file', help='File to read real times from')
# TODO: fix negative slowdown percentage: '0m32.572s' / '0m52.889s'
@pythoninthegrass
pythoninthegrass / .hadolint.yml
Last active April 14, 2024 16:56
Hadolint config stored in $HOME
failure-threshold: info # error|warning|info|style|ignore|none
ignored:
- DL3006 # explicit tag
- DL3008 # pin versions in apt
- DL3018 # pin versions in apk
- DL3026 # allowed registry
trustedRegistries:
- docker.io
@pythoninthegrass
pythoninthegrass / icon.png
Last active January 12, 2024 19:19
Alfred workflow to convert time between ms/secs/min
icon.png
@pythoninthegrass
pythoninthegrass / kamal.md
Last active June 6, 2025 13:58 — forked from huksley/mrsk.md
kamal - the missing manual

kamal

This documentation adds important additions to the docs for kamal deploy tool (see github.com/basecamp/kamal)

Destination flag

You can use kamal deploy --destination staging

This will read config/deploy.yml and config/deploy.staging.yml files, and also will read .env.staging file if it exists.

microk8s & fluxcd

(optional) prepare the server

# install at https://multipass.run/
multipass launch --name microk8s-flux --mem 2G
multipass shell microk8s-flux

# assume ubuntu with snap installed, if not install it via
apt install snapd
@pythoninthegrass
pythoninthegrass / mojo
Last active January 6, 2024 18:25
Shim for mojo to get around MOJO_PYTHON_LIBRARY not being found
#!/usr/bin/env bash
# shellcheck disable=SC2034
cat <<- 'DESCRIPTION' >&2 > /dev/null
Run Mojo with MOJO_PYTHON_LIBRARY set to the current python version
installed by asdf
INSTALL
chmod +x mojo
@pythoninthegrass
pythoninthegrass / GIT_SSH.md
Last active January 4, 2024 17:58
GitHub SSH deploy key

Use SSH deploy key with GitHub

Generate SSH key

ssh-keygen -t ed25519 -C "<email>"

Point to specific SSH key

  • ~/.gitconfig: git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -F /dev/null"
@pythoninthegrass
pythoninthegrass / ghcr.md
Created December 28, 2023 18:41 — forked from yokawasa/ghcr.md
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens