Skip to content

Instantly share code, notes, and snippets.

View ink-splatters's full-sized avatar

Peter A. ink-splatters

View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

This file has been truncated, but you can view the full file.
nick@Nicks-MacBook-Air-4 vma2pwn % tart run 12.0.1 --force-dfu
89994699affdef:132
9905b4edc794469:695
9905b4edc794469:695
e2846af5eb52553:475
9526cec925bde03:111
image <ptr>: bdev <ptr> type illb offset 0x20000 len 0x49cde
image <ptr>: bdev <ptr> type logo offset 0x69cde len 0x42e6
ae71af5ee32b84:116
@Cryptiiiic
Cryptiiiic / ios16_downgrading.txt
Created March 1, 2023 00:10
The unfortunate state of iOS downgrading
Unfortunately I have some bad news for downgrading.
Before I explain the bad news at the end of this post, I first need to introduce a background of iOS devices.
In iOS 16, Apple introduced a new firmware component known as Cryptex1. Technically, this is a "virtual" co-processor.
It's purpose is to allow Apple to push RSRs (Rapid Security Responses) which are separate from traditional iOS updates and can be installed much faster.
Like other firmwares, it also has a signing ticket locked to a cryptographic nonce (number-used-once).
We commonly refer to the Apple signing tickets as SHSH blobs.
Meaning the firmware can't be installed without a valid signing ticket as well as a matching nonce.
The "big two" components we deal with signing/nonces are AP and SEP. AP is basically the main device chip (Application Processor).
SEP is the security chip (Secure Enclave Processor).
With regards to APNonce, Apple conveniently gave us the com.apple.System.boot-nonce NVRAM property which we use to set the APNonce generator.
@eddy-22
eddy-22 / awesome-mac-cli-apps.md
Created February 16, 2023 22:36
MacOS Cool Stuff

A curated list of useful command line apps, in celebration of the TUI.

“Knowledge brings fear” (Mars University Mission Statement)

Awesome

If you want to contribute, you are highly encouraged to do so. Please read the contribution guidelines.

@nat-418
nat-418 / nix-home-manager-neovim-setup.md
Last active April 23, 2024 19:43
Manage Neovim plugins (and more!) with Nix and Home Manager

Manage Neovim plugins (and more!) with Nix and Home Manager

Highly extensible software like Emacs, Vim, and Neovim tend to grow their own package managers. A software developer, for example, might want to install editor plugins that hook into a particular programming language's linter or language server. The programmer's text editor is therefore extended to support managing additional software to extend the text editor. If this loop continues for too long, the programmer's editor becomes more delicate and complex. The remedy for this problem is to manage software using dedicated tools apart

@macshome
macshome / defang.md
Last active April 24, 2024 18:31
How to defang system protections on macOS

How to Defang macOS System Protections

If you want to change things on the root drive of a Mac you will need to take some steps to disable the built in security of the system. Most of these steps are the same regardless if you are on Intel or Apple Silicon. If there is a difference it is noted.

Note that all of these things put a Mac into an unsupported and less secure state.

Make sure you either perform these steps in a VM or that you reset the protections after you are done poking around

Protections and Terms

(This list is not exahustive on the details of each. Check the links at the end for more info.)

@belm0
belm0 / article_sc_and_lua_1.md
Last active September 21, 2023 06:37
Structured concurrency and Lua (part 1)

Structured concurrency and Lua (part 1)

John Belmonte, 2022-Sep

I've started writing a toy structured concurrency implementation for the Lua programming language. Some motivations:

  • use it as a simple introduction to structured concurrency from the perspective of Lua (this article)
  • learn the fundamental properties of structured concurrency and how to implement them
  • share code that could become the starting point for a real Lua library and framework

So what is structured concurrency? For now, I'll just say that it's a programming paradigm that makes managing concurrency (arguably the hardest problem of computer science) an order of magnitude easier in many contexts. It achieves this in ways that seem subtle to us—clearly so, since its utility didn't reach critical mass until around 2018[^sc_birth] (just as control structures like functions, if, and while weren't introduced to languages until long after the first compu

@r281GQ
r281GQ / darwin.nix
Last active March 19, 2023 20:25
wezterm nixos
{ config, pkgs, ... }:
let
p = import ./test.nix;
pkgsM1 = import <nixpkgs> { overlays = []; };
inherit (import <nixpkgs> {}) fetchFromGitHub lib;
inherit (pkgsM1) ffmpeg imagemagick tmux zsh starship gnupg nodejs-14_x nodejs-16_x postgresql_13 rustup;
@gubiithefish
gubiithefish / CreateMontereyISO.sh
Created April 6, 2022 21:03
Create macOS 12.3.1 Monterey ISO for Virtual machines
softwareupdate --fetch-full-installer --full-installer-version 12.3.1
sudo hdiutil create -o /tmp/Monterey -size 16384m -volname Monterey -layout SPUD -fs HFS+J
sudo hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey
sudo /Applications/Installer\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction
hdiutil detach -force '/Volumes/Install macOS Monterey'
hdiutil convert /tmp/Monterey.dmg -format UDTO -o ~/Desktop/macos-monterey
mv ~/Desktop/macos-monterey.cdr ~/Desktop/macos-monterey.iso
sudo rm -fv /tmp/Monterey.dmg
#source:
@mandrean
mandrean / Install Apple Clang 12 next to Apple Clang 13
Created January 23, 2022 02:15
Install Apple Clang 12 next to Apple Clang 13
# download 'Command_Line_Tools_for_Xcode_12.5.1.dmg' from Apple's developer portal:
# https://developer.apple.com/download/all/?q=xcode
# mount 'Command_Line_Tools_for_Xcode_12.5.1.dmg', then unpack it
❯ pkgutil --expand-full /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg /tmp/CLTools
# rename existing CLTools v13
❯ sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools@13
# move CLTools v12 into place