Skip to content

Instantly share code, notes, and snippets.

@mvollrath
mvollrath / cgwrap
Last active August 30, 2021 21:03
Run command in a temporary cgroup
#!/bin/sh
set -e
MYNAME=$(basename $0)
usage() {
echo "${MYNAME} runs a command in a temporary cgroup with cpu and/or memory limits."
echo "Usage: ${MYNAME} [-c <cpu_shares>] [-m <mem_limit>] [-s <swmem_limit>] [-h] command args..."
exit 1
@mvollrath
mvollrath / bower.json
Last active February 14, 2018 22:25 — forked from marchrius/bower.json
{
"name": "load-google-maps",
"version": "1.0.1",
"authors": ["Glenn Baker", "Gavin Foley", "Matteo Gaggiano", "Matt Vollrath"],
"description": "Load Google Maps API using jQuery Deferred.",
"main": "load-google-maps.js",
"keywords": ["Google Maps", "Async"],
"license": ["MIT", "GPL"],
"dependencies": {
"jquery": ">=1.5"
@mvollrath
mvollrath / casper2docker
Last active August 30, 2021 15:57
Import Casper iso to Docker
#!/usr/bin/env bash
# Usage: casper2docker /path/to/your/example.iso
# In this case, the docker image would be named "example"
# Requires tar, md5sum, and docker
set -e
MY_NAME="casper2docker"
ISO_PATH="${1?You must provide the path to an .iso}"
image_name="`basename $ISO_PATH .iso`"
@mvollrath
mvollrath / get-edid.py
Last active February 18, 2023 16:49
Write monitor EDID to stdout with xrandr
#!/usr/bin/env python
import re
import subprocess
def get_edid_for_output(connector: str) -> bytes:
xrandr = subprocess.run(
['xrandr', '--props'],
check=True,
/*************
* ambush.js *
*************
*
* Oh. Oh, I see. This wasn't quite part of the plan.
*
* Looks like they won't let you take the Algorithm
* without a fight. You'll need to carefully weave your
* way through the guard drones.
*
/*************
* colors.js *
*************
*
* You're almost at the exit. You just need to get past this
* color lock.
*
* Changing your environment is no longer enough. You must
* learn to change yourself. I've sent you a little something
* that should help with that.