Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
# get root
sudo -s
# format nvme
mkfs.btrfs /dev/nvme0n1
# create partitions
parted /dev/nvme0n1 mklabel gpt
parted /dev/nvme0n1 mkpart primary 1MiB 100GiB
parted /dev/nvme0n1 mkpart primary 100GiB 100%
# Source: https://gist.github.com/vfarcic/77c63cede031951654d5fea5ce0acb43
#########################################################################################
# Say Goodbye to Makefile - Use Taskfile to Manage Tasks in CI/CD Pipelines and Locally #
#########################################################################################
# Additional Info:
# - Task: https://taskfile.dev
# - Dagger: The Missing Ingredient for Your Disastrous CI/CD Pipeline: https://youtu.be/oosQ3z_9UEM
@pythoninthegrass
pythoninthegrass / gen_cert.sh
Last active February 14, 2024 01:09
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 / .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

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 / 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 / .gitignore
Last active December 28, 2023 00:16
Remove repos from CircleCI via API
repos.txt
@AliOsm
AliOsm / .env
Last active April 17, 2024 17:18
Deploy Rails, GoodJob, PostgreSQL, Redis, Memcached, Meilisearch, and ChromaDB on the same server using Kamal.
KAMAL_REGISTRY_PASSWORD=dckr_pat_xXXxx_x0xXxXx-xX-XXX0xX0x-x
RAILS_MASTER_KEY=00x00xxx000xxx000000xx0x000x0x00
POSTGRES_PASSWORD=xXxxx0xXXx0
MEILI_MASTER_KEY=xXxxx0xXXx0
BLAZER_DATABASE_URL=postgres://service:{POSTGRES_PASSWORD}@service-name-postgres:5432/service_production
@pythoninthegrass
pythoninthegrass / dl-gh
Last active May 2, 2024 18:41
Download latest GitHub releases by user, repo, and extension
#!/usr/bin/env bash
# shellcheck disable=SC2207
base_url="https://github.com/$user_name/$repo_name/releases"
pkg_path=$(pwd)
distro=$(uname) # Linux / Darwin
arch=$(uname -m) # x86_64 / aarch64 / arm64
help() {