Skip to content

Instantly share code, notes, and snippets.

@masklinn
masklinn / cheatsheet.md
Last active May 15, 2025 16:18
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@comex
comex / wormdump.c
Created April 9, 2015 06:07
Some old broken code in case it helps anyone
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/kern_event.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <net/ethernet.h>
@amorton
amorton / gist:1024636
Created June 14, 2011 10:17
Diff the files in a directory using Python
#used as part of a unit test
def _compare_directories(self, expected_dir, actual_dir, header=None):
"""Compares two directories and diffs any different files.
The file list of both directories must match and the files must match.
Sub directories are not considered as I don't need to in my case.
The diff will not show that a file was deleted from one side. It shows
that all the lines were removed.