I've been having tremendous fun writing tutorials about each of the Drupal 8 APIs in turn, and I hope people have been finding them useful. They've certainly been eye-openers for me, as I've always focussed on achieving a clear worked example, and doing that alone unearths all sorts of questions (and usually—but not always—answers) about how Drupal 8's core itself works.
This is an ode to Dirk Engling’s OpenTracker.
It’s a BitTorrent tracker.
It’s what powered The Pirate Bay in 2007–2009.
I’ve been using it to power the downloads on http://driverpacks.net since the end of November 2010. >6 years. It facilitated 9839566 downloads since December 1, 2010 until today. That’s almost 10 million downloads!Stability
It’s one of the most stable pieces of software I ever encountered. I compiled it in 2010, it never once crashed.wim@ajax:~$ ls -al /data/opentracker total 456 drwxr-xr-x 3 wim wim 4096 Feb 11 01:02 . drwxr-x--x 10 root wim 4096 Mar 8 2012 .. -rwxr-xr-x 1 wim wim 84824 Nov 29 2010 opentracker -rw-r--r-- 1 wim wim 3538 Nov 29 2010 opentracker.conf drwxr-xr-x 4 wim wim 4096 Nov 19 2010 src -rw-r--r-- 1 wim wim 243611 Nov 19 2010 src.tgz -rwxrwxrwx 1 wim wim 14022 Dec 24 2012 whitelist Simplicity
The simplicity is fantastic. Getting up and running is fantastically simple: git clone git://erdgeist.org/opentracker .; make; ./opentracker and you’re up and running. Let me quote a bit from its homepage, to show that it goes the extra mile to make users successful:
opentracker can be run by just typing ./opentracker. This will make opentracker bind to 0.0.0.0:6969 and happily serve all torrents presented to it. If ran as root, opentracker will immediately chroot to . and drop all priviliges after binding to whatever tcp or udp ports it is requested.
Emphasis mine. And I can’t emphasize my emphasis enough.Performance & efficiency
All the while handling dozens of requests per second, opentracker causes less load than background processes of the OS. Let me again quote a bit from its homepage:
opentracker can easily serve multiple thousands of requests on a standard plastic WLAN-router, limited only by your kernels capabilities ;)
That’s also what it said in 2010. I didn’t test it on a “plastic WLAN-router”, but everything I’ve seen confirms it.Flexibility
Its defaults are sane, but what if you want to have a whitelist?
- Uncomment the #FEATURES+=-DWANT_ACCESSLIST_WHITE line in the Makefile.
- Create a file called whitelist, with one torrent hash per line.
Have a need to update this whitelist, for example a new release of your software to distribute? Of course you don’t want to reboot your opentracker instance and lose all current state. It’s got you covered:
- Append a line to whitelist.
- Send the SIGHUP UNIX signal to make opentracker reload its whitelist1.
I’ve been in the process of moving off of my current (super reliable, but also expensive) hosting. There are plenty of specialized HTTP server hosts2 and even rsync hosts3. Thanks to their standardization and consequent scale, they can offer very low prices.
But I also needed to continue to run my own BitTorrent tracker. There are no hosts that offer that. I don’t want to rely on another tracker, because I want there to be zero affiliation with illegal files. This is a BitTorrent tracker that does not allow anything to be shared: it only allows the software releases made by http://driverpacks.net to be downloaded.
So, I found the cheapest VPS I could find, with the least amount of resources. For USD $13.504, I got a VPS with 128 MB RAM, 12 GB of storage and 500 GB of monthly traffic. Then I set it up:
- ssh‘d onto it.
- rsync‘d over the files from my current server (alternatively: git clone and make)
- added @reboot /data/opentracker/opentracker -f /data/opentracker/opentracker.conf to my crontab.
- removed the CNAME record for tracker.driverpacks.net, and instead made it an A record pointing to my new VPS.
- watched http://tracker.driverpacks.net:6969/stats?mode=tpbs&format=txt on both the new and the old server, to verify traffic was moving over to my new cheap opentracker VPS as the DNS changes propagated
- create .torrent files for certain files uploaded to Drupal
- append to the OpenTracker whitelist file 5
- parse the statistics provided by the OpenTracker instance
You can see the live stats at http://driverpacks.net/stats.Conclusion
opentracker is the sort of simple, elegant software design that makes it a pleasure to use. And considering the low commit frequency over the past decade, with many of those commits being nitpick fixes, it also seems its simplicity also leads to excellent maintainability. It involves the HTTP and BitTorrent protocols, yet only relies on a single I/O library, and its source code is very readable. Not only that, but it’s also highly scalable.
It’s the sort of software many of us aspire to write.
Finally, its license. A glorious license indeed.
The beerware license is very open, close to public domain, but insists on honoring the original author by just not claiming that the code is yours. Instead assume that someone writing Open Source Software in the domain you’re obviously interested in would be a nice match for having a beer with.
So, just keep the name and contact details intact and if you ever meet the author in person, just have an appropriate brand of sparkling beverage choice together. The conversation will be worth the time for both of you.
Dirk, if you read this: I’d love to buy you sparkling beverages some time :)
Explaining Drupal 8's cache metadata with the help of tacos.
I think romance is a wonderful part of storytelling that we see in just about every form of media. Thing is, in RPGs I feel it often gets the short end of the stick. Why is this?
First, I think we’re uncomfortable having romantic moments with our friends in games. It can feel weird, strange, abnormal, pick an adjective. Emotions and even pretending to have intimate and sappy moments can be awkward.
Second, that might not be the kind of game you’re looking to play or story to collaboratively tell together. Understandable, whatever your reasons.
Third, and where I’m going to focus on with this article, is while we’ve seen hundreds if not thousands of love stories play out on the small and large screens, in our books and audio dramas, and on stage from the bard himself Shakespeare, we might not understand what goes into setting the stage for a love story. So lets get into it.Starting Up
Since we’re playing a RPG and not writing a story it’s important to understand you don’t want to, and probably can’t, force a romance. I mean you could but I imagine it goes poorly most of the time. Besides, who likes to be forced to do anything. With that said, what you’re doing as a GM, or player, is providing an opportunity for romance to happen. To do that you need to know what pieces you need to have in place.Lovers
You can’t have a romance without at least two participants, unless you’re doing something existential and self involved. If you are I want to hear about that by the way. That parts simple. Two or more entities to fall in love.Attraction
This is a moment when the Lovers realize there’s something more between them than just friendship or existence. This thing could be physical or emotional but often it’s best to have both if possible. This attraction is at times one sided and other times it is mutual. It can happen at the same time in a lust or interest at first sight or first conversation situation or it can happen for one lover later than another. In the end this attraction is opening the door for an opportunity.
Before we get to opportunity I want to talk about physical attraction in RPGs. I always felt physical attraction was tricky because RPG’s are often a spoken medium. This is where pictures can come in handy of NPCs to help visualize what people look like but I tend to go more with descriptions, not just of physical looks but the feel and tone of persona’s. A conversation with an NPC to get the feel of them and putting a flirtatious, kind, welcoming, or some other positive adjective tone in there voice can go pretty far. If you know your fellow players you’d actually be aware of what their interests, likes, and enjoyments are and can play to them. That’s a little inside baseball but we should use all the tools at our disposal to create the best possible experience for all of the players, including ourselves, at the table. Let’s move on.Opportunity
So let’s review. You need two or more lovers and then some attraction between those lovers. How that happens is anyone’s guess. You could have two PCs who decide outside of game they want to have a romance in play. You could have the situation spontaneously show up during play between any characters, be they PC/PC or PC/NPC. The thing is that once attraction is there opportunities need to be presented in order to allow the lovers to create connections. These opportunities could be a moment in a hallway of the space ship they’re on together to have a conversation, a chance where one of them can save the other one from a burning building, or an opportunity a lover creates for themselves where they do something kind or sweet for the other lover, like bringing them the pendant of their father they’ve been searching for these past ten years.Connections
Connections are those moments when the lovers realize they have something in common, have a shared belief or ideal, want the same things out of life, or whatever it is that takes their attraction and deepens it. Without those connections, those moments which deepen the bonds between the lovers, there isn’t a way to progress the romance. Opportunities are one kind of moment that creates a connection but there are others.Challenges
These are internal struggles or personal challenges which keep the romance from progressing. They can come in the form of trust issues, having been hurt by lovers before, obligations to other parts of the lovers life such as work or family. They are stronger and often more emotional struggles because of their personal nature, but overcoming them can create deep connections between the lovers.Threats
Threats are active and external forces that may or may not be trying to thwart the romance. Some examples of threats would be the police hunting one of the lovers, a gunshot wound causing one of the lovers to bleed out, or a sun about to go super nova and the lovers are on a ship in the same system. I mean death is a pretty solid threat as is incarceration.Outcomes
The outcome is a good piece to have when love is either young and it hasn’t set in yet or it’s love on the rocks and you need to that moment to see if the romance will continue on or if it will end. These are the moments in stories where one or both of the lovers decide to carry on or go their separate ways. This could be the moment where one of the lovers confronts the other with the truth they know about and want to hear the others answer before they make a decision. It could be the moment where they profess their love for the first time. It could be the gesture or apology to help start healing what has been broken. This is that moment that answers the question “What is the current fate of this romance?“Tying Things Up
So those are the parts of a romance. I’ll be back in a few weeks to talk about what an arc of a romance can look like and provide an example. If you’re looking for more on romance in your games right now you can check out The Misdirected Mark Podcast Episode 247 – The Love Arc and Panda’s Talking Games Episode XX – Romance Is In The Air. Thanks for reading and before you go let me know if you’ve ever used romance in your games, how it went, and the story. I love a good romantic story.