Skip to content

Instantly share code, notes, and snippets.

View akitaonrails's full-sized avatar

Fabio Akita akitaonrails

View GitHub Profile
@akitaonrails
akitaonrails / gist:14290
Created October 2, 2008 06:09
database.yml para gitorious
development:
adapter: mysql
database: gitorious_development
username: root
password: root
host: localhost
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
@akitaonrails
akitaonrails / gist:14291
Created October 2, 2008 06:11
gitorious.yml
# The session secret key (`apg -m 64` is always useful for this kinda stuff)
cookie_secret: frie...kceft
# The path where git repositories are stored. The actual (bare) repositories resides
# in repository_base_path/#{project.slug}/#{repository.name}.git/:
repository_base_path: "/home/git"
# Stuff that's in the html <head>. custom stats javascript code etc
extra_html_head_data:
@akitaonrails
akitaonrails / gist:14292
Created October 2, 2008 06:18
crontab para Gitorious
*/1 * * * * /opt/ruby-enterprise/bin/ruby /var/www/gitorious/script/task_performer
* */1 * * * cd /var/www/gitorious && /opt/ruby-enterprise/bin/rake ultrasphinx:index RAILS_ENV=production
LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /opt/ruby-enterprise/bin/ruby
<VirtualHost *:80>
ServerName servidor.local
DocumentRoot /var/www/gitorious/public
</VirtualHost>
RubyConf
RailsConf
RailsConf EU
acts_as_conference
Euruko
Ruby Kaigi
Mountain West RubyConf
eRubyCon
Ruby Hoedown
Amsterdam Ruby en Rails
def teste
puts 1 + 2
end
# run by doing:
# rake locales:compile LANG_TARGET=pt-BR
namespace :locales do
desc "Compare locale files and get differences and missing keys"
task :compile do
ENV['LANG_SOURCE'] = 'en' if ENV['LANG_SOURCE'].nil?
if ENV['LANG_TARGET'].nil?
puts "define the target language using the LANG_TARGET environment variable\nrake locales:compile LANG_TARGET=pt-BR"
exit(1)
end
require 'autotest/redgreen'
module Autotest::Growl
def self.growl title, msg, img, pri=0, stick=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{ msg.inspect} #{title} #{stick}"
end
Autotest.add_hook :ran_command do |autotest|
filtered = autotest.results.grep(/\d+\s.*examples?/)
output = filtered.empty? ? '' : filtered.last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?(?:,\s(\d+)\s.*pending)?/)
### NGINX
$ httperf --server=akitaonrails.local --uri=/ --rate=10 --num-conns=100
httperf --client=0/1 --server=akitaonrails.local --port=80 --uri=/ --rate=10 --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1
Total: connections 100 requests 100 replies 100 test-duration 10.292 s
Connection rate: 9.7 conn/s (102.9 ms/conn, <=8 concurrent connections)
### NGINX:
$ httperf --server=akitaonrails.local --uri=/posts --rate=10 --num-conns=100
httperf --client=0/1 --server=akitaonrails.local --port=80 --uri=/posts --rate=10 --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1
Total: connections 100 requests 100 replies 100 test-duration 9.906 s
Connection rate: 10.1 conn/s (99.1 ms/conn, <=3 concurrent connections)