Skip to content

Instantly share code, notes, and snippets.

View emjayoh's full-sized avatar

Matt Ogram emjayoh

View GitHub Profile
@emjayoh
emjayoh / remove-read-only-filesystem.sh
Last active January 14, 2020 00:46
Remove read-only filesystem in Catalina+
cd /
sudo mount -uw /
@emjayoh
emjayoh / .git-attributes
Created January 14, 2020 02:02
Use git-crypt on entire directory subtree (place this file in dir)
* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
#!/usr/bin/env bash
npm list -g --depth=0 > ~/.dotfiles/packages/npm || echo "npm failed"
gem list > ~/.dotfiles/packages/gem || echo "gem failed"
pip list > ~/.dotfiles/packages/pip || echo "pip failed"
pip3 list > ~/.dotfiles/packages/pip3 || echo "pip3 failed"
#sudo find / -iname *.app > ~/.dotfiles/packages/app-list || echo "app list failed"
# `brew bundle dump` [`--force`] [`--describe`] [`--no-restart`] [`--file=`<path>|`--global`]
brew bundle dump --force --describe --file=~/.dotfiles/packages/brew || echo "brew failed"
@emjayoh
emjayoh / std.md
Created January 31, 2020 16:52 — forked from turbo/std.md
Git Commit Message Standard

Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/

General Rules

  • Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
  • The subject line must not exceed 50 characters
  • The subject line should be capitalized and must not end in a period
  • The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
  • The body copy must be wrapped at 72 columns
  • The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
@emjayoh
emjayoh / convert-to-image.sh
Created February 10, 2020 18:42
Bootable USB drive (OSX)
# convert iso to img
hdiutil convert -format UDRW -o <~/Path-to-IMG-file> <~/Path-to-ISO-file>
# find name
diskutil list
# unmount
diskutil unmountDisk /dev/disk<N>
# dd it, be very careful!
@emjayoh
emjayoh / macOS x arch linux
Created February 10, 2020 20:18 — forked from vineyardbovines/macOS x arch linux
dual booting macOS high sierra and arch linux on a macbook pro 12,1 (retina, 13", 2015)
#####################################################
# dual booting arch linux & macOS
# on a macbook pro 12,1
# ft. rEFInd
#
# this guide has been smashed together from a variety
# of other awesome guides out there for dual booting
# including but not limited to:
# mark nichols' 5 part guide: https://zanshin.net/2015/02/05/arch-linux-on-a-macbook-pro-part-1-creating-a-usb-installer/
# the arch linux docs: https://wiki.archlinux.org/index.php/mac#Arch_Linux_with_OS_X_or_other_operating_systems
@emjayoh
emjayoh / uninstall-node.sh
Last active November 18, 2020 15:16
[Uninstall node manually] when it doesn't normally work #node #uninstall #osx #manual
# 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*
@emjayoh
emjayoh / removecompletedtorrents.sh
Last active February 20, 2020 14:21 — forked from bulljit/removecompletedtorrents.sh
Transmission-Daemon: Remove Completed Torrents
#!/bin/sh
# script to check for complete torrents in transmission folder, then stop and move them
# either hard-code the MOVEDIR variable here…
MOVEDIR=/Users/spamnrice/Downloads/_complete # the folder to move completed downloads to
# …or set MOVEDIR using the first command-line argument
# MOVEDIR=%1
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
<?php
require_once "Mail.php";
$from = "[email protected]";
$to = '[email protected]';
$host = "ssl://smtp.gmail.com";
$port = "465";
$username = '[email protected]';
$password = 'mypassword';
qemu-system-x86_64 -m 4096 -vga virtio -show-cursor -usb -device usb-tablet -enable-kvm -cdrom /Users/spamnrice/Downloads/archlinux-2020.02.01-x86_64.iso -drive file=./arch-2020.02.01-x86_64.qcow2,if=virtio -accel hvf -cpu host