Skip to content

Instantly share code, notes, and snippets.

View schlueter's full-sized avatar

Brandon Schlueter schlueter

  • United States of America
View GitHub Profile
schlueter /
Last active March 24, 2024 02:38
Rescue Arch LVM on LUKS with direct efi boot system
# Boot off a live usb or similar as if you're installing
# If you're more comfortable with a different keyboard layout
$ loadkeys dvorak
# populate the second argument of the cryptsetup command based on this
$ parted <<<'print'
# the third argument may be anything, it needn't be used later
$ cryptsetup open /dev/sda3 foobar
# check your volume groups to see what to mount
$ ls /dev/vg
schlueter / Vagrantfile-python-systemd
Last active November 11, 2022 22:51
A Vagrant example of the systemd python package
# With Vagrant and Virtualbox installed, running `vagrant up` in a directory with this file
# will create an Ubuntu Xenial VM running on Virtualbox and then will install the
# prerequisites for and then the systemd python package for python3. After
# installation, a simple test is run and it's output will be shown.
apt-get update
apt-get install -qq libsystemd-dev libncurses5-dev python3-dev
curl -fsSl -o
schlueter / markdown-list-end.markdown
Last active August 29, 2023 21:20
How to terminate a markdown list

The problem

- one
- two
- three

    not a list item


schlueter / awk-versus-xargs
Last active December 10, 2017 17:21
Time use of xargs and awk to rename a set of directories
#!/usr/bin/env bash
set -e
((DEBUG)) && set -x
rm -rf $(<head-words)
rm -rf $(<tail-words)
uniq -i /usr/share/dict/words > uniq-words
schlueter / set_jenkins_build_description.groovy
Created November 1, 2017 18:04 — forked from louis89/set_jenkins_build_description.groovy
A Groovy script to automatically set a Jenkins build's description to the title of the pull request that triggered the build. Works with GitHub and Bitbucket.
import groovy.json.JsonSlurper
def build = Thread.currentThread().executable
def workspace = new File(build.workspace.getRemote())
def repositoryMatcher = "git config --get remote.origin.url".execute(null, workspace).text =~ /.+?(||\/)(.*?).git$/
def pullIdMatcher = "git log ${build.getEnvironment()["GIT_COMMIT"]} --merges --oneline -n 1".execute(null, workspace).text =~ /pull request #(\d+)/
if (!pullIdMatcher) {
println "Could not find pull request for commit '${build.getEnvironment()["GIT_COMMIT"]}'."
schlueter / gist:bd84628c4d3da6eef8246624f379fdd8
Created September 16, 2017 22:55
Install xmonad on a chromebook with crouton
# in chromebook shell
4 sudo sh ~/Downloads/crouton -t xorg,cli-extra,audio,touch,extension
5 enter-chroot
6 sudo enter-chroot
# in the chroot
6 sudo apt install curl
7 curl -sSL | sh
8 stack install xmonad
9 stack setup
10 stack install xmonad
schlueter / gist:eb07cba211015d8f6b7db788798f2828
Last active December 2, 2017 23:25
Log into another encrypted linux system using a LiveCD
# if you want to use a non qwerty keyboard layout
sudo dpkg-reconfigure keyboard-configuration
sudo cryptsetup luksOpen /dev/sda3 some-vg
# enter password
sudo vgscan
# mount the root drive
sudo mount /dev/mapper/some--vg-root /mnt
# consult /mnt/etc/fstab to find out where the boot directories are so you can mount them
schlueter / .pythonrc
Last active February 19, 2017 22:56
My pythonrc
# pylint: disable=import-error,wildcard-import,bare-except
from __future__ import print_function
import sys
import traceback
import random
from pprint import pprint as pp
import yaml
schlueter / .xinitrc
Created February 19, 2017 22:36
My xinitrc
# Set cursor
xsetroot -cursor_name left_ptr &
# Set background
xsetroot -solid black &
feh --bg-center background.png &
# Enable a second monitor if present
xrandr --output eDP1 --auto --output HDMI2 --auto --right-of eDP1 &
schlueter / .ratpoisonrc
Created February 19, 2017 21:25
The contents of my .ratpoisonrc. Unmaintained and unused.
escape C-p
bind Escape abort
bind u undo
bind b exec firefox
bind c slack
bind m spotify
set border 0
set barpadding 0 0 0 0
set padding 0 0 0 0