Skip to content

Instantly share code, notes, and snippets.

View fairchild's full-sized avatar

Michael Fairchild fairchild

  • Procore
  • California
View GitHub Profile
pool :sandbox do
cloud :hello do
instances 1..1
using :ec2
end
end
#!/bin/bash
# backup your delicious bookmarks
curl -k --user `cat password.txt` -o backup.xml -O 'https://api.del.icio.us/v1/posts/all'
#!/bin/bash
##CURL Request Directly to WATSON
WATSON_SERVER=
MINERVA_SERVER="ec2-174-129-82-133.compute-1.amazonaws.com"
PORT=80
W_PORT=9000
AUDIO_TEST_FILE="./files/india.au"
##CURL Request Directly to WATSON
curl -i --header 'Transfer-Encoding: Chunked' "http://<WATSON_SERVER:PORT>/smm/watson?imei=hemant&grammar=business.search.lm&resultFormat=json&metrics=1&audioFormat=amr" --data-binary @<path_to_audio_amr_file>
##CURL Request to Minerva
curl -i --header 'Transfer-Encoding: Chunked' "http://<MINERVA_SERVER:PORT>/asr?imei=hemant&grammar=qme.lm&resultFormat=json&audioFormat=au" --data-binary @<path_to_audio_au_file>
## if you have a au audio file instead of the amr, change the audioFormat in the urls above. (applies to both minerva and watson)
## the grammar parameter is the one that points to a directory name under /mnt/grammars/lm, in case you want to change that to chacha
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
pool :sandbox do
cloud :hello_world do
instances 1..1
# Update with the path to your EC2 keypair
# If you don't have one, create with:
# $ ec2-create-keypair NAME > /path/to/your/keypairs/<NAME>
keypair "/path/to/your/keypairs/<NAME>"
export JAVA_HOME=/Library/Java/Home #/usr on ubuntu
#export EC2_HOME=~/opt/ec2
export PATH=$EC2_HOME/bin:$PATH
export EC2_CONTEXTS_DIR=~/.ec2
export EC2_CONFIG_DIR=$EC2_CONTEXTS_DIR/current
ec2-switch-context() {
unset EC2_URL
unset S3_URL
unset EC2_PRIVATE_KEY
require 'sinatra'
EC2_HOME = '~/.ec2'
use Rack::Auth::Basic do |username, password|
[username, password] == ['some_user', 'some_pass']
end
get "/" do
@links = %w{describe_ec2s restart_all_ec2s shutdown_all_ec2s}.map { |cmd|
@fairchild
fairchild / gist:150855
Created July 20, 2009 20:01 — forked from retr0h/gist:98308
content_type filter for sinatra
CONTENT_TYPES = {:html => 'text/html', :css => 'text/css', :js => 'application/javascript'}
before do
request_uri = case request.env['REQUEST_URI']
when /\.css$/ : :css
when /\.js$/ : :js
else :html
end
content_type CONTENT_TYPES[request_uri], :charset => 'utf-8'
end
#!/bin/bash
echo -n "Pick a color (blue, yellow, red ): "
read -e COLOR
echo It is a $COLOR day