How to deploy dbt docs to GitLab Pages

Dbt is a great tool to define the data transformations using SQL. In a nutshell, it's SQL plus Jinja2 templates. It enhances SQL by allowing you to link to dynamic tables, create macros to reuse common parts, add loops, etc.

»
Author's profile picture Vitor Baptista

Religião para não-religiosos

Traduzido de Religion for the non-religious

»
Author's profile picture Vitor Baptista

Deleting all user-defined functions (UDFs) in Snowflake

To drop user-defined functions (UDF) in Snowflake, we need the function name and list of parameters. Depending on how many UDFs you have, this can become boring quickly.

»
Author's profile picture Vitor Baptista

Setting up Ubuntu 20.04 with Regolith

I've been using Ubuntu since its virst version, Ubuntu 4.10. I tried other distributions (Fedora, Debian, Gentoo, etc.), but always ended up back in Ubuntu. It's stable enough, easy to install, and things just work, so I don't see a reason to change. All my servers are either Ubuntu or Debian as well, so the knowledge translates well.

»
Author's profile picture Vitor Baptista

How to export a PostgreSQL table to multiple files

You can use the \COPY command in Postgres to export the result of a SELECT to a file (CSV, TSV, etc.). However, what if the table is huge? I faced this problem where the resulting CSV had more than 50 GB. Thankfully, the \COPY command also allows passing the result to a regular program, so we'll use the CLI program split and gzip to not only split the resulting file, but also compress it with GZIP.

»
Author's profile picture Vitor Baptista

How to compile SASS/SCSS files when deploying a Django app to Heroku

I'm using django-sass-processor to automatically compile the SASS files in a Django 2.1 project. Everything runs fine locally, but on Heroku the pages appear unstyled. The problem is that Heroku only runs ./manage.py collectstatic when building a Django app. This simply copies the static files to the ./staticfiles folder. As the SCSS files weren't compiled yet, only the *.scss files end up in that folder.

»
Author's profile picture Vitor Baptista

Code analysis: How the Diario Oficial project extracts data from gazettes' PDFs

The Diário Oficial is a project by the Serenata de Amor Operation to extract the government purchases that had bidding exemption (because they are below a certain value) published in the official gazettes. Their intent is to get this data in a machine readable format, so we can look for suspicious purchases. In this post, we'll walk through the code to understand how the gazette is parsed and its bidding exemptions are extracted.

»
Author's profile picture Vitor Baptista

How to transcribe a video using YouTube

Transcribing a video is a tedious and time-consuming task. It used to be impossible for machines to do, but this isn't the case anymore, just ask Siri, Alexa, Google Home, or any other of the many voice assitants. The problem becomes how a regular user this technology to convert their own videos?

»
Author's profile picture Vitor Baptista

How to access the host's Docker Socket without root

I needed to run a Docker container from inside another container. While it's possible to run Docker inside Docker, the recommended way is running siblings containers. The challenge now is how to create a Docker container in the host machine from inside another Docker container.

»
Author's profile picture Vitor Baptista

Where does the 2015 Knight News Challenge applicants come from?

The Knight News Challenge is a grant by the Knight Foundation for "breakthrough ideas in news and information". Between September 8th and 30th of this year, 1.023 entries were submitted by 960 teams or individuals (myself included).

»
Author's profile picture Vitor Baptista

Remotely accessing a router's administrative page using SSH tunnels

Before moving to the UK, I left a Raspberry Pi running on my parent's home back in Brazil. It's working as a personal server for Asterisk and a few other uses. As it's not directly connected to the Internet, I had to forward a few ports on my router to be able to SSH into it. The issue happened when I needed to change these configurations.

»
Author's profile picture Vitor Baptista

Continuous Integration for Android Apps with Jenkins and Maven3

Pre-requisites

»
Author's profile picture Vitor Baptista

Meu ambiente de desenvolvimento em 7 itens

Por acaso, estava lendo o blog do @mauriciojr e descobri que ele me convidou pra essa brincadeira.

»
Author's profile picture Vitor Baptista

Comprimindo o diretório /usr (Ou como instalar o Ubuntu 10.04 em menos de 1.5 GB)

No natal passado dei para minha namorada, Samara, um netbook: o Asus EeePC 2G Surf. Ele foi o primeiro netbook lançado, com processador de 800 MHz, 512 MB de RAM e 2 GB de SSD. Infelizmente, para diferenciá-lo de modelos mais caros, alguém na Asus teve a ideia imbecil genial de soldar a memória RAM e o SSD. Ou seja, é impossível fazer um upgrade nele.

»
Author's profile picture Vitor Baptista

Reportagem sobre a Maratona Internacional de Dados Abertos no Jornal da Paraíba (JPB)

Author's profile picture Vitor Baptista