Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / weatherstation.txt
Last active August 6, 2017 09:53
Turns out one of my neighbors has a weather station; I would like to receive its data using Arduino
# Turns out one of my neighbors has a weather station
# I would like to receive its data using Arduino
# sudo ./src/rtl_433
Sensor temperature event:
protocol = Prologue
button = 0
battery = Ok
temp = 16.3
@probonopd
probonopd / gist:e5447a774899006af57f
Last active January 4, 2025 19:45
Modify stock OpenWrt installation to be a DHCP client and to use USB storage to expand capacity; provide TimeCapsule service
# Installed barrier_breaker rc2 OpenWrt image
# Set computer to 192.168.1.2
telnet 192.168.1.1
passwd
# Set new root password; this enables ssh
# Set up the wired network interface as a DCHP client
cat > /etc/config/network <<\EOF
@probonopd
probonopd / traceback.py
Last active February 10, 2018 17:39
Show flask traceback when running on production server
import traceback
@app.errorhandler(500)
def internal_error(exception):
"""Show traceback in the browser when running a flask app on a production server.
By default, flask does not show any useful information when running on a production server.
By adding this view, we output the Python traceback to the error 500 page.
"""
trace = traceback.format_exc()
@probonopd
probonopd / Antergos Arch OS ISO boot from loop GRUB2
Last active August 29, 2015 14:08
WORKING Antergos Arch OS ISO boot from loop GRUB2
menuentry "Antergos" {
iso_path="/boot/iso/antergos-2014.08.07-x86_64.iso"
search --no-floppy --file ${iso_path} --set
live_args="for-arch --> img_loop=${iso_path} img_dev=/dev/sda1 earlymodules=loop"
custom_args=""
iso_args="archisobasedir=arch archisolabel=ANTERGOS quiet"
loopback loop ${iso_path}
linux (loop)/arch/boot/vmlinuz ${live_args} ${custom_args} ${iso_args}
initrd (loop)/arch/boot/archiso.img /boot/iso/additional-initramfs/initramfs
}
@probonopd
probonopd / fstab
Created November 22, 2014 17:44
WORKING extroot /etc/config/fstab for OpenWrt Barrier Breaker 14.07-rc2
config global automount
option from_fstab 1
option anon_mount 1
option delay_root 3
config mount
option target /overlay
option device /dev/sda1
option fstype ext4
option options rw,sync,noatime
@probonopd
probonopd / shairport
Last active August 29, 2015 14:10
WORKING SHAIRPORT ON wr703n http://stdio.be/blog/2014-08-26-Shairport-on-TL-WR703N/ for sending AirPlay audio to the TP-Link TL-WR703N
cat > /etc/init.d/shairport <<\EOF
#!/bin/sh /etc/rc.common
NAME='shairport'
START=99
start() {
SPEAKER=$(amixer scontrols | head -n 1 | cut -d "'" -f 2)
amixer sset $SPEAKER '80%' || exit 1
sleep 2
shairport -d -a $(uci get system.@system[0].hostname)
@probonopd
probonopd / IRExtender.ino
Last active August 29, 2015 14:10
IR Extender using IRLib by Chris Young http://cyborg5.com - Works well with NEC code devices
/*
IR Extender using IRLib by Chris Young http://cyborg5.com
Works well with NEC code devices
*/
#include <IRLib.h>
int RECV_PIN = 11;
IRrecv My_Receiver(RECV_PIN);
@probonopd
probonopd / A5-V11.txt
Last active January 4, 2025 19:41
Very cheap (8 USD) "3G/4G Router", apparently similar to Hame MPR-A1 (but a clone since I can login with admin/admin via telnet). On the PCB it has a W9825G6EH-75 RAM chip. Ethernet MAC address starts with 2C:67:FB:
I flashed OpenWrt CHAOS CALMER (Bleeding Edge, r43793) using the stock web interface of the device. Just connect the router with an Ethernet cable to a network, it will switch on the blue and red LEDs. Find you the IP address from the DHCP server, and log into the router using your web browser.
Login: admin
Password: admin
Switch the language to English from the drop down menu. I got reconnected to a wrong IP address, so I had to type the correct one again in the URL field of the browser, then the interface was English. Using the Administrator -> Firmware menu, I flashed https://dl.dropboxusercontent.com/u/98389203/openwrt-ramips-rt305x-a5-v11-squashfs-factory.bin
Or, if you want to make the image yourself, use the OpenWrt Image Generator:
wget https://downloads.openwrt.org/snapshots/trunk/ramips/OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2
tar xfj OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2
cd OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64/
make image PROFILE="A5-V11"
They DELETE the video after one week? Must be a joke.
First, view the ARD page with the video to be downloaded. It access a master.m3u8 file.
curl http://hls-geo.daserste.de/i/videoportal/Film/c_490000/499702/geo_ios.smil/master.m3u8 | tail -n 1
wget http://hls-geo.daserste.de/i/videoportal/Film/c_490000/499702/geo_ios.smil/index_4_av.m3u8
ffmpeg -i index_4_av.m3u8 -c copy snowdenA.ts
Video: Die Story im Ersten: Jagd auf Snowden
12.01.15 | 45:07 Min. | Verfügbar bis 19.01.15 +++ Aus rechtlichen Gründen ist dieses Video nur innerhalb von Deutschland verfügbar. +++ "Jagd auf Snowden" erzählt die wahre Geschichte der Flucht Edward Snowdens. Es ist eine David-gegen-Goliath-Geschichte, an deren Ende sich Snowden ins Moskauer Exil rettet und die Supermacht USA blamiert ist.
@probonopd
probonopd / ESP8266.txt
Last active August 29, 2015 14:13
ESP8266 experiments
I got cheap ESP8266.txt modules from China and was struggling to get them working electrically. It turns out they are very power hungry, in fact, when you use a serial adapter to power them, most likely they will crash the serial adapter due to their power draw. For this reason, I was not able to communicate with the device for a long time.
This setup works for me:
Solder VCC and CH_PD pin together (TODO: Check whether using a 1k pullup resistor changes the overall power consumption). Use a Prolific USB serial adapter to provide the 3.3V and GND, use another(!) serial adapter connected to the same USB hub (so that they share GND) to provide the RX and TX pins for the serial connection. This setup might not be the cleanest, but it was the quickest for me to get up and running.
According to my measurement with a cheap USB "Charger Doctor", the device draws 470 mA when hooked up to a Prolific serial adapter for providing the 3.3V.
My module had the following firmware pre-loaded:
[Vendor:www.ai-thinker.com Ver