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
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
# | |
# 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
<% 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
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
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
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
bash -c ' | |
( | |
echo "export PS1=\"\\\\H:\\\\w\\\\\\$ \"" >> /etc/profile | |
) | |
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name | |
PROPERHOSTNAME=`cat /tmp/chef_node_name | cut -d. -f1` | |
PROPERDNSDOMAINNAME=`cat /tmp/chef_node_name | sed s/^$PROPERHOSTNAME.//` |
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
bash -c ' | |
( | |
echo "export PS1=\"\\\\H:\\\\w\\\\\\$ \"" >> /etc/profile | |
) | |
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name | |
PROPERHOSTNAME=`cat /tmp/chef_node_name | cut -d. -f1` | |
PROPERDNSDOMAINNAME=`cat /tmp/chef_node_name | sed s/^$PROPERHOSTNAME.//` |
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
execute "turn off chef-client verbose logging" do | |
command "echo 'verbose_logging false' >> /etc/chef/client.rb" | |
not_if "grep 'verbose_logging false' /etc/chef/client.rb" | |
end |