Skip to content

Instantly share code, notes, and snippets.

View EdHurtig's full-sized avatar

Ed Hurtig EdHurtig

View GitHub Profile
/**
* Paradigm Hyperloop Prototype Node Control Firmware
*
* ABOUT:
* This file defines the controls logic for a single Brake Node. A Brake Node
* is special from a generic node in that it is directly connected to all
* the required sensors and actuators to adequately control the brake Module
* in the event of an emergency, a crucial element to building a fail-safe
* vehicle.
*
printf "CPU Temp (C): "
cat /sys/class/hwmon/hwmon0/device/temp1_input | sed 's/...$//'
root@beaglebone:/sys/class/gpio# systemctl status
● beaglebone
State: running
Jobs: 0 queued
Failed: 0 units
● beaglebone
State: running
Jobs: 0 queued
Failed: 0 units
● beaglebone

Keybase proof

I hereby claim:

  • I am edhurtig on github.
  • I am edhurtig (https://keybase.io/edhurtig) on keybase.
  • I have a public key ASDpYraa-zRm-c8m1A4j_WXTLixUaPm5xzGl6Anl8i10Ygo

To claim this, I am signing this object:

@EdHurtig
EdHurtig / hostnames.md
Last active May 16, 2016 18:52
Thoughts on Host naming conventions

Disclaimer

This is just a brain dump on my personal naming convention thoughts. This is not an officail document or decree of how you should name your servers.

Host Naming Conventions and Domain Name Management

A FQDN is made up of a {hostname}.{domain}

where the hostname is the short hostname configured on the actual server. (In linux this is retrieved via the “hostname -s” command). The Full FQDN is retrieved via “hostname -f”.

@EdHurtig
EdHurtig / .bash_profile_chef.sh
Last active October 16, 2015 23:30
Adds fun chef shorthands
export CDPATH="$CDPATH:$CHEF_REPO/cookbooks"
# Manually converge nodes matching the hostname expresion like "converge stage-*logs*"
function converge() {
knife ssh "name:$1" "sudo chef-client"
}
# Run kitchen with different config files (.kitchen.cloud.yml, .kitchen.local.yml)
kitchen() {
if [[ -f ".kitchen.$1.yml" ]]; then
@EdHurtig
EdHurtig / vagrant bounces
Last active September 12, 2015 03:34
Put me in your .bashrc!
function vagrant() {
command vagrant $@
if [[ $1 -eq "up" && $? -eq 0 ]]; then
date >> .bounces
fi
}
function bounces() {
cat .bounces | wc -l | | tr -d '[[:space:]]'
}
@EdHurtig
EdHurtig / .bash_profile_docker
Created August 21, 2015 19:07
Overrides the docker command and ensures that the default docker-machine is running before running the actual docker command
function docker() {
if [ `docker-machine status default` != "Running" ]; then
echo "WARNING! Starting Default Docker Machine."
docker-machine start default | logger
eval "$(docker-machine env default)"
fi
command docker $@
}
@EdHurtig
EdHurtig / chef-server-install.sh
Last active May 4, 2020 22:49
Bash Script to provision a Chef Server
#!/bin/bash
set -e
echo "Welcome to edhurtig's Chef Server Installation Script."
echo "Please change the following options or accept the defaults by just hitting enter"
PACKAGE_URL_BASE="https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/"
read -i "$PACKAGE_URL_BASE" -p "Chef Server Package Download Location (base path): " PACKAGE_URL_BASE
PACKAGE_NAME="chef-server-core_12.0.8-1_amd64.deb"
@EdHurtig
EdHurtig / aws_zombies.rb
Last active August 29, 2015 14:13
Searches AWS for zombie test servers
#!/usr/bin/env ruby
require 'aws-sdk'
require 'colorize'
AWS.config(
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'])
if ARGV.any?
security_group = ARGV[0]