Skip to content

Instantly share code, notes, and snippets.

View ltzany's full-sized avatar

John Mahoney IV ltzany

View GitHub Profile
@prologic
prologic / LearnGoIn5mins.md
Last active July 10, 2025 04:38
Learn Go in ~5mins
@WesleyAC
WesleyAC / build.sh
Last active June 1, 2025 09:19
Simple rust build and deploy script — https://blog.wesleyac.com/posts/simple-deploy-script
#!/usr/bin/env bash
cd $(dirname $0)
docker run --rm -it -v "$(pwd)":/home/rust/src -v cargo-git:/home/rust/.cargo/git -v cargo-registry:/home/rust/.cargo/registry -v "$(pwd)/target/":/home/rust/src/target ekidd/rust-musl-builder:nightly-2021-01-01 sudo chown -R rust:rust /home/rust/.cargo/git /home/rust/.cargo/registry /home/rust/src/target
docker run --rm -it -v "$(pwd)":/home/rust/src -v cargo-git:/home/rust/.cargo/git -v cargo-registry:/home/rust/.cargo/registry -v "$(pwd)/target/":/home/rust/src/target ekidd/rust-musl-builder:nightly-2021-01-01 cargo build --release
@admun
admun / setup_democratic_csi_rke_1_20_4.md
Last active April 1, 2025 11:24
My journey migrating off nfs-client-provisioner, since it's deprecated and broken in k8s 1.20.4...

I recently upgraded my rancher RKE cluster to 1.20.4, and found that nfs-client-proisioner is broken. It failed to create new PVC with an "unexpected error getting claim reference: selfLink was empty, can't make reference" error.

After some google search I found this. However, there is no documentation on how to migrate from nfs-client-provisioner, even it seems to fixed the issue.

When asking around in #sig-storage, @thansen suggested to give democratic-csi a try, which has a crude yet simple implementation of nfs-client as a CSI driver.

Here's capture how I get it to work, after helps from @thansen

My setup: RKE cluster on k8s v1.20.4, 3x Fedora 33 node, managed by Rancher 2.5.6, NFS server on a Thecus N5550, nfs-client-provisioner used for dynamic PVC provisioning.

AWS Certification Resources

Preparing for the AWS Cloud Practitioner Exam (earned Feb 2020)

ACloudGuru.com has a good course and practice test available to help you score >90% found here.

Preparing for the AWS Solutions Architect Exams (Associate and Pro) (earned in 2020)

ACloudGuru's course does not go in-depth enough for either of these exams I have found. I found the best, super in-depth training from a former Linux Academy instructor, Adrian Cantrill. ACloudGuru purchased Linux Academy in 2020, and unfortunately, most of their content was retired :( Adrian has started his own set of reasonably priced courses under his name, and they are here.

Preparing for the AWS Developer Associate Exam (earned Oct 2022)

@motorailgun
motorailgun / idea.md
Last active April 11, 2025 11:36
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@mauvehed
mauvehed / enable_to_sudo_authenticate_with_touch_id.sh
Last active September 27, 2024 21:59
Enable sudo auth for macOS touchID via pam
#!/bin/bash
#
# credit to machupicchubeta/dotfiles/bin/enable_to_sudo_authenticate_with_touch_id.sh
set -eu
set -o pipefail
sudo chmod +w /etc/pam.d/sudo
if ! grep -Eq '^auth\s.*\spam_tid\.so$' /etc/pam.d/sudo; then
( set -e; set -o pipefail
# Add "pam_tid.so" to a first authentication

2019-05-18

Jonathan Blow on societal collapse

It's uncanny how closely this talk follows a line of reasoning I've been working on lately. If you're copied here, we may have discussed one or more of its aspects

https://www.youtube.com/watch?v=pW-SOdj4Kkk

(Jonathan Blow is an independent video game developer, speaking here at a conference in Moscow.)

@ryancdavison
ryancdavison / iPad-Pro-Magic-Keyboard-Portrait-Mode-DIY-Smart-Connector-Cable.md
Last active July 3, 2025 14:23
iPad Pro 12.9 (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

iPad Pro 12.9" (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

I wanted my iPad Pro to be able to use the Magic Keyboard in portrait mode, but the current Smart Connector configuration does not allow this. With too much time on my hands, I made a short jumper cable using a section of USB cable, 5-pin POGO connectors (the 5-pin works using pins 1, 3, and 5, and removing pins 2 and 4), a small electrical project box, 3mm N52 magnets, and some epoxy and Sugru to pack everything into place. My cable and connections orientation had more to do with the boxes I found to encase the connector (with holes on the small end) than anything else. Obviously, there will be many ways to do this.

WARNING: Getting any of these steps wrong will probably ruin your iPad.

Note: These measurements are for the 12.9" (2020) model. The magnets did not line up and the polarity was different for my wife's iPad Pro 11" (2021).

![iPad-Pro-MmagicKeyboard-Jumper-Cable-min](https://user-images.githubusercontent.c

@milesrichardson
milesrichardson / inherit_environment_variables_from_pid_1.md
Created January 21, 2023 07:35
inherit environment variables from PID 1

You can inherit the environment variables from PID 1 by iterating over the list of null-terminated strings in /proc/1/environ, parsing the first characters up to the first = as the variable name, setting the remaining value as that variable, and exporting it.

The Code Snippet

This works with multiline environment variables, and environment variables with arbitrary values, like strings, including = or JSON blobs.

Paste this in your current terminal session to inherit the environment variables from PID 1:

@kconner
kconner / macOS Internals.md
Last active July 10, 2025 04:32
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options: