Skip to content

Instantly share code, notes, and snippets.

View erikkallen's full-sized avatar

Erik Kallen erikkallen

View GitHub Profile
@erikkallen
erikkallen / CircularBuffer.h
Created June 10, 2011 13:11 — forked from yagihiro/CircularBuffer.h
circular buffer library for Arduino (C++)
/*
CircularBuffer.h - circular buffer library for Arduino.
Copyright (c) 2009 Hiroki Yagita.
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
@erikkallen
erikkallen / rbenv-install-system-wide.sh
Created October 18, 2011 14:45
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
apt-get -y install curl
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
@erikkallen
erikkallen / wavedeinterlace
Created August 21, 2012 13:35
Convert a wave file that has for some odd reason both stereo channels interlaced on the left channel and an empty right channel
require 'rubygems'
require 'wav-file'
f = open("test_48khz_c2_s32_le_stereo_on_ch1.wav")
format = WavFile::readFormat(f)
dataChunk = WavFile::readDataChunk(f)
f.close
puts format

Keybase proof

I hereby claim:

  • I am erikkallen on github.
  • I am erikkallen (https://keybase.io/erikkallen) on keybase.
  • I have a public key whose fingerprint is 89FC 9234 4CFF CDDA 92E5 25F6 AACD F8F9 548F 6039

To claim this, I am signing this object:

ser2net
sudo socat pty,link=/dev/tty.net,raw,echo=0,user=erikkallen,group=staff, tcp:10.0.1.50:3333
wget https://raw.githubusercontent.com/deanmao/avrdude-rpi/master/autoreset
wget https://raw.githubusercontent.com/deanmao/avrdude-rpi/master/avrdude-autoreset
sudo cp autoreset /usr/bin
sudo cp avrdude-autoreset /usr/bin
sudo mv /usr/bin/avrdude /usr/bin/avrdude-original
sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
#!/bin/bash
# Still work in progress!
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
CMD_ARGS=($@)
NEW_ARGS="${CMD_ARGS[3]} ${CMD_ARGS[4]} ${CMD_ARGS[5]} ${CMD_ARGS[6]} ${CMD_ARGS[8]}"
if [ "$8" == "-P/dev/tty.Bluetooth-Incoming-Port" ]; then
echo "starting hack"
OLDIFS=IFS
test second gist

Raspberry PI as Arduino network programmer

This guide will show you how to program an Arduino connected to your Raspberry PI from the Arduino IDE on your local computer. Linux and OS X for now

###On your Raspberry PI

First install avrdude

@erikkallen
erikkallen / 16col.txt
Created October 14, 2015 08:16 — forked from solomonhuang/16col.txt
hexdump convert binary to c array data
$ dd if=/dev/urandom bs=1 count=160 | hexdump -v -e '15/1 "0x%02X, " 1/1 " 0x%02X,\n"'
160+0 records in
160+0 records out
160 bytes (160 B) copied, 0.000507955 s, 315 kB/s
0xB3, 0x4C, 0xD7, 0x9B, 0xC4, 0x83, 0x7C, 0x92, 0xDE, 0xF5, 0x63, 0xBA, 0xAB, 0xCF, 0xDE, 0x13,
0x7F, 0xCE, 0x9D, 0xE9, 0x9F, 0xF8, 0xA2, 0xCB, 0x52, 0x6A, 0xD7, 0xDE, 0xD8, 0x12, 0xAC, 0x71,
0x1B, 0x5E, 0xF2, 0x2E, 0x1C, 0x82, 0x24, 0x24, 0xA2, 0x5D, 0x27, 0x90, 0xE4, 0xDC, 0x21, 0xF3,
0xAB, 0x9F, 0xD6, 0x1A, 0xDE, 0xFC, 0xA3, 0xDC, 0x49, 0xA2, 0xEF, 0xF2, 0x95, 0xCB, 0x8A, 0xE2,
0x6F, 0xD5, 0x2E, 0x48, 0x2B, 0x4D, 0x35, 0xEC, 0x62, 0x24, 0x75, 0xEB, 0xCF, 0x26, 0x57, 0xB2,
0x56, 0x65, 0xDF, 0x25, 0xA9, 0xB1, 0xD9, 0x78, 0x7F, 0x76, 0xB2, 0xF4, 0x57, 0xAD, 0xDC, 0xCC,