2 de outubro de 2018

Running puma 3.6 in Linux's that SSL is updated

When you use the gem Puma 3.6 in your Ruby or Rails project, on Linux that SSL is more updated. You needs to install the previewsly version of SSL.

If you are using Debian, execute sudo apt-get install libssl1.0-dev

Done!

30 de setembro de 2018

Meu código promocional Vivo Easy: EASY2MELO

Você pode usar meu código promocional Vivo Easy: EASY2MELO

O que é o código promocional Vivo Easy?

É uma sequência de caracteres que você pode usar ao contrato esse plano de celular na operadora Vivo Celulares. Ao utilizar esse código promocional Vivo Easy, você já ganha 2 GB de dados de internet para navegar como quiser sem prazo de validade. E seu amigo que lhe forneceu o código promocional também ganha.

O próprio aplicativo Vivo Easy, o qual é usado para fazer tudo neste plano de celular, desde a contratação, comprar de pacotes e visualização de saldos, ou seja, gerenciar tudo do Plano Vivo Easy.

O app pode ser baixado na loja de aplicativos Google play e na Appstore.

No aplicativo você pode até personalizar seu código promocional Vivo Easy. Ele tem um tamanho máximo de caracteres e sempre usando letras ou números.


3 de julho de 2018

Running Bundle without install Postgresql

When you use the gem PG in your Ruby or Rails project, usually is necessary install Postgresql before install the gems. But, if your DB is running in a docker, you does not need the Postgresql running local.

So, you need install a lib called 'libpq' on Mac OS before install PG gem. After this you can remove them. Command: brew install libpq

If you are using Debian, execute sudo apt-get install libpq-dev

*** If you don't use brew:

1. Install gem PG by the litle native app Postgres.app. To install access 
https://postgresapp.com/. After installation, execute the and can close them.

$ gem install pg -v <gem version `0.20.0`> -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config

Done!

PS.: To use PSQL, creates a symbolic link like bellow:


$ ln -s /Applications/Postgres.app/Contents/Versions/latest/bin/psql /usr/local/bin/psql

PGPASSWORD=<your-password> psql -h localhost -p 5432 -U postgres -c "\list"

Done again!

17 de maio de 2018

Manage your framework versions in a simple way

To install ASDF, follow the manuals and steps bellow...

$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.3

# Add the two lines bellow on your terminal load file (e. .bashrc, .zshrc)
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

# Adding plugins for ruby and nodejs
$ asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
$ asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git

* I do not recommend you migrate ruby version from RVM, because is fast to install ruby versions.

# To install the tools ruby and nodejs, follow bellow steps

# Ruby

$ asdf install ruby 2.2.9

# Set ruby version locally - asdf <global | local> ruby <version>
$ asdf local ruby 2.2.9

$ ruby --version # ruby 2.2.9p480 (2017-12-15 revision 61259) [x86_64-darwin17]

# Nodejs

# (slow)Imports NodeJS release team's OpenPGP keys to main keyring
$ brew install gpg

** For debian, executes:

    $ sudo apt-get install gpg dirmngr

$ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
$ asdf install nodejs 8.10.0

** When install or update a new version and receive the error: No public key. Executes:

$ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring

If does not work, try:

gpg --keyserver pool.sks-keyservers.net --recv-keys <key-that-has-error>


# Common commands

# Set a local tool version
$ asdf local <name> <version>

# List details of tools
$ asdf current

# Set a tool version
$ asdf local <name> <version>

# List the versions of a tool
$ asdf list <name>

# Detail of environment

When you set a version GLOBAL, this is set in ~/.tool-versions
Otherwise, if you set LOCAL, a file called .tool-versions will be saved in that folder.
I prefer always to use LOCAL.

12 de abril de 2018

Making Git diff beautiful

# Access https://github.com/so-fancy/diff-so-fancy

# To install
$ brew install diff-so-fancy

# Configure local git to use them
$ git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

Done! $ git diff

Easy way to have ZSH on Mac OS High Sierra, a unix command line spectacular!

If you do not have ZSH installed on your machine, install them before.
Access to install ZSH https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH

# http://ohmyz.sh/
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Plugins

1 - https://github.com/sindresorhus/pure
$ npm install --global pure-prompt

## Adds on the of file ~/.zshrc the content belhttps://github.com/sindresorhus/purelow
autoload -U promptinit; promptinit
prompt pure

2 - https://github.com/zsh-users/zsh-autosuggestions
$ brew install zsh-autosuggestions

## Adds on the of file ~/.zshrc the content bellow
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

Done! Your config command line now is ~/.zshrc

# Errors appendix

prompt_pure_setup containing theme pure.

Maybe your nodejs was not installed or not found. Resolve this and try to run the install with npm again.

12 de janeiro de 2018

Usando Postgresql na command line do Mac OS

Listando os bancos de dados:

$ psql --host <host> --username=<user-name> --list


Apagando um bancos de dados:

dropdb --host <host> --username=<user-name> <db-name>


Criando um bancos de dados: 


$ psql --host <host> --username=<user-name> --command="CREATE DATABASE <db-name>"



Restaurando um bancos de dados

$ PGPASSWORD=<user-password> pg_restore --verbose --no-acl --no-owner --host <host> --username=<user-name> --dbname=<database_name> <path-of-dump-file>

Running puma 3.6 in Linux's that SSL is updated

When you use the gem Puma 3.6 in your Ruby or Rails project, on Linux that SSL is more updated. You needs to install the previewsly version ...