Skip to content

Instantly share code, notes, and snippets.

\usepackage{microtype}
\ifluatex
\usepackage{fontspec}
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\setsansfont[UprightFont = *-Regular,
ItalicFont = *-RegularIt,
\lstdefinelanguage{IMP}{
morekeywords={typedef, implementation, as, implement, is, end, select, entity, matching, self, index, extends,include, for, using, enum, with, parent},
morecomment=[l]{\#},
morestring=[b]",
breaklines = true,
}
@bartv
bartv / auth.py
Last active August 29, 2015 14:05
#!/usr/bin/env python
import httplib, socket, sys, os
if len(sys.argv) != 2:
print("The first argument should be the path of the file with the user credentials")
sys.exit(2)
if not os.path.exists(sys.argv[1]):
print("Unable to read the credential file")
Feb 12 09:04:52 mon-1 java[12294]: Feb 12, 2015 9:04:52 AM flens.core.util.AbstractPlugin err
Feb 12 09:04:52 mon-1 java[12294]: SEVERE: multi valued record not exanded:Record [type=null tags=[], values={plugin_instance=dev-shm, type_instance=free, plugin=df, values=[4.186415104E9], interval=10737418240, time=1423731882222, source=mon-1, type=df_complex}]
Feb 12 09:04:52 mon-1 java[12294]: Feb 12, 2015 9:04:52 AM flens.core.util.AbstractPlugin err
Feb 12 09:04:52 mon-1 java[12294]: SEVERE: multi valued record not exanded:Record [type=null tags=[], values={plugin_instance=dev-shm, type_instance=reserved, plugin=df, values=[0.0], interval=10737418240, time=1423731882222, source=mon-1, type=df_complex}]
Feb 12 09:04:52 mon-1 java[12294]: Feb 12, 2015 9:04:52 AM flens.core.util.AbstractPlugin err
Feb 12 09:04:52 mon-1 java[12294]: SEVERE: multi valued record not exanded:Record [type=null tags=[], values={plugin_instance=dev-shm, type_instance=used, plugin=df, values=[0.0], interval=10737418240, time=1423731882222
@bartv
bartv / gist:5056812
Created February 28, 2013 13:44
shell script to build CD
## this script assumes that it is located in a directory where jboss-as, capedwarf-blue, capedwarf-jboss-as and capedwarf-shared is checked out.
# prep jboss
pushd jboss-as
git reset 7.2.0.Final-prerelease1
mvn clean install -DskipTests
# start building cd
pushd capedwarf-shared
git pull
mvn clean install
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
host = std::Host(name = "tripel", os = "linux")
std::File(host = host, path = "/tmp/dir/test", owner = "bart", group = "bart", mode = 644, content =
"test", requires = dir)
dir = std::Directory(host = host, path = "/tmp/dir", owner = "bart", group = "bart", mode = 755)
Deploying on tripel (dry-run = False)
dict_values([(<std.Host object at 0x7f2be3b19310>), (<std.File object at 0x7f2be3b196d8>), (<std.Directory object at 0x7f2be3b19a48>)])
dict_values([(<std.Host object at 0x7f2be3b19310>), (<std.File object at 0x7f2be3b196d8>), (<std.Directory object at 0x7f2be3b19a48>)])
Deploying config
from Imp.export import dependency_manager
from Imp.resources import Resource
@dependency_manager
def one_for_the_other(config_model, resources):
for res in resources.values():
model_instance = res.model
model_scope = model_instance.__scope__
print(model_scope.variables())
from Imp.export import dependency_manager
from Imp.resources import Resource
@dependency_manager
def use_relations(config_model, resources):
for _id, resource in resources.items():
res_class = resource.model.__class__
if resource.model.__module__ == "std" and res_class.__name__ == "File":
model = resource.model