Categories
computing programming

On Medium: How to solve a problem like passwords

I’m going to be occasionally publishing long-form things on Medium as an experiment. Here’s one

Categories
Computer Games computing Python

Sorting Steam Screenshots

So Steam, by default, when asked to take a screenshot will merrily scatter them hither and yon across your hard-drive with unwarranted abandon. Specifically, it’ll put them in the app’s home directory. This isn’t great, because what with cloud-saves and game streaming, I tend to treat the hard-drive with my games on it as transient, and not backed up.

However, Steam also has developed a setting called “Save uncompressed screenshots”, and if you set that and a directory, it’ll put all your screenshots in one place! Hurrah!

Except now all your screenshots are called things like “306760_20160825142347_1.png”. Now, the bit before the underscore is a Steam app ID, so you can look up the game name and file things nicely into the right folders.

So here’s a python script to do that thing.

Categories
Computer Games Larp PHP Projects

Week 27 – A Blunderbuss For House Hunting

Last couple of weeks have been a little hectic, and the next couple seem to continue this trend. So:

Work

Shifted to a new primary project at work for the first time in quite a while. Enjoying new challenges, and a more modern codebase to work from. My side of Skute has wound down a bit while others fan the spark a bit, which gives me a chance to plan the next bits for the API.

Play

Still going though SWTOR, mostly. I’ve not had a lot of playtime.

Rest

Moving House

We have the keys to the new flat, big move is this weekend. We moved a few dozen boxes yesterday (Thanks Dan & Jenny for being awesome). Between that and Odyssey, I’m mildly dead now.

Odyssey

I’m a head ref for Odyssey, and work closely with the Story team to help everything go smoothly, and one of the things that didn’t go smoothly last time was our “Blessings” system – the system by which we add reactionary special statuses to characters (Blessings from their Gods, Curses, Long term effects of magic spells, transformation into bloodless monsters, Roleplay effects, Extra hitpoints, everything). Previously we worked with a somewhat Heath-Robinson contraption built of Excel and Access-based PDF generation.

Previously, I built a system called Mimir, which tracks the kudos priests and other characters can earn with their gods. We’re a more narrative-based than stats-based game, so the numbers get fudged a lot, but it’s a decent guideline. It’s also got a fairly fully-featured blogging engine, which is for debriefs.

Screenshot from 2015-08-12 15-45-00_croppedMy last couple of weeks not-working time has been spent extending and expanding that a lot. Folding in an Autocomplete library that linked to the current list of active players and the Blessing system (complete with three-stage approval process and player-facing PDF generation), and then a general once-over on the design has swallowed a lot of my coding time.

When I built it originally a few years ago, I built it in PHP (because I wanted to be able to make quick changes on the fly during an event) using a custom lightweight microframework, and Idiorm/Paris as the database/ORM model. I’m slightly surprised how well that’s held up. I didn’t need to edit the framework at all for this major revision, and Idiorm & Paris worked really well for me. The frontend’s built in Bootstrap, which gives me style without much effort – though I do need to bite the bullet and shift up to v3 – and I’ll be releasing it as Open Source once Odyssey is over, alongside graphs and statistics generated from the actual dataset.

I should put up another post later on about how well Odyssey went, but now I should be getting ready for work.

(Header photo: A Greek Shield Wall, at Odyssey. Photo by Charlotte Moss for Profound Decisions)

Categories
cevearn comics linux Python Shebang tv

Week Nine – it’s better than bad, it’s good

Quiet work week, so we’ll skip that. Decided that I’d had enough of print statements, and moved both Lifestream and Lampstand over to use Python logging instead for everything outputty. Lampstand also needs a pass to separate output into levels, right now everything’s at INFO.

Positive feedback on some creative writing I did recently – on tumblr, and in scraps elsewhere – has led me to want to carve out time to get the novel moving forward again. I need to suppress the urge to kill it with fire and start from scratch, but right now it’s plodding a bit.

Somewhere between Rest and Play lies Odyssey work this week. A good Story Team meeting at the weekend has set some flags out for the year, and indeed next, and then I spent a few hours putting together the Odyssey T-Shirt shop, to supplement our costume & props budget with mercenary goodness.

Somewhere over the last week I’ve also carved out 13 hours to watch the full first series of Daredevil on Netflix, which I enjoyed a lot, and should turn into another entry shortly…

Categories
Personal programming RPG

Competence

Every so often, it occurs to me that Dungeons and Dragons models an extremely schizophrenic variant of competence.

“I use Vicious Mockery on the guard”

“Okay, you fire off a stream of insults which [Clatter] hit him square in the psychosis, dealing [Clatter] 19 psychic damage and knocking him prone. Crying, actually”

vs

“Okay, I’d like to track where the goblins went.”

“Roll on Nature?” [Clatter] “The ground is some kind of dark brown stuff. You doubt the existence of trees”.

And then I have days where..

[Clatter] You rewrite the app notification code. All the tests pass. With this and the database optimisations, test is running 55% faster.

[Clatter] You have flooded the kitchen, the water is blue, the washing machine is still locked, and now your socks are wet.

