Skip to content

Instantly share code, notes, and snippets.

View morxa's full-sized avatar

Till Hofmann morxa

View GitHub Profile
@morxa
morxa / owncloud.log
Last active August 29, 2015 14:00
owncloud client sync bug with external storage subdirectories
05-01 15:17:20:396 csync_walker: directory: /tmp/test/owncloud-test
05-01 15:17:20:396 _csync_detect_update: ==> file: owncloud-test - hash 8671896127397113479, mtime: 1398950224, fileId: 0000730152460427b79e3
05-01 15:17:20:396 _csync_detect_update: Database entry found, compare: 1398950224 <-> 1398949025, etag: 5362450ed9f59 <-> 5362450ed9f59, inode: 65309 <-> 65309
05-01 15:17:20:396 _csync_detect_update: file: owncloud-test, instruction: INSTRUCTION_EVAL <<=
05-01 15:17:20:396 csync_ftw: Uniq ID from Database: owncloud-test/subdir -> 536248b09129d
05-01 15:17:20:396 csync_walker: directory: /tmp/test/owncloud-test/subdir
05-01 15:17:20:397 _csync_detect_update: ==> file: owncloud-test/subdir - hash 3742522823791505315, mtime: 1398950224, fileId: 0000730252460427b79e3
05-01 15:17:20:397 _csync_detect_update: Database entry found, compare: 1398950224 <-> 1398950055, etag: 536248b09129d <-> 536248b09129d, inode: 65310 <-> 65310
05-01 15:17:20:397 _csync_detect_update: file: owncloud-test/subdir, instruction:
@morxa
morxa / lstlang0.sty
Created June 26, 2014 10:06
Latex Listing PDDL Language Definition
\lst@definelanguage{pddl}
{
keywords={
define,
},
morekeywords={[2]
domain,
problem,
requirements,
predicates,
@morxa
morxa / asprintf.c
Last active August 29, 2015 14:03
string concat with asprintf
std::string foo_string = "foo";
std::string bar_string = "bar";
std::string res;
char * tmp;
if (asprintf(&tmp, "concatenation: %s %s", foo_string.c_str(), bar_string.c_str()) != -1) {
res = tmp;
free(tmp);
} else {
throw Exception("Out of memory");
}
@morxa
morxa / test_generator.sh
Last active August 22, 2016 18:21
test generator
#!/bin/bash
# Copyright 2016 Till Hofmann <till.hofmann@posteo.de>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
random_word () {
ALL_NON_RANDOM_WORDS=/usr/share/dict/words
non_random_words=`cat $ALL_NON_RANDOM_WORDS | wc -l`
random_number=$(expr $non_random_words \* $RANDOM / 32767)
@morxa
morxa / chinagadgets.bash
Created December 15, 2016 15:45
minkorrekt china gadgets
#! /bin/bash
#
# chinagadgets.bash
# Created: Thu 15 Dec 2016 15:53:11 CET
# Copyright 2016 Till Hofmann <till.hofmann@posteo.de>
#
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
@morxa
morxa / rcll_domain_production_nondurative.pddl
Created March 1, 2017 09:11
RCLL non-durative domain for production
;****************************************************************************
; rcll_domain_production.pddl: RoboCup Logistics League Production Model
;
; Created: Fri Feb 24 23:20:38 2017
; Copyright 2017 Tim Niemueller [www.niemueller.de] Till Hofmann
;****************************************************************************
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
@morxa
morxa / bearrc
Last active July 20, 2017 15:15
bash/zsh function to automatically find compile_commands.json for the Build Ear (BEAR) tool
# Add this to your bashrc or zshrc
# or put it into a seperate .bearrc and load that file from your bashrc or zshrc
# You will need to create the initial BEAR_FILE manually, e.g., with "bear make"
# in the right directory.
# After that, simply call "m" to build and add the compiler commands to the BEAR_FILE.
BEAR_FILE=compile_commands.json
function m () {
TOPDIR=$PWD
while [ ! -f $TOPDIR/$BEAR_FILE ] ; do
@morxa
morxa / git-reauthor.sh
Last active November 22, 2021 11:58
Bash script to change author information
#!/bin/bash
if [ $# -lt 3 ] ; then
echo "Wrong number of arguments. Got $#, expected 3 or 4."
echo "usage: $0 [-f] <old_email> <new_email> <first_commit>"
exit 1
fi
if [ "$1" = "-f" ] ; then
FORCE=-f
@morxa
morxa / barman.pddl
Created November 30, 2018 21:24
PDDL Barman Domain
(define (domain barman)
(:requirements :strips :typing)
(:types hand level beverage dispenser container - object
ingredient cocktail - beverage
shot shaker - container)
(:predicates (ontable ?c - container)
(holding ?h - hand ?c - container)
(handempty ?h - hand)
(empty ?c - container)
(contains ?c - container ?b - beverage)
@morxa
morxa / gist:3db2be3262633e72b0b012b6c2290742
Created November 30, 2018 21:28
Barman Solution example MongoDB entry
MongoDB shell version v3.4.11
connecting to: mongodb://enterprise:27017/macro_planning
MongoDB server version: 3.4.11
{
"_id" : ObjectId("5bef198a31eaa60001a439fc"),
"planner" : "fast-downward",
"domain" : ObjectId("5bef0c18caa44127395c7e15"),
"problem" : ObjectId("5bef0c18caa44127395c7e16"),
"raw" : "(GRASP LEFT SHAKER1)\n(GRASP RIGHT SHOT13)\n(LEAVE LEFT SHAKER1)\n(FILL-SHOT SHOT13 INGREDIENT2 RIGHT LEFT DISPENSER2)\n(GRASP LEFT SHAKER1)\n(POUR-SHOT-TO-CLEAN-SHAKER SHOT13 INGREDIENT2 SHAKER1 RIGHT L0 L1)\n(LEAVE RIGHT SHOT13)\n(GRASP RIGHT SHOT14)\n(LEAVE LEFT SHAKER1)\n(FILL-SHOT SHOT14 INGREDIENT3 RIGHT LEFT DISPENSER3)\n(GRASP LEFT SHAKER1)\n(LEAVE RIGHT SHOT14)\n(GRASP RIGHT SHOT13)\n(LEAVE LEFT SHAKER1)\n(CLEAN-SHOT SHOT13 INGREDIENT2 RIGHT LEFT)\n(FILL-SHOT SHOT13 INGREDIENT2 RIGHT LEFT DISPENSER2)\n(GRASP LEFT SHAKER1)\n(LEAVE RIGHT SHOT13)\n(GRASP RIGHT SHOT9)\n(LEAVE LEFT SHAKER1)\n(FILL-SHOT SHOT9 INGREDIENT1 RIGHT LEFT DISPENSER1)\n(POUR-SHOT-TO-USED-SHAKER SHOT9 INGREDIENT1 SHAKER1 RIGHT L1