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
schlueter / Rescue-Arch-LVM-on-LUKS-with-direct-efi-boot.md
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
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.
$SCRIPT = <<EOS
apt-get update
apt-get install -qq libsystemd-dev libncurses5-dev python3-dev
curl -fsSl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
@schlueter
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

produces:

@schlueter
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
TIMES=100
WORDS=100
rm -rf $(<head-words)
rm -rf $(<tail-words)
uniq -i /usr/share/dict/words > uniq-words
@schlueter
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 =~ /.+?(bitbucket.org|github.com)(?::|\/)(.*?).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
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 https://get.haskellstack.org/ | sh
8 stack install xmonad
9 stack setup
10 stack install xmonad
@schlueter
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
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
schlueter / .xinitrc
Created February 19, 2017 22:36
My xinitrc
#!/bin/sh
# 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
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