Our media server

July 26, 2010 in Personal | Comments (3)

Tags:

I can finally show off my week­end pro­ject! Well okay the vestiges of it star­ted a couple week­ends ago and it bled into this morn­ing by a couple hours, but I think it still counts as a week­end project.

Jasna and I don’t have cable or an antenna for our TV, which means we down­load everything we watch, or bor­row it from friends on rare occa­sions. My Mac­Book was start­ing to run near the end of its use­ful life as my main work com­puter — the track­pad was becom­ing unus­able which meant I couldn’t depend on it when trav­el­ling — but it’s still got some life in it as a server. It was wire­less net­work­ing (no cables to string around), uses very little power, is com­pletely silent, comes with media soft­ware (Front Row) and comes with a remote con­trol, is really small (less than 2cm tall), which makes it more or less the per­fect media server.

The only down­side is it was a pain to get shows onto it to watch, as you have to search for the shows manu­ally, down­load them, then copy them manu­ally over to the server. So, I decided to make a web interface.

Check here for screen­shots of the new web inter­face for the media server. EasyN­ews, our Usenet pro­vider, provides very handy ser­vices like global searches, thumb­nails and AutoUn­RAR­ing. A big bene­fit to this is not hav­ing to wait until some­thing has fin­ished down­load­ing it before watch­ing it. So far I’ve got ser­vices for down­load­ing from Usenet — which is where we get almost all of our TV shows to watch, down­load­ing CFL games from TSN and just upload­ing indi­vidual files from your browser. At some point I need to set up schedul­ing so that it auto­mat­ic­ally down­loads new epis­odes of shows when they’re released, but I guess that’s for another weekend.

I’m kind of embar­rassed at how proud I am to have actu­ally fin­ished it in a week­end like I’d planned, espe­cially con­sid­er­ing I haven’t done any web devel­op­ment in years and years. The astute of you may have noticed I used straight-​​up CGI instead of tech­no­lo­gies the cool kids are using: no love from me for PHP or RoR or Ajax or any­thing. Since I haven’t put any pass­word secur­ity in yet — that’s for another week­end yet — and the box is pub­licly address­able via IPv6 I’ve had access to the web inter­face to just within our local net­work, but if IPv6 takes off some day it’ll be cool to be able to down­load movies while I’m away from home.


Rock Point

July 23, 2010 in Personal | Comments (0)

Tags: , ,

Jasna and I just got back today from a spur-​​of-​​the-​​moment camp­ing trip. We’d been want­ing to have a couple days just for the two of us for a while now, and our sched­ules aligned, so why not? We thought camp­ing would be more fun and relax­ing than any­thing else, and I’ve wanted to see the towns along the Grand River forever, so we com­bined the two and went to Rock Point Pro­vin­cial Park: it’s vir­tu­ally right where the Grand River emp­ties into Lake Erie and neces­sit­ates driv­ing along the Grand River, a fairly nice drive.

I’ve got a grand total of 3 pic­tures from the trip and I’m happy with that. It wasn’t the sort of trip to you take to take pic­tures of. Appar­ently the park is known for its fossils, but we didn’t go hunt­ing for those, either. We went down to the beach a few times — twice for moon­light swims — and spent most of the rest of our time in our camp­site sit­ting around and talk­ing and enjoy­ing one another. We got a nice camp­site with fairly good pri­vacy and shade, and none of the camp­sites dir­ectly around us were taken. It was pretty much the per­fect couple of days, only because we were together.

Jasna bought me an e-​​reader! She actu­ally bought it before we’d planned on going on the trip, but I guess this seemed a good time to give it to me, and give me an easier time read­ing. It’s a Kobo, which I adore. I’m actu­ally a bit of a freak in that I’m some­what anti-​​paper: I often prefer read­ing on screen to read­ing on paper; maybe it’s a side-​​effect of grow­ing up with a com­puter. The Kobo has a really beau­ti­ful dis­play and is easier for me to read than any­thing I’ve ever read from, CRT, LCD or paper. The dis­play can’t refresh very often — maybe once a second or some­thing like that — and it’s super low-​​powered which makes it unsuit­able for any­thing but read­ing, which suits me fine. I have only two com­plaints: firstly, that the font size is typ­ic­ally too big, but that’s a cri­ti­cism of the books that are format­ted for it, not the device itself; and secondly, that it’s really dif­fi­cult to skip for­ward or back­ward a lot of pages at a time. With paper it’s easy to do a bin­ary search for the page you want, but the Kobo seems determ­ined to make you do a lin­ear search.

I did bring my laptop, but only so I could do just enough work to make my guilt levels fall to the point where I could genu­inely relax. It turns out that’s about half an hour, ha! I’m still more or less pleased with how the thesis is progressing.


Watching CFL games on Linux

July 2, 2010 in Personal | Comments (3)

