Skip to content

Instantly share code, notes, and snippets.

View dlanileonardo's full-sized avatar
🏠
Working from home

Dlani dlanileonardo

🏠
Working from home
View GitHub Profile
@dlanileonardo
dlanileonardo / Codificação de Arquivos
Last active December 22, 2015 23:09
Codificação de Arquivos via Bash
# Checando codificação de arquivos:
find . -iname "*.phtml" | while read linha; do file -i $linha; done
# Conversão em Lote
find . -iname "*.phtml" | while read linha; do iconv --from-code=ISO-8859-1 --to-code=UTF-8 $linha > $linha.new; mv $linha.new $linha; done
@dlanileonardo
dlanileonardo / .bashrc
Last active December 12, 2018 16:01
Pretty Bash
#######################
# Pretty .bashrc
#######################
alias mountedinfo='df -hT'
BLACK='\e[0;30m'
BLUE='\e[0;34m'
GREEN='\e[0;32m'
CYAN='\e[0;36m'
@dlanileonardo
dlanileonardo / .nanorc
Last active August 29, 2015 14:01
Arquivo de configuração do Nano Editor
## Use auto-indentation.
set autoindent
## Backup files to filename~.
set backup
## Constantly display the cursor position in the statusbar. Note that
## this overrides "quickblank".
set const
## Use cut to end of line by default.
set cut
@dlanileonardo
dlanileonardo / open_subl
Last active August 29, 2015 14:01 — forked from asux/open_subl
Open txtmt and subl on SublimeText in Linux.
#!/usr/bin/env ruby
# /usr/local/bin/open_subl
require 'cgi'
require 'uri'
begin
query = CGI.parse(URI.parse(ARGV.first).query)
url = query['url'].first
file = URI.parse(url).path
line = query['line'].first
column = query['column'].first
@dlanileonardo
dlanileonardo / perfectelementary.bash
Created August 2, 2014 23:58
Elementary Luna Essentials commands.
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@dlanileonardo
dlanileonardo / Azkfile.js
Last active September 3, 2015 23:17
Basic Azkfile.js to Rails App without Database
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
systems({
'rails-app': {
image: { docker: "azukiapp/ruby:2.2", },
provision: [
"bundle install --path /azk/bundler",
"bundle exec rake db:create db:migrate db:seed",
],
@dlanileonardo
dlanileonardo / Azkfile.js
Last active April 2, 2016 17:09
Rails Azkfile.js app with MySQL, Sidekiq,Mongodb and Redis
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
systems({
app: {
depends: [
'mongodb', 'mysql', 'redis', 'sidekiq'
],
image: { docker: "azukiapp/ruby:2.2"},
provision: [
@dlanileonardo
dlanileonardo / VimTips.md
Last active September 3, 2015 23:17
Vim Tips, Shortcuts and Plugins

Based in my .vimrc

Basic movements:

  • h Move left
  • j Move down
  • k Move up
  • l Move right
  • $ Move to end of line
@dlanileonardo
dlanileonardo / foward-to-azk.sh
Last active September 3, 2015 23:16
Cria um redirecionamento de porta para o Azk.
#!/bin/bash
INPUT_PORT=8000
# Usage info
show_help() {
cat << EOF
Uso: ${0##*/} [-arl]
Redirecionamento da porta $INPUT_PORT para um Serviço Azk.
-h display this help and exit
@dlanileonardo
dlanileonardo / tmux-cheatsheet.markdown
Last active September 3, 2015 23:16 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux Shortcuts & CheatSheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname