Skip to content

Instantly share code, notes, and snippets.

View voutilad's full-sized avatar
🥸

Dave Voutila voutilad

🥸
View GitHub Profile
@voutilad
voutilad / bl-brightness
Created April 27, 2017 18:55
Backlight brightness control for MacBook Air 11" on Gentoo using Intel driver. (Adapted from https://wiki.gentoo.org/wiki/Apple_Macbook_Pro_Retina_(early_2013)#Display_backlight)
#!/bin/bash
bldb='/sys/class/backlight/intel_backlight/brightness'
step=113
current=`cat $bldb`
new=$current
if [ "$1" == "up" ];then
new=$(($current + $step))
elif [ "$1" == "down" ];then
new=$(($current - $step))
fi
Section "InputClass"
Identifier "Keyboard Setting"
MatchIsKeyboard "yes"
Option "XkbOptions" "ctrl:swapcaps"
EndSection
@voutilad
voutilad / 90-macbook-air-dpi.conf
Created April 27, 2017 16:03
Setting proper X11 (Xorg) DPI settings for 11" macbook air
Section "Monitor"
Identifier "Monitor0"
DisplaySize 257 144 # In millimeters
EndSection
@voutilad
voutilad / freebsd-manual-install.md
Last active May 29, 2019 16:58
Manually Installing FreeBSD with ZFS root capable of Boot Environments

Use Case

I want to:

  1. dual boot macOS Sierra and FreeBSD 12-CURRENT (or HardenedBSD 12-CURRENT),
  2. use rEFInd to manage EFI boot selection,
  3. use ZFS for my root disk laid out to support boot environments (via beadm)

The current guided installer only does a full root ZFS install when using the whole disk, which defeats #1 above.

Let's do this

Less talkin' more walkin'...

@voutilad
voutilad / macbook-kbd-freebsd.md
Last active March 23, 2017 15:56
MacBook keyboards on FreeBSD

oh my tilde

On both 11.0-RELEASE and 12.0-CURRENT, the default keymap doesn't properly work with MacBook keyboards...the classic backtick/tilde issue where instead you get angle brackets or worst case nothing! (Though often fn+UP will generate a tilde!)

fixing on the console

Using xkbdcontrol, I modified the currently working keymap based on what was running by default on TrueOS at time of writing.

  1. Place this in a file like usr/share/syscons/keymaps/us.macbook.kbd.
@voutilad
voutilad / 50-mtrack.conf
Created February 12, 2017 01:58
Config for making MacBook Pro touchpad not suck under X11
###############################################################
# Config for making MacBook Pro touchpad not suck under X11
###############################################################
Section "InputClass"
Identifier "touchpad catchall"
Driver "mtrack"
MatchIsTouchpad "on"
Option "Sensitivity" "0.2" # fixes jerky motion. crank up mouse pointer acceleration in gnome settings to accomodate for higher speed.
Option "IgnoreThumb" "true" # ignore resting thumb
#assuming you've done `brew install openssl`
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" python setup.py install
@voutilad
voutilad / cl_django_up.sh
Created February 17, 2016 22:24
Quick CL Django Launch
cd /var/www/courtlistener && python manage.py migrate && python manage.py loaddata cl/visualizations/fixtures/scotus_map_data.json && python manage.py cl_update_index --type opinions --solr-url http://127.0.0.1:8983/solr/collection1 --update --everything && python manage.py runserver 0.0.0.0:8000
@voutilad
voutilad / .git-prompt
Created January 26, 2016 20:31
Git Prompt Bash script
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).