So maybe it’s not so far off.

Categories
aqWiki BrowserAngel Larp programming Projects Python

Week One

Daily posts are not interesting, and I’ve got the same problem as Norm, to some degree. I’ve got dozens of projects I’m working on, some of them professionally, so I’m going to try weekly updates, with the hope that with those come progress.

Work

Project S is the company I’ve been working for, for the past year. They have a thing, and I’ll be explaining more about that thing the more public we are about it. The last week I’ve been mostly fixing communication issues with our API server (Beehive) and the Media server (Warehouse). Both are Flask-based python applications backing on to a shared CouchDB cluster, and I’ve been working on getting the transcoding services (Thumbnailing, indexing, that kind of thing) to communicate back to the main systems. It’s uncovered an interesting series of security context issues, and some horrible things around EXIF, where finding out if an image is the same way up it started has become troublesome.

My long running project for the other company continues. There is light at the end of the tunnel. I fear the light, now.

New things? Ansible, this month, and also looking at front-end javascript libraries like KnockoutJS. This year I have learnt a lot about Symfony 1.3. None of it good.

Rest

AqWiki Wetired

Over ten years ago, I created AqWiki, a PHP3 based, textile formatted basic wiki system. Originally as a replacement for BrowserAngel’s TCL-based wiki system, it contains structural flaws caused by being written for PHP3, conceptual flaws due to being written by me ten years ago, and security flaws due to being written by me in PHP3 ten years ago. However, one of those flaws is a slightly baroque SQL schema, and so writing an export of it has been hard, and writing an importer for any better wiki software harder still. However, my current saviour is Gollum, which is a git-backed wiki system. So, I have written an exporter for AqWiki to Gollum. It’s not perfect – There are a few formatting inconsistencies, and I need to fix some double-quoting issues – but it’ll get me off my own NiH platform, and into a new and better world.

More usefully, it’s meant digging deeper into gitpython and some more knowledge about how git works internally, which improves my ability to help others get out of git-holes.

Moving My Lampstand

Lampstand is an IRC bot I originally wrote for a channel I was on some time ago. Since then, I’ve taken over as Responsible Adult for the channel, and it’s become somewhere halfway between a utility bot, toy and mascot. It’s also rotting a bit, since the Twisted framework it’s built on never liked IRC much, and I’m using an outdated version. It’s never really needed deep enough development to keep me from working on the live bot, and it’s a toy, but a rewrite of the core is going to involve spreading the parts on the floor a bit and risking oil on the carpet, so I’ve built it a nice Vagrant virtual environment builder, which has the nice side effect of encouraging the people who report bugs and are able to fix them to be able to do so.

Play

Empire Wiki

The empire plot wiki was getting occasional errors, so I bit the bullet and ran an upgrade of Mediawiki on it.

This will teach me to be quite so fucking stupid.

Everything broke, from the custom theme to the database access, the bugs still existed, and the search functionality – using a Lucene backend – was still entirely fucked. So I fixed what I could, ripped out Lucene in favour of the normal mediawiki search (which sucks, but at least was updating) and backed away slowly.

Then backed back in even more slowly when I got more reports of white-outs of death from updating articles. Fuck everything to do with mediawiki, slowly and with corkscrews.

Trajectory

Me and Mr Cooke have been batting around the concepts for a Scifi larp game for a while, and so I decided to put some of my initial thoughts into short textual illustration, which has raised some interest and caused a number of discussions on the metaphysic and how our Sci Fi universe works. Next steps are to turn it from a universe into a larp game, because I don’t have enough of those.

Categories
computing programming

Kickstarter Tracking & Historic currency conversion in Google Spreadsheets

Because I’m going to need this again at some point.

I’m currently tracking progress of my Kickstarted projects with a Google Drive Spreadsheet. This is partly because it tells me exactly how much money I’ve spent on KS projects over the last year, and helps me manage my new One In One Out system of dealing with them. But one of the issues with this is that most Kickstarters charge in dollars, and the CSV export reflects this, as does my record of how much I’ve spent, so I wanted to convert the numbers to sterling for stats. I could use the current rate, but while it fluctuates slowly, it does fluctuate, and I’d like this to be more long-term useful. Since I already have a completion date for each project – which is within a couple of days of when the money was taken – I can work it out using the GoogleFinance methods. This is how I’m doing that:

Given this:

A B C D E F
Title Progress ..as % Ended Pledge £
OOTS Reprint Delivered 100% 21/02/2012 $76 £47.95
Project GODUS Waiting 20 21/12/2012 £15 £15.00

Column E is worked out like this:

(Because it keeps breaking: That’s This GIST).

So eventually you can get graphs like this:

oimg

Which tells me that by straight count, 34.2% of the projects I’ve backed have delivered, a small number have failed, and most are in progress (“Delivered” means I have all the physical/digital stuff I paid for out of it. This is a personal rather than objective measure, so I’m counting the OOTS as having arrived because my main purpose was to get the books, the digital stuff Rich is still working on is very much an added bonus. So from my perspective it’s “done”. “Failed” means that the project was funded, but didn’t work out. Kickstart failures don’t get on this chart)

