From b43937b395858045b691d0b425789c20e667e567 Mon Sep 17 00:00:00 2001 From: Trevi Awater Date: Sun, 8 Mar 2026 08:54:14 +0100 Subject: [PATCH] updates --- README.md | 54 ++++++++++++++++++++++++++++ brewfile | 2 ++ clone-resoftware-repos.fish | 70 +++++++++++++++++++++++++++++++++++++ meerkoet-proxy.conf | 12 +++++++ 4 files changed, 138 insertions(+) create mode 100644 README.md create mode 100755 clone-resoftware-repos.fish create mode 100644 meerkoet-proxy.conf diff --git a/README.md b/README.md new file mode 100644 index 0000000..2afbb45 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# macOS Configuration + +Personal macOS setup and configuration files. + +## Setup + +### 1. Install Homebrew + +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +### 2. Install packages and apps + +```bash +brew bundle --file=brewfile +``` + +### 3. Symlink configuration files + +```bash +ln -sf $(pwd)/fish-config.fish ~/.config/fish/config.fish +ln -sf $(pwd)/starship.toml ~/.config/starship.toml +ln -sf $(pwd)/ssh-config ~/.ssh/config +``` + +### 4. Set Fish as default shell + +```bash +echo /opt/homebrew/bin/fish | sudo tee -a /etc/shells +chsh -s /opt/homebrew/bin/fish +``` + +### 5. Configure iTerm2 + +Import `iterm-profile.json` via iTerm2 preferences. Uses 1Password SSH agent for key management. + +## Scripts + +### clone-resoftware-repos.fish + +Clones all repositories from the `resoftware` GitHub organization, organized by customer number: + +```bash +fish clone-resoftware-repos.fish +``` + +Repos are cloned via SSH into `~/Repositories/{customer-number}/{repo-name}` based on each repo's `customer-number` custom property. Safe to re-run -- already cloned repos are skipped. + +## Updating the Brewfile + +```bash +brew bundle dump --file=brewfile --force +``` diff --git a/brewfile b/brewfile index c5064db..0887ffd 100644 --- a/brewfile +++ b/brewfile @@ -16,11 +16,13 @@ cask "docker-desktop" cask "font-fira-code-nerd-font" cask "fork" cask "google-drive" +cask "home-assistant" cask "iterm2" cask "jetbrains-toolbox" cask "lens" cask "mos" cask "obsidian" +cask "openinterminal" cask "readdle-spark" cask "slack" cask "spotify" diff --git a/clone-resoftware-repos.fish b/clone-resoftware-repos.fish new file mode 100755 index 0000000..ffb1d04 --- /dev/null +++ b/clone-resoftware-repos.fish @@ -0,0 +1,70 @@ +#!/usr/bin/env fish + +set base_dir ~/Repositories +set org resoftware + +set cloned 0 +set skipped 0 +set warnings 0 + +echo "Fetching repositories and custom properties for $org..." + +set json (gh api "orgs/$org/properties/values" --paginate) + +if test $status -ne 0 + echo "Error: Failed to fetch repository properties from GitHub." + exit 1 +end + +set repo_lines (echo $json | python3 -c " +import json, sys +data = json.load(sys.stdin) +for repo in data: + name = repo['repository_name'] + full_name = repo['repository_full_name'] + customer = '' + for prop in repo.get('properties', []): + if prop['property_name'] == 'customer-number': + customer = prop.get('value', '') or '' + break + print(f'{name}\t{full_name}\t{customer}') +") + +if test $status -ne 0 + echo "Error: Failed to parse repository data." + exit 1 +end + +for line in $repo_lines + set parts (string split \t $line) + set repo_name $parts[1] + set full_name $parts[2] + set customer $parts[3] + + if test -z "$customer" + echo "Warning: $full_name has no customer-number property, skipping." + set warnings (math $warnings + 1) + continue + end + + set target_dir "$base_dir/$customer/$repo_name" + + if test -d "$target_dir" + echo "Skipping $full_name (already exists at $target_dir)" + set skipped (math $skipped + 1) + continue + end + + echo "Cloning $full_name into $target_dir..." + mkdir -p (dirname "$target_dir") + git clone "git@github.com:$full_name.git" "$target_dir" + + if test $status -eq 0 + set cloned (math $cloned + 1) + else + echo "Error: Failed to clone $full_name" + end +end + +echo "" +echo "Done! Cloned: $cloned, Skipped: $skipped, Warnings: $warnings" diff --git a/meerkoet-proxy.conf b/meerkoet-proxy.conf new file mode 100644 index 0000000..6d0a4c6 --- /dev/null +++ b/meerkoet-proxy.conf @@ -0,0 +1,12 @@ +[Interface] +PrivateKey = GMopfBHSJkM00xrF6TUyBFiBzkcre7VxIrl3250AXk4= +Address = 192.168.178.203/24,fd65:e9a5:9f09::203/64 +DNS = 192.168.178.1,fd65:e9a5:9f09::2e3a:fdff:feeb:343a +DNS = fritz.box + +[Peer] +PublicKey = MpQ+8UUqsSMWv3tFCvLqapYXnGCcc0r9eHAQHShZfD0= +PresharedKey = gHwRKA0ftc2Mhp3bQHUYRL3NtJu0sG1EBehXAO0Fl6E= +AllowedIPs = 192.168.178.0/24,0.0.0.0/0,fd65:e9a5:9f09::/64,::/0 +Endpoint = ybmf6ge2fvmqxz3k.myfritz.net:59411 +PersistentKeepalive = 25