Skip to content

Instantly share code, notes, and snippets.

@dabrahams
dabrahams / launchd.org
Last active July 7, 2024 12:10
Notes on Apple's under-documented launchd

Notes on Apple’s Under-Documented LaunchD

Start triggers fire regardless of other conditions

For example, StartOnMount=true will cause the job to start when anything is mounted even if other conditions, e.g. QueueDirectories, say the job should not run

Rhythm of repeating jobs

The StartInterval timer begins ticking at the moment the plist is loaded. If something like QueueDirectories is preventing the job from

@zoocoup
zoocoup / Ubuntu Server Up-to-Speed Cheatsheet
Last active May 6, 2019 20:21
Ubuntu Server Up-to-Speed Cheatsheet
# Making the Switch from RHEL to Ubuntu Server?
# I needed to start supporting Ubuntu 12.0.4 Servers after three years of working with Scientific Linux 5/6 (RHEL-variant)
# This is the cheatsheet I put together to help get over some of the differences
# Last Edit 20130508
_Root_
The root account is not enabled by default. Ubuntu wants to to use sudo to elevate privileges. The first created account will be an administrator in the sudoers group.
Config file: /etc/sudoers (use visudo)
@zoocoup
zoocoup / Casper Packaging & Deployment
Last active October 8, 2018 20:46
Overview of packaging for Casper
Casper Packaging & Deployment
# This document was made for my coworkers as I was leaving a previous job. The content should
# be applicable in most environments.
# Last Edit 20131008 - jkb | @zoocoup
This document is an overview of packaging applications, plug-ins and files or deployment with Casper.
_Testing the Application_
@phillymjs
phillymjs / reposado_update_notification.sh
Last active July 31, 2019 20:13
I wrote this script for myself and thought others might find it useful. Run it on your Reposado server, and it will check for current Apple updates that are not assigned to any of your branches. If it finds any, it will send an email notification. If you also use Margarita to provide a web interface, you can have the email include a link to that…
#!/bin/sh
# File locations - Change as needed
list="/tmp/updatelist.txt" # List of updates not in any branches
email="/tmp/updatemail.txt" # Temp file to hold the email message
mailbinary="/usr/sbin/sendmail" # Location of the binary that sends mail
repoutil="/usr/local/reposado/repoutil" # Location of the repoutil binary
# Options for automatically adding new updates to a branch - Change as desired
autoadd=true
@derhuerst
derhuerst / intro.md
Last active July 19, 2024 05:46
Installing the Z Shell (zsh) on Linux, Mac OS X and Windows

Installing zsh – the easy way

The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.

Z shell – Wikipedia

Read more about ZSH at An Introduction to the Z Shell.

Choose one of the following options.

@michalczukm
michalczukm / Atom_export_settings.md
Last active September 23, 2023 12:32
Atom: Backup all settings

Export:

  1. Copy from ${user}/.atom:
  • config.cson
  • keymap.cson
  • snippets.cson
  • styles.less
  1. Save installed packages list apm list --installed --bare > packages.list
### Updated to reflect changes introduced with 10.13.4. Update to 10.13.4 if needed before attempting to make
SecureToken-related changes. ###
sysadminctl is a tool Apple introduced in 10.10 for working with system user accounts. In 10.13, sysadminctl is Apple's
recommended tool for working with user accounts in the CLI, replacing functionality that has long been provided by dscl
and adds new features available only in 10.13. sysadminctl can be used to change user passwords, create new users or
check the status of a new-to-10.13 security feature named SecureToken.
SecureToken is a non-visible APFS file system attribute, unlike the SIP protected flag or file creation date, that triggers
the creation of a new AuthenticationAuthority entry in a user's local account record
sysadminctl is a tool Apple introduced in 10.10 for working with system user accounts. In 10.13,
sysadminctl is Apple's recommended tool for working with user accounts in the CLI, replacing functionality
that has long been provided by dscl and adds new features available only in 10.13.
sysadminctl can be used to change user passwords, create new users (including automatically provisioning
the user home folder) or check the status of a new-to-10.13 security feature named SecureToken.
SecureToken is a user attribute like password type or user home location. SecureToken is not publicly
documented by Apple so it is not possible to provide a full technical description, but in practice one
needs only to know if a user has SecureToken or not. Having SecureToken set signifies that a user can
unlock a FileVault-encrypted volume. Without the SecureToken bit on a user account, that user will not
@erikng
erikng / kextidentifiers.py
Last active April 19, 2021 22:51
kextidentifiers.py
#!/usr/bin/python
# For mojave only
# In order for this to work, you will need to go to System Preferences in Mojave -> Security & Privacy -> Privacy -> Full Disk Access and grant Terminal.app permissions
import sqlite3
conn = sqlite3.connect('/var/db/SystemPolicyConfiguration/KextPolicy')
c = conn.cursor()
query = 'SELECT * FROM kext_policy'
c.execute(query)
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 17, 2024 18:10
set -e, -u, -o, -x pipefail explanation