Skip to content

Instantly share code, notes, and snippets.

Listando Processo no Linux
ps -f -u postgres
REF -> [http://canaltech.com.br/tutorial/linux/conheca-6-comandos-para-gerenciar-processos-do-linux/]
Listando endereços TCP/IP e portas do PostgreSQL
sudo lsof -n -u postgres |grep LISTEN
REF -> [http://www.vivaolinux.com.br/dica/O-comando-lsof]
@edivandecastro
edivandecastro / preferences-sublime
Last active January 26, 2017 17:54
preferences-sublime-settings
{
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "monaco",
"font_size": 10,
"rulers": [122],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"tab_size": 2,
@edivandecastro
edivandecastro / gist:a53c2b907dbc3ccc46a0
Created July 20, 2015 18:11
Instalando Fontes do mac no linux
wget http://dl.dropbox.com/u/26209128/mac_fonts.tar.gz
tar zxvf mac_fonts.tar.gz
sudo mv fonts /usr/share/fonts/
sudo fc-cache -f -v
Baixe o tema Seti UI, coloque dentro da pasta package do sublime text e renomei a pasta para "Theme - Soda" para adicionar icones ao tema soda dark
@edivandecastro
edivandecastro / javascript-get-first-last-date
Created June 12, 2015 12:35
get-first-and-last-date-of-current-month-with-javascript-or-jquery
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
-- get all latest the finished progresses of all individuals
SELECT *
FROM progresses pr
WHERE id = (
SELECT id
FROM progresses p
WHERE p.individual_id = pr.individual_id AND p.procedure_id = pr.procedure_id AND p.finished
ORDER BY p.created_at DESC LIMIT 1 )
ORDER BY pr.created_at DESC;
@edivandecastro
edivandecastro / help
Last active September 4, 2017 19:47
Help
# [1] Definir o Vim como editor default
# http://vim.wikia.com/wiki/Set_Vim_as_your_default_editor_for_Unix
# no ubuntu
$~> sudo update-alternatives --config editor
# [2] Instalando pacotes .deb no linux
$~> sudo dpkg -i nome_do_infeliz.deb
# [2.1] Removendo pacotes .deb no linux
$~> sudo dpkg --purge nome_do_infeliz
edivan@mint-virtual-machine ~/Projetos/VidracariaPaulista $ cap development deploy
DEBUG [cfc067fd] Running /usr/bin/env [ -d ~/.rvm ] as [email protected]
DEBUG [cfc067fd] Command: [ -d ~/.rvm ]
DEBUG [cfc067fd] Finished in 2.421 seconds with exit status 1 (failed).
DEBUG [73c05d07] Running /usr/bin/env [ -d /usr/local/rvm ] as [email protected]
DEBUG [73c05d07] Command: [ -d /usr/local/rvm ]
DEBUG [73c05d07] Finished in 0.338 seconds with exit status 0 (successful).
DEBUG [0e7d0208] Running /usr/local/rvm/bin/rvm version as [email protected]
DEBUG [0e7d0208] Command: /usr/local/rvm/bin/rvm version
DEBUG [0e7d0208] rvm 1.26.10 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
<%= form_for(@ambiente, :html => {:class => "form-horizontal"}) do |f| %>
<% if @ambiente.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@ambiente.errors.count, "error") %> prohibited this ambiente from being saved:</h2>
<ul>
<% @ambiente.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
sudo fdisk -l