Skip to content

Instantly share code, notes, and snippets.

@sathlan
sathlan / patch-main.c
Last active December 26, 2015 04:39 — forked from anonymous/patch-main.c
--- main.c.orig
+++ main.c
@@ -833,7 +833,12 @@ main(int argc, char **argv, char **envp)
mySignal(SIGPIPE, SigPipe);
#endif
+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
+ orig_GC_warn_proc = GC_get_warn_proc();
+ GC_set_warn_proc(wrap_GC_warn_proc);
+#else
@sathlan
sathlan / influxdb
Last active August 29, 2015 14:02 — forked from akhenakh/influxdb
pkg install bison flex leveldb protobuf gmake ruby bzr mercurial valgrind leveldb go
export CC=clang
export CGO_CFLAGS="-I/usr/local/include"
export CGO_LDFLAGS="-L/usr/local/lib"
git clone https://github.com/influxdb/influxdb.git
sed -i -e 's,^SHELL.*,SHELL = /usr/local/bin/bash,' Makefile.in
./configure --with-flex=/usr/local/bin/flex --with-bison=/usr/local/bin/bison
gmake
@sathlan
sathlan / test-swift.py
Created September 18, 2014 02:31
simple swift debug client.
import swiftclient
c = swiftclient.client.Connection(
authurl='http://localhost:8080/auth/v1.0',
user='test:tester',
key='testing',
auth_version='1')
con_path = c.get_container(container='docker',
path='lvl_1/')
@sathlan
sathlan / drds-mocker.py
Created September 18, 2014 05:18
mocked docker registry swift get_container function.
''' Get a listing of objects for the container. '''
def get_container(self, container, marker=None, limit=None, prefix=None,
delimiter=None, end_marker=None, path=None,
full_listing=False):
lst = []
search = path
if search is None:
search = prefix
for key, value in self._swift_containers[container].iteritems():
# works only for two level deep path. Enough to test.
def lookup(self, key_name, **kwargs):
if self._bucket_dict and key_name in self._bucket_dict:
value = Bucket._bucket[self.name][key_name]
k = Key(self)
prefix = '/'
if not value.startswith('/'):
prefix = ''
suffix = '/'
if not value.endwith('/'):
suffix = ''
@sathlan
sathlan / test-gem-mysql.rb
Last active August 29, 2015 14:12
OPT_PROTOCOL difficulty in mysql-gem.
#!/opt/chef/embedded/bin/ruby
require 'mysql'
require 'optparse'
options = {:localhost => '127.0.0.1'}
OptionParser.new do |opts|
opts.on("-l", "Use localhost instead of 127.0.0.1") do |l|
options[:localhost] = 'localhost'
end
end.parse!
HOSTS:
centos-server-71-x64:
roles:
- master
platform: el-7-x86_64
box: sofer/centos-71-base
box_url: https://vagrantcloud.com/sofer/centos-71-base
hypervisor: vagrant_libvirt
# this assume that the ssh user is vagrant. Tweak the .vagrant/beaker_vagrant_files/libvirt-centos.yml/Vagrantfile file
# to change this, adding : v.vm.ssh.username = 'centos' somewhere in the file.
@sathlan
sathlan / faraday_openstack_test.rb
Created October 15, 2015 18:37
Connect to openvstack keystone v3 and make a request using basic faraday.
#!/usr/bin/ruby
require 'faraday'
require 'json'
conn = Faraday.new(:url => 'http://localhost:5000')
responce = conn.post do |post|
post.url '/v3/auth/tokens'
post.headers['Content-Type'] = 'application/json'
post.body = {
Modified lib/puppet/provider/mongodb.rb
diff --git a/lib/puppet/provider/mongodb.rb b/lib/puppet/provider/mongodb.rb
index 6bbc350..d82fa83 100644
--- a/lib/puppet/provider/mongodb.rb
+++ b/lib/puppet/provider/mongodb.rb
@@ -55,8 +55,11 @@ class Puppet::Provider::Mongodb < Puppet::Provider
if bindip
first_ip_in_list = bindip.split(',').first
- if first_ip_in_list.eql? '0.0.0.0'
heat_template_version: 2014-10-16
description: >
Extra config to add swap space to nodes.
# Parameters passed from the parent template - note if you maintain
# out-of-tree templates they may require additional parameters if the
# in-tree templates add a new role.
parameters:
controller_servers: