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
## One way to change the rest_connection settings using Ruby code. | |
RightScale::Api::BaseExtend.class_eval <<-EOF | |
@@connection.settings = { | |
:user => "someuser@rightscale.com", | |
:pass => "test1234_", | |
:api_url => "https://my.rightscale.com/api/acct/12345", | |
:common_headers => { | |
"X_API_VERSION" => "1.0" | |
} |
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
def clean_and_translate_server_params(it) | |
it.each do |k, v| | |
clean_and_translate_server_params(val) if val.is_a?(Hash) | |
end | |
it.reject! { |k, v| v == nil || v == "" } | |
it.each { |k, v| v = translate_href(v) if k.to_s =~ /href/ } | |
it | |
end | |
def translate_href(href) |
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
Buildfile: /home/jeremy/recent_projects/testapp/build.xml | |
[setup] Android SDK Tools Revision 8 | |
[setup] Project Target: Android 2.2 | |
[setup] API level: 8 | |
[setup] | |
[setup] ------------------ | |
[setup] Resolving library dependencies: | |
[setup] No library dependencies. | |
[setup] | |
[setup] ------------------ |
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 'ruboto' | |
ruboto_import "org.myname.example.MySQLiteOpenHelper" | |
#ruboto_import "org.ruboto.example.MyCursorAdapter" | |
#ruboto_import "org.ruboto.example.DepListActivity" | |
ruboto_import_widgets :LinearLayout, :TableLayout, :TableRow, :TextView, :EditText, :ScrollView | |
$activity.start_ruboto_activity("$dep_list_activity") do |bundle| |
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 | |
puts `gem sources -a http://gems.opscode.com/` | |
puts `gem install chef` | |
solorb = <<EOF | |
file_cache_path "/tmp/chef-solo" | |
cookbook_path "/tmp/chef-solo/cookbooks" | |
recipe_url "http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz" | |
EOF | |
bootstrap = <<BOOT |
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
pkgname=cloud-init | |
pkgver=701 | |
pkgrel=1 | |
pkgdesc="cloud-init from canonical" | |
arch=(any) | |
license=("GPLv3") | |
depends=(systemd python2 python2-yaml python2-cheetah python2-prettytable python2-oauth2 python2-boto python2-argparse python2-configobj) | |
makedepends=('bzr' 'python2') | |
_bzrtrunk="lp:~jeremydei/cloud-init/archlinux" | |
_bzrmod="cloud-init" |
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
# REST METHODS | |
# takes a block of HttpGet/Put/Post/Delete | |
def self.get(&block) | |
options = self.load_preferences | |
client = DefaultHttpClient.new | |
params = BasicHttpParams.new | |
HttpProtocolParams.setVersion(params, HttpVersion::HTTP_1_1); | |
HttpProtocolParams.setContentCharset(params, "UTF_8"); | |
HttpProtocolParams.setUseExpectContinue(params, false); | |
client.setParams(params) |
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
def self.load_preferences | |
e = getPreferences(Context::MODE_PRIVATE) | |
email = e.getString("Email", "") | |
pass = e.getString("Password", "") | |
host = e.getString("RightScale Host", "") | |
account_id = e.getString("Account ID", "") | |
return { :email => email, :pass => pass, :host => host, :account_id => account_id } | |
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
disable_root: false | |
preserve_hostname: false | |
# The modules that run in the 'init' stage | |
cloud_init_modules: | |
- bootcmd | |
- write-files | |
- set_hostname | |
- update_hostname | |
- update_etc_hosts | |
- users-groups |
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
pkgname=cloud-init-bzr | |
pkgver=723 | |
pkgrel=1 | |
pkgdesc="Bootstrap EC2 instances with Cloud-init from Canonical. Packaged from bzr trunk." | |
arch=(any) | |
license=("GPLv3") | |
url=https://launchpad.net/cloud-init | |
# cloud-init python lib requirements (according to Requires file): | |
# cheetah (aur), PrettyTable (aur), oauth (aur), boto (aur), configobj (community), pyyaml (community), argparse (aur) | |
# the ONLY non-match is we are using python2-yaml vs pyyaml. |