Brain Phrye

code cooking diy fiction personal photos politics reviews tools


Miscellaneous Pix

Some left over pictures I didn’t categorise when going through all my photos .

Tag Cloud

In the new site design I wanted a subtle and simple tag cloud. I initially did it by ordering tags in the footer by how common they were. However alphabetical order exists for a reason, so it was clear that wasn’t the best choice. Tag clouds normally show popularity with font size. Not being a huge CSS person, I hadn’t realized font size was another thing you could specify relative to everything else - but you can! Read more

Terraforming Gandi

I use gandi for all my DNS needs and while I used to run my own dns it got tiresome after a while. So a long time ago I switched to using gandi to do it. Back then they had an api I was able to manipulate rather easily with python. But a few years ago they changed to a new api and I put it on the long finger to migrate over. Read more

Openssl Annoyances

OpenSSL 1.1.0 introduced some incompatible changes for symetric encryption. I use it for some code repos to store secrets in lieu of other options. It works just fine for a single developer, but obviously doesn’t work very well beyond that. Recently those projects started breaking and I wasn’t sure why. The commands I used to encrypt and decrypt were, respectively, as follows: 1 2 3 4 openssl enc -aes-256-cbc -pass "pass:$SECRET" \ -in . Read more

Initial pass at git-ls

In Google there was (and possibly still is) a tool called “sourcerer” that let you browse through a repo. One nice feature it had was that deleted files and directories were shown struch through in red - and you could even follow down deleted dirs. I’ve long wanted that view of a git repo. And today while digging through a rather old, imported work project it turned out that was useful to have. Read more

Older House Pix

Pictures of my house and my mom’s house as they were being built. Month by month build photos for my mom’s house here .

Search

I’ve mentioned before this is a static site so how is it there’s now a search function. The magic of javascript! I’d seen a search box on hugo sites so I looked around and found these two articles 1 2 on adding search and they each built on each other using lunr. I tweaked the index building to try and squash it down a bit. The javascript I use to build the lunr prebuilt indexes (search/index. Read more

The Unix Way

I was reminded of this article which is a nice little example of how to use shell tools in Unix to solve problems faster than if you were to “write a program.” You’re still coding in shell, it’s just that each “line” is a pretty powerful function. Plus each function has a pretty simple interface: it will take a text stream and some positional or named arguments and it will produce two text streams (one is usually “the output” and the other is usually an “out of band” stream) and an integer. Read more

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