Skip to content

Instantly share code, notes, and snippets.

View daronco's full-sized avatar

Leonardo C. Daronco daronco

View GitHub Profile
@lfzawacki
lfzawacki / changedb
Created May 14, 2014 15:54
Simple script to manage different database.yml files in a rails development environment
#!/home/lucas/.rbenv/shims/ruby
# Use an appropriate file path for your ruby interpreter
require 'fileutils'
class ChangeDB
def initialize dir='config/.changedb', db_yml='config/database.yml'
@dir = dir
@db_yml = db_yml
@fcecagno
fcecagno / build-web.sh
Last active August 29, 2015 14:09
Compile bbb-web
#!/bin/bash
set -xe
sudo service tomcat7 stop
sudo chmod 666 /var/log/bigbluebutton/bbb-web.log
cd ~/dev/bigbluebutton/bigbluebutton-web
# cp /var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties grails-app/conf/
sudo rm -rf /var/lib/tomcat7/webapps/bigbluebutton*
@fcecagno
fcecagno / build-apps.sh
Created November 11, 2014 19:58
Build bbb-apps
#!/bin/bash
sudo service bbb-red5 stop
sudo pkill -u red5
set -xe
sudo chmod -R 777 /usr/share/red5/webapps
apps=( "bbb-video" "bbb-voice" "bigbluebutton-apps" "deskshare" )
Factory.define :application do |factory|
factory.attachment(:sample, "public/samples/sample.doc", "application/msword")
end
module God
module Conditions
class RestartFileTouched < PollCondition
attr_accessor :restart_file
def initialize
super
end
def process_start_time
Time.parse(`ps -o lstart -p #{self.watch.pid} --no-heading`)
@divineforest
divineforest / god
Created May 4, 2011 06:54
god ubuntu init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: god
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: God
### END INIT INFO
FactoryGirl.define do
factory :application do
attachment :sample, "public/samples/sample.doc", "application/msword"
end
end
@enthal
enthal / people_controller.rb
Created October 24, 2011 21:00
simple rails rspec testing that devise before_filter :authenticate_user! covers controller actions
class PeopleController < ApplicationController
before_filter :authenticate_user!, :except => [:index, :show]
...
end
@rafamoreira
rafamoreira / Ubuntu rbenv
Created July 24, 2012 23:00 — forked from HatemMahmoud/Ubuntu rbenv
Installing Ruby 1.9.3 with OpenSSL on Ubuntu 12.04 using ruby-build and rbenv
# for more info: https://gist.github.com/1120938
@german
german / gist:1237902
Created September 23, 2011 17:05
god config for delayed_job
# run with: god -c /path/to/config.god [add -D if you want to not-deamonize god]
# This is the actual config file used to keep the delayed_job running
APPLICATION_ROOT = "/var/www/application"
RAILS_ENV = "production"
God.watch do |w|
w.name = "delayed_job_production"
w.interval = 15.seconds
w.start = "/bin/bash -c 'cd #{APPLICATION_ROOT}/current; /usr/bin/env RAILS_ENV=#{RAILS_ENV} #{APPLICATION_ROOT}/current/script/delayed_job start > /tmp/delay_job.out'"