Skip to content

Instantly share code, notes, and snippets.

View matthewhochler's full-sized avatar

Matt H matthewhochler

View GitHub Profile
@matthewhochler
matthewhochler / fastmail.sieve
Last active June 19, 2023 00:28
My FastMail Sieve rules
### Trash ###
# Trash anything from LinkedIn
# (Because LinkedIn is trash)
if address :all :is ["to", "cc", "resent-to", "x-delivered-to"] "linkedin@matthewhochler.fastmail.fm" {
fileinto "INBOX.Trash";
stop;
}
# Trash Sony PSN 'Funds added' emails
#!/usr/bin/env bash
set -e
while [ true ]
do
if ifconfig | pcregrep -M -o '^[^\t:]+(?=:([^\n]|\n\t)*status: active)' | grep awdl0;
then
echo "Shutting down awdl0..."
ifconfig awdl0 down
else
@matthewhochler
matthewhochler / macos_setup.markdown
Last active December 30, 2021 15:07
New macOS Setup

Setup new MacOS installation

Homebrew

brew tap homebrew/dupes
brew update
brew upgrade
brew install \
  "awscli" \
  "bash" \
@matthewhochler
matthewhochler / README.md
Created April 26, 2021 16:43 — forked from daniel-j/README.md
Converts images in a directory to a comic/manga EPUB3 ebook. Can be used to convert extracted CBZ/CBR to EPUB3.

images2epub.py

Converts a directory of images into a modern EPUB3 ebook. Use a tool to extract CBZ/CBR/CBT files and then run this program to generate a nice fixed-layout EPUB ebook of it. You can optionally set the reading direction to right-to-left (e.g. for manga). For Kobo ereaders, use the file extension .kepub.epub to get the modern reader and correct reading direction.

Usage

Install dependencies with pip install imagesize lxml

@matthewhochler
matthewhochler / uninstall-razer-synapse.sh
Created January 8, 2021 00:08 — forked from timotgl/uninstall-razer-synapse.sh
How to fully uninstall Razer Synapse 2 on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) without using Razer's official uninstall tool
# How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 )
# on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra)
# without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Edited with additional steps for later OS X versions,
# contributed by commenters on this gist.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater

Keybase proof

I hereby claim:

  • I am matthewhochler on github.
  • I am mattyhochs (https://keybase.io/mattyhochs) on keybase.
  • I have a public key ASCIeB6GtEN1EEn8ugJOLnkIQDcOEbnCxlPig8lbGQJYfQo

To claim this, I am signing this object:

@matthewhochler
matthewhochler / readme.md
Created May 1, 2019 22:42 — forked from max-mapper/readme.md
Video stabilization using VidStab and FFMPEG (Mac OS X)

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Here's an example video I made

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
@matthewhochler
matthewhochler / ffmpeg.md
Created May 1, 2019 21:18 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@matthewhochler
matthewhochler / heroku_pg_db_reset.md
Created April 10, 2019 23:18 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@matthewhochler
matthewhochler / heroku_pg_db_reset.md
Created April 10, 2019 23:18 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate