#!/bin/sh
-# Copyright (C) 2011-2013 Simon Ruderich
+# Copyright (C) 2011-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
exec python -i -c '
# Math functions.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
if test $# -lt 2; then
echo "Usage: $0 <logfile> <cmd> <args>.." >&2
# Wrapper command for `mv` which creates the target directory before moving
# the file there.
-# Copyright (C) 2011-2013 Simon Ruderich
+# Copyright (C) 2011-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
# Get last argument.
for last; do
:
# Search only in the local `locate` database. Created with `supdatedb`.
-# Copyright (C) 2012-2013 Simon Ruderich
+# Copyright (C) 2012-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
exec locate -d "$HOME/.tmp/locatedb" "$@"
# Run all files in the current directory (recursively) in a random order with
# the given program.
-# Copyright (C) 2012-2013 Simon Ruderich
+# Copyright (C) 2012-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set -e
+set -eu
if test "$#" -eq 0; then
echo "Usage: $0 <program-args>.." >&2
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
set -x
exec rsync \
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set -e
+set -eu
if test "$#" -lt 2; then
echo "Usage: $0 <backups-directory> <arguments to rsync>" >&2
fi
-cd "$1" || exit 1
+cd "$1"
shift
# Get absolute path to last backup directory.
# Generate `locate` database for my home directory only. Exclude backups and
# other temporary files.
-# Copyright (C) 2012-2013 Simon Ruderich
+# Copyright (C) 2012-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
exec updatedb \
--localpaths="$HOME" \
--prunepaths="$HOME/.tmp $HOME/tmp" \
#!/bin/sh
-# Copyright (C) 2011-2012 Simon Ruderich
+# Copyright (C) 2011-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
exec valgrind --leak-check=full --show-reachable=yes --error-exitcode=1 \
--track-fds=yes "$@"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set -e
+set -eu
logdir="$HOME/.tmp/logs"
#
# An existing crontab entry not generated with this script is not overwritten.
-# Copyright (C) 2012-2013 Simon Ruderich
+# Copyright (C) 2012-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set -e
+set -eu
HEADER_WARNING='# WARNING! DO NOT EDIT THIS FILE! #'
#!/bin/sh
-# Copyright (C) 2011-2013 Simon Ruderich
+# Copyright (C) 2011-2014 Simon Ruderich
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
case "$1" in
# Color diff files.
*.diff | *.patch)