Skip to content

Instantly share code, notes, and snippets.

@joevt
joevt / dumpvols.sh
Created Jan 16, 2021
A script to help with diagnosing legacy BIOS boot issues on Macs
View dumpvols.sh
#!/bin/bash
#
# Get Partition Info from all disks
#
# Written by joevt updated Dec 29. 2020
# Patches marked "rgh" July, 2010, to dump information beyond the
# four bios partitions
#
# sudo ./dumpvols.sh > dumpvols_result.txt 2>&1
#
@joevt
joevt / M1MacTimings.sh
Last active Aug 1, 2021
List the display timings on an M1 Mac
View M1MacTimings.sh
#!/bin/bash
# by joevt Jan 7/2021
dodump=1
if [[ "$1" == "-s" ]]; then
dodump=0
shift
fi
@joevt
joevt / KextUtil.sh
Last active Apr 6, 2021
Commands for kexts
View KextUtil.sh
# by joevt Dec 30, 2020
checkkext () {
local thekextpath="$1"
if [[ -d "$thekextpath" ]]; then
if [[ -f "$thekextpath/Contents/Info.plist" ]]; then
local kextname="$(basename "$thekextpath")"
if [[ "$kextname" =~ ".*\.kext" ]]; then
local kextidentifier=""
kextidentifier="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$thekextpath/Contents/Info.plist" 2> /dev/null)"
@joevt
joevt / ioreg.pl
Last active Mar 16, 2021
perl script parses ioreg output, can output JSON, dumps M1 Mac display timings.
View ioreg.pl
#!/bin/perl
# by joevt Dec 30, 2020
use 5.010;
use strict;
#use warnings;
use Data::Dumper qw(Dumper);
use JSON::PP;
@joevt
joevt / DiskUtil.sh
Last active Aug 6, 2021
macOS disk labels, mounting partitions
View DiskUtil.sh
#!/bin/bash
# by joevt Aug 5, 2021
directblesscmd="/Volumes/Work/Programming/XcodeProjects/bless/bless-204.40.27 joevt/DerivedData/bless/Build/Products/Debug/bless"
usedirectbless=0
if [[ -d /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS ]]; then
if [[ ! -f "$directbless" ]]; then
echo "# Download and build bless from https://github.com/joevt/bless , then update the path of directbless defined in DiskUtil.sh"
else
usedirectbless=1
@joevt
joevt / gfxutil.sh
Last active Aug 23, 2021
macOS nvram boot variables, device properties, EFI device paths
View gfxutil.sh
#!/bin/bash
# joevt Aug 22, 2021
# https://forums.macrumors.com/threads/documentation-on-all-parameters-for-nvram.2239034/post-28518123
gfxutilcmd=~/Downloads/gfxutil
alias gfxutil='"$gfxutilcmd"'
directblesscmd="/Volumes/Work/Programming/XcodeProjects/bless/bless-204.40.27 joevt/DerivedData/bless/Build/Products/Debug/bless"
usedirectbless=0
if [[ -d /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS ]]; then
@joevt
joevt / ThunderboltUtil.sh
Last active Aug 26, 2021
A set of functions to examine and modify Thunderbolt DROMs
View ThunderboltUtil.sh
# by joevt Jul 7, 2020
#=========================================================================================
#
#
# Thunderbolt DROM Notes:
#
#
# https://lore.kernel.org/patchwork/patch/714766/
#
@joevt
joevt / pcitree.sh
Last active Aug 29, 2021
A bash script to produce more informative output than lspci -nntv
View pcitree.sh
#!/bin/bash
# by joevt May 8, 2020
#===================
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root like this:"
echo "sudo $0"
exit 1
fi
#===================
@joevt
joevt / EDIDUtil.sh
Last active Sep 25, 2021
A set of shell functions used to view and edit EDIDs.
View EDIDUtil.sh
#!/bin/bash
#!/bin/zsh
# by joevt Sep 25/2021
#=========================================================================================
edid_decode=edid-decode
#=========================================================================================
# Modify EDID