Skip to content

Instantly share code, notes, and snippets.

View rdeguzman's full-sized avatar

Rupert de Guzman rdeguzman

View GitHub Profile
@rdeguzman
rdeguzman / gist:1756976
Created February 7, 2012 03:32
RVM + RUBY + RAILS core dumped
This is now solved in freenode@irc#rvm by mpapis. Try ruby-1.9.3-p0!!!! Thank you to mpapis
FreeBSD9 64 bit + rvm + ruby1.9.2-p180 + rails3.0.10
[root@rufus /usr/local/datalink/cws-rails]# uname -a
FreeBSD rufus.datalink.loc 9.0-STABLE FreeBSD 9.0-STABLE #0: Thu Jan 19 09:10:51 EST 2012 [email protected]:/usr/obj/usr/src/sys/RUFUS amd64
[root@rufus /usr/local/datalink/cws-rails]# rails s -e development
=> Booting WEBrick
=> Rails 3.0.10 application starting in production on http://0.0.0.0:3000
@rdeguzman
rdeguzman / Gemfile
Created February 28, 2012 02:33
ruby1.9.3 + growl1.2 -> guard start -> fail
source 'http://rubygems.org'
gem 'rails', '3.0.10'
gem 'mysql2', '< 0.3'
gem 'pg'
gem 'devise'
gem 'jquery-rails'
gem 'simple-navigation'
gem 'cancan'
gem 'formtastic', "2.0.2"
Started GET "/notices" for 127.0.0.1 at 2012-02-29 15:02:14 +1100
Processing by NoticesController#index as HTML
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1
Role Load (0.5ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE "roles"."name" = 'AdminSuper' AND ("roles_users".user_id = 8 ) LIMIT 1
Role Load (0.7ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE "roles"."name" = 'ClientAdmin' AND ("roles_users".user_id = 8 ) LIMIT 1
Role Load (0.5ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE "roles"."role_type" = 'admin' AND ("roles_users".user_id = 8 ) LIMIT 1
Client Load (0.3ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = 63 LIMIT 1
Rendered layouts/_header.datatables.html.erb (2.0ms)
SQL (0.3ms) SELECT COUNT(*) FROM "notices" INNER JOIN "clients_notices" ON "notices".id = "clients_notices"
@rdeguzman
rdeguzman / 1-dmesg
Created April 3, 2012 02:18
Get sierra wireless MC8790 working on lucid 5.2.8
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for Sierra USB modem
sierra 1-7:1.0: Sierra USB modem converter detected
usb 1-7: Sierra USB modem converter now attached to ttyUSB0
sierra 1-7:1.1: Sierra USB modem converter detected
usb 1-7: Sierra USB modem converter now attached to ttyUSB1
sierra 1-7:1.2: Sierra USB modem converter detected
@rdeguzman
rdeguzman / tasks
Created April 27, 2012 21:31
MyTravelPhilippines Android Task List
Total: 19-20 days
1. http://developer.android.com. (1-2 days)
- Download SDK. http://dl.google.com/android/android-sdk_r18-macosx.zip
- Prep dev environment
- Need to register like Apple iOS Developer $99/year?
2. Get an Android device? (optiional?)
- Heck, why did I sell the HTC desire.
- Device mostly used in PH/Asia? Im guessing Samsung Galaxy?
namespace :queue do
#task :stop do
# run "sh #{deploy_to}/current/tools/queue_stop.sh"
#end
task :start do
#run "/usr/local/rvm/bin/rvm-shell 'ruby-1.9.3-p0@dfms' -c 'RAILS_ENV=production nohup /usr/local/datalink/dfms-rails/current/bin/worker/geocoder_queue &'"
run "sh #{deploy_to}/current/tools/queue_start.sh"
end
end
@rdeguzman
rdeguzman / _form.html.erb
Created December 5, 2012 22:35
formtastic
<%= semantic_form_for @fleet_group do |f| %>
<div class="column left">
<section>
<% unless params[:action] == "edit" %>
<%= f.input :id, :label => "Fleet Group ID" %>
<% end %>
<%= f.input :schema_name, :hint => "dfms_[fleet_group_id]", :label => "Schema Name" %>
@rdeguzman
rdeguzman / alias
Last active December 11, 2015 09:59
RAILS_ENV shell shortcuts.. no need to type export RAILS_ENV=development
https://github.com/rdeguzman/dotfiles/blob/master/zsh/aliases
# cd
alias ..='cd ..'
# ls
alias ls="ls -F"
alias l="ls -lAh"
alias ll="ls -l"
alias la='ls -A'
109 def getGames(n, t):
110 teams = n
111 table = t[:]
112 if n % 2 == 0:
113 games = [[] for i in range(0, (2*(n-1)))]
114 elif n % 2 != 0:
115 games = [[] for i in range(0, (2*n))]
116 for y in range(0, n):
117 a = table[y]
118 for x in range(0, n):
@rdeguzman
rdeguzman / fail
Last active December 16, 2015 19:38
Postgres Replication with Archiving on Master.
When I set wal_level = 'archive' on master and hot_standby = 'off' in slave.
The slave won't start, replication user seem to authenticate, however the postgres
startup process seems to keep on trying.. why?
# master
wal_level = 'archive'
archive_mode = on
archive_command = '../pgscripts/archive.sh %p %f'
# - Streaming Replication -