Skip to content

Instantly share code, notes, and snippets.

View fabianoflorentino's full-sized avatar
♾️
Studing

Fabiano Santos Florentino fabianoflorentino

♾️
Studing
View GitHub Profile
@fabianoflorentino
fabianoflorentino / git-deployment.md
Created August 20, 2020 13:03 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@fabianoflorentino
fabianoflorentino / mysql-docker.sh
Created September 28, 2020 18:52 — forked from nshtg/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE > backup.sql
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | gzip > backup.sql.gz
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | bzip2 > backup.sql.bz2
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
gunzip < backup.sql.gz | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
bunzip2 < backup.sql.bz2 | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
@fabianoflorentino
fabianoflorentino / LC_CTYPE.md
Created October 9, 2020 14:44 — forked from nicks9188/LC_CTYPE.md
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
  1. vi /etc/environment

add these lines...

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Alternatively,

@fabianoflorentino
fabianoflorentino / occlusterup.sh
Last active March 6, 2021 15:16 — forked from orcunuso/occlusterup.sh
Minimal OpenShift cluster
#!/bin/bash
IP_ADDR=$(ip addr |grep 172.16.252 |head -n1 |awk '{ print $2 }' |cut -d"/" -f1)
echo "${IP_ADDR} $HOSTNAME" >> /etc/hosts
# Install Docker latest. yum-utils package is required (which provides the yum-config-manager
# utility) in order to set up the docker stable repository. After install, we need to define
# docker network as insecure registry to prevent failure during cluster creation.
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
@fabianoflorentino
fabianoflorentino / MySqlBackup.bat
Created June 21, 2021 13:43 — forked from adityasatrio/MySqlBackup.bat
Mysql Backup Script For Windows
@echo off
set dbUser=root
set dbPassword=password
set backupDir="F:\AdityaSatrioNugroho\testbackupDb-bat\"
set mysqldump="C:\xampp\mysql\bin\mysqldump.exe"
set mysqlDataDir="C:\xampp\mysql\data"
set zip="C:\Program Files\7-Zip\7z.exe"
:: get date
@fabianoflorentino
fabianoflorentino / certificate.py
Last active September 18, 2021 14:52 — forked from gdamjan/ssl-check.py
Python script to check on SSL certificates
"""
requires a recent enough python3+ with:
astroid==2.7.3
autopep8==1.5.7
cffi==1.14.6
cryptography==3.3.2
idna==3.2
isort==5.9.3
lazy-object-proxy==1.6.0

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple: