manniwood.com

This blog is updated more than the home page might imply, but only the most intersting stuff gets posted on the home page.

Compiling and installing PostgreSQL 16.1

07 Dec 2023

I generally don't link this to the home page, but every time a new version of PostgreSQL comes out, I compile and install it on my Linux laptop and make notes about the process. Turns out I've been doing this since version 9.3! Here are my notes.

EUFI (BIOS) Update on a ThinkPad Running Ubuntu

07 Dec 2023

It turns out we live in a brave new world where Ubuntu now has software to do this.

pgxtras!

30 Jan 2023

Version 5 of the excellent pgx library for Go pulls in a number of useful functions from jackc's own pgxutil library. This is very nice, because one can basically almost always use the Query() method of a pgx.Conn, pgxpool.Pool, pgx.Tx, or pgxpool.Tx, and then just hand the resulting pgx.Rows into collectors such as pgx.CollectRows() and pgx.CollectOneRow(), and into scanners such as pgx.RowTo(), pgx.RowToAddrOf(), pgx.RowToMap(), etc.

This inspired me to write my own helper functions, because there were some needs I had that are not currently covered by pgx 5. These helper functions now live in a Go module named pgextras!

pgxtras allows one to select one row and not get an error from pgx when nothing is found: the same way one does not get an error when no rows are returned at a psql prompt.

pgxtras also has a more lenient version of a row scanner where snake case column names are more easily/automatically mapped to camel case Go struct field names.

Check it out!

Installing Arch Linux on an old ThinkPad

13 Feb 2022

I've been using Ubuntu for a good lone time, but this weekend, I tried installing Arch Linux on an old ThinkPad I had kicking around.

Fizzbuzz in assembler!

24 Jan 2022

This explores writing fizzbuzz in Intel 64-bit assembler.

Multiline copy commands in psql!

13 Nov 2021

This explores a tip I saw on another blog about how to do multiline copy commands in psql.

Fun with tmux

2 Aug 2021

I finally got around to using tmux because I had a particular use-case where I figured it would shine. Details here.

Intro to assembler!

5 Jul 2021

I thought it would be a fun to try to write a very basic intro to assembler. I didn't get very far, but I figured my first few chapters might make a nice blog entry.

Reading PostgreSQL Files with Go

21 Dec 2020

I thought it would be a fun learning exercise to try to parse a PostgreSQL table file with Go. I definitely learned a lot. :-)

AWS and aws

13 Dec 2020

Everybody's using AWS these days. I've started keeping notes on the more intersting bits. In particular, the aws command-line utility is very handy for us command-line junkies.

Here's a look at extracting secrets into AWS Fargate containers from Systems Manager / Parameter Store.

Here's a look at using SQL to query parquet files in S3 from the command-line.

Args and Env Vars in Linux/amd64 Assembler

26 Apr 2020

Want to know where your Linux process's command-line args and env vars live on process starup? And how to get them from an assembler program?

Details here.

Counting 1-bits

25 Aug 2019

The book Hacker's Delight has a pretty neat way of counting the 1-bits in an integer. But my exploration shows that modern Intel CPUs have an instruction that do that for you, and that Go's math/bits library takes advantage of that instruction. Nonetheless, I leave notes that spell out the Hacker's Delight solution as obvoiusly as I can.

Details here.

Go Channels/Select

1 Aug 2018

I've been reading parts of Katherine Cox-Buday's Concurrency in Go, and I think this incomplete list of facts about channels and select statements is useful. A full table of channel operation/state/result is on page 75; these notes are just for me and whoever else may find them useful

Channels

Select Statements