Skip to content

Instantly share code, notes, and snippets.

@nmbr73
nmbr73 / macos-clean-install_DE.md
Last active August 3, 2022 21:33
Neuinstallation von macOS per USB-Stick

Clean Install per Installationsmedium

Meine tl;dr-Kurzanleitung zur Neuinstallation von macOS von einem USB-Stick.
Alle Angaben ohne Gewähr und auf eigene Gefahr.

Bei Intel-Macs mit T2-Chip liegt das OS seit Bug Sur in einem eigenen Sealed System Volume, bzw. bei Apple-Silicon-Macs in der sogenannten Secured Enclave. Damit kann man den Mac quasi in einen Auslieferungszustand zurücksetzen, in dem man in den Systemeinstellungen alle Inhalte und Einstellungen löscht.

Alternativ kann man macOS per Recovery-Modus installieren (siehe HT204904). Damit wird wahlweise die bei Lieferung enthaltene, die nächste noch verfügbare, oder auch die neueste kompatible Version des Betriebssystems wiederhergestellt. Bei der Wiederherstellug werden keine Daten vom Mac entfernt.

Anonsten bleibt noch - und darum geht es hier - die Neuinstallation von einem externen Laufwerk (wie in HT201372 beschrieben):

@nmbr73
nmbr73 / macos-defaults.sh
Last active August 31, 2022 21:38
Change some preferences on a freshly installed macOS
#!/bin/bash
# ============================================================================
# Some defaults I change on a new Mac ... done via shell script to
# not have to do it manually. These settings are personal preference,
# but the commands might be helpful if you want to write your own such
# script. Seems to work on Monterey; don't know for Ventura.
# ============================================================================
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND!
@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 25.swift
Created September 17, 2022 23:52
This code is a total disaster ... preserved here as a cautionary example - hope to be able to create a way better solution soon.
//
// ContentView.swift
// RockPaperScissors
//
// Created by nmbr73 on 17.09.22.
//
import SwiftUI
//
// ContentView.swift
// Conversion
//
// Created by nmbr73 on 07.09.22.
//
import SwiftUI
struct ContentView: View {
enum IntegerSqrtError : Error {
case outOfBounds, noRoot
}
func isqrt(_ n: Int) throws -> Int {
if n < 1 || n > 10_000 {
throw IntegerSqrtError.outOfBounds
}
@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 14 - Checkpoint 9.swift
Last active September 28, 2022 09:10
Day 14, Checkpoint 9 of #100DaysOfSwiftUI ... where @twostraws provided some excellent content again! #HACKINGWITHSWIFT https://www.hackingwithswift.com/quick-start/beginners/checkpoint-9
func f(_ array: [Int]? ) -> Int {
return array?.randomElement() ?? Int.random(in: 1...100)
}
f(nil)
f([Int]())
f([-1,-2,-3])
@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 13 - Checkpoint 8.swift
Last active September 28, 2022 09:11
Day 13, Checkpoint 8 of #100DaysOfSwiftUI ... thanks @twostraws - I really enjoy the course so far!
/// Any kind of building on the estate market.
///
protocol Building {
/// Number of rooms the building has.
///
/// Note that the numebr of rooms can't change heavy construction work.
var rooms: Int { get }
@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 12 - Checkpoint 7.swift
Last active September 28, 2022 09:12
Day 12, Checkpoint 7 of #100DaysOfSwiftUI ... nothing special here, I think ... ?!?
class Animal {
let legs = 4
}
class Dog: Animal {
func speak() {
@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 11 - Checkpoint 6.swift
Last active September 28, 2022 09:13
My attempt to solve 'Checkpoint 6' of #100DaysOfSwiftUI (https://www.hackingwithswift.com/100/swiftui)
// Bear with me - sure, exceptions, custom initializers, observers, static methods,
// computed properties, etc. are really not all needed to solve the problem, but I
// wanted to try some of the things we learned so far and thereby the code got a bit
// bloated maybe.
struct NonSense: Error {
}
struct Car {
@nmbr73
nmbr73 / 100DaysOfSwiftUI - Day 9 - Checkpoint 5 - Whitespace.swift
Last active September 28, 2022 09:16
A basic syntax question I'm having just starting out with the Swift programming language ... I wished @twostraws would have added a video on whitespace for the #100DaysOfSwitUI 😜
// ==============================================================================================
// How can it be explained that Swift interprets whitespace and whitespace so differently?!?
// ----------------------------------------------------------------------------------------------
// Must be some "a line break makes a chain of commands a sequence and therefore a line
// break cannot be used in places where a semicolon would obviously not be allowed". But
// I don't see it and some explanation would be much appreciated!
// ==============================================================================================
let luckyNumbers = [7, 4, 38, 21, 16, 15, 12, 33, 31, 49]