Skip to content

Instantly share code, notes, and snippets.

View JayWalker512's full-sized avatar

Brandon Foltz JayWalker512

View GitHub Profile
@JayWalker512
JayWalker512 / md5-sidecar
Created December 13, 2013 01:54
Functions for creating checksum files and easily testing them against the parent file. These go in your .bashrc file. Works on Linux.
md5sc()
{
local target="$1"
local checksumString=$(md5sum "$target")
local checksum=${checksumString:0:32}
echo "$checksum" > "$target.md5"
echo "$checksum $target"
}
md5v() #md5 verifies a file based on it's .md5 sidecar file. return 0 == passed.
@JayWalker512
JayWalker512 / batch_wav_to_ogg
Created October 19, 2012 16:15
Batch convert .wav to .ogg
for f in *.wav
do
oggenc -q 6 "$f" -o "${f%.wav}.ogg"
done
@JayWalker512
JayWalker512 / Battery_Consumption_Tester
Created October 9, 2012 21:34
Laptop battery consumption test under simulated user load
#! /bin/bash
RUNTIME=1500 #number of seconds to run for
DELAY=7 #time to delay between starting/closing progs
OUTFILE=$1 #file to write results in
FIRSTPROG="gimp"
SECONDPROG="geany"
THIRDPROG="rhythmbox"
STARTTIME=$SECONDS
@JayWalker512
JayWalker512 / flawless_ds
Created October 7, 2012 05:02
Settings for a flawless (working) dual screen setup on my desktop
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 304.51 (buildd@pluot) Tue Sep 25 01:59:08 UTC 2012
#Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
# Identifier "Monitor1"
# VendorName "Unknown"
# ModelName "DELL 1704FPT"
# HorizSync 30.0 - 81.0
# VertRefresh 56.0 - 76.0
@JayWalker512
JayWalker512 / teensy_setup.sh
Last active December 17, 2019 17:26
Teensy Setup Script (for Ubuntu/Debian)
#!/bin/bash
#Teensy setup script. Configures your Ubuntu linux machine for developing on the Teensy.
#By: Brandon Foltz
#September 18, 2012
#Released under MIT license:
#Copyright (c) 2012 Brandon Foltz
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including #without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to #the following conditions: