Go Lang

CURL to GO

CURL to GO

Quite often we are looking for a quick way to make a request in GO, and we have working query tested in CURL. Sometimes it’s problematic to “move” all queries to GO, and build up whole query using client, protocol and so on.

From the author of my beloved Caddy server there is a tool called curl-to-Go which basically does what is says. Just paste your CURL request and GO lang code to implement that.

Automated email parser

Automated email parser

It’s a simple mechanic to decompose emails into valuable parts, like some markup (to push emails directly into internal systems), create file attachments and extract inline images.

Flow is pretty simple, but we have a couple of components.

  1. We need something to “receive” emails. The easiest way is to use Amazon SES or mailgun or… something else. There are a couple of SASS solutions for that.
  2. Next step is to be notified when the email arrives, so we don’t have overhead with checking email every couple of minutes
  3. We have to “decompose” – decode email from it’s raw format to text, and attachments. We can achieve that using couple of existing libraries, but you get the idea
  4. We have to save all data and expose it to public

So we know what to do and roughly how to do the whole process. Points 1 and 2 are pretty straightforward for anyone who uses AWS and their services.

How to make email work better email2issue

How to make email work better email2issue

The problem:

We are using a bug tracking system, like most software development companies. Creating an issue is quite simple. Open bug tracking system, fill some inputs, upload attachments – done. The issue is created. Sometimes an issue is described with multiple attachments (screenshots). A bug tracking system allows us to embed images into a description. All issues come from users in the form of an email.

Binary compression still alive – golang binary compression.

Binary compression still alive – golang binary compression.

In the ancient times, when I was coding mostly in Pascal – size did matter. People were using RAR to shave couple kilobytes from archives, and having 2mb executable was better then having 4mb executable file. In that beautiful time we used  UPX – I wasn’t aware that this project is still alive, and works nicely with binaries create bo go lang.

Ultimate Packer for eXecutables
Copyright (C) 1996 - 2017
UPX 3.94        Markus Oberhumer, Laszlo Molnar & John Reiser   May 12th 2017

File size Ratio Format Name
-------------------- ------ ----------- -----------
11512772 -> 3547792 30.82% macho/amd64 main

Packed 1 file.