Skip to content

Instantly share code, notes, and snippets.

Ethan Spoelstra espoelstra

Block or report user

Report or block espoelstra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
espoelstra / tabs_outliner.json
Last active Aug 6, 2019
Add custom Tabs Outliner overrides for "rux616/karabiner-windows-mode" `karabiner://karabiner/assets/complex_modifications/import?url=`
View tabs_outliner.json
"title": "Tabs Outliner overrides",
"rules": [
"description": "X (Ctrl+Shift) [Only Chrome]",
"manipulators": [
"from": {
"key_code": "x",
"modifiers": { "mandatory": ["control", "shift"]}
espoelstra / !
Created Aug 2, 2019
New macOS setup for flexibility and productivity
View !
# Check the dock settings
# Future plan is automatic removal of unwanted items and addition of only necessary items using dockutil/Ansible
# plutil -p Library/Preferences/
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL"
brew cask install karabiner-elements
espoelstra / azure-pipelines.yml
Last active Apr 2, 2019
Azure DevOps Docker for Mac installation
View azure-pipelines.yml
vmImage: 'macOS-10.13'
- bash: |
brew cask install docker # grabs Docker for Mac
set -x
echo "Running xattr" # I think brew is supposed to do this but I was still prompted to "trust" it if I didn't
xattr -d -r /Applications/
echo "Running Docker as root to install helpers"
espoelstra /
Last active Apr 2, 2019 — forked from fkorotkov/nanka.xml
Use the xml to enabled nested virtualization with the Anka command line installation instructions like `sudo installer -applyChoiceChangesXML nanka.xml -pkg AnkaBuild- -target /`


Save this XML somewhere like $HOME/Downloads alongside the Anka .pkg file. Install/reinstall using this xml to enabled nested virtualization with the Anka command line installation instructions:

  • sudo installer -applyChoiceChangesXML nanka.xml -pkg AnkaBuild- -target / If your hardware supports things properly, you should be able to install Docker for Mac inside the VM and use it.
espoelstra /
Created Feb 6, 2019 — forked from stuaxo/
Launch desktop files instead of opening them in gedit.
$ sudo apt-get install dex
$ /usr/bin/dex -c /usr/bin/dex -t ~/.local/share/applications/
espoelstra / !
Last active Feb 8, 2019
Jetbrains IntelliJ IDEA RubyMine WebStorm PhpStorm PyCharm HiDPI on ChromeOS experiments
View !

Finding optimal settings for rapidly scalable ChromeOS UI

Official documentation

"Best" method in Chrome v73+

The BEST way to do this in ChromeOS is to right click the application icon and choose "Use low density", then either allow ChromeOS to restart the app or say "Not now" and do it yourself. Upon starting the application again you should have a readable UI without monkeying with the Java VM options or the properties of whichever app your are using.

espoelstra /
Last active Oct 1, 2018
Moving hard drive between computers when joined to an AD/SSSD domain

When imaging a computer to speed up the process and avoid prompts but also prevent duplicate names on the network, you will typically configure your image to pull out some unique identifier from the hardware and use that as part of the hostname. This could be the system serial number or the MAC address of the on board network controller (highly unlikely to change without a new motherboard) or something else like that.

The trouble with moving a hard drive that has been imaged this way is that it doesn't magically adopt the unique attributes from the new system, and if you reimage the old system with another drive, there is now an "evil" twin on the network, which causes no end of fun and frivolity when suddenly one becomes untrusted and you can't log into any AD accounts from it.

The solution is that immediately after moving the drive to a new computer, you should login, then unjoin the domain (requires domain admin permissions) so you can rename and rejoin once you know what unique identifier you will use i

espoelstra /
Created Sep 30, 2018
Bats testing advice, pitfalls, and behaviors to watch out for

You can test almost anything with Bats, assuming it accepts input and produces output or an exit code. Bats is commonly used to test scripts, but it can also be used to wrap characterization or integration tests or API "contract" tests around an executable (eg run my-thing.bin -h ; assert_exit_code == 0 or to run a series of commands and test the results across various parts of the system (eg docker ps | grep bats ; assert_line 'bats/bats:latest').

When testing a shell script with bats there are multiple ways to perform the tests. You can do a "blackbox" style run --some option --other-flag and assert certain outputs and status codes and check for the presence or absence of temporary files in /tmp (if it was supposed to create or clean them up), or the absence of oh-poop.log files if the script triggers logging when it hits an error. Or you can do individual function testing and examine the environment variables after executing individual functions to check for any state that you are t

espoelstra /
Last active Sep 30, 2018
Bats-mock which to use?
espoelstra /
Created Sep 26, 2018
Creating a FreeDOS image for PXE boot

FreeDOS easy to update USB or PXE boot (Legacy or EFI)

I've been wanting to do this for quite a while, ever since I had to make up dozens of USB drives with a system image for deployment to migrate from Windows XP to Windows 7 for a large enterprise. Any tweaks to the image required re-writing all the drives, and the quickest way to burn up a cheap drive is repeated reads and writes. Then I learned partway through the rollout from the support staff performing the hands-on reimaging that on some systems the boot took forever, and while investigating I discovered that there was a BIOS update that remedied the issue and the system boot dropped from 10-15 minutes to a minute or two. After that I added updating the BIOS to our reimage procedure checklist, but again I was making multiple copies of the USB so that each tech could have one to do the fairly quick BIOS update before switching over to the other USB for imaging the system. Luckily at the time I had opted for the USB "full" image of FreeDOS which had sp

You can’t perform that action at this time.