Skip to content

Instantly share code, notes, and snippets.

View carlcrott's full-sized avatar

Carl Crott carlcrott

  • <( '.' <) <( '.' )> (> '.' )>
  • San Francisco CA
View GitHub Profile
export EC2_KEYPAIR=<your keypair name> # name only, not the file name
export EC2_URL=https://ec2.<your ec2 region>.amazonaws.com
export EC2_PRIVATE_KEY=$HOME/<where your private key is>/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
export EC2_CERT=$HOME/<where your certificate is>/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/
ubuntu@domU-12-31-39-0A-16-63:~$ rvm get stable /or head
Usage
rvm-installer [options] [action]
Options
--branch <name> - Install RVM head, from named branch
ubuntu@domU-12-31-39-0A-16-63:~$ rvm get stable
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 919k 100 919k 0 0 3293k 0 --:--:-- --:--:-- --:--:-- 3293k
Upgrading the RVM installation in /home/ubuntu/.rvm/
RVM PATH line found in /home/ubuntu/.bashrc /home/ubuntu/.zshrc.
RVM sourcing line found in /home/ubuntu/.bash_login /home/ubuntu/.zlogin.
ubuntu@domU-12-31-39-0A-16-63:~$ netstat -nlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::3000 :::* LISTEN 14657/java
tcp6 0 0 :::22 :::* LISTEN -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
Active UNIX domain sockets (only servers)
ubuntu@ip-10-140-12-134:~/skinny-sinatra-jruby$ jruby -S trinidad
Mar 8, 2012 3:45:22 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-3000"]
Mar 8, 2012 3:45:22 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Mar 8, 2012 3:45:22 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
2012-03-08 15:45:23 INFO: No global web.xml found
2012-03-08 15:45:24 INFO: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (OpenJDK Client VM 1.6.0_20) [linux-i386-java]
2012-03-08 15:45:25 INFO: Info: received min runtimes = 1
ubuntu@domU-12-31-39-10-75-CD:~/skinny-sinatra-jruby$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.8.7 (2012-02-22 patchlevel 357) [java]
- INSTALLATION DIRECTORY: /home/ubuntu/.rvm/gems/jruby-1.6.7-d19@skinnySinatraJruby
- RUBY EXECUTABLE: /home/ubuntu/.rvm/rubies/jruby-1.6.7-d19/bin/jruby
- EXECUTABLE DIRECTORY: /home/ubuntu/.rvm/gems/jruby-1.6.7-d19@skinnySinatraJruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
ubuntu@domU-12-31-39-10-75-CD:~/skinny-sinatra-jruby$ bundle install
Fetching gem metadata from http://rubygems.org/.....
Installing jruby-rack (1.1.4)
Installing rack (1.4.1)
Installing rack-protection (1.2.0)
Installing tilt (1.3.3)
Installing sinatra (1.3.2)
Installing trinidad_jars (1.0.2)
Installing trinidad (1.3.4)
Using bundler (1.1.0)
ubuntu@domU-12-31-39-10-75-CD:~/skinny-sinatra-jruby$ rvm info
jruby-1.6.7-d19@skinnySinatraJruby:
system:
uname: "Linux domU-12-31-39-10-75-CD 2.6.32-342-ec2 #43-Ubuntu SMP Wed Jan 4 18:22:57 UTC 2012 i686 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)"
zsh: " => not installed"
rvm:
@carlcrott
carlcrott / gist:2218175
Created March 27, 2012 17:24
JSON validation method
class String
def valid_json?
begin
JSON.parse(self)
return true
rescue Exception => e
return false
end
end
end
require 'open-uri'
require 'nokogiri'
require 'mechanize'
require 'json'
REPO_NAME = __FILE__.split(".")[0]
class String
def valid_json?
begin