Skip to content

Instantly share code, notes, and snippets.

View Shonke's full-sized avatar
😗
I may be slow to respond.

xiaoke Shonke

😗
I may be slow to respond.
View GitHub Profile
@Shonke
Shonke / readme.md
Created November 13, 2020 16:31 — forked from darwin/readme.md
APFS Container cloning/replicating under Catalina (with a bootable system)

Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. I upgraded my late 2014 Mac Mini with a shiny new 1TB SSD. This took way too many hours of my life I will never get back. Hope this saves some time to you.

Good news:

  1. it is possible to create a DMG image from existing APFS container with macOS Catalina installation including metadata needed for complete restore (the DMG contains OS, OS Data, Preboot, Recovery and VM volumes)
  2. it is possible to restore this DMG image into empty APFS container and get a bootable copy of the original system

This information is relevant for Catalina (I'm currently running macOS 10.15.1).

@Shonke
Shonke / ddns_cf.ps1
Last active October 15, 2020 11:23
cloudflareDDNS-PowerShell
Param(
[Parameter(Mandatory = $true)] [string] $Token,
[Parameter(Mandatory = $true)] [string] $Zone,
[Parameter(Mandatory = $false)] [string] $RecordNameV4,
[Parameter(Mandatory = $false)] [string] $RecordNameV6
)
# add Scheduled Task
# At computer startup
# Every 2 hours
@Shonke
Shonke / bridge-zerotier.sh
Created October 4, 2019 00:37
Layer 2 Bridging with zerotier
#!/bin/bash
# doc: https://zerotier.atlassian.net/servicedesk/customer/portal/1/article/7471125
LOGGING_FILE='/var/log/zt-bridge.log'
LAN_INT='eth3'
BR_INT='br0'
ZT_INT='ztwdjesw7o'
BRIDGE_IP='172.28.10.5/16'
#GATEWAY_IP='192.168.3.5'