This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# R script to install the R jupyter notebook kernel | |
# Instructions: | |
# 1. Install Anaconda 3 | |
# 2. Install the R Binaries from CRAN. No need for RStudio to run Jupyter notebooks. | |
# 3. If you are on a Mac, install XQUARTZ from https://www.xquartz.org/ | |
# 4. In terminal, go to this script directory, and open R there (R, not RStudio) | |
# run in the R REPL Shell: | |
"source("jupyte.R")" | |
install.packages(c('devtools','repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save your R package list: | |
packages <- levels(as.data.frame(installed.packages()[,1])[,1]) | |
write.csv(packages, "requirements.txt", row.names = FALSE, quote = FALSE) | |
# Load your R package list: | |
backup <- levels(read.csv("requirements.txt")[,1]) | |
# Install your package list on a new machine: | |
install.packages(backup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script contains commands to install RStudio & Jupyter in ubuntu 18 | |
# Add keys and CRAN repo for ubuntu 18 | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 | |
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/' | |
sudo apt update | |
# Install R + system dependencies for tidyverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# CSV => PARQUET | |
Converte um csv para parquet em uma pasta com o mesmo nome. | |
# DEPENDÊNCIAS: | |
Instale o pyspark: | |
pip install pyspark | |
# USO: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u""" | |
tentar.py | |
autor: Marcelo Tournier | |
url: https://github.com/marcelotournier | |
objetivo: Minha abstração de um método "Try" | |
""" | |
from sys import exc_info | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Scripts em R para ajudar a abstrair algumas rotinas que rodo sempre. | |
# Para carregar: Cole em um arquivo `utils.R` e use `source("./utils.R")` | |
# no seu script. | |
library(data.table) | |
library(dplyr) | |
library(purrr) | |
# Read multiple files into a single Tibble | |
read_multiple_files <- function(directory, filetype="csv") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jenkins https simple setup | |
# | |
# Shell script to install jenkins in a cloud machine, with https and ssl cert auto-renew | |
# Tested on ubuntu 20.04 | |
# | |
# refs: | |
# - overall setup | |
# https://computingforgeeks.com/configure-jenkins-behind-nginx-reverse-proxy-and-lets-encrypt-ssl/ | |
# - for changing jenkins conf file: | |
# https://www.digitalocean.com/community/tutorials/how-to-configure-jenkins-with-ssl-using-an-nginx-reverse-proxy-on-ubuntu-20-04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zipfile | |
def read_json_zip(path): | |
""" | |
Reads all json files inside of a zip file | |
and appends the result in a list of dictionaries. | |
""" | |
json_list = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tensorflow-aarch64>=2.8.2; platform_machine == 'aarch64' | |
tensorflow>=2.8.2; platform_machine != 'aarch64' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIT License | |
# Copyright (c) 2022 Marcelo Benedet Tournier | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in all | |
# copies or substantial portions of the Software. |
OlderNewer