Skip to content

Instantly share code, notes, and snippets.

View magnocosta's full-sized avatar
🌴
On vacation

Magno Costa magnocosta

🌴
On vacation
View GitHub Profile
@magnocosta
magnocosta / jetbrains-ide-commands.txt
Last active December 11, 2018 17:27
O objetivo desse gist é ser um lembrete para todos os atalhos que eu gosto de usar nas IDE's da JetBrains
=====================================================================================
Atalhos
=====================================================================================
command + 1 = Abre / fecha os arquivos do projeto
shift + esc = Sai de qualquer janela secundária
command + ] = Avança na navegaçao do código
command + [ = Volta na navegação do código
ctrl + shift + R = Executa o teste onde o cursor estiver
@magnocosta
magnocosta / workspace.sh
Created June 19, 2017 12:43 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 100g -volname workspace ${WORKSPACE}
}
detach() {
# Update all packages
sudo apt-get update
# Upgrade all packages
sudo apt-get upgrade
# List all routes
sudo route -n
# Add default route to 192.168.1.1
Git plugin -> Plugin para habilitar o Git no Jenkins
Config File Provider Plugin -> Plugin que permite criar arquivos de configuração na workspace do projeto com o Jenkins
Android Emulator Plugin -> Plugin que gerencia os SDK's do Android, executa emuladores e monkey tests.
@magnocosta
magnocosta / iterm2-solarized.md
Created March 6, 2016 01:00 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@magnocosta
magnocosta / create_user_postgresql.txt
Created February 23, 2016 20:35
Create User Admin Postgresql
# Criando um usuario admin no Postgresql
sudo -i -u postgres
createuser --superuser admin
# Configurando o charset do banco de dados
psql
UPDATE pg_database SET datallowconn = TRUE where datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE where datname = 'template1';
drop database template1;
@magnocosta
magnocosta / Configure multiple SSH identities for GitBash
Last active July 16, 2016 00:08
Config multiple SSH private keys on one client
Configurando terminal com 2 contas no Bitbucket
# Gerar a chave privada que acessará a conta A
ssh-keygen -f ~/.ssh/chave_a -C "<<seu-email-conta-a>>"
# Gerar a chave privada que acessará a conta B
ssh-keygen -f ~/.ssh/chave_b -C "<<seu-email-conta-b>>"
#Criar um arquivo pra orquestrar as chaves de acordo com alias
vim ~/.ssh/config
@magnocosta
magnocosta / vim-commands.txt
Last active September 13, 2018 18:38
Vim Commands
-> OUTROS
u -> Desfazer
-> Recortar
dd -> Recorta a linha que o cursor esta posicionado;
-> Copiar
yy -> Copia a linha que o cursor esta posicionado;
-> JANELAS
@magnocosta
magnocosta / apps.sh
Last active October 6, 2016 04:15
Helper script with alias for linux, I use this file with Vagrant for add alias on my virtual machine.
alias f='foreman start -f Procfile.dev'
alias c='rails c'
alias s='rails s -b 0.0.0.0'
alias bi='bundle install'
alias igh='echo "vagrant ssh -c \'su - admin -c cd /var/apps/$(basename $(pwd))/ && rake db:create && rake db:migrate && rspec --format progress && rubocop\'" > test-hook.sh'
@magnocosta
magnocosta / gist:c02f8284147e04859eb5
Created September 17, 2014 15:09
upgrade-puppet.sh
#!/bin/bash
# Credits by http://blog.doismellburning.co.uk/2013/01/19/upgrading-puppet-in-vagrant-boxes/
apt-get install --yes lsb-release
DISTRIB_CODENAME=$(lsb_release --codename --short)
DEB="puppetlabs-release-${DISTRIB_CODENAME}.deb"
DEB_PROVIDES="/etc/apt/sources.list.d/puppetlabs.list" # Assume that this file's existence means we have the Puppet Labs repo added
if [ ! -e $DEB_PROVIDES ]