Skip to content

Instantly share code, notes, and snippets.

View bradcosine's full-sized avatar
👋

Brad Inscoe bradcosine

👋
View GitHub Profile
@BertanT
BertanT / guide_macskeyinstaller.md
Last active April 18, 2025 22:43
macOS OpenSSH Client Patcher for Hardware Security Key Support (ED25519-SK With YubiKey Etc.)

🔐 macOS OpenSSH Patcher for Hardware Security Keys

Supports ED25519-SK with Yubikey and other FIDO2 hardware security keys!

🤔 Discussion

Despite being compiled to support hardware security keys that take advantage of the FIDO2 protocol, the built-in OpenSSH client on macOS Sonoma and above lacks the middleware/library to support these devices. To keep using the built-in client - which is often the most stable and secure method for SSH connections - we need to compile the Security Key Provider from OpenSSH source and tell the macOS client about it ourselves.

This script does all of that for you on both Apple Silicon and Intel Mac computers!

The script installs openssl and libfido2 along with the required build tools from Homebrew. It then clones the latest main branch of OpenSSH Portable and builds from it the Security Key Provider library: sk-libfido2.dylib. It finally moves the built library to /usr/local/lib/, modifies ~/.zshenv to expor

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<!-- Partytown config -->
<script>
partytown = {
debug: true,
@davidcorbin
davidcorbin / script.sh
Last active February 25, 2025 05:59
Remove Rancher from Cluster - Force Delete CRDs
# Manually remove finalizers
kubectl edit -n cattle-system secret tls-rancher
kubectl patch secret tls-rancher -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl patch namespace cattle-system -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl delete namespace cattle-system --grace-period=0 --force
kubectl patch namespace cattle-global-data -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl delete namespace cattle-global-data --grace-period=0 --force
@cmendible
cmendible / kubectl_ubuntu_wsl.sh
Created November 16, 2019 22:02
Install kubectl on ubuntu (WSL) and use kubectl config from Windows
#!/bin/bash
# Receives your Windows username as only parameter.
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
windowsUser=$1
@giggio
giggio / settings.json5
Last active August 22, 2024 01:47
Giovanni Bassi's Windows terminal config
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema-preview",
// "$schema": "https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json", // canary
// "$schema": "https://aka.ms/terminal-profiles-schema-preview", // preview
// "$schema": "https://aka.ms/terminal-profiles-schema", // stable
"actions":
[
{
"command":
@npearce
npearce / install-docker.md
Last active April 26, 2025 04:27
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@christrotter
christrotter / Filebeat-IIS-Setup.ps1
Last active June 7, 2017 17:45
Powershell install of filebeat for IIS in EC2
function PostToSlack {
Param([string]$message)
$wc = New-Object net.webclient
$wc.UploadString("https://hooks.slack.com/services/random/moreRandom", (ConvertTo-Json @{ text = ("$message") }))
}
###################################
### Modules ###
Import-Module WebAdministration
###################################
@Sirfrummel
Sirfrummel / Statistics.js
Last active January 9, 2020 23:43
Loading Segment.io analytics.js open source version async
// Create a dummy analytics object until real loaded
window.analytics || (window.analytics = []);
window.analytics.methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off'];
window.analytics.factory = function(method) {
return function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(method);
window.analytics.push(args);
return window.analytics;
};
@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active April 20, 2025 05:41
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@ianblenke
ianblenke / .ebextensions_00_tune_ec2.config_.yaml
Created July 23, 2015 19:12
Tuning EC2 with an ElasticBeanstalk ebextension
packages:
yum:
wget: []
curl: []
commands:
00_remove_99_swap.conf.bak:
command: rm -f /etc/sysctl.d/99_swap.conf.bak
test: test -f /etc/sysctl.d/99_swap.conf.bak
ignoreErrors: true
00_remove_99_filesystem.conf.bak: