Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active November 13, 2024 07:51
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@pudquick
pudquick / brew.md
Last active November 7, 2024 11:03
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@cielavenir
cielavenir / readme.md
Last active October 23, 2024 12:42
zoom sandbox-exec for macOS
  1. Download Zoom.pkg from https://zoom.us/download
  2. Extract it using https://www.timdoug.com/unpkg/
  3. Now you have Zoom/zoom.us.app
  4. Launch Zoom by zoom.sh Zoom/zoom.us.app/Contents/MacOS/zoom.us

caveats:

  • Zoom will fail to start meeting for the first time. Just launch again.
  • Zoom will tell that crash happened, but you should ignore it.
@eddieh
eddieh / chroot-env-on-mac.org
Created July 28, 2021 19:43
chroot Environments on macOS (draft)

chroot Environments on macOS

This is a draft.

macOS doesn’t have many of the advanced Linux or UNIX features that have come about in the past 20 years. So getting a proper chroot environment up and running takes a little more work.

@chrisswanda
chrisswanda / age_encryption_scripts.md
Last active June 4, 2024 09:32
Age encryption scripts

I've slowly been converting various processes and encryption schemes over to age, versus using PGP to store encrypted data at rest and sending of encrypted payloads to other users/machines.

If you are not familiar with age, see the specs here -> https://github.com/C2SP/C2SP/blob/main/age.md

And the current project in GitHub -> https://github.com/FiloSottile/age

Man page - https://htmlpreview.github.io/?https://github.com/FiloSottile/age/blob/master/doc/age.1.html

Since version 1.0.0 is out and is considered release, hopefully we will start seeing some cool projects using age for encryption, and hopefully some mobile apps, slick UIs, etc... will soon follow.

@qdm12
qdm12 / README.md
Last active October 29, 2024 23:50
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@nwesterhausen
nwesterhausen / apprise_notify.sh
Created October 9, 2019 15:57
Apprise Notifier Script for Radarr/Sonarr/Lidarr
#!/bin/bash
###
# This script utilizes apprise (https://github.com/caronc/apprise) to send notifications
# You need to have apprise available for the user sonarr operates under.
# I installed it via `sudo pip install --system apprise` although the python
# community really dislikes it when you do that. Recommended installation would be
# something along the lines of:
#
# sudo su sonarr -s /bin/bash
# pip install --user apprise

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@paulgalow
paulgalow / rename-photos-videos-timestamp.sh
Last active October 13, 2024 17:38
macOS Automator script to rename photos/videos based on creation date. Blog post: https://paulgalow.com/macos-quick-action-rename-photos-videos-timestamp
#!/bin/bash
# macOS Automator script to rename photos/videos based on creation date
# Blog post: https://paulgalow.com/macos-quick-action-rename-photos-videos-timestamp
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Create subfolder to store renamed files
createDestination() {
readonly destination="$(dirname "$file")/sorted"
@pixelomer
pixelomer / mkjail.sh
Last active October 23, 2024 16:53
Create a macOS chroot jail with GNU bash and utilities
#!/usr/bin/env sh
#############################################
# WARNING #
# No more commits are going to be made to #
# this gist. Please get the latest script #
# from the new repository: #
# https://github.com/pixelomer/macos-mkjail #
#############################################