Skip to content

Instantly share code, notes, and snippets.

View Qyriad's full-sized avatar

Qyriad Qyriad

View GitHub Profile
@Qyriad
Qyriad / Domains.md
Created February 18, 2026 18:07 — forked from leminlimez/Domains.md
A deep dive into the iOS backup/restore system

Domains.plist

Documentation of /System/Library/Backup/Domains.plist. File taken from iOS 16.4 iPhone SE 3. The file was removed in iOS 17.0

Values

Values in the plist. Other than SystemDomains, these are not really important and are just here for preservation sake.

A domain in domains.plist contains keys that determine what gets backed up for what types of devices and where (i.e. iCloud vs iTunes). Not all domains have each key. The only 2 keys that must be in every domain are RootPath and RelativePathsToBackupAndRestore. Some domains have the value ShouldDigest. I am not sure exactly what it means but I have included it for documentation purposes.

  • Version: "24.0"
  • SystemDomains: (Dictionary), see below
@Qyriad
Qyriad / refmut.hpp
Last active June 27, 2024 21:10
C++ non-nullable pointer wrapper specifically for out parameters
#pragma once
#include <memory> // std::addressof
#include <optional>
#include <type_traits> // std::type_identity_t
template<typename T>
using NoDeduce = std::type_identity_t<T>;
/** Non-nullable pointer, for making out-parameters explicit.
@Qyriad
Qyriad / flake.lock
Last active April 17, 2024 03:02
Proof of concept Linux -> macOS cross compilation in Nixpkgs
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
@Qyriad
Qyriad / diffcmd.py
Created April 5, 2024 02:06
Diff the output of two only slightly different commands. I got annoyed.
#!/usr/bin/env python3
# Assumes that the differing argument is the last one.
import argparse
import os
from pathlib import Path
import shlex
import shutil
import subprocess
@Qyriad
Qyriad / flake.lock
Created March 11, 2024 01:03
Nixpkgs stdenv.mkDerivation fixed point's doCheck is incorrect when cross compiling
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
@Qyriad
Qyriad / what.bash
Created February 15, 2024 19:46
Discount `dbg!()` in Bash
function what() {
echo -n "what $1: "
if declare -p "$1" > /dev/null 2>&1; then
declare -p "$1"
elif declare -F "$1" > /dev/null 2>&1; then
declare -F "$1"
elif type -t "$1" > /dev/null 2>&1; then
type -t "$1"
else
echo "string --" "$1"
@Qyriad
Qyriad / hammerspoon.nix
Created February 4, 2024 23:38
Hammerspoon package definition for Nix
{
lib,
stdenvNoCC,
fetchurl,
unzip,
}:
# This cannot be built from source since Hammerspoon requires entitlements to work,
# and codesigning entitlements is unfortunately incompatible with immutability.
stdenvNoCC.mkDerivation (self: {
pname = "hammerspoon";
@Qyriad
Qyriad / kglobalaccel_friendly.xsh
Created September 3, 2023 02:18
kglobalaccel DBus Names to Friendly Names
#!/usr/bin/env xonsh
names = $(qdbus org.kde.kglobalaccel /component org.freedesktop.DBus.Introspectable.Introspect | rg r'\s*<node name="(.+)".?>' -r r'$1').splitlines()
friendly_names = dict()
longest_name_len = 0
for name in names:
longest_name_len = max(longest_name_len, len(name))
friendly_name = $(qdbus org.kde.kglobalaccel /component/@(name) org.kde.kglobalaccel.Component.friendlyName).strip()
friendly_names[name] = friendly_name
@Qyriad
Qyriad / homebrew_keep_output.patch
Created August 27, 2023 22:15
Homebrew patch to show output of build commands (or other subprocs), and to *not* set `-DCMAKE_VERBOSE_MAKEFILE` unless `-v` is passed
diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb
index 03bb33852..5eadae8ff 100644
--- a/Library/Homebrew/env_config.rb
+++ b/Library/Homebrew/env_config.rb
@@ -399,6 +399,10 @@ module Homebrew
SUDO_ASKPASS: {
description: "If set, pass the `-A` option when calling `sudo`(8).",
},
+ HOMEBREW_KEEP_OUTPUT: {
+ description: "If set, system commands run by Homebrew will not have their output suppressed.",
@Qyriad
Qyriad / TaskViewControllerInput.ahk
Created August 13, 2023 07:10
Make controller/gamepad input work in Windows 11 Task View
#Requires AutoHotkey v2.0
; Joy1 is A
#HotIf WinActive("Task View")
Joy1::Send "{Enter}"
; Joy2 is B
#HotIf WinActive("Task View")
Joy2::Send "{Escape}"