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 May 3, 2024 15:10
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 / 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 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 / bs_deb_stretch_vbox.sh
Created December 25, 2017 05:54
Debian Stretch Virtualbox VM.
#!/usr/bin/env bash
set -e
PACKAGES="i3 tmux vim stow"
read -d '' APT_SRC <<"EOF" ||:
deb http://mirrors.kernel.org/debian/ stretch main contrib non-free
deb http://security.debian.org/debian-security stretch/updates main
deb http://mirrors.kernel.org/debian/ stretch-updates main contrib non-free
deb http://mirrors.kernel.org/debian stretch-backports main contrib non-free
@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 / debugging_ios_uiautomation.js
Last active December 12, 2020 22:44
IOS UIAutomation Debugging
function dumpElementTree() {
UIALogger.logStart("Logging element tree ...");
UIATarget.localTarget().logElementTree();
UIALogger.logPass();
}
function inspect(obj) {
var log = UIALogger;
var methods = [];
@triangletodd
triangletodd / fizzbuzz.rb
Last active December 12, 2020 22:43
Ruby Fizzbuzz
#!/usr/bin/env ruby
# Requires Ruby 2.1
# BUT.. Keeps the code clean without monkey patching
module Refinements
refine Integer do
def div_by?(int)
self % int == 0
end
end
@triangletodd
triangletodd / currencies.yml
Created January 23, 2017 20:57
Currencies
---
- :code: AED
:description: UAE Dirham
:notes: "United Arab Emirates"
- :code: AFA
:description: Afghani
:notes: "Afghanistan. DEPRECATED, replaced by AFN"
- :code: AFN
:description: Afghani
:notes: "Afghanistan (prices normally quoted as integers)"
@triangletodd
triangletodd / gdrive_to_yml.rb
Last active December 12, 2020 22:43
GDrive to YAML
#!/usr/bin/env ruby
require 'pry'
require 'yaml'
require 'google_drive'
GDRIVE_USER = ENV['GDRIVE_USER'] || raise('Please set the GDRIVE_USER environment variable')
GDRIVE_PASS = ENV['GDRIVE_PASS'] || raise('Please set the GDRIVE_USER environment variable')
YML_FILE = 'apple_app_info.yml'
data = {}