This Arduino sketch controls a series of ten leds similar to the visor of a Cylon Centurion or Knight Rider's car, KITT. Pressing the button cycles through different speed settings.
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
############################################################################### | |
# Base box # | |
############################################################################### | |
config.vm.box = "chef/centos-6.5" |
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/bash | |
echo 'Downloading pre-built binaries' | |
wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.2.24.linux-amd64.go1.2.tar.gz | |
echo 'Extracting archive' | |
tar xzf nsq-0.2.24.linux-amd64.go1.2.tar.gz | |
echo 'Creating correct directory structure' | |
mkdir -p nsq-0.2.24.linux-amd64.go1.2/usr/local/ | |
mv nsq-0.2.24.linux-amd64.go1.2/{bin,share} nsq-0.2.24.linux-amd64.go1.2/usr/local/ |
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/bash | |
echo "Creating directory structure" | |
mkdir -p ./tmproot/usr/bin | |
mkdir -p ./tmproot/usr/share/applications | |
mkdir -p ./tmproot/usr/share/icons/hicolor | |
mkdir -p ./tmproot/usr/share/icons/gnome | |
mkdir -p ./tmproot/opt/ | |
echo "Downloading archive" | |
cd ./tmproot/opt |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC19TqKl998IFqVt6RP4mTsVTX0qP95yBUnbX1/Cfm33YgPulRyju3Q0tfajTi47yvKgTgniLoFpev4YySGiXBZ0NECCLITISoarakcqITBiY73R+F+aaw0mHx6FM9mQSAvqmEP/Vvg6UGiSUMDKxfKZPhzlbzaJO0ch00RyVgfW8CfHkL0PeUA2qFFb24nvcnqmhNeVGer0ze/NsndnvztgOp01ql6PnEES4589AgQ7y3AgwOIHz8YGr+EdAQzSsglt3cxco1wj8k7JRB+I6uIb3pcV0Y8R6kTYqdJD7QmkqOMzWZNsy+rHBzLrudZ1Wu/7eP8JBbMuVVs+5i8gU93 kenny 20180423 |
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
# Alternative to vagrant destroy | |
# Example usage: $> hulk smash -f vm1 | |
hulk() { | |
if [[ $1 == "smash" ]]; then | |
shift | |
vagrant destroy $@ | |
fi | |
} | |
# When you use caps, -f is implied | |
# Example usage: $> HULK SMASH |
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/bash | |
# This script wraps around ssmtp. It makes a bit easier for me to send emails from cron. | |
# How to use this script: | |
# send-email.sh --subject="hello world" --body_file="/path/to/file.txt" --email="kenny@example.com" | |
# Set PATH | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
function fail() { |
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
# If you have a healthcheck defined in your Dockerfile | |
# | |
# HEALTHCHECK --interval=5s --timeout=4s --start-period=10s CMD-SHELL pg_isready -U postgres -t 0 || exit 1 | |
# | |
# or in your docker-compose.yml | |
# | |
# healthcheck: | |
# test: ["CMD-SHELL", "pg_isready -U postgres -t 0 || exit 1"] | |
# timeout: 4s | |
# interval: 5s |
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/bash | |
command="curl -s $1 2>/dev/null" | |
prev_output=$(eval "$command") | |
echo "$prev_output" | |
while :; do | |
curr_output=$(eval "$command") | |
curr_wc=$(echo "$curr_output" | wc -l) | |
prev_wc=$(echo "$prev_output" | wc -l) | |
wc_diff=$((curr_wc - prev_wc)) |
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/bash | |
if [[ -z $1 ]]; then | |
echo "Usage: $(basename $0) HOSTNAME" >&2 | |
exit 1 | |
fi | |
ssh-copy-id $@ | |
ssh-copy-rsub $@ |