Skip to content

Instantly share code, notes, and snippets.

darwin /
Created November 16, 2020 21:59
APFS Container cloning/replicating under macOS 11.0 (Big Sur) - with a bootable system

It is the year 2020 and replicating APFS containers still sucks. One would expect it would be a simple copy and paste in the Disk Utility app but this is still far from reality.

Last year I wrote how I managed to clone my macOS system under Catalina. The main trick was to create a DMG file with multiple volumes, mount it on target machine and drop to command-line to do asr restore from synthetised disk while avoiding possible pitfalls.

The good news is that Apple devs definitely worked on improving this under Big Sur and added some documentation (see man asr). But I didn't understand it fully on first read. Maybe someone could explain how is this supposed to work?

romdim /
Created September 26, 2020 08:44
Install apfs-fuse in Ubuntu 20.04 LTS
sudo apt update
sudo apt install fuse libfuse-dev libicu-dev bzip2 libbz2-dev cmake git libattr1-dev zlib1g-dev g++
sudo snap install cmake --classic
git clone
cd apfs-fuse
git submodule init
git submodule update
mkdir build
knightsc / inject.c
Last active May 21, 2024 15:22
An example of how to inject code to call dlopen and load a dylib into a remote mach task. Tested on 10.13.6 and 10.14.3
#include <dlfcn.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <mach/mach.h>
#include <mach/error.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/mman.h>
gaearon / index.html
Last active February 13, 2024 09:46
Multiple React components on a single HTML page
<!DOCTYPE html>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
Alanaktion / Celeste Dark.sublime-color-scheme
Last active February 16, 2024 03:27
Celeste Dark Sublime Text Theme
// Rough modified version of Celeste to darken it up
"name": "Celeste Dark",
"author": "Sublime HQ Pty Ltd",
// These colors are part of the hashed range
// and should only be used in non-source
"purple": "hsla(260, 50%, 70%, 1)",
"blue": "hsla(200, 70%, 55%, 1)",
neumond /
Last active August 30, 2021 14:36
My qtile config
import pickle
import weakref
from contextlib import contextmanager, suppress
from datetime import datetime
from itertools import islice
from logging import getLogger
from pathlib import Path
from libqtile import bar, hook, layout, widget
from libqtile.command import lazy
TomWhitwell /
Last active December 19, 2021 06:27
"Hello World' for Mutable Instruments Clouds module
// Copyright 2014 Olivier Gillet.
// Author: Olivier Gillet (
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
# This file is an example of how to configure ITM/ETM tracing
# using openocd if you do not want to modify the application.
# Use like this:
# openocd -f configure-trace.openocd
# Modify there to match your debugger hw & cpu
source [find interface/stlink-v2.cfg]
source [find target/stm32f4x_stlink.cfg]
Authors : Bradley Austin Davis <>
Copyright : Copyright Brad Davis. All Rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
puffnfresh / SpacesDemo.m
Created November 11, 2012 07:19
Demo of Spaces API discovered via reverse engineering
#include <Carbon/Carbon.h>
typedef uint64_t CGSConnection;
extern CGSConnection _CGSDefaultConnection(void);
#define CGSDefaultConnection _CGSDefaultConnection()
typedef uint64_t CGSSpace;
typedef enum _CGSSpaceType {