Skip to content

Instantly share code, notes, and snippets.

@ringods
ringods / SConstruct.py
Created December 20, 2011 13:49
SCons snippet
env['LDFLAGS'] = "$_LIBDIRFLAGS $LINKFLAGS -ggdb3"
env.Execute("echo $LDFLAGS")
t = env.Command('$THIRD_PARTY/lib/libcurl.a',
'%s.tar.bz2' % name,
['mkdir -p $THIRD_PARTY/build',
'cd $THIRD_PARTY/build && tar jxf $THIRD_PARTY/%s' % zip_file,
'cd $THIRD_PARTY/build/%s && CFLAGS="$_CPPINCFLAGS $CCFLAGS $CFLAGS -ggdb3" CXXFLAGS="$_CPPINCFLAGS $CCFLAGS $CXXFLAGS -ggdb3" LDFLAGS="$LDFLAGS" ./configure --prefix=$THIRD_PARTY --without-ssl --with-pic --without-libssh2 --without-librtmp --without-libidn --without-axtls --without-ca-bundle --without-libssh2 --without-zlib --enable-static=yes --disable-shared --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-sspi --disable-tls-srp --enable-ares' % name,
@ringods
ringods / client.py
Created November 28, 2011 09:33
rpyc workaround for async request and callback: sync request on separate thread
from threading import Thread
import rpyc
import logging
import time
class ClientWrapper(Thread):
def __init__(self):
Thread.__init__(self)
logging.info('client - before connect')
@ringods
ringods / client.py
Created November 25, 2011 10:24
rpyc async request: faulty behaviour
import rpyc
import logging
import time
class ClientWrapper:
def __init__(self):
logging.info('client - before connect')
self._connection = rpyc.connect('127.0.0.1',39876)
logging.info('client - after connect')
@ringods
ringods / client.py
Created November 25, 2011 10:21
rpyc async request: correct behaviour
import rpyc
import logging
import time
class ClientWrapper:
def __init__(self):
logging.info('client - before connect')
self._connection = rpyc.connect('127.0.0.1',39876)
logging.info('client - after connect')
@ringods
ringods / switch_branch_with_subrepo.py
Created September 23, 2011 14:51
Pre-update hook to remove subrepositories for branch switching to work.
'''Removes .hgsub and any subrepos when switching branches in the parent repository
To activate this hook, add this to your ~/.hgrc file:
[extensions]
switch_branch_with_subrepo =
[hooks]
preupdate.switch_branch_with_subrepo = python:switch_branch_with_subrepo.preupdate
'''
@ringods
ringods / AutoConfig.py
Created September 22, 2011 07:14
Build setup (added .py extension to SConstruct/SConscript for gist to detect Python code, full path on first line of content)
# thirdparty/site_scons/site_tools/AutoConfig.py
# AutoConfig Builder: Runs ./configure inside a directory.
# This builder takes over the compile and linker flags from the following SCons settings.
# Set all required flags on the environment before calling the builder.
# - CFLAGS
# - CCFLAGS
# - CPPFLAGS
# - CXXFLAGS
# - LINKFLAGS
@ringods
ringods / gist:1234224
Created September 22, 2011 07:01
SCons dependency tree: output when building "production"
rdesmet@amplidata-desktop-ringo:~/Projects/amplidata/default/thirdparty$ /usr/local/bin/scons --tree=prune production
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
params(target,source,env) returns:
configure_opts = ['--disable-shared', '--enable-static', '--prefix=/home/rdesmet/Projects/amplidata/default/thirdparty/target/debug']
cd /home/rdesmet/Projects/amplidata/default/thirdparty/gtest/build/debug && CFLAGS=" -fPIC -DSSE_16 " CXXFLAGS=" -fPIC -DSSE_16 " LDFLAGS="" /home/rdesmet/Projects/amplidata/default/thirdparty/gtest/configure --disable-shared --enable-static --prefix=/home/rdesmet/Projects/amplidata/default/thirdparty/target/debug
params(target,source,env) returns:
configure_opts = ['--disable-shared', '--enable-static', '--prefix=/home/rdesmet/Projects/amplidata/default/thirdparty/target/debug']
Mkdir("/home/rdesmet/Projects/amplidata/default/thirdparty/gtest/build/debug")
@ringods
ringods / gist:1234218
Created September 22, 2011 06:58
SCons dependency tree.
+-all
+-test
| +-debug
+-test-production
| +-production
+-test-coverage
+-coverage
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "lucid-amd64-chef-0.10.0"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
rdesmet@amplidata-desktop-ringo:~/Projects/amplidata/infrastructure/chef-repo$ gem update knife-github-cookbooks
Updating installed gems
Updating knife-github-cookbooks
Fetching: knife-github-cookbooks-0.1.5.gem (100%)
Successfully installed knife-github-cookbooks-0.1.5
Gems updated: knife-github-cookbooks
Installing ri documentation for knife-github-cookbooks-0.1.5...
Installing RDoc documentation for knife-github-cookbooks-0.1.5...
rdesmet@amplidata-desktop-ringo:~/Projects/amplidata/infrastructure/chef-repo$ knife cookbook github install fnichol/chef-jenkins -V
Installing jenkins from git://github.com/fnichol/chef-jenkins.git to /home/rdesmet/Projects/amplidata/infrastructure/chef-repo/.chef/../cookbooks