Skip to content

Instantly share code, notes, and snippets.

View tcr's full-sized avatar
🚮
bad command or file name

Tim Ryan tcr

🚮
bad command or file name
View GitHub Profile
--- hw/arm/stellaris.c.orig 2014-04-17 13:44:44.000000000 +0000
+++ hw/arm/stellaris.c 2014-04-17 13:44:44.000000000 +0000
@@ -1186,7 +1186,7 @@
{ "LM3S6965EVB",
0x10010002,
0x1073402e,
- 0x00ff007f, /* dc0 */
+ 0x0fff007f, /* dc0 */
0x001133ff,
0x030f5317,
@tcr
tcr / beaglebone-instructions.md
Last active February 16, 2016 10:59
Creating a reusable Beaglebone Debian Image

BeagleBone Debian Image

Quick reference:

screen /dev/tty.usbmodem1d113 115200 (tty)
ssh debian@beaglebone.local (ethernet)
ssh debian@192.168.7.2 (usb0)
@tcr
tcr / README.md
Last active August 29, 2015 14:03 — forked from kevinmehall/README.md

Setup

  1. Install OpenOCD. You need version >= 0.8.0.
  1. Acquire a configuration script for your Bus Blaster. Included in the firmware repo is tools/tessel-busblaster.cfg.

  2. Plug the JTAG cable into the Bus Blaster's adapter board and the Tessel. Pin one is towards the USB port; the cable goes over the center of the board.

  3. Run

@tcr
tcr / dist_static_lib.sh
Created February 10, 2014 05:26
Creating distributable, flattened static libraries for distribution with gyp
#!/bin/bash
set -e
cd out/ARM
node -e "console.log('CREATE ' + process.argv[1]); console.log('ADDLIB', 'obj/lib' + process.argv.slice(2).join('.a\nADDLIB obj/lib') + '.a'); console.log('SAVE\nEND')" $@
node -e "console.log('CREATE ' + process.argv[1]); console.log('ADDLIB', 'obj/lib' + process.argv.slice(2).join('.a\nADDLIB obj/lib') + '.a'); console.log('SAVE\nEND')" $@ | arm-none-eabi-ar -M
@tcr
tcr / gist:8460625
Last active January 3, 2016 12:09
coolio
import os
from os.path import join
"""find_tty_usb('067b', '2302') -> '/dev/ttyUSB0'"""
# Note: if searching for a lot of pairs, it would be much faster to search
# for the enitre lot at once instead of going over all the usb devices
# each time.
for dnbase in os.listdir('/sys/bus/usb/devices'):
dn = join('/sys/bus/usb/devices', dnbase)
if not os.path.exists(join(dn, 'idVendor')):
@tcr
tcr / gist:8445503
Created January 15, 2014 21:53
Install node-gyp support on Windows
cinst python VisualStudio2012WDX
for(Iterator<String> it = my2Do; it.hasNext();) {
String elem = it.next();
if (elem.equals(work2)) {
it.remove();
}
}
#!/usr/bin/env ruby
# checkout the readme from the master branch
`git checkout gh-pages; git checkout master README.md`
path = `pwd`.gsub(/\n/, "")
readme_path = File.join(path, "README.md")
index_path = File.join(path, "index.md")
# write the index readme file
@tcr
tcr / Test.md
Last active December 22, 2015 07:48

In your computer / Node.js

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain', 'Content-Length': 'Hello World\n'.length});
  res.end('Hello World\n');
}).listen(4444);
console.log('Server running at http://localhost:4444/');
@tcr
tcr / gist:5339126
Created April 8, 2013 18:16
Rem over Tor
var rem = require('rem');
var SocksAgent = require('socksified').SocksAgent;
var tor = rem.createClient({
base: 'http://....onion'
agent: new SocksAgent({
socks_host: '127.0.0.1',
socks_port: 9050
}),
key: 'null'