Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / .env.example
Created March 28, 2024 23:14
Public facing version of an internal Infisical export script
BASE_URL=
ID=
SERVICE_TOKEN=
OUT_DIR=
@pythoninthegrass
pythoninthegrass / Dockerfile
Last active March 22, 2024 05:24 — forked from orenitamar/Dockerfile
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
ARG VERSION=3.18
FROM alpine:${VERSION}
RUN apk update \
&& apk add \
--no-cache \
# 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
# 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%
@pythoninthegrass
pythoninthegrass / godaddy.sh
Created March 4, 2024 20:06
Test script for GoDaddy V1 REST API
#!/usr/bin/env bash
set -euo pipefail
# get the root directory
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
if [ -n "$GIT_ROOT" ]; then
TLD="$GIT_ROOT"
else
@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 / settings.json
Created February 14, 2024 05:15
Zed settings
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"base_keymap": "Atom",
@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 / 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