This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pool :sandbox do | |
cloud :hello do | |
instances 1..1 | |
using :ec2 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# backup your delicious bookmarks | |
curl -k --user `cat password.txt` -o backup.xml -O 'https://api.del.icio.us/v1/posts/all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'chef' | |
require 'chef/node' | |
require 'chef/rest' | |
# Please see the readme for overview documentation. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -n "Pick a color (blue, yellow, red ): " | |
read -e COLOR | |
echo It is a $COLOR day |