Skip to content

Instantly share code, notes, and snippets.

View lucasmartins's full-sized avatar
🤘

Lucas Neves Martins lucasmartins

🤘
View GitHub Profile
@lucasmartins
lucasmartins / gist:8690171
Created January 29, 2014 15:20
Heroku Mahem
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v84 --app YOURAPP
@lucasmartins
lucasmartins / atualizando_ssl_heroku.md
Last active July 6, 2017 20:45
Gerando um novo cert. SSL e atualizando no Heroku

(check the en_US version here) Gerando um novo cert. SSL e atualizando no Heroku

Para gerar um novo certificado SSL você precisa dos seguintes procedimentos:

  • @dev Gerar um .CSR (é um arquivo texto com uma chave);
  • @dev Enviar o .CSR para a entidade certificadora (TheSSLstore);
    • @dev Verificar o Ownership do domínio via email (também da pra colocar um arquivo no srv. http);
    • @dev Baixar o .CRT (vem um zip com vários .CRT);
  • @dev Criar o bundle.crt
@lucasmartins
lucasmartins / updating_heroku_ssl.md
Last active December 20, 2015 03:59
Updating your Heroku SSL certificate

(check the pt_BR version here) Updating your Heroku SSL certificate

To generate the new SSL you need to follow these steps:

  • @dev Generate a .CSR (a key text file);
  • @dev Send the .CSR to your certificate authority (We use TheSSLstore);
    • @dev Verify the domain ownership through email (you can also put a file at your http server);
    • @dev Download the .CRT file (probably a zipball with a bunch of .CRT files);
  • @dev Brew the bundle.crt
@lucasmartins
lucasmartins / dtrace_tips.md
Created July 8, 2013 17:29
Ruby DTrace tips & tricks
@lucasmartins
lucasmartins / reports.rake
Created February 28, 2013 13:47
Rake Task para Relatório de Tempo Restante do Redmine
#@author: Lucas Martins
namespace :report do
desc 'Reports remaining time of tasks under work'
task :remaining => :environment do
data = []
Issue.find(:all, :conditions => ['status_id in (?)', [2,4] ],:order=>'id').each do |issue|
remaining = issue.estimated_hours-issue.spent_hours
puts "##{issue.id} '#{issue.subject}' => remaining: #{remaining}, spent: #{issue.spent_hours}, estimated: #{issue.estimated_hours}"
subtasks = []
@lucasmartins
lucasmartins / simple_socket_buffer.rb
Created October 24, 2012 13:34
Ruby TCPServer with 'persistent' connection
require 'socket'
server = TCPServer.open(6060)
loop {
client = server.accept
loop {
buffer = client.gets()
if buffer.nil?
buffer.close
@lucasmartins
lucasmartins / readable_token.rb
Created June 12, 2012 15:29 — forked from lpar/pwgen.rb
Simple generation of readable tokens using Ruby
#!/usr/bin/env ruby
# encoding: UTF-8
# Simple readable password generation in Ruby.
#
# Generate reasonably secure random passwords of any chosen length,
# designed to be somewhat easy for humans to read and remember.
# Each password has a capitalized letter and a digit.
#
# Example:
@lucasmartins
lucasmartins / rbenv-install
Created April 4, 2012 20:11
Install RBenv+Ruby-Build
#!/usr/bin/env bash
# This is (kinda) a RBenv (plus ruby-build) installer for linux
# Just copy & paste off the install instructions from Github.
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
@lucasmartins
lucasmartins / id_rsa.pub
Created November 16, 2011 11:48
Siga Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtfa1ympybOXisMIlvinQ5nbDB0WGtu4q5SaUaQ67M7GJ8oacBCAy63pf9YCf+GuJ9XvQDhAhRGUPpmn0qtz5zP+ZTLrRdXZ9tYcl4RHo3ElCFgvaL5vWsISxwBXj4G4xLX4GTMSWYDJvQCzm2rWxqq98nswWvFOOgPh40Wx2ztU1uNXEq1tOO/1AtF/nTGL/xZzjw59fpjhP1UghkXfYd/nMPQDIytvNXJdc3V/O+Oo4vfkOqQ0+feL9laeJuht5XPDm/GMfLajkf+iJe7e9AIMIJhEsNCJj0GC4plricTXzqnY12iaIzupDf11M9/hbPNOImUFuB1zbmTaTIKCUYQ== siga