Skip to content

Instantly share code, notes, and snippets.

View pfaffman's full-sized avatar

Jay Pfaffman pfaffman

View GitHub Profile
#!/bin/bash
# Get data from connected server identified by the current WIFI SSID
if [ -f /sbin/iwconfig ]
then
# it's ubuntu (or, maybe debian)
HOST=`iwconfig wlan0 | grep ESSID | sed 's/.*ESSID:\"\(.*\)\"/\1/'`
else
# oops.
echo Mac solution is not implemented
# networksetup -getairportnetwork en1 | awk -F": " '{print $2}'
#!/bin/bash
# install stuff needed to be a server and wifi hotspot
# Make any stanford.edu address resolve to 10.10.10.1
# Jay Pfaffman <pfaffmman@relaxpc.com>
# This should be used on a stand-alone network where access to the
# actual server is unavailable.
if [ ! -f /etc/init.d/bind9 ]
then
sudo apt-get -y --force-yes install bind9
#!/bin/bash
### Setup a wifi Access Point for Fall 2013 critter corral study
# based on from https://gist.github.com/dashohoxha/5767262/
# unlike the above script, this configures hotspot to run at boot
### make sure that this script is executed as root
if [ $(whoami) != 'root' ]
then
echo "
This script should be executed as root or with sudo:
sudo $0
#!/usr/bin/env bash
# fixnames
# Jay Pfaffman <jay@pfaffman.com>
# Available from https://gist.github.com/pfaffman/8644399
if [ $# -lt 1 ]
then
echo "Usage " $0 files
echo " Replaces names (or any words) in files passed on the command line."
echo " Edit below to change what names get replaced."
exit
@pfaffman
pfaffman / gist:6383973
Created August 29, 2013 22:02
Start critter corral
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/play.conf
#
# This could be the foundation for pushing play apps to the server using something like git-deploy
# By calling service play stop in the restart command and play-start in the restart command.
#
# Usage:
# start play
# stop play
# restart play
@pfaffman
pfaffman / README.md
Last active December 19, 2015 17:08 — forked from mbostock/.block

Switch between stacked and grouped layouts using sequenced transitions! Animations preserve object constancy and allow the user to follow the data across views. Animation design by Heer and Robertson. Colors and data generation inspired by Byron and Wattenberg.

@pfaffman
pfaffman / README.md
Last active December 19, 2015 16:59 — forked from mbostock/.block
@pfaffman
pfaffman / README.md
Last active December 19, 2015 16:59 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;