Skip to content

Instantly share code, notes, and snippets.

View rmetzler's full-sized avatar
💭
Recruiters should mention the role and salary range if you spam me.

Richard Metzler rmetzler

💭
Recruiters should mention the role and salary range if you spam me.
View GitHub Profile
def smiley
# this is also possible
# %w[ :-) X-) ;-) :-( B-D B-D ].sample
[":-)", "X-)", ";-)", ":-(", "B-D"].sample
end
(0..100).each {|x| puts "#{ ' '*x }#{smiley}"}
@rmetzler
rmetzler / nix.sh
Created February 12, 2024 19:59 — forked from vfarcic/nix.sh
# Source: https://gist.github.com/vfarcic/8ebbf4943c5c012c8c98e1967fa7f33b
#####################################################################
# Say Goodbye to Containers - Ephemeral Environments with Nix Shell #
#####################################################################
# Additional Info:
# - Nix: https://nixos.org
# - Dagger: The Missing Ingredient for Your Disastrous CI/CD Pipeline: https://youtu.be/oosQ3z_9UEM
<#
Create Unix VM's.
PREREQUISITES:
- A VM that has been installed with an OS that supports cloud-init
- cloud-init is installed on the vm
How it works:
- Asks for a bunch of parameters
- Creates a disk from parent vhdx for speed
@rmetzler
rmetzler / assume-role.sh
Created October 23, 2023 08:42 — forked from mbarneyjr/assume-role.sh
aws sts assume-role one-liner
export $(aws sts assume-role --role-arn arn:aws:iam::$TARGET_ACCOUNT_ID:role/ci-access --role-session-name ci --output text --query "[['AWS_ACCESS_KEY_ID',Credentials.AccessKeyId],['AWS_SECRET_ACCESS_KEY',Credentials.SecretAccessKey],['AWS_SESSION_TOKEN',Credentials.SessionToken]][*].join(\`=\`,@)")
@rmetzler
rmetzler / install-chrome.ps1
Created June 1, 2023 08:35 — forked from timothywarner/install-chrome.ps1
Install Chrome browser with a PowerShell one-liner
$Path = $env:TEMP; $Installer = 'chrome_installer.exe'; Invoke-WebRequest -Uri 'http://dl.google.com/chrome/install/375.126/chrome_installer.exe' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args '/silent /install' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer
# Thank you, nicolaigj!
@rmetzler
rmetzler / DefaultKeyBinding.dict
Created October 19, 2022 14:04 — forked from padde/DefaultKeyBinding.dict
Disable non-breaking space (Alt+Space) on OS X
# in ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"~ " = ("insertText:", " ");
}
# Source: https://gist.github.com/d8113b6f149583e1cf1614d76f2a4182
#####################################################################
# How To Create, Provision, And Operate Kubernetes With Cluster API #
# https://youtu.be/8yUDUhZ6ako #
#####################################################################
# Referenced videos:
# - Should We Replace Docker Desktop With Rancher Desktop?: https://youtu.be/bYVfCp9dRTE
# Source: https://gist.github.com/c7cdfef142bd65cc744789d3c1e90170
###########################################
# Talos Linux: OS Designed For Kubernetes #
# https://youtu.be/iEFb2Zg4xUg #
###########################################
# Additional Info:
# - Talos Linux: https://www.talos.dev/
# - How To Create, Provision, And Operate Kubernetes With Cluster API (CAPI): https://youtu.be/8yUDUhZ6ako
@rmetzler
rmetzler / fsnotifytest.go
Created February 1, 2022 13:44 — forked from db47h/fsnotifytest.go
fsnotify test
package main
import (
"io/ioutil"
"log"
"gopkg.in/fsnotify.v1"
)
func main() {
#!/bin/bash
export B2_ACCOUNT_ID=<your keyID here>
export B2_ACCOUNT_KEY=<your key here>
export RESTIC_PASSWORD=<your restic repository password here>
command1="restic -r b2:mybucket-desktop-backups:alfred/ backup /home/eric/Documents/ 2>&1"
output1=$(eval "${command1}")
result1=$?