Creating AWS Lambda functions in Python with dependencies

Wed 01 May 2019

This assumes you have a package called mylambda and a requirements.txt file listing your dependencies.

build.sh:

#!/bin/sh

tmp_dir=$(mktemp -d)
trap "rm -rf '$tmp_dir'" EXIT

pip install -r requirements.txt -t "$tmp_dir"
cp -R mylambda "$tmp_dir/mylambda"

here=$(pwd)
(
    cd $tmp_dir
    zip -r -9 $here/lambda.zip …

Bootstrapping development VMs with Ansible

Sat 09 March 2019

I often need VMs set up locally for development purposes. Setting these up manually can be time-consuming and error-prone, so I use Ansible to almost entirely automate the process.

[Aside: This post assumes you know how to use Ansible, and also doesn’t go into a tonne of detail on …

On asking for things

Mon 25 February 2019

I’ve had variants of this stuck in my drafts for a while now. It’s time I sat down and wrote down what’s been on my mind.

First of all, go read Salary Negotiation Tips from White Men in Tech (and part 2). It had been on my …

Becoming two thirds the man I was

Fri 18 January 2019

Note

I’ve had a post sitting here, waiting to be finished for almost three years. It concerns my previous attempt to fix my weight issues. There’s no sense in trying to post it now, but I might work it into a few different posts. There’s some stuff …

Ending 2018

Mon 31 December 2018

It’s coming to the end of the year, and I figure it’s a good time to review what went well over the past year, what went poorly, and how things can go better.

The good

First up, and most important, is that I found a few great friends …

Advent of Code 2018, Day 3

Sun 30 December 2018

Part 1

There’s some parsing needed on the input file, and because there doesn’t seem much point in writing the parsing code myself, I used the text_io crate.

Also, I needed some representation of the rectangles, so I wrote a simple implementation with some tests for a method …

Advent of Code 2018, Day 1

Wed 26 December 2018

Part 1

Very simple. Just a matter of summing up the lines.

Given this is the first time I’m writing non-trivial Rust, I ran into a small issue. Initially, my main function used the default return type of (), so when I compiled my code, I got this:

warning: unused …

Advent of Code 2018, Day 2

Wed 26 December 2018

Part 1

This one has us applying a simple algorithm to a list of strings to extract some characteristics of a string - specificially, whether a given string contains exactly two or three of any letter - then summing up how many each of these characteristics applies to the strings, and multiplying …

Starting again

Wed 21 November 2018

I haven’t posted here in two years. This site was meant to be a way for me to start writing something more than post random crap on Twitter. I’ve failed at that, but I’d like to try again.

Note

What’s written above was accurate when I …

Getting Ubuntu up and running on a Lenovo Miix 310

Sat 03 March 2018

Back in January, I picked up a Lenovo Miix 310 a while back to play with Windows. It was an interesting experience, but I really can’t see myself shifting my development over to Windows any time soon, so I figured I’d throw Xubuntu on it and see if …

Esperanto orthography is terrible

Wed 28 September 2016

Note

If you’re an Esperantist, I’m not saying you’re a bad person for liking Esperanto. I’m not saying the language is bad either. I’m just saying the writing system could’ve been much better.

Nor am I proposing that this orthography be adopted; I’m …

Custom attribute values in Django form field widgets

Sat 11 June 2016

This has frustrated me for so long.

If you want to use checkboxes in a form in Django, the obvious choice is BooleanField. There are times it would be really useful to have the value attribute filled out, but by default, Django just checks for the presence of the field …

Progression of mail management on a Debian box

Thu 26 May 2016
  1. Ah, I just need to deal with local mail, so I’ll have Debian configure Exim for that. After all, it’s already there.
  2. Huh. Seems I need to send some mail from this box. I’ll have Debian reconfigure Exim to use a smarthost for non-local mail.
  3. Huh. Seems …

Centring blocks with CSS

Sun 15 May 2016

Some good friends of mine got married recently, and I helped out with the site for the wedding. One of the things that needed to be put up on the site was a poem. Now, just dropping the text of the poem into the page as-is would look weird; poems …

What monads are

Fri 06 May 2016

It’s almost like a rite of passage for a developer to write a monad tutorial.

Well, this isn’t a monad tutorial. This is simply an effort to put an end to some of the nonsense that leads to monad tutorials being written in the first place and all …

How I use git

Tue 05 April 2016

My git workflow for anything non-trivial is pretty straightforward, but a little different from what I’ve seen others describe. I’m almost certainly not the only person out there who uses this workflow, so I’m certainly not claiming any originality.

There seem to be two camps, both based …

The progressive in Irish

Mon 07 March 2016

It’s funny. When I started this, I didn’t think the first proper post here I’d make would be on Irish grammar. This assumes a certain basic knowledge of Irish, such as word order and basic vocabulary. Tweet at me with any feedback.

Like English, but unlike many …

On languages

Fri 04 March 2016

One of the things I’ll be covering here will be languages.

I’m currently learning a number of languages, though I’m taking some more seriously than others. The ones I’m currently taking seriously, in order of importance, are:

  • French
  • Spanish
  • Dutch

I would actually like to be …

Hello, world!

Tue 01 March 2016

Can’t Hack is a blog. Those who know my might know that I already have a blog over at stereochro.me, but this is meant to be something a little different.

Over the years, I’ve began feeling somewhat burned out in general. There are so many things I …

Quick hacks: Python netstring reader

Thu 15 May 2008

I’m writing a proof-of-concept server for a less jokey version of the SRGP. The protocol is more or less SRGP, but it doesn’t use MIME-style headers each request is made up of a series of netstrings. The header and body sections are terminated with empty netstrings, i …

continue   →