Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Bernardo bgalvao

💻
  • Madeira Island, Portugal
  • Twitter @brnr_d1
View GitHub Profile
View json.resume
{
"basics": {
"name": "Bernardo Galvão",
"label": "MLOps Engineer",
"image": "https://avatars.githubusercontent.com/u/17158288?v=4",
"email": "brnrd.glv@gmail.com",
"phone": "",
"url": "dev.brnrdo.live",
"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
bgalvao / cli_workflow.md
Last active Mar 31, 2022
Docker Compose/Stack templating and file generation using jsonnet and yq
View cli_workflow.md

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
bgalvao / .env
Created Dec 7, 2021
Support gist for opening issue on mlflow/mlflow
View .env
MLFLOW_DB_NAME=mlflow_db
MLFLOW_DB_PASSWORD=use_vault
MLFLOW_DB_CONNECTION_URI=postgresql+asyncpg://postgres:${MLFLOW_DB_PASSWORD}@mlflow-db:5432/${MLFLOW_DB_NAME}
@bgalvao
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
bgalvao / minikube
Last active Oct 27, 2021
Output of minikube start --kubernetes-version=v1.17.17 for an #94 opened in OpenMLOps https://github.com/datarevenue-berlin/OpenMLOps/issues/94
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
bgalvao / kde_chrome_app_icons.py
Last active Jul 3, 2022
Make the fix so that kde shows chrome app icons, like in https://superuser.com/a/1068709. Loops through desktop files in ~/Desktop.
View kde_chrome_app_icons.py
#!/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
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
bgalvao / .theme_dark.sh
Created Mar 16, 2021
theme toggling on xfce4
View .theme_dark.sh
THEME="vimix-dark-laptop-amethyst"
echo $THEME
# change icon theme
ICON_THEME="Vimix-White-dark"
xfconf-query --channel xsettings --property /Net/IconThemeName --set $ICON_THEME
# change window style
xfconf-query -c xsettings -p /Net/ThemeName -s $THEME
View jupyter_super_import.py
%load_ext autoreload
%autoreload 2
import sys
sys.path.append("..")
from scrpts import sample # 'scripts' is a reserved name btw
@bgalvao
bgalvao / grid_search.py
Last active Aug 13, 2020
Grid Search Examples
View grid_search.py
import datetime
import pickle
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit, GridSearchCV