HNHacker News
TopNewBestAskShowJobs

DavidBuchanan

249 karma · joined October 3, 2016

submissionscomments
DavidBuchanan··on PNG files can be animated via network latency
It's with HostUS. I got a coupon a few years ago (via LowEndBox), and it's been renewing at the same rate ever since. I have no complaints about them, but I'm not sure you can get the same pricing today.
DavidBuchanan··on PNG files can be animated via network latency
Server seems fine, I think it just doesn't work on Safari
DavidBuchanan··on PNG files can be animated via network latency
Author here - this was just a quick PoC, I'm pleasently surprised that it seems to be handling all the HN traffic.

It's served from a python script using aiohttp, behind nginx, on a $16/year VPS.

I might make a github repo with more details, but in the meantime, here's the server script: https://pastebin.com/ykUeppqc (apologies for pastebin, I don't have access to my github account at present)

Just in case the server dies, there's a video of it here: https://twitter.com/David3141593/status/1388602027484356614

DavidBuchanan··on Understanding how AES encryption works
This is my "textbook" implementation of AES128, which follows the FIPS specification as closely as possible (in python): https://github.com/DavidBuchanan314/aes-playground

It also includes from-scratch Galois field arithmetic functions.

DavidBuchanan··on What's in a Linux Executable?
Here's my writeup/solution for the same challenge, represented as a diagram:

https://twitter.com/David3141593/status/1253122980525334529

DavidBuchanan··on Show HN: dlinject.py – Inject a .so into a running Linux process, without ptrace
This was recently suggested to me on Twitter, I'll have a look at implementing it tomorrow.

https://twitter.com/arnaud_lb/status/1212512382859251712

DavidBuchanan··on JPEG image of Shakespeare which is also a zip file containing his complete works
It isn't massively complex, but it did require some custom encoding/decoding logic. I plan to write a blog post on this some time soon...
DavidBuchanan··on JPEG image of Shakespeare which is also a zip file containing his complete works
Not quite, ICC profile chunk size limits.
DavidBuchanan··on JPEG image of Shakespeare which is also a zip file containing his complete works
And yet, nobody has done the same for Twitter until now.

The difference is that twitter applies a series of operations to all uploaded image, stripping EXIF data, recompressing, etc., which would normally be difficult to work around.

DavidBuchanan··on Core_bench: better micro-benchmarks through linear regression (2014)
> The main issue with RDTSC is that task-switches may cause your thread of execution to change cores or mess up your timing

I got around this by running my benchmarks in a kernel module, with interrupts disabled. Obviously this is only possible under certain circumstances.

I also disabled caching via the CR0 register for maximum repeatability, although of course that isn't at all reflective of "real world" performance, so it depends on what you're actually trying to measure.

DavidBuchanan··on Cherry’s new switches may help bring mechanical keyboards to more laptops
I performed an experiment based on this idea - I wired up a clicky relay to the numlock LED (via a transistor), and glued it to a decent Dell keyboard. Then, I rigged up a python script to toggle the numlock led on each key press/release event.

Honestly, typing experience wasn't too different to a real mechanical keyboard.

DavidBuchanan··on 640k Really Is Enough for Anyone
Amusingly, loading that page takes up 897kB.
DavidBuchanan··on An introduction to reverse-engineering x86 microcode and writing it
How do busses work without tri-state logic?
DavidBuchanan··on Using LD_PRELOAD to cheat, inject features and investigate programs (2013)
I wouldn't categorise security as an "arbitrary concern".
DavidBuchanan··on Using LD_PRELOAD to cheat, inject features and investigate programs (2013)
Here's my take on libfaketime, which hooks also hooks syscalls:

https://github.com/DavidBuchanan314/TARDIS

It isn't intended for any kind of serious usage, I mainly just wanted to understand ptrace and LD_PRELOAD.

DavidBuchanan··on Photobucket limits displaying of images on external sites to $40/month plan
I wrote a simple extension to disable the new direct image link behaviour: https://github.com/DavidBuchanan314/imgur-anti-anti-hotlink
DavidBuchanan··on Easy 6502 – How to get started writing 6502 assembly language
One thing I'd recommend is to try to find some 5V erasable EEPROMs, so you can reprogram it in-system wthout having to transfer it over to a dedicated (and expensive) programmer.

I went with a 12V-EEPROM at the time, so I had to write my own emulator to speed up my development cycles :)

DavidBuchanan··on Easy 6502 – How to get started writing 6502 assembly language
I built my SBC without any prior experience. You pretty much just have to connect all the adress and data lines, and then figure out the chip selection logic. I used an MC68B50 for the UART, which can still be found very cheaply on eBay.
DavidBuchanan··on Easy 6502 – How to get started writing 6502 assembly language
Not really. You can get up to about 1Mhz on a breadboard, and my wire-wrap SBC works at 4Mhz without any issues. If you did run into timing issues, you could just underclock the whole thing.
DavidBuchanan··on Easy 6502 – How to get started writing 6502 assembly language
Writing a 6502 emulator is also a lot of fun!

Shameless plug: https://github.com/DavidBuchanan314/6502-emu