TL;DR: How you can to enable the code completion for your Visual Studio Code IDE

Image for post
Image for post
JSON Schema rules!

Motivation

The code completion is one of the most worth and important features of an IDE. Since the first version of Visual Basic or Visual C++, the presence of “IntelliSense” feature improved the productivity of thousands of programmers.

Normally, to create a custom code-completion bundle for your favorite programming or scripting language is a non trivial task.

But in the case of JSON formats, that task is not so hard.

The JSON Schema

As you probably knows the JavaScript Object Notation (JSON) is a structureless format.

You can define whatever properties, arrays, etc. …


TL;DR: I’ve release a pure-go Apache H2 Database SQL driver for Golang. You can checkout here: h2go

Image for post
Image for post
Oh yeah! The H2 SQL Driver for Go is here at last!

Introduction

Apache H2 is a light weight and high performance SQL Database written in Java.

It’s (almost) 100% ANSI SQL-99 compatible and it can store the data in files or in-memory. You can embed in your Java project or using with client/server pattern.

Motivation

Some months ago, I worked in a “tech debt” project where a lot of business logic was coded as SQL sentences.

The goal was significantly improve the performance and scalability.

We chosen Go as programming language for its performance and flexibility balance. …


TL;DR: How to patch a node module package after execute npm install

Image for post
Image for post
Oh! This module needs a patch!

Why the hell do you need to patch a node module package?

Sometimes you are working in a npm project and a module dependency not works properly. You can submit a issue to its CVS (normally GitHub) but you can’t wait until the authors resolve it or approve your PR.

What can we do then? Well, we can patch the package after its installation.

We use a real example: Liferay Angular portlet build process.

Life Angular portlet

To build a 100% Angular Liferay portlet, we use a Liferay’s support libraries (lnbs-*).

It’s works perfectly if we build for a production environment. But, what’s happen if I want to build for pre-production environment? And for QA? …


Image for post
Image for post
Is proxy.conf.js weird? No! It’s fun!

TL;DR: How to configure your Angular project to use a backend while your are developing in local mode.

Rarely you have to develop an isolate Angular app. The normal thing is that it has access to a backend and/or consumes one or more APIs.

Then, you starts the development in your local computer and when you write your service for access to the backend or API, and access with your browser to http://localhost:4200...

Surprise! Probably you have a CORS problem… (at least)

Image for post
Image for post
WTF can’t access to my backend!

Angular CLI provides a solution to bypass these problems: reverse proxy server.

Enable the Angular Proxy

To use the angular proxy you need to define a configuration file and pass it when invoking. …


TL;DR: Recently (June 2020) Hetzner added a cloud native load balancer with Kubernetes support. Learn how to use it.

Image for post
Image for post
We finally have load balancer in Hetzner!

Introduction

Until a couple of months ago (June 2020) Germany Hetzner Cloud provider did not have a native cloud load balancer in its portfolio.

To achieve a “LoadBalancer” service in an Hetzner Kubernetes cluster you must to use a software solution like as MetalLB.

I wrote this previous post about how to create a Rancher Kubernetes cluster on Hetzner cloud using MetalLB.

Now we are going to see how to create a Kubernetes cluster using the new Load Balancer service already available in Hetzner. …


TL;DR: Use of NLP (spaCy and Gensim) for topic modelling of Hacker News favorites links scraped with Selenium.

Image for post
Image for post
Freud Icon from iconspng.com

I love Hacker News. With just a daily glance you can be up to date in technology, start-ups, etc. It is a link aggregator where users can upvote the links they like the most. Simple and effective.

Not long ago I checked that it had a lot of “upvoted” links (I often use it as a bookmarker) and I realized that it might be interesting to analyze the links and determine what my main interests were.

Could NLP “magic” be done with something? …


TL;DR: Use CronJob to schedule a DB daily backup

Image for post
Image for post
Based on the photo by Erda Estremera on Unsplash

One good friend of me told me time ago…

The difference between a good developer and a bad one is that the former makes backups.

Image for post
Image for post
I know how to recognize good advice

Designing our backup solution

Our business requirements for the backup solution are:

  • Not in the same place. We use AWS S3 for store the backups. Out of our cluster network.
  • Secure and encrypted. Custody of data is essential. We will use secure transport up to S3 and the files will be encrypted with a symmetric key.
  • Kubernetes way. Backups should be done automatically using Kubernetes resources.

Create and configure an AWS S3 bucket

It’s very pretty straightforward create a AWS S3 bucket. We create it using our main AWS account with the “Create bucket wizard”. …


Image for post
Image for post
The efficient dream team

When you start to develop with Go (a.k.a. Golang), one thing you realize is that the generated executable is “big”. A simple HTTP “Hello world” app has a size around 7 MB (depends on the OS and architecture).

For many cases is not a problem, but if you need to transfer it through Internet or to store it in an embedded device… it’s not good.

Introducing UPX

The Ultimate Packer for eXecutables, UPX, is an executable compressor with very fast decompression time for many of architecture-OS combinations.

The most important architectures are supported: i386, x86_64, arm64, armeb, powerpc, etc.

Regarding OSs, Windows, Linux, BSD and even DOS are supported too. …


Image for post
Image for post
One sniffer tool to capture EVERYTHING!

Motivation

Sometimes you need to develop software with libraries, frameworks or software not so well documented.

In much of these cases, the software involves a kind of client/server communication that uses an API REST.

If for example we haven’t a client library for our programming language, sometimes it is preferable to study the behaviour capturing and analyzing the JSON or XML exchanged by the two parts.

Just the case that concerns us today.

1. Capturing the HTTP traffic

We first need to get the HTTP data traffic.

I like to capture the data and save it in a file, and later process it with Wireshark GUI.

This is useful if the software is running under a container, for example. …


TL;DR: Deploy a private docker registry in just 5 minutes!

Image for post
Image for post
Containers, containers, containers!

Why your own private registry?

The main reason is for privacy.

If your are working with private code, you need to use a private registry. Among the available options we have Docker Hub, Azure Container Registry, GitLab … and your cluster!

Other reason is the flexibility.

I prefer my own registry in my cluster because we use a lot of containers for our DevOps cycle: testing, pipelines, etc. If you use a cheap cloud provider for the storage in the cluster, you have a private registry with endless possibilities.

Prerequisites

  • A Kubernetes cluster managed by Rancher.
    If you haven’t it, use the following post to create one in just 15 minutes. …

About

JM Robles

R+D @ Civica Software. CTO @ Digitalilusion.com & DigitalSecured.net Full-stack developer (Django, Go, ML) Betabeers Granada co-organizer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store