Skip to content

Instantly share code, notes, and snippets.

View lodestone's full-sized avatar
:octocat:
🤘Grokking Out 🤘

Matt Petty lodestone

:octocat:
🤘Grokking Out 🤘
View GitHub Profile
@lodestone
lodestone / 100.conf
Created October 14, 2024 20:59 — forked from mallendeo/100.conf
Windows 11 Gaming VM on Proxmox VFIO
##/etc/pve/qemu-server/100.conf
##Network and disks not included in this example
##Set halt_poll_ns
#set_halt_poll 0
##CPU pinning
#cpu_taskset 1-7
#assign_interrupts --sleep=10s 1-7 --all
agent: 1
@lodestone
lodestone / mac-network-commands-cheat-sheet.md
Created September 26, 2024 08:13 — forked from jjnilton/mac-network-commands-cheat-sheet.md
Mac Network Commands Cheat Sheet

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

The original author seems to be Charles Edge, here's the original content, as pointed out by @percisely.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and s

@lodestone
lodestone / gist:ca0adf22a9e64457d45c29c7ce78a718
Created October 17, 2023 09:42 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2016 Matt Menzenski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@lodestone
lodestone / gfxutil.sh
Created October 26, 2021 17:59 — forked from joevt/gfxutil.sh
macOS nvram boot variables, device properties, EFI device paths
#!/bin/bash
# joevt Oct 11, 2021
# https://forums.macrumors.com/threads/documentation-on-all-parameters-for-nvram.2239034/post-28518123
gfxutilcmd=~/Downloads/gfxutil/gfxutil
if [[ ! -f $gfxutilcmd ]]; then
gfxutilcmd=~/Downloads/gfxutil
fi
if [[ ! -f $gfxutilcmd ]]; then
gfxutilcmd="/Volumes/Work/Programming/EFIProjects/gfxutil/joevt-gfxutil/DerivedData/gfxutil/Build/Products/Debug/gfxutil"
@lodestone
lodestone / TrueColour.md
Last active April 30, 2021 13:38 — forked from XVilka/TrueColour.md
Terminal/Console/Shell Color Sequence Cheat Sheet

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@lodestone
lodestone / me-and-blade-chatting.csv
Last active November 6, 2020 15:36
Log of me and Blade the Vampire Hunter have a chat. (Just testing CSV rendering on gist.github.com)
date person message
2020-10-21 22:04:50 Matt Oh hey! Are you Blade? That half-vampire vampire-hunter?
2020-10-21 22:04:52 Blade ___
2020-10-21 22:05:45 Matt Um. Okay yeah. You're busy all hackin' and slashin' all these vamparoonies about.
2020-10-21 22:04:47 Blade ___
2020-10-21 22:05:55 Matt Uh if you ever want to keep your black leather clothes clean and still hack n slash - you can join my D&D game.
2020-10-21 22:06:08 Blade ___
2020-10-21 22:06:15 Blade I will play this Dee and Dee. On one condition - I must play a bard.
2020-10-21 22:06:25 Blade Text the number carved into the chest of this dying vampire before it turns to dust.
@lodestone
lodestone / appify
Created June 23, 2020 13:17 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@lodestone
lodestone / bytes.rb
Created June 11, 2020 10:08 — forked from ttscoff/bytes.rb
Convert file sizes between human-readable and machine representations
#!/usr/bin/ruby
module Bytes
def to_human(n,fmt=false)
count = 0
formats = %w(B KB MB GB TB PB EB ZB YB)
while (fmt || n >= 1024) && count < 8
n /= 1024.0
@lodestone
lodestone / bulk-remove-iterm-colors.sh
Created May 5, 2020 23:50 — forked from dedy-purwanto/gist:11312110
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist