Skip to content

Instantly share code, notes, and snippets.

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

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
@crowjdh
crowjdh / F*ckYouBigSur.md
Last active November 22, 2022 08:10
Sometimes you just really want BigSur to just shut the fu*k up.

Prerequisite

  • Disable auto update check from System Preferences -> Software Update
  • Dismiss update notification

Disable Apple Software Update Domain

  • Add entries below to /etc/hosts
    127.0.0.1 swscan.apple.com
    127.0.0.1 swcdn.apple.com

127.0.0.1 swdist.apple.com

defaults write com.apple.systempreferences AttentionPrefBundleIDs 0 && killall Dock

Resources

Hardware

  • MBP Retina mid 2012

OS

  • Main: MacOS Catalina
  • Second: Windows 10 Home Edition
  • Third: Kali Linux 2020.4

Install Windows via BootCampAssistant

@jthodge
jthodge / universal-switcher
Created September 6, 2020 22:07
Show macOS app switcher across all monitors
defaults write com.apple.Dock appswitcher-all-displays -bool true
killall Dock
@kabili207
kabili207 / Rclone systemd service.md
Last active May 6, 2024 03:20
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox

Volume

OVPN_DATA="openvpn-data"
docker volume create --name $OVPN_DATA

Server

docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm mjenz/rpi-openvpn ovpn_genconfig -u udp://your.vpnhost.com