This art­icle is for you if you’re a Cana­dian foot­ball fan, you don’t have cable TV, you use an oper­at­ing sys­tem which doesn’t run Microsoft Sil­ver­light (such as Linux) and you can’t afford to go out to the bar all the time to watch foot­ball games. I may have described only one per­son (myself), but just in case there’s another per­son out there, I will describe to you how to watch your foot­ball games. I should say that while I’m no law­yer, my under­stand­ing is that what I describe here could become illegal should Bill C-​​32 pass, and we all hope it won’t.

The first and most import­ant part is to install rtm­p­dump, a util­ity which you will use to actu­ally down­load the video stream. I’m using a rel­at­ively ancient ver­sion of rtm­p­dump and I don’t think it mat­ters par­tic­u­larly which ver­sion you use.

From there all that is needed is a way to get the rtmp URLs of the game you want. To use the script below, you give it a link to a game you want to down­load — some­thing of the form http://​watch​.tsn​.ca/​c​f​l​-​g​a​m​e​s​-​o​n​-​d​e​m​a​n​d​/​w​e​e​k​-​1​-​a​l​o​u​e​t​t​e​s​-​v​s​-​r​o​u​g​h​r​i​d​e​rs/ (one of the best foot­ball games I’ve seen in a long time, incidentally) — as an argu­ment. It then extracts the clip IDs for each quarter (includ­ing over­time, if needed), determ­ines the rtmp URL for each video clip, and down­loads the video files in sequence.

