Skip to content

Instantly share code, notes, and snippets.

View reinaldocoelho's full-sized avatar

Reinaldo Coelho Sartorelli reinaldocoelho

View GitHub Profile
@reinaldocoelho
reinaldocoelho / CloneUbuntuUser.sh
Created June 10, 2019 16:04
Clonning ubuntu user.
## Sugestion #1
# on Bash
sudo bash
# Home origin user
cd /home/bob
# Clone home folder
tar cf - . | (cd ../pete;tar xf -)
# Change home permissions
chown -R pete:pete /home/pete
@reinaldocoelho
reinaldocoelho / exemplos_elasticsearch.md
Last active August 29, 2019 14:51
Exemplos ElasticSearch

Lista todos os indices

GET /_cat/indices?v

Lista todos os registros de um indice

GET //_search?pretty=true&q=*:*
@reinaldocoelho
reinaldocoelho / .wslconfig
Last active February 7, 2024 19:04
Configuração de WSL no windows.
## CONFIG DO WSL2 para limitar memória (Parou de existir)
## vim %UserProfile%\.wslconfig
[wsl2]
memory=6GB
swap=0
localhostForwarding=true
## Para instalar X no WSL2:
## Mais: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
@reinaldocoelho
reinaldocoelho / profile.ps1
Last active March 4, 2022 18:17
Powershell profile.
# Outros modulos PS instalados
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox
# Salve este arquivo em: $profile (C:\Users\reinaldo\Documents\PowerShell\Microsoft.PowerShell_profile.ps1)
# Pode-se abrir direto para edição com: vim $profile
# Mais detalhes em: https://stackoverflow.com/questions/24914589/how-to-create-permanent-powershell-aliases
# Cria uma funcao para processar os comandos
@reinaldocoelho
reinaldocoelho / ElasticSearch.md
Last active November 22, 2022 15:27
Documento de dicas de uso do Elastic Search

Ajuda com ElasticSearch

ElasticSearch 2

ElasticSearch

Elastic search é a API do servidor de pesquisa propriamente dito e depende das portas 9200 e 9300 onde a 9200 é a API HTTP para uso.

URL Padrão: http://localhost:9200

@reinaldocoelho
reinaldocoelho / win-term-settings.json
Last active May 1, 2022 12:46
Windows Terminal Settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@reinaldocoelho
reinaldocoelho / .bash_aliases
Last active June 2, 2022 20:00
Scrips configuração ambiente Linux
## About Alias
# https://www.tecmint.com/create-alias-in-linux/#:~:text=Aliases%20are%20like%20custom%20shortcuts%20used%20to%20represent,on%20your%20profile%20by%20simply%20executing%20alias%20command.
## ##############
## ALIASES
## #############
# Como fazer:
# Ediar arquivo de profile:
vim $HOME/.bash_aliases
@reinaldocoelho
reinaldocoelho / TriggerCalculoMariaDBComDebug.sql
Created March 3, 2022 00:17
Exemplo de Trigger com MariaDB
-- EXEMPLO:
-- 1. CRIA TABELA PARA REGISTRAR LOGS
CREATE OR REPLACE TABLE TriggerLog(text varchar(200)) ENGINE=MyIsam;
-- 2. CRIA TABELA DE REGISTROS
CREATE OR REPLACE TABLE registros (
id int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
cliente int NOT NULL,
valor varchar(80) COLLATE utf8_unicode_ci NOT NULL,