Skip to content

Instantly share code, notes, and snippets.

View marcelopalin's full-sized avatar

Marcelo Facio Palin marcelopalin

View GitHub Profile
@marcelopalin
marcelopalin / install_update_golang.sh
Created April 10, 2024 19:12
Instala ou atualiza o golang na máquina! Cuidado, remove a versão anterior do Golang e instala a nova versão!
#!/bin/bash
# Verifique se curl ou wget está disponível e ajuste o comando de download
DOWNLOAD_CMD=""
if command -v curl &>/dev/null; then
DOWNLOAD_CMD="curl -L" # Adiciona opção -L para seguir redirecionamentos
elif command -v wget &>/dev/null; then
DOWNLOAD_CMD="wget --quiet --continue --show-progress"
else
echo "Este script requer curl ou wget. Instale um deles e tente novamente."
@marcelopalin
marcelopalin / gist:6f6ff31d6904bc5820a77730c984868e
Last active December 4, 2023 15:11
Configurando Duas Contas GitLab no Mesmo Sistema Linux
# **Configurando Duas Contas GitLab no Mesmo Sistema Linux**
## **1. Introdução**
Este tutorial auxilia na configuração de duas contas GitLab — uma pessoal e outra de trabalho — em uma única máquina Linux, utilizando chaves SSH e configurações de usuário distintas.
## **2. Geração e Configuração de Chaves SSH**
@marcelopalin
marcelopalin / docker_wordpress.md
Created May 6, 2022 08:14 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
"""
program.py
This script will keep adding logs to our logger file.
"""
import logging
import time
import os
# create logger with log app
real_path = os.path.realpath(__file__)
@marcelopalin
marcelopalin / mascarando-arquivo-netcdf-salem.ipynb
Last active January 27, 2022 13:43
Mascarando arquivo NetCDF (Salem).ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marcelopalin
marcelopalin / installcdo.sh
Created April 4, 2020 20:29 — forked from mainvoid007/installcdo.sh
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <maywald@klimagipfel.de>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command
@marcelopalin
marcelopalin / node_nginx_ssl.md
Created December 16, 2019 21:26 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@marcelopalin
marcelopalin / formatar_cnpj_cpf.md
Created September 22, 2019 22:02 — forked from davidalves1/formatar_cnpj_cpf.md
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === 11) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  }