Brain Phrye

code cooking diy fiction personal photos politics reviews tools


Retirement Revisit

A further update to my original and updated retirement posts. Since I last wrote on this topic I chatted with two pension plan advisors in the course of setting up my company pension. One interesting thing I learned is that for the best tax benefit for an Irish pension, the goal is a €800,000 pension account. You can withdraw 25% tax-free up to a maximum of €200,000. As a US citizen who is also subject to US taxes - which do not recognise 25% tax-free withdrawals of pension funds, I’m not clear what the consequences are. Read more

Xargs Script

This year it seems that everything that was ticking along just fine is suddenly breaking. Which is annoying. This week was a home git mirror. My network connection is, at times, rather slow. Sometimes it even disappears. It’s therefore kind of nice if I have copies of code bases locally. I have a script that does this just fine and it’s worked for years. Starting this year it started to bog down the server I ran it on. Read more

Git Text Tools (update)

Read the tig manual a bit more after my last post and it turns out there is a way to checkout older versions. Just put this in your ~/.tigrc: 1 bind blob C !git checkout %(commit) -- %(file) That binds C in blob mode to the command to check out that version of the file. The one downside is that it puts the file in the index so you need to do a git reset -- FILE to take it back. Read more

Git Text Tools

I’ve been looking at ways to view the commit graph in git in a terminal because FreeBSD doesn’t natively package the gitk tool. This is annoying because it’s a nice way to show new git users what’s happening when they do merges. Coming from older VCS tools, merges are scary. They’re really not scary in git if you know what’s happening but if your experince with merges is subversion or, worse CVS, you’re going to get twitchy about a merge. Read more

Git Commit Style Rules

When working in a git repo with lots of people a frequent command I’ll use after a git fetch (note, not a git pull since looking before I leap is wise here) is git g. That’s defined as: 1 2 3 git config --global alias.g \ log --graph --abbrev-commit --date=short --all \ --pretty=format:'%Cblue%h %Cgreen%cd %an%Creset -%C(yellow)%d%Creset %s' This way I get a quick view of who committed what since I last was working on a branch. Read more

School Placement

Got an email to my gmail address today. It’s a common-ish Irish name so I occasionally get odd emails to it. Good Morning, Your child was selected to participate in the Half-Day UPK Program for the 2019-2020 school year and has been placed at School Time Children’s Center (Coldenham location). Please read the attached letter/registration appointment schedule for details about registering your child. It went on to give instructions on how to register my child. Read more

Zsh Plugins

I’ve maintained my shell startup files by hand for ages. First for tcsh and then for zsh. But the kids today seem to have come up with some nifty ways to do this. Things like oh my zsh (omz), antigen and zgen. They provide some nice tools for configuring your shell in a plugin type way with lots of nifty ideas out of the box. There are some other ones as well - presto and zplug for instance - but I just dug into these three. Read more

Terraform Providers

Recently I was creating sets of AWS instances. To configure themselves they needed access to some script functions and a place to share configuration information between them. They would operate as a cluster but there was no way for terraform to tell each machine the ip addresses of the other members. However terraform could inform the last-allocated instance the ip addresses of all the other members so I used an s3 bucket to share around that configuration information as well as some other things. Read more

How to write code - an instant ramen analogy

This episode of Gourmet Makes on Bon Appétit is actually pretty awesome at explaining software development. It involves cooking which most of us vaguely know on some level so it’s more relatable than code. Claire is a super-knowledgeable chef so she knows her stuff when it comes to cooking. But in this series generally and in this episode in particular she pushes the limits of her experience. First she does the research and breaks the problem down - how to make instant ramen - explaining why each step is needed. Read more

Terraform errors

So terraform has this interesting feature. Say you have resource A and it depends on resource B. But it turns out there’s an error in the definition of resource B. Say resource B has an element that’s a string and there’s a limit to how big the string can be and as defined the string is too large. In that case terraform plan will exit with an error. Which makes sense. Read more

Doing sets in shell

Sometimes I need to take two newline delimited lists and do set operations on them. These generally are outputs from commands. You can do unions, intersections and differences - and in this post I’m going to explore the latter. Specifically A - B. Say you have three directories, A, B and C and you want all the files in A that aren’t in B copied into C. To do this, you can do the following: Read more


Blog update

Upgraded hugo and it broke things in the theme I’d been using. A while back I’d read this rant on website (MFWS) and found it amusing. So while browsing through hugo themes I came across this. And was further amused to see it was inspired by this response to MFWS. Tweaked it and here we are. Will try now to go back to posting regularly.

Bloom Filters

Ever since I first read about them, bloom filters were one of those algorithms that seemed really interesting to use. However I’d never found a use for them - until a few months back. Bloom filters are a space and (often) time efficient data structure. However they’re probablistic; they can be wrong. So what do they actually do? Sometimes you need to know if you’ve seen a piece of data before. Read more

EOL at EOF

Doesn’t happen often but every now and then I’m confronted with a bunch of files that should have a newline as the last char of the file, but some or all of them don’t. A few months back it was postfix config files (postconf assumes there’s a newline at the end when adding a new config option), and today it was the source files for this blog. In the latter case not exactly required, but “nice to have. Read more

Oatmeal Cookies

When I first moved to Ireland this was the first recipe I got stuck on because I could not find molasses anywhere. I tried to make them a number of times with my Aunt Trixie without molasses but it never tasted right. One day, in a pharmacy, I looked up on a shelf and there it was. I checked and it was for people (this was a rural pharmacy and humans were not the only species catered for). Read more

FOSDEM 2019

FOSDEM 2019 is now history. This was my second one and last year’s experience made this year’s trip much better. Being more familiar with the campus and giving a bigger time buffer before and after made a big difference. Just like last year there were oodles of talks but these are the ones that caught my eye - and I either saw them in person or caught them on video or plan to catch them on video.

Read more

The g command in vim

My knowledge of g in vi is kind of ironic. I first learned about it when I learned the etymology of grep. It was from the ed command g/re/p. Ed wasn’t a visual editor. You essentially kept the file in your head and then could bring it up line by line - and change it line by line - in an editor. So the g/re/p command was really useful because you could print all lines (p) that matched a pattern (re) over the entire file (g). Read more


Zsh completion for home grown scripts

I use irssi on a cloud server for my IRC needs. Along with it I’ve written some utility scripts - the most useful is kibo to find all messages sent to myself by searching the irssi logs. Since my home dir is a bit longer lived my scripts keep getting little tweaks and improvements. One I’ve been doing lately is completions. I had hoped yesterday to show a more complicated zsh completion example but so far haven’t gotten it to work. Read more