#!/​bin/​bash
match_​name=$(echo “$1″ | sed ‘s,\(http://.*\)\(week-[^/]*\)\(.*\),\2,’)
q=0
# get through all the videos (quar­ters) linked to by the given game (“epis­ode”)
for i in $(wget –q –O — “$1″ | fgrep ‘#clip’ | sed ‘s/\(.*#clip\)\([0 – 9]*\)\(.*\)/\2/’ | uniq) ; do
        src=$(wget –q –O — “http://​esi​.ctv​.ca/​d​a​t​a​f​e​e​d​/​f​l​v​/​u​r​l​g​e​n​j​s​.​a​s​p​x​?​vid=$i | sed ‘s@\(.*\)\(rtmp://.*\.flv\)\(.*\)@\2@’ | tr –d ‘\n\r ‘)
        echo “sav­ing from $src
        echo “sav­ing to $match_​name-$q.flv“
        rtm­p­dump –r $src –o $match_​name-$q.flv“
        q=$(($q + 1))
done
# cre­ate dummy file so we don’t know before­hand if a game went into over­time
if [ $q –eq 4 ] ; then
        touch $match_​name-$q.flv“
fi

It’s worked well for me but there are cer­tainly no guar­an­tees about it. CTV could break it eas­ily if they so wanted (if you’re read­ing this, CTV, please don’t be mean­ies. Let’s be BFFs). The only unfor­tu­nate down­side to it is that CTV poten­tially loses out on some advert­ising rev­enue. My recom­mend­a­tion is to stare extra hard at the com­mer­cials to make up for it on the days you do go out to the bar to watch a game. Head­ing out to the sta­dium — at the very least whenever the Riders are in town — would also be a nice way to sup­port the league and TSN for put­ting games up online.


Back from Calgary

June 26, 2010 in Research | Comments (0)

Tags: , , ,

Check out the pic­ture gal­lery. Even though it was all cat­egory the­ory, and con­sequently I can fol­low almost none of the other talks, it’s still a won­der­ful con­fer­ence to go to. It’s a nice atmo­sphere, a good mix­ture of grad stu­dents, pro­fess­ors and pro­fess­ors emeriti.

After the con­fer­ence I stayed in Cal­gary for another couple weeks work­ing on my thesis and going through bounds infer­ence in detail with Brian. Unfor­tu­nately, and excit­ingly, we found a big prob­lem with the mix­ture of coin­duct­ive and induct­ive recur­sion which can take one out of poly­no­mial time. I may write on that more at some other time, but only after I think of a good way to describe it, at which point the first place it will appear is my thesis.


FMCS

June 10, 2010 in Research | Comments (0)

Tags: , , ,

The fol­low­ing ffffff­fuuuuuuuuuuuu describes most of my life for this week:
Problem?

I’m fly­ing out to Cal­gary Sunday morn­ing and then head­ing to Kana­nas­kis for FMCS. My code is already work­ing for many cases, but it’s not as com­plete as I’d like it to be. I’d like to do a proper demon­stra­tion of bounds infer­ence when I give my talk. It’s a pretty laid-​​back con­fer­ence so, truth be told, even if I don’t get it totally work­ing by then I can still just demo what I have, or just not demo at all.

I went to FMCS once before, in 2004 at the end of my under­grad. It’s a very nice con­fer­ence, less formal than most, which makes it a lot more fun and a lot more pro­duct­ive, I think. After the con­fer­ence I’ll be hanging around in Cal­gary for another week or so work­ing on my thesis and hanging out with the par­ents. Good times.


A new laptop and a new look at Linux

June 9, 2010 in Personal | Comments (4)

Tags: ,

I bought a new laptop a couple days ago. For the past 6 years I’ve been using Macs just about exclus­ively; for the past 3 years or so it’s been my Mac­Book that’s been my main machine. How­ever, for the past sev­eral months I’ve been increas­ingly annoyed with the Mac­Book: the case is crack­ing; the track­pad but­ton is stick­ing; and, some­thing which mat­ters to very people other than me, Apple has been slow in fix­ing some bugs and the source code wasn’t avail­able for me to fix them myself. So, after much delib­er­a­tion, a couple days ago I picked up a Toshiba Satel­lite, on sale and marked down even fur­ther because it was a demo model. Accord­ing to the spe­cific­a­tions it’s bet­ter than a mod­ern Mac­Book in pretty well every way, and at about one quarter the price. The only down­side was it didn’t run OS X, which I was becom­ing dis­il­lu­sioned with anyway.

I inten­ded to run OpenSol­aris on it because I quite like the tech­no­lo­gies in OpenSol­aris. Unfor­tu­nately OpenSolaris’s hard­ware sup­port is very poor, but the laptop I bought looked like it had the highest chances of work­ing, and it was very highly rated by Con­sumer Reports as well. After try­ing vari­ous OpenSol­aris dis­tri­bu­tions and developer builds, I’ve come to the con­clu­sion that it’s not going to work, at least not yet. It was prob­ably naïve of me to think I could get my wire­less card work­ing under OpenSolaris.

(more…)


The Moon

May 29, 2010 in Personal | Comments (1)

Tags:

Every now and then I find some­thing that blows my mind at how awe­some the Inter­net is. The first mind-​​blowing exper­i­ence for me was more than 15 years ago, when I dis­covered the Future Crew’s home BBS in Hel­sinki, Met­ro­poli, was online, and I wouldn’t have to wait months to get the latest demos out of Fin­land anymore.

Today it was find­ing 360º pan­or­a­mas of the moon. Check it out right now. I’ve always wondered what it would be like to stand on a for­eign world. And yes, I’ve seen the movie Moon, but it didn’t quite do it for me. These pan­or­a­mas were really amaz­ing for me, though, prob­ably the closest I’ll ever get to stand­ing on the moon myself.

The Apollo 17 pan­or­ama is prob­ably my favour­ite due to the geo­graphy of the area, the boulders and “moun­tains”. The Apollo 12 pan­or­ama is nice just to appre­ci­ate how ghetto the lander was and how incred­ible it is that NASA was able to pull the mis­sions off so well given the tech­no­logy of the time.


FMCS

May 28, 2010 in Research | Comments (0)

Tags: , , ,

I’m going to be going to attend­ing FMCS 2010 in Kana­nas­kis — not far from Cal­gary — in a couple weeks. I’ll be giv­ing a talk on the imple­ment­a­tion of Pola in some capa­city, though I haven’t figured out how broadly scoped or what to focus on.

I’m get­ting pretty psyched about it. The con­fer­ence will be fun if it’s any­thing like I remem­ber FMCS 2004 to be. The loc­a­tion is amaz­ing. Plus after that I get to spend some time in Cal­gary with my par­ents and hanging out with Brian and, prob­ably most import­antly but least awe­somely, work­ing on my thesis.


Yay open source

May 22, 2010 in Personal | Comments (1)

Tags:

Today’s xkcd is so val­id­at­ing. I first stumbled across the GNU mani­festo prob­ably in 1996, when I was in high school. I wanted to teach myself C and a good way to do that was to use the DJGPP com­piler, which led me to GNU. I didn’t really think much of it at the time except that these “Free Soft­ware Found­a­tion” people took soft­ware way too ser­i­ously, but I was happy to have a free com­piler to play with.

(more…)


Itanium tutorial

May 12, 2010 in Personal | Comments (0)

Tags: , ,

I’ll make a research-​​oriented entry before long; I prom­ise. I’m start­ing to get towards writ­ing up some of the cool stuff in my thesis.

I’ve star­ted writ­ing an Itanium tutorial. That doc­u­ment will magic­ally update every now and then as I write more. On the one hand it’s slightly embar­rass­ing how much I’ve writ­ten — it’s almost half as much as I’ve writ­ten for my thesis so far — but it’s an entirely dif­fer­ent kind of writ­ing. There’s really no rigour at all to it. I don’t have to worry about prov­ing things or cit­ing things; I’ve never proofread any of it. I just write whatever pops into my head, which makes it very quick and easy. Primar­ily it’s for my bene­fit, so I don’t for­get any­thing and so that it forces me to fig­ure things out more con­cretely than I would otherwise.

(more…)