Skip to content

Instantly share code, notes, and snippets.

🐱
Meow

Larry Zhao larryzhao

🐱
Meow
Block or report user

Report or block larryzhao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View testruby.rb
def thefunc
@this = "123"
end
View deploy.rb
require 'torquebox-capistrano-support'
require 'bundler/capistrano'
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'jruby-1.6.7@myapp'
set :use_sudo, false
set :stages, %w(staging production)
set :default_stage, "production"
require 'capistrano/ext/multistage'
View torqubox capistrano start
$ cap deploy:start
triggering load callbacks
* executing `staging'
triggering start callbacks for `deploy:start'
* executing `multistage:ensure'
* executing `deploy:start'
Starting TorqueBox AS
* executing "nohup /usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java/jboss/bin/standalone.sh -b 0.0.0.0 < /dev/null > /dev/null 2>&1 &"
servers: ["domain"]
[domain] executing command
@larryzhao
larryzhao / gist:2044425
Created Mar 15, 2012
directly cap deploy:start
View gist:2044425
$ /usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java/jboss/bin/standalone.sh -b 0.0.0.0
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java/jboss
JAVA: java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml
View JSON test result in JRuby
$ jruby json_text.rb
["に到着を待っている"] is in encoding: UTF-8
に到着を待っている is in encoding ASCII-8BIT
@larryzhao
larryzhao / spec result
Created Mar 26, 2012
twitter-text-rb extractor spec
View spec result
Twitter::Extractor
mentions
should accept a block arugment and call it in order
single screen name alone
should be linked
should be linked with _
should be linked if numeric
multiple screen names
should both be linked
screen names embedded in text
@larryzhao
larryzhao / Capfile.rb
Created May 28, 2012
uninitialized constant Capistrano in rvm-capistrano
View Capfile.rb
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
@larryzhao
larryzhao / ls -ld rvm_path
Created May 29, 2012
Output of installing rvm system widely
View ls -ld rvm_path
$ ls -ld $rvm_path/*
-rw-rw-r-- 1 root rvm 566 May 30 00:54 /usr/local/rvm/LICENCE
-rw-rw-r-- 1 root rvm 8662 May 30 00:54 /usr/local/rvm/README
-rw-rw-r-- 1 root rvm 7 May 30 00:54 /usr/local/rvm/RELEASE
-rw-rw-r-- 1 root rvm 7 May 30 00:54 /usr/local/rvm/VERSION
drwxrwsr-x 2 root rvm 4096 May 30 00:43 /usr/local/rvm/archives
drwxrwsr-x 2 root rvm 4096 May 30 00:54 /usr/local/rvm/bin
drwxrwsr-x 2 root rvm 4096 May 30 00:54 /usr/local/rvm/config
drwxrwsr-x 3 root rvm 4096 May 30 00:15 /usr/local/rvm/contrib
drwxrwsr-x 2 root rvm 4096 May 30 00:45 /usr/local/rvm/environments
@larryzhao
larryzhao / error
Created May 30, 2012
Permission denied error when `rvm get stable`
View error
$ rvm get stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 185 100 185 0 0 441 0 --:--:-- --:--:-- --:--:-- 1456
100 9249 100 9249 0 0 8117 0 0:00:01 0:00:01 --:--:-- 8117
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 125 100 125 0 0 140 0 --:--:-- --:--:-- --:--:-- 174
100 1045k 100 1045k 0 0 304k 0 0:00:03 0:00:03 --:--:-- 440k
@larryzhao
larryzhao / error
Created May 30, 2012
torquebox launch error when using zip install
View error
$ $JBOSS_HOME/bin/standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/web/torquebox-current/jboss
JAVA: java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Xss2048k
You can’t perform that action at this time.