Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / ardmonitor.py
Created March 1, 2014 21:03
Python Arduino Monitor
#! /usr/bin/env python
# Read the output of an Arduino which may be printing sensor output,
# and at the same time, monitor the user's input and send it to the Arduino.
# See also
# http://www.arcfn.com/2009/06/arduino-sheevaplug-cool-hardware.html
import sys, serial, select
class Arduino() :
@probonopd
probonopd / schwaebische_orbituaries.py
Created March 9, 2014 15:41
Create an RSS feed out of schwaebische.de orbituaries images
#!/usr/bin/python
#
# Create an RSS feed out of schwaebische.de orbituaries images
#
import os, sys, time, datetime, urllib2, re
from BeautifulSoup import BeautifulSoup
debug = False
@probonopd
probonopd / connect_ssh_macaddr.sh
Last active August 29, 2015 13:57
Connect to the device with known MAC address but unknown Ethernet addres
#!/bin/bash
# Connect to the device with known MAC address but unknown Ethernet addres
## Or simply:
## sudo nmap -sP 192.168.180.0/24 | grep "FE:ED"
MAC="10:FE:ED" # Can be just partial
OWNIP=$(LANG="" ifconfig | grep "inet addr" | head -n 1 | cut -d ":" -f 2 | cut -d " " -f 1)
SUBNET="$(echo $OWNIP | cut -d "." -f 1).$(echo $OWNIP | cut -d "." -f 2).$(echo $OWNIP | cut -d "." -f 3).0/24"
ssh $(sudo nmap -sP $SUBNET | grep FE:ED -C 2 | head -n 1 | cut -d " " -f 5) -l root
@probonopd
probonopd / Arduino Yun (Linino) on OpenWrt
Last active December 21, 2021 06:28
Install Arduino Yun (Linino) software on OpenWrt on 3rd-party devices. TODO: Fully automate install and/or use Linino rootfs image and/or build own firmware using OpenWrt Image Generator. CAVEATS: I have not yet found out how to make the Bridge use Serial (USB) instead of Serial1 (HardwareSerial) for the Leonardo. I have asked a question about t…
opkg install luci-lib-json luci rng-tools usbutils avrdude avahi-daemon
# If rng-tools is not installable, then install it by hand from e.g., http://download.linino.org/linino_distro/linino_dev/latest/packages/rng-tools_3-2_ar71xx.ipk
# Edit your /etc/opkg.conf, add
src/gz barrier_breaker http://download.linino.org/dogstick/all-in-one/latest/packages/
# Comment out your earlier src/gz
opkg update
opkg list|grep bridge
@probonopd
probonopd / fast-sd-flashing.sh
Last active August 29, 2015 13:57
Fast dd SD card flashing on Mac
# Flash FAST (9 MB/sec with SanDisk Class 10 16 GB card; roughly 8 minutes for 4 GB)
sudo dd if=$FILE of=/dev/rdiskX bs=1m
# Check the status
# Run on second terminal
while pgrep ^dd; do pkill -INFO dd; sleep 10; done
# Or, use this GUI
http://www.gingerbeardman.com/dd-gui/dd-gui-021.zip
@probonopd
probonopd / announce
Last active August 29, 2015 13:58
Announce services using tinysvcmdns
#!/bin/sh /etc/rc.common
# This script should not have the same name as one of the binaries
# that gets launched by it, otherwise it terminates itself rather
# than shutting down cleanly.
START=94
STOP=1
start() {
@probonopd
probonopd / DIDL-Lite
Last active April 17, 2020 00:54
Play a YouTube video on a Samsung Smart TV using UPNP
<?xml version="1.0" encoding="UTF-8"?>
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sec="http://www.sec.co.kr/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item id="f-0" parentID="0" restricted="0">
<dc:title>Video</dc:title>
<dc:creator>vGet</dc:creator>
<upnp:class>object.item.videoItem</upnp:class>
<res protocolInfo="http-get:*:video/mp4:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" sec:URIType="public">$URI</res>
</item>
</DIDL-Lite>
@probonopd
probonopd / 0_reuse_code.js
Created June 21, 2014 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 311c206e82386107364cd0e6b042e88d87bd7a68
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
Clang: 5.1 build 503
@probonopd
probonopd / flamingo.ino
Last active February 6, 2020 06:32
ELRO Flamingo FA50R Remote Protocol
/******************************************************************************
** Flamingo_send **
** **
** Flamingo device commands (on/off)hard coded (not deciphered yet) **
** code is 28 byte long. To transfer it in 32 bit code 4 *0 **
** is added to the left. For programming reason hex code representation**
** of device code is used. E.g. Remote 0,C,On: **
** code 28 bits: 0001100110111111110100100110 **
** code 32 bits: 00011001101111111101001001100000 **
** Hex: 19BFD260 **