Skip to content

Instantly share code, notes, and snippets.

View cobalamin's full-sized avatar
👾

Simon Welker cobalamin

👾
View GitHub Profile
@cobalamin
cobalamin / keybase.md
Created November 12, 2017 17:49
keybase.md

Keybase proof

I hereby claim:

  • I am cobalamin on github.
  • I am cobalamin (https://keybase.io/cobalamin) on keybase.
  • I have a public key whose fingerprint is B6BD 656D D8E6 73B1 24E9 2ACF AD89 CB1E F8FC C1FF

To claim this, I am signing this object:

@cobalamin
cobalamin / grab_pdf.sh
Last active February 17, 2019 15:23
Download a PDF via `rclone` to the reMarkable
#!/bin/bash
set -e
# Extract some info from the given remote path
REMOTE_PATH="$1"
REMOTE_FILENAME="$(basename $REMOTE_PATH)"
REMOTE_EXTENSION="${REMOTE_FILENAME##*.}"
# Expect the filename given in the remote to end in .pdf
if [ "$REMOTE_EXTENSION" != "pdf" ]
@cobalamin
cobalamin / next_week.sh
Last active February 17, 2019 21:11
next_week.sh: a script for the reMarkable tablet to create a new page for my weekly planner suspend screen
#!/bin/bash
set -e
BASE_PATH="/home/root/.local/share/remarkable/xochitl"
TEMPLATE_NAME="S_Blk_screen"
SUSPEND_SCREEN_UUID="cb55aae3-6073-44a2-96ef-3f02e89d127e"
SUSPEND_SCREEN_PATH="$BASE_PATH/$SUSPEND_SCREEN_UUID"
systemctl stop xochitl
@cobalamin
cobalamin / .Xmodmap
Created June 16, 2019 20:16
.Xmodmap to remap CapsLock to Alt ("Meta")
keycode 66 = Alt_L
clear Lock
@cobalamin
cobalamin / audiomgmt.sh
Created June 16, 2019 20:29
Audio management (prev/play+pause/next, volume up/down, speaker/headphone switching) via the command line
# I used the commands below not only on the command line, but also set up the aliased commands as global keyboard shortcuts.
# This can be useful if you have a keyboard that lacks media keys, or if the media keys don't behave exactly as you want them to.
# Everything below assumes PulseAudio on top of ALSA.
alias volup="amixer set 'Master' 10%+" # Using amixer because pacmd/pactl can increase beyond 100% volume, which I don't want.
alias voldn="amixer set 'Master' 10%-"
# This assumes sink port #1 and the naming of these ports. Check `pacmd list-sinks` and make adjustments if necessary.
alias outsp='pacmd "set-sink-port 1 analog-output;output-speaker' # output to speakers
alias outhp='pacmd "set-sink-port 1 analog-output;output-headphones-1' # output to headphones
import matplotlib.pyplot as plt
class Paper(object):
def __init__(self, force_inline=True):
from copy import copy
self.orig_rc = copy(plt.rcParams)
self.force_inline = force_inline
def __enter__(self):
if self.force_inline: