guest - flak

easy gopher-lua bridge

I have some go code that I’d like to be a little more flexible at runtime. Like a config file, but maybe with some conditional logic based on string matching. If this sounds like a proxy deciding which filtering functions to apply based on URL, that’s a good guess.

Continue reading easy gopher-lua bridge...

Posted 2017-12-04 23:02:39 by tedu Updated: 2017-12-04 23:02:39
Tagged: go lua programming

userland traffic shaping

A short program to demonstrate network filtering with Lua. Although the kernel provides pf filtering and some bandwidth shaping facilities, they don’t cover every scenario. For example, consider the case where our server is connected to a network port where we pay for some amount of bandwidth, but have burstable speeds much faster than that. Commonly seen as 95th percentile billing. As long as we’re under our five minute quota, we want to pass traffic full speed, but as we approach that mark, we want to start clamping down. The pf.conf burst queueing rules can’t quite handle this situation.

Continue reading userland traffic shaping...

Posted 2014-06-15 02:49:42 by tedu Updated: 2014-06-15 02:49:42
Tagged: lua network openbsd programming

efficient uniform shuffling

Spotify had a blog post about how to shuffle songs, which included a link to earlier work on the art of shuffling music. The original algorithm uses a lot of both memory and CPU (in particular, a playlist containing a lot of loosies will be extremely memory hungry as each song is expanded). I think I understand how to implement the Spotify “dithering” algorithm efficiently, but there’s no pudding.

Continue reading efficient uniform shuffling...

Posted 2014-03-11 04:53:22 by tedu Updated: 2014-03-11 06:40:08
Tagged: lua programming