Skip to content

Instantly share code, notes, and snippets.

View sinewalker's full-sized avatar

Michael Lockhart sinewalker

View GitHub Profile
@sinewalker
sinewalker / keybase.md
Last active December 13, 2023 10:42
How to import pub/sec PGP keys from keybase to your local GPG keyring.

Import Keybase PGP to GPG

After installing the keybase command-line tool onto a new / fresh computer, you may want to import your PGP key to the local keyring so that you may use the keys with GPG.

Import your PUBLIC PGP key:

keybase pgp export|gpg --import -
@sinewalker
sinewalker / screen-share.md
Last active May 23, 2018 03:49
Share a GNU Screen session with a different user

Let's say you want to do some cooperative hacking with another user. Here is how:

  1. Screen needs the setuid flag set:
ls -l $(which screen)
-rwxr-sr-x 1 root screen 383096 May 11  2016 /usr/bin/screen

If yours doesn't have an s in the mode field, set it:

@sinewalker
sinewalker / fix-void-function.md
Last active March 28, 2018 10:38
Fixing most emacs/spacemacs "Symbol's function definition is void: some-package-function"

TL;DR: try recompiling everything. You can ask emacs to, or you can just force it to:

find ~/.emacs.d -name "*.elc" -delete

Then restart emacs.


The main culprits for this error are:

@sinewalker
sinewalker / unbrew.md
Last active March 20, 2018 05:44
Uninstall all of Homebrew and casks

I recently had to uninstall/reinstall my brew casks and recipies because I had royally screwed something up. I have a script to re-install all the things I want so it was no drama except for the downloads and re-install, and some oversights when I uninstalled brew. So here is what I think I should have done:

1. uninstall any applications installed with brew cask

$ for APP in $(brew cask list); do
  brew cask uninstall $APP
done
@sinewalker
sinewalker / rsync.md
Last active March 28, 2018 10:33
Rsync source -> dest *properly*

What to run:

rsync -HPva --delete <source>/ <dest>/

(tip for remembering: "Arr! Sync! Hey, Pretty view, eh? Do Eet")

why:

  • -H (--hard-links) sync any hard links as hard links, as distinct from files, at the destination
@sinewalker
sinewalker / whoops.sh
Created March 16, 2018 00:03
Delete last command from shell history, AND the fact that you deleted it, without HISTCONTROL="ignorespace" having been set
history -d $((${HISTCMD}-1));history -d $((${HISTCMD}-1))
@sinewalker
sinewalker / compositing.md
Created March 9, 2018 23:30
Toggle compositing in KDE

qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.active

Gives you true or false depending on whether it is currently enabled or not

You can enable compositing by calling

qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.resume

and disable by calling

@sinewalker
sinewalker / bach-wtc1-1.rb
Last active February 26, 2018 12:09
Bach Well Tempered Clavier, Book 1, Prelude 1 (Sonic Pi)
#### Sonic Pi -*- mode:ruby -*-
# Bach Preludes & Fugues 1-12 Well Tempered Clavier
# Book 1, Prelude 1. Transcribed from
# https://www.youtube.com/watch?v=2oFjk0HynY4
define :bach do |n|
#play an array of notes twice, with the last 3 repeated each time
#this is the pattern used repeatedly in Prelude no.1
2.times do
@sinewalker
sinewalker / firefox-reverse-wheel.md
Last active November 8, 2023 08:47
Firefox Reverse/"Natural" scroll wheel direction

Open about:config and set mousewheel.default.delta_multiplier_y to negative, e.g. -100 if the current value is (the default) 100

This should only be necessary on platforms where Firefox isn't honouring the global setting. For instance on a Mac or Windows it's not necessary if you've set the scrolling direction to reverse globally, but on Linux, Firefox doesn't honour KDE's setting. I haven't tested GNOME ….

The default setting is fine for an actual mouse-wheel, but when using a touchpad to two-finger-scroll (or a trackball), it's more Natural for the page to scroll down when you swipe your fingers up: it seems more like how a paper page will shift.

@sinewalker
sinewalker / irish-cream.md
Last active July 20, 2019 10:51
Whiskey Cream

Whiskey Cream

Per batch (about 870ml)

  • 1 teaspoon unsweetened cocoa powder
  • 1 teaspoon instant coffee powder
  • 1 cup (235 ml) thickened/whipping cream
  • 1 (400 ml) can sweetened condensed milk
  • ½ teaspoon vanilla extract