Skip to content

Instantly share code, notes, and snippets.

@brunoluz
brunoluz / Configure-conda.ps1
Created September 10, 2023 00:48
Install miniconda on windows and add conda command to powershell at startup
winget install Miniconda3
New-item –type file $PROFILE
Add-Content -Path $PROFILE -Value "$HOME\miniconda3\shell\condabin\conda-hook.ps1"
@brunoluz
brunoluz / conda-jupyter-r-kernel.sh
Created September 9, 2023 23:45
Install jupyter notebook with R kernel on the current conda envronment
#!/bin/bash
conda install -y r-recommended r-irkernel
conda install -y notebook
R -e 'IRkernel::installspec()'
@brunoluz
brunoluz / get-table-creation-time-athena.py
Created September 2, 2023 14:06
Obter data de criação de uma tabela glue via Boto3 e athena client
import boto3
# Configure a sessão AWS (substitua com suas próprias credenciais e região)
session = boto3.Session(
aws_access_key_id='[aws access key]',
aws_secret_access_key='[aws secret key]',
region_name='[aws region]'
)
# Crie um cliente Athena
@brunoluz
brunoluz / get-table-creation-time-glue.py
Created September 2, 2023 13:46
Obter data de criação de uma tabela glue via Boto3 e glue client
import boto3
# Configure a sessão AWS (substitua com suas próprias credenciais e região)
session = boto3.Session(
aws_access_key_id='[aws access key]',
aws_secret_access_key='[aws secret key]',
region_name='[aws region]'
)
# Crie um cliente Glue
@brunoluz
brunoluz / std_handler.sh
Created December 4, 2020 02:43
To write stdin in a daily log basis. Usage: {command} | ./std_handler.sh {log_filename}
#!/bin/bash
while read line; do
echo "${line}" | tee -a "$1.$(date '+%Y%m%d').log"
done < /dev/stdin