Skip to content

Instantly share code, notes, and snippets.

View slomo's full-sized avatar

Yves Müller slomo

View GitHub Profile
filesystem extended attributes limit each limit all filename length path length
ext4 y 4KiB typically 4KiB 255 B -
btrfs y 4KiB 255 B -
xfs y 256B / 64 KiB 255 B -
ntfs f - - 255 B 32767 B
hfs+ y/f [128 / 4KiB][1] 255 UTF-16 -
ufs y 255 B -
zfs y/f? 255 B -
ftp n?
export PATH=/home/yves/repos/policycompass/nix/env/bin:/home/yves/.nix-profile/bin:/home/yves/.nix-profile/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/sbin:/sbin:~/bin:~/.scripts:`(gem env gempath | cut -d ':' -f 2 )`/bin&&\
mkdir -p var/lib/tomcat/webapps&&\
gem install --user compass&&\
./carneades/src/CarneadesWeb/scripts/build_war.sh --deploy /home/yves/repos/policycompass/var/lib/tomcat/webapps/carneades.war
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/nix/store/kn475x0hqa96vxhb3f6czfpm714n80hc-ruby-1.9.3-p484/bin/ruby extconf.rb
checking for ffi_call() in -lffi... *** extconf.rb failed ***
@slomo
slomo / gist:1428438
Created December 3, 2011 23:05
New try für convex hull
import numpy
from pprint import pprint
"""
class Point:
def __init__ (self,x,y):
self.x = x
self.y = y
@slomo
slomo / intervaltree.py
Created December 10, 2011 22:48
Implementation of intervaltree
class Node:
def __init__(self,value):
self.left = Leaf()
self.right = Leaf()
self.value = value
self.maxima = value.high
def search(tree,interval):
if interval.low > tree.maxima:
#!/bin/bash
MUNIN_DIR="/var/lib/munin"
TARGET="${HOME}/test"
DIRS=$( find /var/lib/munin -iname *.rrd -exec dirname {} \; | uniq )
for DIR in ${DIRS}; do
mkdir -p ${TARGET}${DIR}
done
#!/bin/bash
TARGET="$HOME/test"
DATABASES=$( cat ./enabledDBs )
for DATABASE in ${DATABASES}; do
mysqldump ${DATABASE} > ${TARGET}/${DATABASE}.mysql
done
#!/bin/bash
TARGET="/backup/mysql"
egrep -v "^(#|\\s*$)" /etc/duply/default/enabledDBs | while read DATABASE ; do
# this works securly for all tables in this database. It locks all tables (no read or write) and dumps them.
# Inculding creat db-statment. The quick options dumps to ram, and flushes then. This leads to less locktime.
mysqldump --lock-tables --quick --databases ${DATABASE} | gzip > ${TARGET}/${DATABASE}.mysql.gz
done
@slomo
slomo / read-result.java
Last active December 1, 2015 14:57 — forked from miguelcardo/read-result.java
Check operation result
// handles response from the Read MIFARE Data message
post(new Route(Constants.readBlockCallbackUrl) {
@Override
public Object handle(Request request, Response response) {
JSONObject jsonParameters = (JSONObject) JSONValue.parse(request.body());
String operationId = (String) jsonParameters.get("operationId");
String sessionId = pendingOperations.get(operationId);
pendingOperations.remove(operationId);
int statusCode = ((Long)jsonParameters.get("statusCode")).intValue();
if (statusCode != HTTP_OK)
> bft = unfoldr f
> where
> f [] = Nothing
> f xs = Just (tops, concat subtrees)
> where
> (tops, subtrees) = unzip $ g xs
> where
> g ((Node l a r):xs) = (a, [l,r]):(g xs)
> g (Empty:xs) = g xs
> g [] = []
# process/__init__.py
class BasePhasePermissions():
can_edit = False
can_delete = False
# idea_collection/phases.py
from . import process
class PhasePermissions(process.BasePhasePermissions):
can_edit = True