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
# from https://forum.micropython.org/viewtopic.php?p=19988&sid=7aaeff853648d6cd65371661708c1fba#p19988 | |
import network | |
import time | |
import uos | |
from machine import Pin | |
led = Pin(2, Pin.OUT) | |
led.off() # actually turns it on | |
sta_if = network.WLAN(network.STA_IF) | |
sta_if.active(True) |
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 | |
while :; do # until forever... | |
if ! evtest --query /dev/input/event2 EV_KEY BTN_TOUCH; then # if somebody is pressing their finger on the touchscreen... | |
echo BTN_TOUCH! | |
tmux next-window -t 0 # tell un-named tmux session #0 to switch to its next window | |
sleep .1s # avoid doing this twice for a single touch | |
fi | |
sleep .05s | |
done |
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
#!/usr/bin/env python | |
import subprocess, time, os, sys | |
#TODO: kill any already-running bluelog instances | |
cmd = ['./bluelog', '-m', '-t', '-f', '-a0', '-n', '-v'] | |
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
mru_macs = [] |
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
diff -r d8638b19d99d bluelog.c | |
--- a/bluelog.c Tue Jun 30 21:44:06 2015 -0400 | |
+++ b/bluelog.c Tue Jun 30 21:48:00 2015 -0400 | |
@@ -911,7 +911,7 @@ | |
{ | |
if (friendlyclass) | |
{ | |
- printf("[%s] %s,%s,%s,(%s)\n",\ | |
+ printf("%s,%s,%s,%s,(%s)\n",\ | |
dev_cache[ri].time, dev_cache[ri].addr,\ |
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
/* | |
* modem.pde | |
* | |
* Copyright (c) 2014 panStamp <contact@panstamp.com> | |
* | |
* This file is part of the panStamp project. | |
* | |
* panStamp is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or |
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 | |
socat -ddd -ddd PTY,raw,echo=0 "EXEC:'python /home/tz/proj/dsc/stdinout_tofrom_named_pipe.py that',pty,raw,echo=0" & | |
SOCAT_PID1=${!} | |
echo | |
read -p 'Enter PTY number (eg "12"): ' PTY1 | |
sudo slattach -dv -p slip /dev/pts/${PTY1} & | |
SLATTACH_PID1=${!} | |
echo | |
read -p 'Enter interface name (eg "sl0"): ' IFACE1 |
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
# create a pty and attach it to python app's stdin/out | |
socat -ddd -ddd PTY,raw,echo=0 "EXEC:'python /home/tz/proj/dsc/stdinout_tofrom_named_pipe.py that',pty,raw,echo=0" | |
# create a second pty and attach it to python app's stdin/out | |
socat -ddd -ddd PTY,raw,echo=0 "EXEC:'python /home/tz/proj/dsc/stdinout_tofrom_named_pipe.py other',pty,raw,echo=0" | |
# write some binary data into the first pty (where '7' is what's printed by socat) | |
cat /bin/true > /dev/pts/7 | |
# read some binary data from the second pty (where '11' is what's printed by socat) |
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
#!/usr/bin/env python | |
import thread, sys, time | |
if sys.argv[1] == "other": | |
fifo_w = open('/tmp/south', 'wb') | |
fifo_r = open('/tmp/north', 'rb') | |
log = open('/tmp/serial_log_southbound', 'wb') | |
else: | |
fifo_r = open('/tmp/south', 'rb') | |
fifo_w = open('/tmp/north', 'wb') |
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
#!/usr/bin/python | |
import json, sys | |
# convert time warner cable's json channel listing to csv | |
# http://www.timewarnercable.com/northeast/support/clu/clu.ashx?CLUID=476&Zip=14534&Embedded=true | |
# 1. use chrome's "network" tab in "developer tools" to obtain a curl command line to retrieve the listing (http://www.timewarnercable.com/CustomerService/Clu/CluJson.ashx?[..]) | |
# 2. retrieve the listing w/ curl | |
# 3. nuke the non-ascii bytes perl -i.bak -pe 's/[^[:ascii:]]//g' time_warner_channel_listings.json |
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
#!/usr/bin/env python | |
# dump the contents of an atmel AT45DB041B flash part to 'data.bin' | |
# usage: ./dump_AT45DB041B.py /dev/ttyUSB0 | |
# tested w/ https://github.com/audiohacked/pyBusPirate ac19e00b53, Bus Pirate Hardware labelled v3.6, Firmware: "Bus Pirate v3b, Firmware v5.10 (r559), Bootloader v4.4" | |
# bugs: slow. as in... dozens of hours :/ |
NewerOlder