This file contains hidden or 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
zaphod:~$ grep joyent ~/.chef/knife.rb | |
knife[:joyent_username] = "someara" | |
knife[:joyent_password] = "mahpasswordhere" | |
knife[:joyent_api_url] = "https://us-sw-1.api.joyentcloud.com/" | |
zaphod:~$ knife joyent server list | |
ERROR: ArgumentError: Joyent is not a recognized compute provider |
This file contains hidden or 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
zaphod:~$ time knife joyent server create --image 47e6af92-daf0-11e0-ac11-473ca1173ab0 --flavor "regular_128" --name "smartos-2" | |
Created machine: 5d989f72-b3bc-44a1-816d-1d6d0e969b57 | |
real 0m24.673s | |
user 0m2.179s | |
sys 0m0.533s | |
zaphod:~$ time knife joyent server create --image 47e6af92-daf0-11e0-ac11-473ca1173ab0 --flavor "regular_128" | |
Created machine: 09061a38-6916-4be8-b993-efb70f3f0f3b | |
real 0m28.115s |
This file contains hidden or 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
package "httpd" do | |
action :install | |
end | |
service "httpd" do | |
action [:start, :enable] | |
end | |
This file contains hidden or 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
<% if @port != 80 -%> | |
Listen <%= @port %> | |
<% end -%> | |
<VirtualHost *:<%= @port %>> | |
ServerAdmin webmaster@localhost | |
DocumentRoot <%= @document_root %> | |
<Directory /> | |
Options FollowSymLinks |
This file contains hidden or 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
# | |
# Cookbook Name:: apache | |
# Recipe:: default | |
# | |
# Copyright 2012, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
package "httpd" do |
This file contains hidden or 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
function append_if_no_such_line() { | |
local line="$1"; | |
local file="$2"; | |
if ! grep "^`printf '%q' "$line"`$" $file 2>&1>/dev/null ; then echo "$line" >> $file ; fi | |
} |
This file contains hidden or 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
function check_if_mounted() { | |
local mount_point="$1" | |
local device="$2" | |
mount | grep "^`printf "$mount_point"`" | awk '{ print $3 }' | grep "`printf "$device"`" 2>&1>/dev/null | |
} |
This file contains hidden or 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
# boolean checks | |
function if_mounted() { | |
local mount_point="$1" | |
local device="$2" | |
mount | grep "^`printf '%q' "${mount_point}"`" | awk '{ print $3 }' | grep "`printf '%q' "${device}"`" 2>&1>/dev/null | |
} | |
function if_lofi_associated(){ | |
local block_image="$1" | |
lofiadm | grep "`printf '%q' ${block_image}`" | awk '{ print $2 }' | grep "^${block_image}$" 2>&1>/dev/null |
This file contains hidden or 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
zaphod:~/work/sean.io$ for i in `knife joyent server list | grep running | awk '{ print $1 }'` ; do knife joyent server delete $i ; done | |
Stopped server: cddb17fc-0a80-462b-ba00-ae192343712d | |
Deleted server: cddb17fc-0a80-462b-ba00-ae192343712d | |
Stopped server: 6a72d486-bb15-410c-a8e4-73f2915ec25b | |
Deleted server: 6a72d486-bb15-410c-a8e4-73f2915ec25b | |
Stopped server: 2e7a4e41-abe4-49db-8c40-ba189d7791ae | |
Deleted server: 2e7a4e41-abe4-49db-8c40-ba189d7791ae | |
Stopped server: 8bc9a177-1fc4-456d-b507-163f25dfa70c | |
Deleted server: 8bc9a177-1fc4-456d-b507-163f25dfa70c | |
Stopped server: aa6754b0-66e1-4e6a-a087-2e30d22ec85e |
This file contains hidden or 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
[root@0f5d206 ~]# wget http://s3.amazonaws.com/opscode-full-stack/solaris2-5.11-i86pc/chef-full-0.10.8-3-solaris2-5.11-i86pc.tar.gz | |
--2012-07-27 19:29:38-- http://s3.amazonaws.com/opscode-full-stack/solaris2-5.11-i86pc/chef-full-0.10.8-3-solaris2-5.11-i86pc.tar.gz | |
Resolving s3.amazonaws.com (s3.amazonaws.com)... 207.171.163.151 | |
Connecting to s3.amazonaws.com (s3.amazonaws.com)|207.171.163.151|:80... connected. | |
HTTP request sent, awaiting response... 200 OK | |
Length: 24622816 (23M) [application/octet-stream] | |
Saving to: `chef-full-0.10.8-3-solaris2-5.11-i86pc.tar.gz' | |
100%[==========================================================================================================================================>] 24,622,816 4.25M/s in 5.5s |