Skip to content

Instantly share code, notes, and snippets.

View dschep's full-sized avatar

Daniel Schep dschep

View GitHub Profile
@dschep
dschep / vbox-check
Created December 3, 2014 21:56
Check if running in VirtualBox
sudo -n dmidecode -s bios-version | grep VirtualBox
@dschep
dschep / _etc_udev_rules.d_98-autorandr.rules
Created January 29, 2015 00:10
Automatically call autorandr
# detect monitor [un]plug events, and call autorandr
SUBSYSTEM=="drm", ACTION=="change", RUN+="/bin/bash -c 'DISPLAY=:0 sudo -u $(who|sed -nre s/\(.*\)\\s:0.*/\\1/p) /usr/bin/autorandr -c'"
@dschep
dschep / bashrc
Last active August 29, 2015 14:15
Quick Vi mode for Bash & Readline, with superminimal PS1
set -o vi
bind -m vi-insert "\C-l":clear-screen
PS1='[\u@\h:\W] \$ ' # plain & static liquidprompt-esque prompt
@dschep
dschep / gh-notify
Last active January 8, 2016 19:49
Stupid simple GitHub desktop notifications! Requires cURL, jq, and notify-send.
#!/bin/bash
USER='Your username, Duh.'
TOKEN='An access token that has access to notifications, make one here: https://github.com/settings/tokens'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
API_URL=https://api.github.com
date=
while sleep 30; do
curl -u $USER:$TOKEN $API_URL/notifications?since=$date |\
@dschep
dschep / gist:6004fbe69fceacd340e2
Created May 21, 2015 18:37
Use Shift-Esc as ~ (For use on Lenovo X1 Carbon 2014)
xmodmap -e 'keycode 9 = Escape asciitilde Escape'
@dschep
dschep / run.sh
Last active June 28, 2017 07:04
Helium(Carbon) backup script for use ON android device. (NO PC REQUIRED!!)
CLASSPATH=$(pkg=$(pm path com.koushikdutta.backup);echo ${pkg#*:}) app_process /system/bin com.koushikdutta.shellproxy.ShellRunner2
@dschep
dschep / keybase.md
Created July 7, 2015 19:03
keybase.md

Keybase proof

I hereby claim:

  • I am dschep on github.
  • I am dschep (https://keybase.io/dschep) on keybase.
  • I have a public key whose fingerprint is 583B 5A11 0703 B4F5 C5F8 A28D 1D09 8FA6 AE40 D301

To claim this, I am signing this object:

- name: Compute Vagrant latest version
sudo: no
shell: wget -qO - https://dl.bintray.com/mitchellh/vagrant/|sed -n 's/.*href=\"\([^"]*\).*/\1/p'|grep x86_64\.deb|tail -1|cut -d'%' -f2
register: vagrant_file_name
- name: Download Vagrant latest version
sudo: no
get_url: url="https://dl.bintray.com/mitchellh/vagrant/{{ vagrant_file_name.stdout }}" dest="/tmp/{{ vagrant_file_name.stdout }}"
- name: Install Vagrant latest version
@dschep
dschep / fix-apple-kbd.sh
Created November 25, 2015 15:23
Swap Alt & Meta and default to Fkeys not media keys
#!/bin/bash
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
echo 1 | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
@dschep
dschep / docker-compose-subcommand-wrapper.sh
Created December 3, 2015 03:07
Allow for calling `docker-compose` via `docker compose`
function docker() {
if [ "$1" == 'compose' ] ; then
docker-compose "${@:2}"
else
env docker "${@:1}"
fi
}