Skip to content

Instantly share code, notes, and snippets.

@rogerleite
rogerleite / fluentd_links.md
Created March 19, 2015 16:24
Fluentd links
@rogerleite
rogerleite / list-units
Created April 15, 2015 18:17
fleetctl list-units
UNIT MACHINE ACTIVE SUB
api_v28.web.1.service 15499c5f.../10.21.2.149 active running
dashboard_v34.web.1.service c98d2f7c.../10.21.1.230 active running
deis-builder.service 15499c5f.../10.21.2.149 activating start-post
deis-cache.service c98d2f7c.../10.21.1.230 active running
deis-controller.service 15499c5f.../10.21.2.149 active running
deis-database.service 25992000.../10.21.1.229 active running
deis-logger.service 25992000.../10.21.1.229 active running
deis-logspout.service 15499c5f.../10.21.2.149 active running
deis-logspout.service 25992000.../10.21.1.229 active running
@rogerleite
rogerleite / gemfile_inline.rb
Created July 3, 2015 14:21
Template for ruby script with Gemfile inline and thor to map actions and arguments
#!/usr/bin/env ruby
begin
require "bundler/inline"
rescue LoadError => e
puts "You should install bundler with >= 1.10.3 version."
puts "* Current Ruby: #{`ruby -v`}"
puts "* Current Bundler: #{`gem list bundler`}"
puts "* Original Exception: \"#{e.message}\""
exit 1
<defs>
<query>
<class>org.example.entities.Client</class>
<name>SEARCH_CLIENT</name>
<descr>Alguma descrição desatualizada.</descr>
<filter>
<![CDATA[
select id, column1, column2, column3
from tabela_exemplo
where id = ?
require 'rexml/document'
include REXML
doc = Document.new( File.new('ex-query-hibernate.xml') )
root = doc.root
root.each_element('//query') { |query|
name = query.elements['name'].text #vem um SEARCH_CLIENT
arr_temp = name.split('_').each { |n|
@business_words = ['Sinergia','Mentalidade','Agregar','Mercado','E-mail','Follow up','Clientes','Benefício','Parceiros','Estratégia','Sistema','Rendimento','Pró-ativo','Business','Custos','Otimização','Foco','Efetivamente','A nível de','Recursos','Resultados','Paradigma','Projeto','Implementação','Integrar']
#puts @business_words
#puts '=========================================='
def generate_card number_words, number_columns
random_words = random_business_words number_words
card = []
number_lines = (number_words / number_columns)
@rogerleite
rogerleite / gedit-snippets-cheat-sheet-template.eruby
Created May 4, 2009 11:52
gedit-snippets-tool ... template for generating cheat sheets
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cheat Sheet Gedit Snippets</title>
<style>
span {
border-bottom: 1px solid;
text-align: center;
font-size: 3em;
#!/usr/bin/ruby -w
#
# tdg - Thread Dump Grapher (any better name?)
#
# Given a Java Thread Dump file as argument, it prints out
# a Grapviz (.dot) to generate a graph that shows which threads
# are waiting on others for a lock.
# (tested with a Sun JDK 1.4 thread dump)
#
# from: http://neuroning.com/2005/11/24/graphical-thread-dumps
@rogerleite
rogerleite / pomodoro.sh
Created October 27, 2009 18:58
Simple timer for Pomodoro Technique in shell script
#!/bin/bash
# http://www.pomodorotechnique.com/
#Icones:
#/usr/share/icons/hicolor/48x48/apps/typing-monitor.png
#/usr/share/icons/hicolor/48x48/apps/evolution-tasks.png
#Requisitos:
#sudo apt-get install beep
#! /bin/sh
#reference: http://www.mysysad.com/2008/01/ftp-using-shell-script.html
REMOTE='esoft'
USER='anyuser'
PASSWORD='myftp125'
FTPLOG='/tmp/ftplog'
date >> $FTPLOG