Skip to content

Instantly share code, notes, and snippets.

View triangletodd's full-sized avatar

Todd Edwards triangletodd

View GitHub Profile
@triangletodd
triangletodd / README.md
Last active June 1, 2023 05:22
MSF Basic eCourse

[toc]

MSF Basic eCourse

Basic Street Strategies

Traffic situations can change fast, especially around intersections and in curves. The Basic Street Strategies in this section will help you:

  • Properly position your motorcycle well on the road
  • See and be seen
  • Use RiderRadar to avoid traps, and focus your mental processing to make good, quick judgments while riding
@triangletodd
triangletodd / console.log
Last active February 24, 2023 20:19
Passing environment variables to docker run
$ TEST_1=one
$ TEST_2=two
$ PATTERN2_1=one
$ PATTERN2_2=two
$ docker run -d --name test $(for var in $(set | grep -E '^TEST_|^PATTERN2_'); do printf -- '-e "%s" ' $var; done) nginx
541a23d4e432b375f71b081593d533de0aeb0b918f74d911bee7c36c95bcc4e3
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
@triangletodd
triangletodd / update_discord.sh
Created December 5, 2020 04:29
Update Discord on Debian
#!/usr/bin/env bash
set -e
trap "{ rm -f $tmpfile; }" EXIT
tmpfile="$(mktemp)"
main() {
curl -Lo "$tmpfile" 'https://discord.com/api/download?platform=linux'
sudo dpkg -i "$tmpfile"
@triangletodd
triangletodd / README.md
Last active April 23, 2024 00:51
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
@triangletodd
triangletodd / cloudflare.inc.sh
Created November 5, 2019 06:35
Bash functions for interacting with the Cloudflare v4 API
#!/usr/bin/env bash
export CF_CURL_OPTS=()
export CF_V4_API='https://api.cloudflare.com/client/v4'
_cf_exit() {
# if being called directly, don't exit
if [ ${#FUNCNAME[@]} -eq 0 ]; then
return 1
fi
exit 1
@triangletodd
triangletodd / feature_flipper.rb
Last active December 12, 2020 22:41
Ruby Feature Flipper
#!/usr/bin/env ruby
require 'redis'
require 'flipper'
require 'flipper/adapters/redis'
class Feature
ENABLED = Flipper::Actor.new(true)
DISABLED = Flipper::Actor.new(false)
def initialize
@triangletodd
triangletodd / gcr_cleanup.sh
Last active May 24, 2019 09:40
GCR Image Cleanup - list or delete all but the 5 newest tags for all images in a GCR repository
#!/usr/bin/env bash
# Exit if no arguments are passed
if [ $# -lt 1 ]; then
cat << HELP
gcr_cleanup -- list or delete all but the 5 newest tags for all images
EXAMPLE:
- list all but the 5 newest tags for all images
@triangletodd
triangletodd / k8s_secret.code-snippets.json
Last active May 24, 2019 09:42
VSCode Kubernetes Snippets
{
"k8s_secret": {
"prefix": "k8s_secret",
"scope": "plaintext,yaml",
"body": [
"apiVersion: v1",
"kind: Secret",
"metadata:",
" name: ${1:secret_name}",
"type: Opaque",
@triangletodd
triangletodd / Chassis.stl
Last active December 12, 2020 22:44
Wifi Pineapple Quad
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@triangletodd
triangletodd / sparse_clone.sh
Created February 28, 2019 22:06
Sparse git clone (clone a single subdirectory from a repo)
mkdir config
cd config
git init
git remote add -f origin https://github.com/cockroachdb/cockroach
git config core.sparseCheckout true
echo "cloud/kubernetes" >> .git/info/sparse-checkout
git pull origin master