(If you want to copy the spreadsheet for your own purposes, you can clone it to your own Google Drive account from this blank version)

Current issues: If the final date wasn’t a trading day, the historical version falls back to today’s result, rather than the previous trading day. Also, I’d like to automatically pull in data from Kickstarter, but so far no API to do so 🙂

Categories
Django escape Piracy Inc

Piracy Inc

A few years and five houses ago, I had an idea. It was to be an online game, browser based, where you would own and run a racing car company. There’d be research and development, and aliens, and stuff, and every Saturday night, you and the people in your league would be able to watch in real time as the races happened.

I started it in PHP, badly. I used it as a reason to learn Django a few months later, then converted it to Code Igniter when I was about to start at Doof and needed to learn it in a hurry. Then I changed it to be about Pirates instead of race cars, because I’m not actually very interested in race cars. Then I rewrote it in Plank, which was a PHP framework library I still think should exist. Then again in Rails because frameworks are hard and Ruby seemed useful, then finally in Django again because I actually like Django.

By the PHP version it had bits of the game defined, by the Ruby version it had ships and missions and such, and by the Django version there are actual bits of the universe to go and attack (though you can’t actually attack them yet).

Updates on how its going appear on its own weblog every so often, and between that, LARP, Soulbook and Languagelab, that’s what I’m doing with my time.

Categories
programming Projects

"You've forgotten to commit, you moron"

Something I keep doing: Forgetting to commit to git.

Having pretty much moved everything over to git & github for all my source control needs, I am now getting used to how Git works. It hasn’t, however, solved the problem that I’ll occasionally work on something for a while, make it work on my local system, then forget to commit to it and return some days later to work on something else. Commits become either huge things of no trackability, or I end up committing by chunk and trying to remember exactly *why* I changed the define syntax to be “look up” instead. So, because I don’t have enough impenetrable bash scripts in my life, I wrote another one.

This one finds git repositories in $HOME, iterates though them looking for where your friendly user hasn’t committed stuff, and then whines to him in email about it.

it’s executed like this:

and the “uncommited-dir.sh” file looks like this:

Categories
linux Perl Projects

DNS for DHCPd in the FUTURE

I have a dream.

My dream is that one day, a giant carrot carved into the shape of a submarine will sail down the Thames before sinking below the waves to take back America using only the power of latin.

But also, I want for machines that are on my local network to be accessible as “$hostname.d.water.gkhs.net” to everyone else on the same local network. That’s a more technical dream, and this is how I did it:

first, we google “smoothwall dhcp to dns”. The first result seems to be exactly what we need, so we click it, and find outselves on Kryogenix, the website of Aquarius, who I have known for somewhere close to a decade, which is an aeon in internet time. The article is now close seven years old, and while its lost its styling, it is (a) entirely what I want to do (b) comprehensive and (c) now completely broken.

The new page that Douglas Warner’s dhcp2dnrd script lives is now somewhere else on the site, and appears to be having some kind of formatting problem, but can still be downloaded from this direct link. At the bottom of this is a link to my own version of this file, with all these changes already made.

Although the the class::date problem no longer exists, a few other things that have changed since the article was released. So, this is what to do to get it working. Most of this is built on the stuff sill said already in his article, just updated for Smoothwall 3.0:

Log in to your Smoothwall box over ssh (If you cannot do this, you need to go to the web interface, Services, Remote Access, and tick SSH. Then, using your favourite terminal, log in to the same IP, port 222. Username root, password whatever you chose when you set up the firewall so long ago. I do hope you remember it.

mkdir dhcp2dnrd; cd dhcp2dnrd # (Being neat and tidy is good)

wget http://www.silfreed.net/download/progs/dhcp2dnrd.pl
wget http://search.cpan.org/CPAN/authors/id/D/DL/DLUX/Class-Date-1.1.9.tar.gz

tar xzvf Class-Date-1.1.9.tar.gz # to extract the perl module.
mv Class-Date-1.1.9/Date* /usr/lib/perl5/5.8.8/Class/ # to copy the perl module in place
vim dhcp2dnrd.pl # Or use your personal favourite editor. Unless it’s emacs or something, because I don’t think that’s installed.

Personally, I change the “home.net” line to “d.water.gkhs.net”, because it fits my network model better. You do need to change the “$dhcpdpath” to “/usr/etc/dhcpd.leases”, however.

Finally, smoothwall no longer uses dnrd, so either comment out the entire bottom of the file after “# restart dnrd”, or rewrite that to work. I’ve modified the code in mine to “work”, but it’s mostly cargo culty.

Downloading Douglas’ script, I found it had windows line endings, which confused me. You can convert it back to unix format in vim with “:set fileformat=unix”. If you’re using mine you shouldn’t need to.

Finally, run it, check the output of /etc/hosts is roughly what you expect, then throw the script into cron like this:
cp dhcp2dnrd.pl /etc/cron.often/

And that appears to work. You can grab my copy of the code from github should you want to.