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
include_recipe "postgresql_database" | |
postgresql_database 'test' do | |
connection { :host => "127.0.0.1", :port => 5432, :username => 'postgres', :password => node['postgresql']['password']['postgres'] } | |
action :create | |
provider "postgresql_database" | |
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
cookbook_file "/opt/cntw/conf/create_cntw.pgsql" do | |
mode "0644" | |
owner "root" | |
group "root" | |
source "create_cntw.pgsql" | |
end | |
#include_recipe "database" | |
package "cntw-plsqlmodules" do | |
action [:install, :upgrade] |
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
# Copyright (C) 2012, SCM Ventures AB | |
# Author: Ian Delahorne <ian@scmventures.se> | |
# | |
# Permission to use, copy, modify, and/or distribute this software for | |
# any purpose with or without fee is hereby granted, provided that the | |
# above copyright notice and this permission notice appear in all | |
# copies. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL | |
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
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
* Basic scenario is that we want to hand out static IPs over DHCP | |
using hostnames provided by the clients. Ideally we could use the | |
hostname, but I haven't found dhcpd configuration that works, so I | |
used dhcp-client-identifier instead. | |
Our setup is: | |
* VMs get created in VMware by deploying from a template, which is a | |
base VM image. VMware has limited customization possibilities when | |
deploying, so it can only really set the hostname and configure | |
interfaces' IP address / use DHCP. |
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/knife exec | |
# ian-note: run from your home directory. Add the following to your .chef/knife.rb: | |
# knife[:ssh_user] = "myusername" | |
# A knife exec script to change chef node's name, preserving all the attributes. | |
# | |
# Usage: knife exec rename-node.rb old-name new-name | |
# | |
# Script retrieves the Node object, changes its 'name' attribute, |
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
# | |
# Author:: Ezra Pagel (<ezra@cpan.org>) | |
# License:: Apache License, Version 2.0 | |
# | |
require 'chef/knife' | |
require 'chef/knife/BaseVsphereCommand' | |
# Lists all known virtual machines in the configured datacenter | |
class Chef::Knife::VsphereVmList < Chef::Knife::BaseVsphereCommand |
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
#ifndef _S3_H | |
#define _S3_H | |
struct s3_string { | |
char *ptr; | |
size_t len; | |
}; | |
struct s3_string * s3_string_init(); | |
size_t s3_string_curl_writefunc(void *ptr, size_t len, size_t nmemb, struct s3_string *s); |
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
path_elems=(${PATH//:/ }) | |
sbin_missing=1 | |
usr_sbin_missing=1 | |
usr_local_sbin_missing=1 | |
for i in "${!path_elems[@]}" ; do | |
if [ "${path_elems[i]}" = /sbin ]; then sbin_missing = 0 ; fi | |
if [ "${path_elems[i]}" = /usr/sbin ]; then usr_sbin_missing = 0 ; fi | |
if [ "${path_elems[i]}" = /usr/local/sbin ]; then usr_local_sbin_missing = 0 ; fi | |
done |
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
package main | |
import ( | |
"code.google.com/p/goauth2/oauth" | |
urlshortener "code.google.com/p/google-api-go-client/urlshortener/v1" | |
"flag" | |
"fmt" | |
"log" | |
) |
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
: ian@Upshot-Knothole go; ./serverbyid | |
Got JSON body {"itemNotFound": {"message": "Instance could not be found", "code": 404}} | |
panic: runtime error: invalid memory address or nil pointer dereference | |
[signal 0xb code=0x1 addr=0x0 pc=0x304f2] | |
goroutine 16 [running]: | |
runtime.panic(0x2aa680, 0x46e8e4) | |
/usr/local/go/src/pkg/runtime/panic.c:279 +0xf5 | |
github.com/rackspace/gophercloud.(*genericServersProvider).ServerById(0xc2081de7b0, 0x2ee450, 0x8, 0x15, 0x0, 0x0) | |
/Users/ian/go/src/github.com/rackspace/gophercloud/servers.go:103 +0x252 |
OlderNewer