Skip to content

Instantly share code, notes, and snippets.

View acampagnaro's full-sized avatar

Alexandre Campagnaro acampagnaro

View GitHub Profile
# Find the latest version on https://github.com/creationix/nvm#install-script
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Add in your ~/.zshrc the following:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ source ~/.zshrc

Guia rápido de instalação do WSL2 + Docker

Em 2016, a Microsoft anunciou a possibilidade de rodar o Linux dentro do Windows 10 como um subsistema e o nome a isto foi dado de WSL ou Windows Subsystem for Linux.

O acesso ao sistema de arquivos no Windows 10 pelo Linux era simples e rápido, porém não tinhamos uma execução completa do kernel do Linux e outros artefatos nativos e isto impossibilitava a execução de várias tarefas no Linux, uma delas é o Docker.

Em 2019, a Microsoft anunciou o WSL2, com uma dinâmica aprimorada em relação a 1ª versão:

  • Execução do kernel completo do Linux
@acampagnaro
acampagnaro / How to fix a corrupt zsh history file
Last active April 4, 2025 10:11
How to fix a corrupt zsh history file
How to fix a corrupt zsh history file
Occasionally you may find you have a corrupt zsh history file preventing you from using the `fc` command or searching the history. Here's how to fix it.
Estimated reading time: 1 minutes
Table of contents
Corrupt ZSH history file
How to fix it
Making it a script
Corrupt ZSH history file
If you use zsh for your shell very occasionally you may find the following message appearing indicating a corrupt history file. This is normally after a reboot.
{"lastUpload":"2020-03-12T16:09:48.647Z","extensionVersion":"v3.4.3"}
@acampagnaro
acampagnaro / default.conf
Created November 1, 2019 16:45
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@acampagnaro
acampagnaro / mysql-docker.sh
Created January 24, 2019 18:10 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@acampagnaro
acampagnaro / git.md
Created August 2, 2018 14:45 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@acampagnaro
acampagnaro / nginx_s3_proxy.conf
Created March 21, 2018 13:11 — forked from josue/nginx_s3_proxy.conf
Simple Nginx Proxy to S3 Bucket Asset
server {
listen 80;
listen 443 default_server ssl;
ssl on;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
server_name *.example.com;
root /var/www/vhosts/website;
@acampagnaro
acampagnaro / erro nodemon
Last active February 26, 2018 17:36
socketio token
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
criar um arquivo config
dentro do diretorio ssh
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 4h
GSSAPIAuthentication no