Skip to content

Instantly share code, notes, and snippets.

View gdchamal's full-sized avatar

Aymeric Barantal gdchamal

View GitHub Profile
@gdchamal
gdchamal / gist:10847910
Last active August 29, 2015 13:59
libcloud s3 using authentication version 4 protocol
diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py
index 9577f98..de15e72 100644
--- a/libcloud/storage/drivers/s3.py
+++ b/libcloud/storage/drivers/s3.py
@@ -13,14 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import time
import copy
// not null string
type NNstring string
func (n *NNstring) UnmarshalJSON(b []byte) (err error) {
if string(b) == "null" {
return errors.New("String can't be null")
}
return json.Unmarshal(b, (*string)(n))
}
- name: ensure directory with opentsdb source
file: name='/home/{{ tsdb_user }}/opentsdb' state=directory
register: opentsdb_dir
tags: tsdb
- name: clone opentsdb
when_changed: '{{ opentsdb_dir.changed }}'
sudo_user: '{{ tsdb_user }}'
shell: git clone git://github.com/OpenTSDB/opentsdb.git
tags: tsdb
@gdchamal
gdchamal / gist:5896340
Created June 30, 2013 18:40
Creating a dns farm servers :)
(.env)mric@chamalbook:mygnadi][builder]$ python platform/builder.py etc/dns.yaml
DEBUG:main:Will create 2 servers in farm dns
WARNING:main:VM dns-1 already exist with id 81821
WARNING:main:No creation for vm dns-1
INFO:main:Create of vm dns-2 spawn operations : [10028983, 10028984, 10028985]
INFO:main:Vm dns-2 created with id 81822
INFO:main:Set fqdn dns-2.toto.com to x.x.x.x done
INFO:main:Set fqdn dns-2.toto.com to xxxx:xxx:dc0:xx:xxx:ffff:feef:ffff done
INFO:main:VM #81822 (dns-2) have public IPv4 x.x.x.x