Skip to content

Instantly share code, notes, and snippets.

View gdchamal's full-sized avatar

Aymeric Barantal gdchamal

View GitHub Profile
@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
- 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
// 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))
}
@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
@gdchamal
gdchamal / gist:d5a41a384678bedf0141
Created September 3, 2014 13:50
Vagrant box diff to make backends start having enough memory
(.env)[mric@zen vagrant]$ diff Vagrantfile Vagrantfile.update
48c48
< # config.vm.provider "virtualbox" do |vb|
---
> config.vm.provider "virtualbox" do |vb|
53,54c53,54
< # vb.customize ["modifyvm", :id, "--memory", "1024"]
< # end
---
> vb.customize ["modifyvm", :id, "--memory", "2048"]
@gdchamal
gdchamal / gist:0fcfa10a38b3b5eb2b31
Created September 29, 2014 19:56
Draft caliopen architecture

Caliopen Architecture Guide

Context

Caliopen in this document refer to the technical messaging infrastructure developed to achieve Caliopen project aims.

Caliopen is designed as a scalable online platform for management of messages in many protocols. Mail and related protocols are the first implementation.

Keybase proof

I hereby claim:

  • I am gdchamal on github.
  • I am chamal (https://keybase.io/chamal) on keybase.
  • I have a public key whose fingerprint is 3A11 7218 7EF7 406F CBCE CFA6 0E68 C4F8 5D04 D8FC

To claim this, I am signing this object:

@gdchamal
gdchamal / gist:0b5cdd8f20a1ce74008e
Created January 21, 2015 13:16
load Interfaces
from caliopen.config import Configuration
from caliopen.core.config import includeme
pwd = os.path.dirname(os.path.realpath(__file__))
DEFAULT_CONFIG_FILE = '%s/../../../../config/caliopen.yaml.template' % pwd
Configuration.load(os.environ.get('CALIOPEN_CONFIG', DEFAULT_CONFIG_FILE),
'global')
includeme()
Verifying that +chamal is my blockchain ID. https://onename.com/chamal
In [25]: res.json()
Out[25]:
{'contact': {'additional_name': None,
'addresses': [],
'avatar': 'avatar.png',
'contact_id': 'bd724ec9-2746-4cf3-be11-eed0ed88d6e5',
'date_insert': '2015-12-19T12:15:50.284000',
'date_update': None,
'deleted': 0,
'emails': [],