Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 1

Other posts: Part 2, Part 3, Part 4. Building Furnace: Part 1 Intro Hi folks. This is the first part of a 4 part series which talks about the process of building a middlish sized project in Go, with AWS. Including Unit testing and a experimental plugin feature. The first part will talk about the AWS services used in brief and will contain a basic description for those who are not familiar with them. The second part will talk about the Go SDK and the project structure itself, how it can be used, improved, and how it can help in everyday life. The third part will talk about the experimental plugin system, and finally, we will tackle unit testing AWS in Go. ...

March 16, 2017 · 7 min · hannibal

Images on older posts

Hi folks. Just a quick headsup, that older posts and images, may have been lost unfortunately, because I made the terrible mistake, when I migrated over from my old blog, that I forgot to download all the images from the remote host. For lack of options, I deleted the images. :/ Sorry for the inconvencience! Gergely.

March 3, 2017 · 1 min · hannibal

How to HTTPS with Hugo LetsEncrypt and HAProxy

Intro Hi folks. Today, I would like to write about how to do HTTPS for a website, without the need to buy a certificate and set it up via your DNS provider. Let’s begin. Abstract What you will achieve by the end of this post: Every call to HTTP will be redirected to HTTPS via haproxy. HTTPS will be served with Haproxy and LetsEncrypt as the Certificate provider. Automatically update the certificate before its expiration. No need for IPTable rules to route 8080 to 80. Traffic to and from your page will be encrypted. This all will cost you nothing. I will use a static website generator for this called Hugo which, if you know me, is my favorite generator tool. These instructions are for haproxy and hugo, if you wish to use apache and nginx for example, you’ll have to dig for the corresponding settings for letsencrypt and certbot. ...

February 15, 2017 · 9 min · hannibal

How to do Google Sign-In with Go - Part 2

Intro Hi Folks. This is a follow up on my previous post about Google Sign-In. In this post we will discover what to do with the information retrieved in the first encounter, which you can find here: Google Sign-In Part 1. Forewords The Project Everything I did in the first post, and that I’m going to do in this example, can be found in this project: Google-OAuth-Go-Sample. Just to recap, we left off previously on the point where we successfully obtained information about the user, with a secure token and a session initiated with them. Google nicely enough provided us with some details which we can use. This information was in JSON format and looked something like this: ...

November 2, 2016 · 6 min · hannibal

RScrap scraper

Intro Hey folks. So, there is this project called Huginn which I absolutely love. But the thing is, that for a couple of scrappers ( at least for me ), I don’t want to spin up a whole rails app. Hence, I’ve come up with RScrap. Which is a bunch of Ruby scripts run as cron jobs on a raspberry pi. And because I dislike emails as well, and most of the time, I don’t read them, I opted for a nicer solution. Enter the world of Telegram. They provide you with the ability to create bots. You basically get an API key, and than using that key, you can send private messages, or even create an interactive bot which you can send messages too. ...

October 6, 2016 · 4 min · hannibal

Budget Home Theather with a Headless Raspberry Pi and Flirc for Remote Controlling

Intro Hello folks. Today, I would like to tell you about my configuration for a low budget Home Theater setup. My tools are as follows: FLIRC Raspberry Pi 2 500G SSD An a good ‘ol wifi TL;DR Use Flirc for remote control, omxplayer for streaming the movie from an SSD on a headless PI controller via SSH and enjoy a nice, cold Lemon - Menta beer. Flirc First, the remote control. So, I like to sit in my couch and watch the movie from there. I hate getting up, or having a keyboard at arm length to control the pi. Flirc is a very easy way of doing just that with a simple remote control. ...

September 17, 2016 · 3 min · hannibal

Always Go with []byte

Update: This post ignored the fact that this works for utf-8 characters only. Characters which are stored on more than 1 byte will cause trouble. Look at this Effective Go Example. for pos, char := range "日本\x80語" { // \x80 is an illegal UTF-8 encoding fmt.Printf("character %#U starts at byte position %d\n", char, pos) } Prints: character U+65E5 '日' starts at byte position 0 character U+672C '本' starts at byte position 3 character U+FFFD '�' starts at byte position 6 character U+8A9E '語' starts at byte position 7 Keep this in mind when working with strings. ...

August 19, 2016 · 3 min · hannibal

Global variable for never changing regex

Quick reminder. If you have a never changing regex in Go, do NOT put it into a frequently called function. ALWAYS put it into a global variable. I’ll show you why. Benchmark for code with a variable in a frequently called function: BenchmarkNumber-8 30000 41633 ns/op BenchmarkAreaCode-8 50000 27736 ns/op BenchmarkFormat-8 50000 29263 ns/op PASS ok _/phone-number 5.110s Benchmark for code with the same variable outside in a global scope: BenchmarkNumber-8 300000 5618 ns/op BenchmarkAreaCode-8 500000 3884 ns/op BenchmarkFormat-8 300000 4696 ns/op PASS ok _/phone-number 5.197s Notice the magnitude change in ns/op! That’s something to keep an eye out for. ...

August 16, 2016 · 1 min · hannibal

Drupal missing ToolBar and settings not saving

Hi folks. Quick gotcha, when working with Drupal. If you just freshly installed it, and everything seems to work fine, and yet you are experiencing things like, the admin toolbar is randomly disappearing, or configuration is not saved; than you might not have modrewrite enabled on your apache server. Because, by default, Drupal has clean url enabled, that needs URL rewriting on apache. So, step one. Have this in your .htaccess file: ...

August 13, 2016 · 1 min · hannibal

Jenkins Best Practices Talk

Hi folks. I wanted to take the time to share with you a talk that I recently did. The slides and the source I used, can be found here: Github. And then, there is also a docker image which contains all the plugins, job configurations and all the practices which I did during the talk. Please feel free to have a go with it. DockerHub - Jenkins Best Practices. For easy access and reading, here are the slides on Slideshare: Jenkins Best Practices Slides. ...

July 28, 2016 · 1 min · hannibal