Skip to content

Instantly share code, notes, and snippets.

@simonw
simonw / geocode.py
Created January 26, 2025 16:49
Geocode using the API bulit into macOS CoreLocation
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "pyobjc-core",
# "pyobjc-framework-CoreLocation",
# "click"
# ]
# ///
"""Basic geocoding using CoreLocation on macOS."""
@caarmen
caarmen / legacy-android-emulator.md
Last active January 4, 2026 10:01
Run Android 1.5 Cupcake emulator on MacOS Intel (MacOS 15), in 2025
@skatkov
skatkov / choosy
Last active June 7, 2025 21:47 — forked from cesarolea/choosy
Open browser based off of certain rules (like choosy for macOS)
#!/bin/bash
URL=$1
DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}')
# Read the list of domains from the file
DOMAIN_LIST=$(cat /home/sk/.config/url-list.txt)
# Check if the domain is in the list
if echo "$DOMAIN_LIST" | grep -q "$DOMAIN"; then
@theJayTea
theJayTea / Gemini System Prompt (32-8-24).txt
Created December 19, 2024 19:16
Gemini System Prompt Extraction
```
You are Gemini, a large language model built by Google. You're currently running on the Gemini family of models, including 1.5 Flash. You don't have a knowledge cut-off as you have access to up-to-date information from search snippets.
You can write and run code snippets using the python libraries specified below. Code must be valid self-contained Python snippets with no imports and no references to APIs that are not specified except for Python built-in libraries. You cannot use any parameters or fields that are not explicitly defined in the APIs in the context. Use "print" to output any information to the screen that you need for responding to the user. The code snippets should be readable, efficient, and directly relevant to the user query.
You can use the following generally available Python libraries:
```python
import datetime
import calendar
import dateutil.rrule
@reynldi
reynldi / main.go
Created December 10, 2024 06:26
Go VPN Detector
package main
import (
"bufio"
"io"
"log"
"net"
"net/http"
"os"
"strings"
@pythoninthegrass
pythoninthegrass / macos_terraform.md
Last active March 3, 2026 14:44 — forked from gwarf/MacOSX_terraform.md
Using terraform in macOS to manage KVM-backed VMs.

Using Terraform on macOS to manage KVM-backed VMs

Installing

Terraform

brew install terraform
@b0gdanw
b0gdanw / Disable-Sequoia-Bloatware.sh
Last active July 21, 2026 08:34
Disable Sequoia Bloatware
#!/bin/zsh
# WARNING! The script is meant to show how and what can be disabled. Don’t use it as it is, adapt it to your needs.
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12), macOS Ventura (13), macOS Sonoma (14) and macOS Sequoia (15)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user
# Apple smart card config
## Prerequisites
macOS High Sierra or later
an administrator account with a password configured
a YubiKey with the PIV application. Make sure you go through the device setup.
@leminlimez
leminlimez / Domains.md
Last active June 20, 2026 10:57
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
# This script syncs a device with intune using powershell.
# This can be pushed with RMM and avoids the dreaded "remote wipe" and "remote sync" buttons being mixed up.
# Source: https://oofhours.com/2024/03/30/when-does-a-windows-client-sync-with-intune/
[Windows.Management.MdmSessionManager,Windows.Management,ContentType=WindowsRuntime]
$session = [Windows.Management.MdmSessionManager]::TryCreateSession()
$session.StartAsync()