Skip to content

Instantly share code, notes, and snippets.

View thiagosf's full-sized avatar
🏠
Always working at home

Thiago Silva Ferreira thiagosf

🏠
Always working at home
View GitHub Profile
@thiagosf
thiagosf / gist:50737c6c4dcb42ce8d5addc1e289d068
Created November 13, 2017 12:57
Resolução para instalar php-mbstring no Ubuntu 16.04
sudo apt-add-repository ppa:ondrej/php
sugo apt-get update
sudo apt-get install php7.0-mbstring
@thiagosf
thiagosf / new-rails-project-azk.sh
Created October 18, 2017 15:02
Novo projeto Rails usando AZK
azk start --image azukiapp/ruby --shell /bin/bash
gem install rails --no-rdoc --no-ri
rails new project --api -d mysql --skip-bundle
@thiagosf
thiagosf / home-end.json
Last active January 28, 2018 18:12
Home e end para Sublime Text (Preferences > Key Bindings > User), credits: https://coderwall.com/p/upolqw/fix-sublime-text-home-and-end-key-usage-on-mac-osx
[
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }
]
@thiagosf
thiagosf / revoke.sh
Created May 24, 2017 23:39
Revogar certificado letsencrypt
letsencrypt revoke -d example.com --cert-path /etc/letsencrypt/live/examplecom/cert.pem
@thiagosf
thiagosf / rsync.sh
Created May 20, 2017 17:13
Transferência de arquivos com rsync e nohup para executar em background
# -v, --verbose increase verbosity
# -a, --archive archive mode; same as -rlptgoD (no -H)
# --no-OPTION turn off an implied OPTION (e.g. --no-D)
# -r, --recursive recurse into directories
# -p, --perms preserve permissions
# --executability preserve the file's executability
# --chmod=CHMOD affect file and/or directory permissions
# -z, --compress compress file data during the transfer
# --compress-level=NUM explicitly set compression level
# -C, --cvs-exclude auto-ignore files the same way CVS does
@thiagosf
thiagosf / mp4-to-mp3.sh
Created April 8, 2017 13:36
Converte arquivos mp4 para mp3
for f in *.mp4; do ffmpeg -i "$f" "output/${f%mp4}mp3"; done
@thiagosf
thiagosf / ports.sh
Created March 27, 2017 12:29
Lista portas sendo utilizdas na máquina (útil para verificar apps rails)
netstat -tulpn
@thiagosf
thiagosf / home-end.md
Created September 24, 2016 16:16
Teclas home e end MacOS

Criar ~/Library/KeyBindings/DefaultKeyBinding.dict com o seguinte conteúdo:

{
   "\UF729"  = moveToBeginningOfParagraph:; // home
   "\UF72B"  = moveToEndOfParagraph:; // end
   "$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
   "$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
}
@thiagosf
thiagosf / certbot.md
Last active September 17, 2016 20:16
Passos para novo certificado do https://certbot.eff.org
@thiagosf
thiagosf / compress.sh
Last active May 5, 2016 16:07
Comprimi imagem com ImageMagick #notes
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% source.jpg result.jpg