If I get a seat with a table on the train during my commute, I’m able to hack on some small projects. Today I’m publishing one of them:
I had a ton of home videos on miniDV tapes that I wanted to have available on my media PC, so I set up a few scripts to make this happen.
With the magic of inotify, it made the process fairly straightforward.
The first step is to start the inotify watch:
#!/bin/sh # # set -u set -e set -o noclobber while true do FILENAME=`inotifywait -r . -e close_write --format %f 2> /dev/null` echo $FILENAME if [[ "$FILENAME" = *.dv ]] then nice -20 ffmpeg -i $FILENAME -target ntsc-dvd completed/$FILENAME.vob rm $FILENAME fi done
Then, start the file transfer:
dvgrab -f raw -autosplit -size 0 -showstatus -t -rewind
With short clips, the files are occasionally missed because ffmpeg is still running, so a final pass takes care of the missed files:
for i in *.dv; do ffmpeg -i $i -target ntsc-dvd completed/$i.vob && rm $i; done
I’m loving the passwordstore tool.
I’m slowly converting all of my passwords over to it. The clipboard integration is great as I don’t ever have to actually see my passwords any more.
The Firefox integration is great, and apparently there is Chrome support as well, although I don’t have that working yet.
However, the killer feature IMO is how it uses GPG and git for the backend. This makes it easy for me to tie it into my existing backup system.
I spent a bunch of time doing something like
pass show twitter.com | qrencode -o - | display - and passing that to a barcode scanning app on my phone, only to find out there is a proper Android app.
A future TODO: figure out how to sign and decrypt with multiple keys. This would be an excellent tool for a group that wanted to distribute regularly changing passwords. I’m thinking that you would use git submodules to have a central repo for common passwords, and the main repo for your personal passwords. If your login fails, the first thing to do would be a
pass git submodule update --remote --merge in case you’re out of date.
What’s On is a project to track songs played by radio stations around North America. It was mostly an excuse to learn how Amazon SimpleDB works.
The project source is available for download.
It comes in two parts:
- Airplay scraper
- Django interface
Many radio stations use a common format to list their songs played, with a history of about 12 hours. My scraper runs every 4 hours to get the latest songs, and stores them in Amazon’s SimpleDB.
Every night, new data in SimpleDB is converted to JSON and imported into the project’s Django database.
Right now, there are only about 30 stations available, and the current design with the SimpleDB architecture limits me to 500. After that, a database redesign would be needed.
It’s pretty basic right now, a few features I’d like to add are:
- Infinite scrolling
- Weekly/monthly popularity
Eventually, with enough data, I’ll be able to do some other statistics. Tracking the spread of a newly played song would be fun. Right now, there’s too many ‘new’ songs that are just not in the regular rotations.
Some notes on hacking a Kobo Wifi with a broken screen:
- Taking the case apart is difficult. A cell-phone repair kit probably would have made things easier.
- There is a serial port available, so I soldered a header on and connected with a USB serial breakout board from Sparkfun. 115200, 8N1.
- There was not enough working screen to set the wifi password without a lot of trial and error. Fortunately I had enough screen to scan for networks and select my AP. With the serial console I was able to hardcode the password in /usr/local/Kobo/configure_wpa_network.sh.
- This file persists across boots.
- I enabled telnet and ftp by following these Kobo Wifi hacking instructions, but editing them directly on the filesystem over the serial console instead of creating a Koboroot.tgz
- I noticed that wget is on the default root filesystem, which seems like an easier way of doing things.
- Debian Wheezy ARMEL packages run on the N647 and N647B models.
- The i2c buses don’t seem to work with the standard Linux I2C tools like i2cdetect, etc.
Here is a dump of the serial console from an N647B model.