This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# This configuration file script will create links to the various | |
# dotfiles and directories in the user's home directory. This allows | |
# for the .configuration directory to be "dropped" in and immediately | |
# setup the shell, keys, editor settings, environment variables, etc. | |
# Instructions | |
# | |
# 1. Setup a link called ".configuration" that points to the dotfiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE=$1 | |
FILENAME=${FILE%%.*} | |
# extract the keys and certificates | |
sed -n "/<ca>/,/<\/ca>/p" $FILE > $FILENAME.ca.crt-tmp | |
sed -n "/<cert>/,/<\/cert>/p" $FILE > $FILENAME.crt-tmp | |
sed -n "/<key>/,/<\/key>/p" $FILE > $FILENAME.key-tmp | |
# modify the keys and certificates | |
sed '/ca>/d' $FILENAME.ca.crt-tmp > $FILENAME.ca.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# separate times and words (grep and -v) | |
grep '^[0-9]+:[0-9]+:' $1 &> $1.times | |
grep '^[0-9]+:[0-9]+:' -v $2 &> $2.words | |
# apply the times to the text | |
awk 'NR==FNR{a[i++]=$0;next;}{ if ($0 ~ /[0-9]+/) printf"%s\n%s\n", $0,a[j++];else print;}' i=1 j=1 $1.times $2.words &> $1_vs_$2.srt | |
# add the counter | |
#awk '/[0-9]+\:/{printf("%d\n%s",++counter,$0);}{print $0;}' $1_vs_$2.srt &> $1_vs_$2-final.srt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git branch display | |
git_prompt() | |
{ | |
if ! git rev-parse --git-dir > /dev/null 2>&1; then | |
return 0 | |
fi | |
git_branch=$(git branch 2> /dev/null | sed -n '/^\*/s/^\* //p') | |
if git diff --quiet 2> /dev/null >&2; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int motorPin = 3; | |
int lightsPin = 5; | |
int limitPin = 7; | |
int buttonPin = 8; | |
int buttonLightPin = 4; | |
boolean active = false; | |
boolean motorRunning = false; | |
int dispenseSeconds = 300; | |
int motorRunMaxSeconds = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# ip2dec | |
BEGIN { | |
ip = ARGV[1] | |
split(ip, octets, ".") | |
for (i = 1; i <= 4; i++) { | |
dec += octets[i] * 256 ** (4 - i) | |
} | |
printf("%i\n", dec) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph { | |
rankdir=LR; | |
{ iron_ore copper_ore stone coal uranium_ore } -> ore_line | |
// smelter: specific to iron/copper plate production (1:1 ratio) | |
// quarry: any stone or pure stone-based production | |
// steel mill: specific for steel plate production | |
// due to 5:1 ratio, iron ore fed separate from general smelter | |