Skip to content

Instantly share code, notes, and snippets.

View josteinaj's full-sized avatar

Jostein Austvik Jacobsen josteinaj

View GitHub Profile
@josteinaj
josteinaj / pipeline-build.sh
Last active December 26, 2015 18:39
Bash script for building DAISY Pipeline 2.
#!/bin/bash
# WARNING: this will git pull all projects, which may overwrite any unstaged file changes! I've added "git add -A" to the script to avoid this, but try commiting any changes before running this script just to be safe.
# Convenience script that builds all Pipeline 2 projects
#
# To clean all projects:
# ./pipeline-build.sh clean
#
# To checkout, pull and install all projects:
@josteinaj
josteinaj / autobuild-mvn.sh
Created November 1, 2013 15:05
Automatically build maven projects on file change.
#!/bin/bash
# Jostein Austvik Jacobsen © 2013
#
# Before using:
# To increase your inotify watch limit,
# see: http://monodevelop.com/Inotify_watches_limit
# and for more info: http://askubuntu.com/questions/154255/how-can-i-tell-if-i-am-out-of-inotify-watches
# I have the limit set to 524288 as described in the last link and it works great.
#
@josteinaj
josteinaj / 09d64df4-5e80-493c-9782-75dc8d22092d.log
Created May 2, 2014 12:56
Job Summary - 09d64df4-5e80-493c-9782-75dc8d22092d
2014-05-02 14:40:42,690 [INFO ] org.daisy.pipeline.job.Job - Changing job status to: RUNNING
2014-05-02 14:40:42,696 [DEBUG] org.daisy.pipeline.push.Poster - Status changed 09d64df4-5e80-493c-9782-75dc8d22092d->RUNNING
2014-05-02 14:40:42,697 [DEBUG] o.d.p.p.jobs.PersistentJobContext - load script XProcScript[name=HTML to EPUB3]
2014-05-02 14:40:42,699 [DEBUG] o.d.p.p.jobs.PersistentJobContext - load script XProcScript[name=HTML to EPUB3]
2014-05-02 14:40:42,700 [DEBUG] o.d.p.p.jobs.PersistentJobContext - Post loading jobcontext
2014-05-02 14:40:42,700 [DEBUG] o.d.pipeline.job.JobContextFactory - configuring object org.daisy.pipeline.persistence.jobs.PersistentJobContext@554b2083
2014-05-02 14:40:42,701 [DEBUG] o.d.pipeline.job.JobContextFactory - configuring object org.daisy.pipeline.persistence.jobs.PersistentJobContext@554b2083
2014-05-02 14:40:42,701 [INFO ] o.d.p.persistence.jobs.PersistentJob - Changing Status:RUNNING
2014-05-02 14:40:42,701 [DEBUG] o.d.p.persistence.jobs.PersistentJob - Updating object
#!/bin/sh -e
#Define our target device
export TARGET_ARCH="-march=armv7-a"
export TARGET_TUNE="-mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb"
#Define the cross compilators on your system
export AR="arm-linux-gnueabi-ar"
export CC="arm-linux-gnueabi-gcc"
export CXX="arm-linux-gnueabi-g++"
#!/bin/bash
# DEPENDENCY: xsltproc (easy to install; alternatively modify to use another XSLT processor)
cd /var/packages/debian/conf
if [ ! -f REPOSITORIES ]; then
echo "Please add the URL to at least one repository to the file 'REPOSITORIES' (one repository on each line)'"
exit
fi
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/*">
<xsl:for-each select="/metadata/versioning/versions/version">
<xsl:value-of select="normalize-space(.)"/>
<xsl:text>
</xsl:text>
@josteinaj
josteinaj / pipeline-watchdog.sh
Created October 16, 2014 09:28
Linux bash script that can be used to keep Pipeline 2 running. It will start Pipeline 2 if it is not running, and kill it if it is not responding. You might need to install curl and screen.
#!/bin/bash -x
# Change APPDATA/ENGINE_HOME/WEBUI_HOME if necessary,
# and set this script up as a cron job, for instance:
# */1 * * * * $HOME/pipeline-watchdog.sh >/tmp/pipeline-watchdog.log 2>&1
PIPELINE_APPDATA="$HOME/.daisy-pipeline"
PIPELINE_ENGINE_HOME="$HOME/daisy-pipeline"
PIPELINE_WEBUI_HOME="$HOME/daisy-pipeline-webui"
#!/bin/bash -x
SNAPSHOTS="https://dl.dropboxusercontent.com/u/6370535/nordic-epub3-dtbook-migrator"
INSTALLED="`ls ~/daisy-pipeline/modules/ | grep nordic-epub3-dtbook-migrator | grep jar$`"
CURRENT="`curl $SNAPSHOTS/current.txt`"
if [ "$?" -ne "0" ]; then
echo "Could not retrieve filename of current version of the Nordic EPUB3/DTBook Migrator"
@josteinaj
josteinaj / checkout.sh
Created January 26, 2015 16:29
A bash script I use to checkout a specific version of the Pipeline 2 modules (master, v1.8, v1.9); makes it easy to switch between them during development.
#!/bin/bash
# WARNING: this will git pull all projects, which may overwrite any unstaged file changes! I've added "git add -A" to the script to avoid this, but try commiting any changes before running this script just to be safe.
# Convenience script that checks out Pipeline 2 module projects for a given minor version (or master)
#
# To checkout:
# ./pipeline-build.sh tag
#
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" version="2.0" xmlns="http://www.w3.org/1999/xhtml"
xpath-default-namespace="http://xmlcalabash.com/ns/profile" xmlns:profile="http://xmlcalabash.com/ns/profile" xmlns:f="#">
<xsl:output indent="yes"/>
<!-- input: calabash profiling xml output -->
<!-- output: html view which highlights steps that spends much time -->
<!-- change this URI to point to whatever XProc script you want to compare the profiling output against -->