Skip to content

Instantly share code, notes, and snippets.

@joevt
joevt / EDIDUtil.sh
Last active January 14, 2024 16:48
A set of shell functions used to view and edit EDIDs.
#!/bin/bash
#!/bin/zsh
# by joevt May 24/2023
#=========================================================================================
edid_decode=edid-decode
#=========================================================================================
# Modify EDID
@joevt
joevt / pcitree.sh
Last active February 8, 2024 00:44
A bash script to produce more informative output than lspci -nntv
#!/bin/bash
# by joevt Feb 6, 2024
# Jan 22, 2023 - Updated to work in Mac OS X 10.4.
# Jan 30, 2023 - Fixed the method options.
# Apr 7, 2023 - Fixed parse of unknown prog-if and move temp files to separate tmp directory.
# Feb 6, 2024 - Fix column alignment.
#===================
if [[ $EUID -ne 0 ]]; then
@joevt
joevt / ThunderboltUtil.sh
Last active April 7, 2024 09:31
A set of functions to examine and modify Thunderbolt DROMs
#! /bin/zsh
# ThunderboltUtil.sh v1.6
# by joevt Apr 2, 2024
#=========================================================================================
#
#
# Thunderbolt DROM Notes:
#
#
@joevt
joevt / gfxutil.sh
Last active October 9, 2023 16:15
macOS nvram boot variables, device properties, EFI device paths
#!/bin/bash
# joevt Jun 13, 2023
# https://forums.macrumors.com/threads/documentation-on-all-parameters-for-nvram.2239034/post-28518123
gfxutilrepository="/Volumes/Work/Programming/EFIProjects/gfxutil/joevt-gfxutil"
for gfxutilcmd in \
~/Downloads/gfxutil/gfxutil \
~/Downloads/gfxutil \
"$gfxutilrepository/build/Release/gfxutil" \
"$gfxutilrepository/build/Debug/gfxutil" \
@joevt
joevt / DiskUtil.sh
Last active May 11, 2023 06:34
macOS disk labels, mounting partitions
#!/bin/bash
# by joevt May 10, 2023
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 ]]; then
if [[ ! -f "$directblesscmd" ]]; 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 / ioreg.pl
Last active March 10, 2024 08:39
perl script parses ioreg output, can output JSON, dumps M1 Mac display timings.
#!/bin/perl
# by joevt Nov 18, 2021
use 5.010;
use strict;
#use warnings;
use Data::Dumper qw(Dumper);
use JSON::PP;
@joevt
joevt / KextUtil.sh
Last active February 10, 2024 11:55
Commands for kexts
#!/bin/bash
# joevt Feb 10, 2024
#10.4 Tiger to 10.13 High Sierra
kextload=kextload
# Later macOS versions
command -v kextutil > /dev/null && kextload=kextutil
getkextidentifier () {
@joevt
joevt / M1MacTimings.sh
Last active September 3, 2022 15:30
List the display timings on an M1 Mac
#!/bin/bash
# by joevt Jan 7/2021
dodump=1
if [[ "$1" == "-s" ]]; then
dodump=0
shift
fi
@joevt
joevt / dumpvols.sh
Last active March 16, 2024 10:31
A script to help with diagnosing legacy BIOS boot issues on Macs
#!/bin/bash
#
# Get Partition Info from all disks
#
# Written by joevt updated March 16, 2024
# Patches marked "rgh" July, 2010, to dump information beyond the
# four bios partitions
#
# sudo ./dumpvols.sh > dumpvols_result.txt 2>&1
#
@joevt
joevt / VolumeIconUtil.sh
Last active March 10, 2024 08:38
Script for working with macOS icns files
#!/bin/bash
# joevt May 1, 2023
alias icns2icns=/Volumes/Work/Programming/XcodeProjects/Icons/osxiconutils/joevt-osxiconutils/DerivedData/osxiconutils/Build/Products/Debug/icns2icns
alias icns2image=/Volumes/Work/Programming/XcodeProjects/Icons/osxiconutils/joevt-osxiconutils/DerivedData/osxiconutils/Build/Products/Debug/icns2image
alias image2icns=/Volumes/Work/Programming/XcodeProjects/Icons/osxiconutils/joevt-osxiconutils/DerivedData/osxiconutils/Build/Products/Debug/image2icns
patmatch () {
# substitute for [[ =~ ]] for Mac OS X 10.4
perl -0777 -ne '<>; exit !( $_ =~ /'"$1"'/ )'