Skip to content

Instantly share code, notes, and snippets.

@alebcay
alebcay / cooler.7
Last active October 25, 2023 23:48
Quickly export your Homebrew and Homebrew-Cask settings: the configured taps, installed formulae, and installed casks.
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "COOLER" "7" "February 2014" "" ""
.
.SH "NAME"
\fBcooler\fR \- import and export homebrew settings
.
.SH "SYNOPSIS"
\fBname import name_of_cooler_bundle\fR
@soarez
soarez / ca.md
Last active March 4, 2026 04:50
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@reklis
reklis / -
Created October 3, 2014 13:00
bsd/dev/dtrace/dtrace.c:19734: if (!PE_parse_boot_argn("dtrace_dof_mode", &dtrace_dof_mode, sizeof (dtrace_dof_mode))) {
bsd/dev/dtrace/dtrace.c:19764: if (!PE_parse_boot_argn("dtrace_kernel_symbol_mode", &dtrace_kernel_symbol_mode, sizeof (dtrace_kernel_symbol_mode))) {
bsd/dev/dtrace/fbt.c:477: PE_parse_boot_argn("IgnoreFBTBlacklist", &gIgnoreFBTBlacklist, sizeof (gIgnoreFBTBlacklist));
bsd/dev/unix_startup.c:261: (void) PE_parse_boot_argn("ncl", &ncl, sizeof (ncl));
bsd/dev/unix_startup.c:262: (void) PE_parse_boot_argn("mbuf_pool", &mbuf_pool, sizeof (mbuf_pool));
bsd/kern/bsd_init.c:1113: if (PE_parse_boot_argn("-s", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1116: if (PE_parse_boot_argn("-b", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1119: if (PE_parse_boot_argn("-x", namep, sizeof (namep))) /* safe boot */
bsd/kern/bsd_init.c:1123: if (PE_parse_boot_argn("-vnode_cache_defeat", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1127: if (PE_parse_boot_argn("-disable_aslr", namep, sizeof (namep)))
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active July 24, 2025 16:11
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 20, 2026 18:39
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

@tevino
tevino / fix_virtualenv
Last active February 11, 2026 11:51
Fix python virtualenv after python update
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
BAD_ENV_PATHS="/usr/local"
echo "Ensure the root of the broken virtualenv:"
echo " $ENV_PATH"
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 20, 2026 13:01
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@zmwangx
zmwangx / need-bottle
Last active December 19, 2016 23:08
Determine which homebrew/core formulae still don't have Sierra bottles. https://github.com/zmwangx/brew-misc/
#!/usr/bin/env zsh
here=$0:A:h
print_error () print -R $'\e[31m'"Error: $*"$'\e[0m' >&2
blacklist=
print_number=0
while [[ $1 == -* ]]; do
case $1 in
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active December 24, 2025 06:37
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4