How to do a good code review

Intro Hi folks. This time, I would like to talk a little bit about code reviews. How do you do code reviews? Don’t hesitate to share it in the comments. How do I do code reviews? Well read on if you would like to know. The Top Down approach If I’m dealing with a small code change, a couple of lines here and there in the odd file first, I’ll try to understand why the review is there? What was it trying to achieve? What’s the goal of the change? Is there a ticket/issue I can read for background info? Or an RFC? ...

May 11, 2020 · 6 min · hannibal

How to Make SPA refresh work with a Go backend

Intro Hi folks. Today I would like to share a quick “fix” for a problem I’ve seen popping up here and there. That is, if you have a react frontend which is a SPA app but you still want refresh to work. What do I mean by that? Consider the following… The problem You have a SPA app with a react router which navigates the user around. The app calls to a backend api which serves content of some kind. You have the following routes…. login, signup, reset, archive. ...

February 17, 2020 · 4 min · hannibal

Using a Kubernetes based Cluster for Various Services with auto HTTPS - Part 2

Intro Hi folks. This is a continuation of the previous post about my Kubernetes infrastructure located here. The two remaining points are to deploy Athens Go proxy and setting up monitoring. Athens Let’s start with Athens. First of all if you are a helm user, Athens has an awesome set of helm charts which you can use to deploy it in your cluster. Located here. I prefer to deploy my own config files, but that’s me. So here is my preferred way of deploying Athens. ...

October 15, 2019 · 8 min · hannibal

Summary of Practical Go workshop from Dave Cheney

Intro Hi folks. So there is this workshop from Dave Cheney. And I thought I’d draw a sort of summary of that workshop. Right-click->Open Image for higher resolution. Cheers, Gergely.

October 10, 2019 · 1 min · hannibal

How I killed my entire Kubernetes cluster

Intro One morning I woke up and tried to access my gitea just to find that it wasn’t running. I checked my cluster and found that the whole thing was dead as meat. I quickly jumped in and ran k get pods -A to see what’s going on. None of my services worked. What immediately struck my eye was a 100+ pods of my fork_updater cronjob. The fork_updater cronjob which runs once a month, looks like this: ...

October 1, 2019 · 2 min · hannibal

Using a Kubernetes based Cluster for Various Services with auto HTTPS

Intro Hi folks. Today, I would like to show you how my infrastructure is deployed and managed. Spoiler alert, I’m using Kubernetes to do that. I know… What a twist! Let’s get to it. What What services am I running exactly? Here is a list I’m running at the time of this writing: Athens Go Proxy Gitea The Lounge (IRC bouncer) Two CronJobs Fork Updater IDLE RPG online checker My WebSite (gergelybrautigam.com) Monitoring And it’s really simple to add more. ...

September 21, 2019 · 21 min · hannibal

Updated Face-recog architecture drawing

I had a lot of fun using Procreate to re-draw the architecture image I’ve drawn for my distribute face recognition application detailed in this post Distributed Face-Recognition App. Without much fanfare, here is the drawing: Thanks, Gergely.

September 19, 2019 · 1 min · hannibal

Efferent and Afferent metrics in Go

Intro Hi folks! Today I would like to write about a metric that I read in a book called Clean Architecture from Robert Cecil Martin ( Uncle Bob ). Abstract The metrics I mean are Efferent and Afferent coupling in packages. So you, dear reader, don’t have to navigate away from this page, here are the descriptions pasted in: Afferent couplings (Ca): The number of classes in other packages that depend upon classes within the package is an indicator of the package’s responsibility. Afferent couplings signal inward. (Affected by this package) (Fan-In). ...

April 21, 2019 · 6 min · hannibal

Living with a new Parser for a year

Hi folks! Today’s post is a retrospective. I would like to gather some thoughts about living with the new parser that I wrote for JsonPath. After a little over a year, some interesting problems surfaced that I thought I’d share for people who also would like to endeavor on this path. Let’s begin. Previously About, two years ago, I took over managing / fixing / improving this ruby gem: Json Parser. It’s a json parser in ruby. Amongst other problems, it used eval in the background to evaluate expressions. It was a security risk to use this gem to its full extent. Something had to be done about that. ...

April 12, 2019 · 8 min · hannibal

Deploy a Hugo Blog Github Actions

Intro Hi folks. Today I thought I show you how you can use Github Actions to deploy a hugo based blog like this one. Let’s dive in. Actions What are actions? If you read the above linked document they are basically steps performed in containers based on some events that happened with your repository. Events can be such as pushing, creating a PR or creating/closing an issue etc. We need an even on a push. ...

March 19, 2019 · 5 min · hannibal