Skip to content

Instantly share code, notes, and snippets.

docker exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" -ti container bash
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
def bytes_to_bits(bytes):
bits_repr = bin(int(bytes, base=16))[2:]
bits = []
for end_idx in range(len(bits_repr) - 1, 0 - 1, -4):
end_idx = end_idx + 1
start_idx = max(0, end_idx - 4)
bits_chunk = bits_repr[start_idx:end_idx]
bits.append(bits_chunk)

⚠️ Make sure you know what you're doing: Be very careful here!

  • Boot into recovery mode by pressing ⌘ + r after bootup sound and before apple logo show up
  • Open Terminal and remove e[x]ecute flag from MobileDeviceUpdater binary:
    cd /Volumes/Macintosh\ HD/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/Resources/MobileDeviceUpdater.app/Contents/MacOS/
    chmod 644 MobileDeviceUpdater
  • Reboot normally
echo "Core Clock: "$(vcgencmd measure_clock core | sed -E "s/.*=//g" $STDIN);
echo "Core Volts: "$(vcgencmd measure_volts core | sed -E "s/.*=//g" $STDIN);
echo "Temperature: "$(vcgencmd measure_temp | sed -E "s/.*=//g" $STDIN);
echo "Throttled: "$(vcgencmd get_throttled | sed -E "s/.*=//g" $STDIN);
def hex_to_bin_repr(hex):
a = bin(int(hex, 16))[2:]
b = ''.join(list(reversed(a)))
return ' '.join(list(reversed([''.join(list(reversed(b[i:i+4]))) for i in range(0, len(b), 4)])))
curl HOST_URL -w "\n%{time_connect}:%{time_starttransfer}:%{time_total}\n"

Expand pkg

$ pkgutil --expand GoogleDrive.pkg GoogleDrive.unpkg

Remove unnecessary pkg files

$ rm -rf GoogleDrive.unpkg/GARBAGE.pkg
@crowjdh
crowjdh / f*ck_you_google_software_update.sh
Created October 10, 2021 10:37
Sometimes you just really want GoogleSoftwareUpdate to just get lost.
#!/bin/bash
# Uninstall Keystone
$ cd ~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers
$ ./ksinstall --nuke
# Lock out ~/Library/Google/GoogleSoftwareUpdate
$ cd ~/Library/Google
$ mkdir GoogleSoftwareUpdate
$ sudo chown root GoogleSoftwareUpdate
|---------------|                   
|               |                   |---------------|
|               |                   |               |
|      Host     |  1. SSH Tunnel    |               |
|     Behind    |==================>|      My       |
|  Firewall(A)  |<------------------|   Device(B)   |
|               |  2. Reverse SSH   |               |
|               |==================>|               |
|---------------|                   |---------------|