Carlos Alexandro Becker

Cross-compiling Go

go build generates a binary for the platform you run it in. So, if I build antibody in a Linux machine - which uses Mach-O, it will not work in OS X - which uses ELF. I wanted to distribute antibody at least for Linux and OS X, so I went out searching for how to do this in a not so complicated way… I found an article from 2012, demonstrating how to compile Go itself for multiple platforms, so you can use the specific go to build the binary for the specific platform, which is a lot of work to do.

I wrote Antigen in Go: Antibody

Learning Go was in my TODO list for a while, and finally I did something about it. This post contains some thoughts about it… Before we start, I should familiarize you with antigen. Antigen is particularly slow. With the plugins I have, it takes an eternity to load. I saw an attempt to re-write Antigen in Haskell, but I always believed that Antigen does too much, so I decided that it would be a nice thing to play with.

Running a Selenium Grid with docker-compose

At ContaAzul, we had 31 Windows machines powering our Selenium tests - one running the grid and 30 more running clients. Needless to say, this is very expensive. As we are already using Docker to run our builds (on Shippable), we decided to try it out to run Selenium tests too. It was no surprise that Selenium folks already made a ready-to-go set of Docker images. There is an image for the Selenium Grid itself, and the browser images - Chrome and Firefox, also with debug versions - which allow you to access them using VNC to “see what’s happening there”.

Docker: The very basics

Or “what the hell is this Docker thing?” Intro According to their website, Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments.

Docker Protips™

Like my old post on git, this is somewhat a collection of useful Docker commands/tricks/whatever. Feel free to leave yours in the comments! Stop all containers $ docker stop $(docker ps -qa) ps -qa will output the CONTAINER_ID of all containers; stop will get ps -qa as input and stop all of them. You can also kill all running containers instead of stop them. Delete all stopped containers $ docker rm $(docker ps -qa -f="exited=0") ps -qa will output the CONTAINER_ID of all containers; -f="exited=0" flag will tell docker ps to filter by exited containers only; rm will remove the container.

QCon Sao Paulo - 2015: A short overview

So, this week I attended to QCon-SP. The conference was great (congratulations everyone :beers:), but, I thought it would be nice to do an overview. So, the top subjects were Microservices and Docker. A lot of Big Data too, but I like the Microservices thing more, so I didn’t follow the Big Data track. We saw a lot of company culture too, and, believe it or not, it was strongly related to Microservices.

Using Mockito's InjectMocks

FYI: Like the previous post, this is a really quick tip. Let’s imagine we have two classes, and one depends on another: @Log public class Another { public final void doSomething() {"another service is working..."); } } @Log @RequiredArgsConstructor public class One { private final transient Another another; public final void work() {"Some service is working"); another.doSomething();"Worked!"); } } Now, if we want to test One, we need an instance of Another.

One more process might not be the right answer

Don’t get me wrong, I do believe that some set of basic rules must exist. What I don’t believe is that they are the only way of fixing things. Warning: this article will contain some philosophical and economics boring stuff. Introduction I would like to start my rationale with a quote about politics I recently found which I think applies perfectly to this scenario: I think we can interpret this as something like

Introducing JVM - The Java Version Manager

Last years it becomes more and more common to work in different projects running on different versions of Java. There still some running on Java 6, and there are tons already running on Java 8. That’s nice! What isn’t nice is to change JAVA_PATH and PATH every time you work on other project. JVM aims to help you with that. It’s basically a shell script that you load on your bashrc or zshrc.

Dump a PostgreSQL table as insert statements

FYI: Like the previous post, this is a really quick tip. This week I’m working closely to the “front-end guy”. Not that I don’t know how to front end, but he was helping me. We are developing an internal tool, that, for this first version, will use only a few tables of one of our databases. Doing the “back end” part of it, I created tons of rows in my local database, and, in order to properly test the front end part, the “front end guy” needed some data.