Skip to content

Instantly share code, notes, and snippets.


Bernardo bgalvao

  • Madeira Island, Portugal
  • Twitter @brnr_d1
View GitHub Profile
View json.resume
"basics": {
"name": "Bernardo Galvão",
"label": "MLOps Engineer",
"image": "",
"email": "",
"phone": "",
"url": "",
"summary": "Data Scientist turning into a full-fledged MLOps Engineer. My experience in Data Science and Software Engineering is resulting in the perfect positioning for this new area of expertise. Currently acquiring DevOps skills and counting. Hire me if you need someone to operationalize the Machine Learning Operations in your company and let the Data Scientists focus on their modelling task: I'll handle the operations.",
"profiles": [
bgalvao /
Last active Mar 31, 2022
Docker Compose/Stack templating and file generation using jsonnet and yq

Prereqs: install jsonnet, yaml2jsonnet (optional) and yq:

If you already have .yaml files lying around, or prefer to start with them, you don't have to start from scratch: convert them to jsonnet using yaml2jsonnet

yaml2jsonnet ../config/authelia/configuration.yaml | jsonnetfmt - -o config.authelia.jsonnet

Let that be your starting point. Now edit to your will. If you want to test it (see what it renders) or save it, then:

bgalvao / .env
Created Dec 7, 2021
Support gist for opening issue on mlflow/mlflow
View .env
bgalvao / settings.json
Created Nov 27, 2021
hella fine vscode preferences 👌
View settings.json
"workbench.colorTheme": "Mayukai Mirage Gruvbox Darktooth",
"gitlens.hovers.currentLine.over": "line",
"gitlens.codeLens.enabled": false,
"files.associations": {
"*.nomad": "terraform",
"*.hcl": "terraform"
"editor.fontFamily": "'Iosevka', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontWeight": "bold",
bgalvao / minikube
Last active Oct 27, 2021
Output of minikube start --kubernetes-version=v1.17.17 for an #94 opened in OpenMLOps
View minikube
(base) [user@machinelmao openmlops]$ minikube start --kubernetes-version=v1.17.17
😄 minikube v1.23.2 on Arch 21.1.6
✨ Using the docker driver based on user configuration
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
🔥 Creating docker container (CPUs=2, Memory=3900MB) ...
🐳 Preparing Kubernetes v1.17.17 on Docker 20.10.8 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
💢 initialization failed, will try again: wait: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.17:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerificatio
bgalvao /
Last active Jul 3, 2022
Make the fix so that kde shows chrome app icons, like in Loops through desktop files in ~/Desktop.
#!/usr/bin/env python3
import os
from shutil import copyfile
home_dir = os.getenv('HOME') # only works on Linux
desktop_dir = os.path.join(home_dir, 'Desktop')
chrome_based_browsers = ['brave', 'chrome', 'chromium', 'vivaldi']
bgalvao / selected_feature_set_hack.ipynb
Created Jun 14, 2021
Encode feature selection support on a scikit-learn cross-validation hack.
View selected_feature_set_hack.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bgalvao /
Created Mar 16, 2021
theme toggling on xfce4
echo $THEME
# change icon theme
xfconf-query --channel xsettings --property /Net/IconThemeName --set $ICON_THEME
# change window style
xfconf-query -c xsettings -p /Net/ThemeName -s $THEME
%load_ext autoreload
%autoreload 2
import sys
from scrpts import sample # 'scripts' is a reserved name btw
bgalvao /
Last active Aug 13, 2020
Grid Search Examples
import datetime
import pickle
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit, GridSearchCV