Some Bits: Nelson's log

5 posts in November 2015

Somebits Games

Mostly putting this here so I don’t forget. I made a new Twitter account, @SomebitsGames, for uploading game screenshots and video clips. The PS4 has some very nice sharing features built in but I didn’t want to share them to my main Twitter account.

(Fallout 4 is awesome, y’all.)

Tweeting a torrent

A friend asked what the best way to tweet a Torrent would be. I thought the obvious thing would be to tweet the magnet link, but those tend to be too long to fit in 140 characters and Twitter’s URL shortener doesn’t work on magnet: links.

Why are magnet links so long any way? Here’s a working magnet link to a copy of wikipedia, an 11GB file named enwiki-20140707-pages-articles.xml.bz2:

magnet:?xt=urn:btih:e18b8cce7d9cb2726f5f40dcb857111ec573cad4&tr=http%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce

That’s awfully wordy, let’s break it down and futz it to be readable.

magnet:?
xt=urn:btih:e18b8cce7d9cb2726f5f40dcb857111ec573cad4
tr=http://academictorrents.com/announce.php
tr=udp://tracker.publicbt.com:80/announce
tr=udp://tracker.openbittorrent.com:80/announce

The important thing is the hash in the xt parameter. That uniquely identifies the content and it can be addressed as such via DHT discovery. Those tr parameters just list trackers, which you don’t strictly need thanks to trackerless torrents. Indeed, the following 61 character URL works fine in Transmission.

magnet:?xt=urn:btih:e18b8cce7d9cb2726f5f40dcb857111ec573cad4

It’s not very convenient though. It lacks a filename, file size, etc. Startup time is (theoretically) slower as we have to discover data. I also don’t know how much of a performance impact removing the tracker list has, if any.

Of course one could add some of the missing bits back. “dn” is the displayed filename, “xl” is the file size.

The xt parameter is a bit subtle; there are at least 9 different hash algorithms that can be specified. BTIH seems to work well for torrents.

 

Home surveillance cameras

I want a security camera for my house, for when I’m away. Nothing too creepy or serious, just some peace of mind so I can see if a package got delivered or if the propane delivery guy came.

tl;dr; I’m going to try ZoneMinder with an Axis M1034-W camera.

The mainstream product everyone recommends is Dropcam. But it and its competitors all work by uploading a video feed 24/7 to a server they host which then does the processing to do useful things like only show video clips of motion, etc. They tend to charge $10/month for the hosting. And it’s a lot of bandwidth. So I’d rather roll my own, using my own Linux server. (Yes when Jack Bauer breaks in, Chloë will be able to knock my surveillance offline with a Linux zero-day. That’s not my threat model.)

The hacker solution for this stuff is surprisingly unclear. On the Linux video collection side, motion(1) is a popular low level tool for doing motion detection from video feeds. ZoneMinder seems to be the high end tool of choice for managing multiple cameras. It works with a lot of stuff including video capture devices hard-wired to the machine and network cameras.

I’m baffled by the choice of camera hardware. I decided to try Axis because they have a developer program, ZoneMinder works well with them, and they have a reputation for being good but expensive. I only need one camera so expensive is OK. The M10 line seems to be the low end stuff, $200 instead of $400+. The M1034-W is the WiFi option. They also make wired POE stuff which seems like it’d be good for outdoor use.

That’s all research. I ordered the camera, will tinker with it next week.

 

LoL lag on Wifi

When I play LoL with a wired connection to my router in Grass Valley it looks like this. But when I play via WiFi it looks like this. Periodic ping spikes, from the usual 85ms to 170ms or so. Note the packet loss number is the same, about 10 packets/s. This ping pattern is not particularly noticeable while playing, but sometimes on WiFi I’ve had serious lag, disconnects, etc. Not so much when wired.

The WiFi link is as good as it could be. I’m 10 feet from the router, clear line of site, 30dB SNA. 802.11n, 5GHz, relatively quiet network. Either there’s something broken with the hardware or else WiFi really is just this unreliable. Need to experiment more. I sure wish I knew what algorithm LoL used to report ping. Last time I did the packet dissection work it looked like it was the RTT time on special ping/pong packets. Maybe they get lost and are retransmitted?

OpenWRT second impressions

I’ve been running OpenWRT for a few days now. I like it. I also don’t like it. I’m going to keep running it, and will probably install it on any new routers in the future.

The part I like is it feels like a “real Unix”. I trust that it’s going to do its job right, or if it doesn’t I have access to look inside and figure out what went wrong. Tomato has always been opaque, and if it rebooted itself or didn’t do something I wanted I felt powerless to understand or fix it. With OpenWRT it’s all just a Linux distro.

The part I’m on the fence about is that it’s “real Unix”. In particular, that it’s super complicated. The ipchains have some 100+ rules in them, which really are defining about seven “zones”, which really are 4 physical interfaces and maybe 6 aliased interfaces. It’s great that the system is so flexible, but then it also makes even simple things hard.

vnstatThe part I don’t like is that it’s a “real Unix”, complete with that awful lack of usability. You can configure everything but you also have to configure everything. That’s a grand old Unix tradition, see also: Linux-on-the-desktop. As an example, I’d like a simple counter of bandwidth used per month. There’s none installed by default. But here’s a list of 17 tools that might do it. Only a few of those have Web UIs, and only ~half of them are installable via the package manager. And none do precisely what I want, the best I could find is something that churns out hideous 1990s-style gd images. Of course I could build my own, it’s Unix! But I don’t want to build my own.

I think there’s a need for a new router firmware, a nicely packaged distribution based on top of OpenWRT. Take the stock OpenWRT and add the packages that ordinary home router users need. Maybe write / package a few other things, like the monthly bandwidth monitor I would like. Then stick them all together with a nice GUI that ordinary technical savvy people can use, not just Linux/networking experts. Tomato is the model for this, the core Tomato firmware was a beautiful, well documented product. Tomato-on-OpenWRT would be terrific. It all seems doable, OpenWRT is a strong foundation. The only thing I’m not sure about is how hard it’d be to build the web UI. Luci is pretty flexible as a foundation, I think what I’m describing could just be a skin and set of Luci apps. But not sure.