Understanding golang channel range

Here we go again with my golang self teaching, today with a topic I had hard time understanding correctly (and hope I actually did): range over channels along with goroutines. First of all, let’s have a little reminder. We all know a goroutine live its own life and must be waited for at the main level, i.e. in this example: package main import "fmt" func main() { go func() { fmt.

Golang interfaces, a pragmatic explanation for the programmer

I’m still in the process of learning golang the right way. Yes I already wrote some projects with the Go language (here and here), but I like to understand the real meaning of techniques when using them. One of what is said to be the most amazing features of Go is interfaces. Here’s what the official golang docs has to say about it: Interfaces in Go provide a way to specify the behavior of an object: if something can do this, then it can be used here.

An Elasticsearch from the past

Here’s a procedure I came up with in order to migrate an elasticsearch 1.1 database to version 6 (actually 6.4 but probably any 6.x version). Fire up a temporary elasticsearch version 1.1 Fetch the tar.gz version from https://www.elastic.co/downloads/past-releases/filebeat-1-1-2 and untar it. Use the following basic configuration file $ egrep -v '^[[:space:]]*(#|$)' ~/tmp/elasticsearch-1.1.2/config/elasticsearch.yml http.port: 9202 transport.tcp.port: 9302 path.conf: /home/imil/tmp/elasticsearch-1.1.2/config path.data: /var/db/elasticsearch Note that I changed the standard ports to $((standard_port + 2)).

OpenVPN routes dynamic NATting

Assume the following scenario: your {Open,Free}BSD pf-enabled (yes, I know what’s missing and it’s a pity, I am well aware of it) gateway connects to an OpenVPN server. This server pushes a couple of routes to your gateway that you’d like to be able to reach from within your own private network. As routers on the other end don’t have routes to your network(s), mandatory NAT is to be configured, but let’s also assume those routes are subject to change, and there’s more than a couple of them, some kind of dynamic rule adding should be considered.

From GitLab CI to Docker Hub

With all the noise around those topics I would have imagined this one had been covered thousands of time, yet I did not find a single complete resource on this subject which I found to be a basic building block: pushing docker images from GitLab CI to the Docker Hub registry. There’s actually an opened issue on Docker GitHub’s that’s sitting there for 3 years, and it really feels more like a political / strategic / commercial issue than a technical one.

Kubernetes under my desk

I’m diving into Kubernetes for a couple of months now. Discovering the possibilities and philosophy behind the hype definitely changed my mind. Yes, it is huge (in every sense ;) ) and it does change the way we, ex-sysops / ops / syasdmins do our work. Not tomorrow, not soon, now. I’ve had my hands on various managed kubernetes clusters like GKE (Google Container Engine), EKS (AWS Elastic Container Service) or the more humble minikube but I’m not happy when I don’t understand what a technology is made of.

MATE desktop fixes (updated)

Last week I upgraded my Linux Mint 18 MATE desktop distro to 18.3. With the massive progresses GNU/Linux has done in the desktop, those kind of upgrades use to be simple tasks and no more hassle is to be expected. Except this time where I had several a GUI-related annoyances. 1. MATE panel transparency I recently became addicted to /r/unixporn and made myself a shiny modern desktop made of MATE and rofi.

Webcam streaming with ffmpeg

I’m a bit of a stressed person, and when I’m not home, I like to have a webcam streaming what’s going on, mainly to see how my dog is doing. At my main house, I use the fabulous motion project, which has a ton of cool features like recording images and videos when there’s movement, playing a sound, handling many cameras and so on. As I said before, I acquired an apartment destined for rental, and it has really poor Internet access, as it is located on the mountainside, only weak ADSL was possible to get.

date over HTTP

I always manage to get myself into weird issues… I have this (pretty old) wrt54g router that works well with dd-wrt v3.0-r34311 vpn release. This router is installed in an apartment intended for rental where I happen to crash every now and then. It connects to an OpenVPN hub of mine so I can monit it and be sure guests renting the apartment have working Internet access. The apartment is located on a small mountain and electricity is not exactly stable, from times to times power goes down and comes back up.

Fetch RSVPs from Meetup for further processing

I’m running a couple of demos on how and why to use AWS Athena on a Meetup event tonight here at my hometown of Valencia. Before you start arguing about AWS services being closed source, note that Athena is “just” an hosted version of Apache Hive. Like pretty much every AWS service is a hosted version of a famous FOSS project. One of the demos is about fetching the RSVP list and process it from a JSON source to a basic \t separated text file to be further read by Athena.