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
Created June 12, 2024 04:27
When to Use Deployment Protection Rules vs. Rulesets in GitHub Enterprise

When to Use Deployment Protection Rules vs. Rulesets in GitHub Enterprise

Deployment Protection Rules

Deployment protection rules are used to enforce checks and policies specifically around the deployment of code to environments. You would use a deployment protection rule when you want to ensure that certain conditions are met before code can be deployed. This can include:

  • Security Checks: Ensuring that security scans or vulnerability assessments have been completed and passed.
  • Approval Processes: Requiring manual approvals from designated reviewers or teams before deployment.
  • Integration with External Systems: Verifying that external systems or services have approved the deployment.
@triangletodd
triangletodd / Private Github Workflows.png
Last active June 12, 2024 02:49
Private Required GitHub Workflows
Private Github Workflows.png
@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 June 18, 2024 14:46
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",