]> gitweb.fluxo.info Git - scripts.git/commitdiff
Move scripts to other repositories
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 20 Aug 2024 23:44:34 +0000 (20:44 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 20 Aug 2024 23:44:34 +0000 (20:44 -0300)
47 files changed:
README.md
anarchronofile [deleted file]
android-backup [deleted file]
android-pull [deleted symlink]
android-push [deleted file]
android-restore [deleted symlink]
build [deleted file]
catcode [deleted file]
chownme [deleted file]
collector [deleted file]
copy-annotations-from-kobo [deleted file]
copy-item-to-kobo [deleted file]
dangling-archive [deleted file]
dict [deleted file]
docshower [deleted file]
doi2bib [deleted file]
dupbackup [deleted file]
export-firefox-bookmarks [deleted file]
export-koreader-note [deleted file]
export-pad [deleted file]
fixmes [deleted file]
inotifier [deleted file]
keyringer-export-pads [deleted file]
mvln [deleted file]
openvpn-resolv-conf
pw [deleted file]
quarter-timestamps [deleted file]
reminders [deleted file]
repl [deleted file]
scuttle [deleted file]
status [deleted file]
suser [deleted file]
sync-from-kobo [deleted file]
sync-to-kobo [deleted file]
task [deleted file]
tasks [deleted file]
telneter [deleted file]
timew-shell [deleted file]
todo [deleted file]
tomb-close [deleted file]
tomb-create [deleted file]
tomb-open [deleted file]
urlinfo [deleted file]
urlmd [deleted symlink]
urlsave [deleted file]
urlssave [deleted file]
vnc [deleted file]

index 722dbcf775c791aaf5ab49dc438cf041fc088ce1..89f2d50eee1085e923b0b8bafb055facb82e10d4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
-Misc scripts
-============
+# Misc scripts
 
-This is a collection of simple scripts to be available on $PATH.
+This is an assorted collection of simple scripts to be available on `$PATH`.
diff --git a/anarchronofile b/anarchronofile
deleted file mode 100755 (executable)
index 26ee7e5..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-# Ana(r)chronofile parser.
-#
-# Copyright (C) 2021 Silvio Rhatto <rhatto@riseup.net>
-#
-# 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 3 of the License,
-# or any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Dependencies
-import os
-import yaml
-import argparse
-from pprint import pprint
-
-class AnarChronofile:
-    def __init__(self, args):
-        if not os.path.exists(args.file[0]):
-            raise FileNotFoundError('File not found: ' + args.file[0])
-
-        if os.path.isfile(args.file[0]):
-            self.args = args
-            self.file = open(args.file[0], '+r')
-            self.yaml = yaml.load(self.file)
-
-    def run(self):
-        if getattr(self, 'args', None) is None:
-            return
-
-        print(self.args)
-        print("---")
-        print("")
-
-        if self.args.topic is not None:
-            topic = self.args.topic
-
-            for item in self.yaml:
-                if topic in item:
-                    if self.args.subtopic is not None:
-                        subtopic = self.args.subtopic
-
-                        if subtopic in item[topic]:
-                            print('Date: ' + str(item['date']))
-                            print("\n")
-                            pprint(item[topic][subtopic])
-                            print("\n")
-
-                    else:
-                        print('Date: ' + str(item['date']))
-                        print("\n")
-                        pprint(item[topic])
-                        print("\n")
-
-        else:
-            pprint(self.yaml)
-
-def cmdline():
-    """
-    Evalutate the command line.
-
-    :return: Command line arguments.
-    """
-
-    basename = os.path.basename(__file__)
-    examples = "Examples:\n\t" + basename + " incoming.yaml\n"
-    epilog   = examples
-    parser   = argparse.ArgumentParser(description='Parse an ana(r)chronofile',
-                                       epilog=epilog,
-                                       formatter_class=argparse.RawDescriptionHelpFormatter,)
-
-    parser.add_argument('file',     nargs=1,   help='YAML file')
-    parser.add_argument('topic',    nargs='?', help='Topic to search')
-    parser.add_argument('subtopic', nargs='?', help='Subtopic to search')
-
-    # Get args
-    args = parser.parse_args()
-
-    return args
-
-if __name__ == "__main__":
-    args = cmdline()
-
-    try:
-        parser = AnarChronofile(args)
-        parser.run()
-    except (FileNotFoundError, KeyboardInterrupt) as e:
-        print(e)
-        exit(1)
diff --git a/android-backup b/android-backup
deleted file mode 100755 (executable)
index 1985f6b..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/bin/bash
-#
-# Android backup
-#
-
-# Basic parameters
-BASENAME="`basename $0`"
-NAME="$1"
-
-# Backup user files
-function android_backup_files {
-  if [ ! -z "$1" ]; then
-    USER_ID="$1"
-  else
-    USER_ID="0"
-  fi
-
-  BASE="/storage"
-  EMULATED="$BASE/emulated/$USER_ID"
-
-  # Files: full copy
-  #adb pull $EMULATED files/
-
-  # Remove multimedia cache from backup
-  #rm -rf files/Music
-
-  # Files: full basic copy
-  #adb shell ls -1 $EMULATED | grep -v ^Music | while read file; do
-  #  adb pull $EMULATED/$file files/
-  #done
-
-  mkdir -p files/$USER_ID
-
-  # Files: incremental basic copy
-  for file in `adb shell ls -1 $EMULATED | grep -v '^Music'`; do
-    adb-sync --delete --reverse $EMULATED/$file files/$USER_ID/
-  done
-
-  # SD cards
-  for file in `adb shell ls -1 $BASE | grep -v "^self" | grep -v "^emulated"`; do
-    adb-sync --delete --reverse $BASE/$file files/
-  done
-}
-
-# Restore user files
-function android_restore_files {
-  if [ ! -z "$1" ]; then
-    USER_ID="$1"
-  else
-    USER_ID="0"
-  fi
-
-  BASE="/storage/emulated/$USER_ID"
-
-  # Files: complete copy
-  #for file in `ls files`; do
-  #  adb push files/$file $base/$file
-  #done
-
-  # Files: incremental copy
-  for file in `ls $WORK/android-backup-$NAME-$DATE/files/$USER_ID`; do
-    adb-sync --delete $WORK/android-backup-$NAME-$DATE/files/$USER_ID/$file/ $BASE/$file/
-  done
-}
-
-function android_backup_backup {
-  # Check previous backup
-  if [ -d "$STORAGE/$DATE" ]; then
-    echo "backup for $DATE already exists"
-    exit 1
-  fi
-
-  # Work folder
-  mkdir -p $WORK/android-backup-$NAME-$DATE && cd $WORK/android-backup-$NAME-$DATE &> /dev/null || exit 1
-
-  # If you have a previous backup you might want to use it with hardlinks
-  if [ -e "$STORAGE/$PREVIOUS/files" ]; then
-    sudo cp -alf $STORAGE/$PREVIOUS/files files
-  fi
-
-  # Ensure we have a files folder
-  mkdir -p files
-
-  # Contacts. Export also to a .vcf directly from the contact app
-  adb-export.sh           -e    content://com.android.contacts/contacts
-  adb shell content query --uri content://com.android.contacts/contacts > contacts.rows
-
-  # User and system information
-  adb shell dumpsys user > users.dump
-  adb shell dumpsys      > system.dump
-
-  # Configurations
-  # Right now this is possible only for the main user
-  # https://stackoverflow.com/questions/50978678/adb-backup-restore-multiple-users-apps
-  # https://android.stackexchange.com/questions/43043/non-root-backup-with-multiple-users-non-owner-or-secondary-users
-  #adb backup -apk -shared -all
-  adb backup -all
-
-  # Backup each user files
-  for USER in $USERS; do
-    android_backup_files $USER
-  done
-
-  # Move backup to storage
-  cd .. &> /dev/null && sudo mv android-backup-$NAME-$DATE $STORAGE/$DATE
-}
-
-function android_backup_restore {
-  # Check for previous backups
-  if [ -z "$PREVIOUS" ]; then
-    echo "$BASENAME: no previous backups for device $NAME"
-    exit 1
-  fi
-
-  # Copy files to workfolder
-  mkdir -p $WORK && sudo cp -alf $STORAGE/$PREVIOUS $WORK/android-backup-$NAME-$DATE && chown -R `whoami`. android-backup-$NAME-$DATE
-
-  # Check if copy was successful
-  if [ ! -e "$WORK/android-backup-$NAME-$DATE" ]; then
-    echo "$BASENAME: could not copy from $STORAGE/$PREVIOUS"
-    exit 1
-  fi
-
-  # Restore each user files
-  if [ -e "$WORK/android-backup-$NAME-$DATE" ]; then
-    for USER in $USERS; do
-      android_restore_files $USER
-    done
-  fi
-
-  # Configurations
-  adb restore android-backup-$NAME-$DATE/backup.ab
-
-  # Cleanup
-  rm -rf android-backup-$NAME-$DATE
-}
-
-# Syntax check
-if [ -z "$NAME" ]; then
-  echo "$BASENAME: missing phone name"
-  exit 1
-fi
-
-# Additional parameters
-WORK="/var/data/load"
-DATE="`date +%Y%m%d`"
-STORAGE="/var/backups/remote/$NAME.`facter domain`/"
-USERS="`adb shell pm list users | grep '{' | cut -d '{' -f 2 | cut -d ':' -f 1 | xargs`"
-
-# Dest folder and previous backups
-sudo mkdir -p $STORAGE
-PREVIOUS="`sudo ls -1 $STORAGE | tac | head -n 1`"
-
-# Dispatch
-if [ "$BASENAME" == "android-backup" ]; then
-  android_backup_backup
-else
-  android_backup_restore
-fi
diff --git a/android-pull b/android-pull
deleted file mode 120000 (symlink)
index 4bac549..0000000
+++ /dev/null
@@ -1 +0,0 @@
-android-push
\ No newline at end of file
diff --git a/android-push b/android-push
deleted file mode 100755 (executable)
index 1eafa10..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# Push and pull to android device.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-ORIG="$1"
-DEST="$2"
-ANDROID_BASE="${3:-/storage/emulated/0}"
-
-# Check
-if [ -z "$DEST" ]; then
-  echo "Usage: $BASENAME <orig> <dest> [android-base]"
-  echo ""
-  echo "Examples"
-  echo ""
-  echo "android-push /mylocal/music/ Music/"
-  echo "androis-pull DCIM/Camera     /mylocal/camera"
-  echo "androis-pull Music           /mylocal/music"
-  echo "androis-pull Ringtones       /mylocal/ringtones $ANDROID_BASE"
-  exit 1
-fi
-
-# Run
-if [ "$BASENAME" == "android-pull" ]; then
-  adb pull $ANDROID_BASE/$ORIG $DEST
-else
-  adb push $ORIG $ANDROID_BASE/$DEST
-
-  # Thanks https://stackoverflow.com/questions/17928576/refresh-android-mediastore-using-adb
-  #adb shell "find $ANDROID_BASE/$DEST -exec am broadcast \
-  #-a android.intent.action.MEDIA_SCANNER_SCAN_FILE \
-  #-d file://{} \\;"
-fi
diff --git a/android-restore b/android-restore
deleted file mode 120000 (symlink)
index 6ccc9f5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-android-backup
\ No newline at end of file
diff --git a/build b/build
deleted file mode 100755 (executable)
index 795e0f6..0000000
--- a/build
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-#
-#  build 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 any later version.
-#
-#  build is distributed in the hope that it will be useful, but WITHOUT ANY
-#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-#  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License along with
-#  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-#  Place - Suite 330, Boston, MA 02111-1307, USA
-#
-
-BASENAME="`basename $0`"
-
-#LIBDIR="/usr/lib"
-#if [ "$ARCH" = "x86_64" ]; then
-#  FPIC="export CFLAGS=-fPIC"
-#  LDFLAGS='export LDFLAGS="-L/lib64 -L/usr/lib64"'
-#  LIBDIR="/usr/lib64"
-#fi
-
-#CONF="./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR"
-CONF="./configure --prefix=/usr --sysconfdir=/etc"
-INSTALL="make DESTDIR=`pwd`/installation/ install"
-HELP="./configure --help | less"
-MAKE="make"
-
-case $1 in
-  "--conf") $CONF ;;
-  "--fpic") $FPIC ;;
-  "--ld") $LDFLAGS ;;
-  "--make") $MAKE ;;
-  "--install") $INSTALL ;;
-  "--help") $HELP ;;
-  "--show")
-    echo $FPIC
-    echo $LDFLAGS
-    echo $CONF
-    echo $INSTALL
-    ;;
-  *) $CONF ; $MAKE ;;
-esac
-
diff --git a/catcode b/catcode
deleted file mode 100755 (executable)
index fb3b99d..0000000
--- a/catcode
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-#
-# Display the source of a script.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-COMMAND="$1"
-PAGER="$2"
-
-# Check
-if [ -z "$COMMAND" ]; then
-  echo "usage: $BASENAME <command>"
-elif [ ! -e "$COMMAND" ]; then
-  COMMAND="`which $COMMAND 2> /dev/null`"
-
-  if [ -z "$COMMAND" ]; then
-    echo "$BASENAME: cannot find command"
-    exit 1
-  fi
-fi
-
-# Shebang checker
-if head -1 $COMMAND | grep -q '#!'; then
-  if [ -z "$PAGER" ]; then
-    cat $COMMAND
-  elif [ "$PAGER" == "less" ]; then
-    less $COMMAND
-  fi
-fi
diff --git a/chownme b/chownme
deleted file mode 100755 (executable)
index 4a37e90..0000000
--- a/chownme
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# Chown a destination to the current user.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-DEST="$*"
-ME="$(whoami)"
-
-# Check
-if [ -z "$1" ]; then
-  echo "usage: $BASENAME <dest>"
-  exit 1
-fi
-
-# Proceed
-sudo chown -R $ME. "$DEST"
diff --git a/collector b/collector
deleted file mode 100755 (executable)
index 387cb02..0000000
--- a/collector
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env bash
-#
-# Collector: add, view, edit a collector file (from GTD/ZTD methodologies).
-#
-# The collector file is a Markdown file with the Task list extension, such as
-# https://docs.gitlab.com/ee/user/markdown.html#task-lists
-#
-
-# Parameters
-BASENAME="`basename $0`"
-ACTION="$1"
-COLLECTOR_NAME="`echo $COLLECTOR_FILE | sed -e "s|$HOME|~|"`"
-
-# Check
-if [ -z "$COLLECTOR_FILE" ]; then
-  # Do not be verbose here, otherwise the "status" command will show an error
-  # message on unconfgirued systems. Maybe that should be controlled by a verbosity flag.
-  #echo "$BASENAME: please export the COLLECTOR_FILE environment variable pointing to your collector markdown file"
-
-  exit 1
-elif [ ! -e "$COLLECTOR_FILE" ]; then
-  echo "$BASENAME: error: file not found: $COLLECTOR_FILE"
-  exit 1
-fi
-
-# Dispatch
-if [ -z "$ACTION" ] || [ "$ACTION" == "view" ]; then
-  cat "$COLLECTOR_FILE"
-elif [ "$ACTION" == "add" ]; then
-  shift
-  echo "* $*" >> "$COLLECTOR_FILE"
-elif [ "$ACTION" == "list" ]; then
-  if grep -q -e "^ *\* " "$COLLECTOR_FILE"; then
-    echo "Collected items at $COLLECTOR_NAME:"
-    echo ""
-    grep -e "^ *\* " "$COLLECTOR_FILE"
-    echo ""
-  fi
-elif [ "$ACTION" == "count" ]; then
-  if grep -q -e "^ *\* " "$COLLECTOR_FILE"; then
-    COUNT="`grep -e "^ *\* " "$COLLECTOR_FILE" | wc -l`"
-    echo "$COUNT collected items at $COLLECTOR_NAME"
-    echo ""
-  fi
-elif [ "$ACTION" == "edit" ]; then
-  if [ ! -z "$EDITOR" ]; then
-    $EDITOR "$COLLECTOR_FILE"
-  else
-    echo "$BASENAME: error: please export the EDITOR environment variable pointing to your editor of choice"
-    exit 1
-  fi
-fi
diff --git a/copy-annotations-from-kobo b/copy-annotations-from-kobo
deleted file mode 100755 (executable)
index f86d1fe..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-#
-# A mini-wrapper to copy a remote kobo annotation into a local one.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-BASEFOLDER="$HOME/data/doc"
-REMOTE_BASE="/mnt/sd"
-REMOTE="kobo"
-PATTERN="$1"
-
-# Thanks https://serverfault.com/a/764403
-#        https://serverfault.com/questions/36421/stop-ssh-login-from-printing-motd-from-the-client#38160
-function silentSsh {
-    local connectionString="$1"
-    shift
-    local commands="$*"
-    if [ -z "$commands" ]; then
-        commands=`cat`
-    fi
-    ssh -T $connectionString "$commands"
-}
-
-# Check
-if [ -z "$PATTERN" ]; then
-  echo "usage: $BASENAME <pattern>"
-  exit 1
-fi
-
-# Dispatch
-show --search "$PATTERN" | while read item; do
-  #sdr="`echo $item | sed -e 's/\.pdf$//' -e 's/\.epub$//' -e 's/\.djvuf$//'`.sdr"
-  basename="`echo $item | sed -e 's/\.[^.]*$//'`"
-  extension="$(echo $item | sed -e "s|$basename.||")"
-  sdr="$basename.sdr"
-
-  # Check if remote file exists
-  silentSsh $REMOTE <<EOT
-    test -e "$REMOTE_BASE/$sdr/metadata.$extension.lua"
-EOT
-
-  # Skip if remote file does not exist
-  if [ "$?" != "0" ]; then
-    echo "Skipping $item as it's not available at $REMOTE..."
-    continue
-  fi
-
-  echo "Processing $item..."
-
-  # Make sure that the annotation file exists
-  mkdir -p "$BASEFOLDER/$sdr"
-  touch "$BASEFOLDER/$sdr/metadata.$extension.lua"
-
-  # Make sure it's not locked by git annex
-  if [ -L "$BASEFOLDER/$sdr/metadata.$extension.lua" ]; then
-    git -C $BASEFOLDER annex unlock "$sdr/metadata.$extension.lua"
-  fi
-
-  # Update
-  silentSsh kobo >"$BASEFOLDER/$sdr/metadata.$extension.lua" <<EOF
-    cat "$REMOTE_BASE/$sdr/metadata.$extension.lua"
-EOF
-
-  # Stage
-  git -C $BASEFOLDER add "$sdr/metadata.$extension.lua"
-done
diff --git a/copy-item-to-kobo b/copy-item-to-kobo
deleted file mode 100755 (executable)
index aa751fb..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-#
-# A mini-wrapper to copy a local item to kobo.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-BASEFOLDER="$HOME/data/doc"
-REMOTE_BASE="/mnt/sd"
-REMOTE="kobo"
-PATTERN="$1"
-TMPFILE="tmpwork"
-
-# Thanks https://serverfault.com/a/764403
-#        https://serverfault.com/questions/36421/stop-ssh-login-from-printing-motd-from-the-client#38160
-function silentSsh {
-    local connectionString="$1"
-    shift
-    local commands="$*"
-    if [ -z "$commands" ]; then
-        commands=`cat`
-    fi
-    ssh -T $connectionString "$commands"
-}
-
-# Check
-if [ -z "$PATTERN" ]; then
-  echo "usage: $BASENAME <pattern>"
-  exit 1
-fi
-
-# Dispatch
-show --search "$PATTERN" | while read item; do
-  dirname="`dirname "$item"`"
-
-  # Check if item has unspported chars in it's file name
-  if echo "$item" | grep -q ':'; then
-    echo "$BASENAME: unsupported character ':' in file name '$item'"
-    echo "$BASENAME: please rename the file and try again"
-    exit 1
-  fi
-
-  echo "Copying $item..."
-
-  silentSsh $REMOTE <<EOC
-    mkdir -p "$REMOTE_BASE/$dirname"
-    touch "$REMOTE_BASE/$item"
-EOC
-
-  scp "$BASEFOLDER/$item" "$REMOTE:$REMOTE_BASE/$TMPFILE"
-  silentSsh $REMOTE <<EOS
-    mv "$REMOTE_BASE/$TMPFILE" "$REMOTE_BASE/$item"
-EOS
-done
diff --git a/dangling-archive b/dangling-archive
deleted file mode 100755 (executable)
index e9a66c2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-#
-# Archive dangling files.
-#
-
-# Parameters
-DATE="`date +%Y%m%d%I%M%S`"
-LOAD="$HOME/load"
-IMAGES="$HOME/data/images/incoming"
-IMAGES_PATTERN=".*\.(png|jpg|jpeg|gif|svg)"
-DOC="$HOME/data/doc/incoming"
-DOC_PATTERN=".*\.(txt|doc|docx|rtf|pdf|sxc|csv|odt|odf|ods|xls|xlsx|ppt|epub|mobi|djvu|lit)"
-NOISE="$HOME/data/noise/incoming"
-NOISE_PATTERN=".*\.(mp3|ogg|opus|m4a)"
-VIDEO="$HOME/data/video/incoming"
-VIDEO_PATTERN=".*\.(mp4|mov|mkv|avi|srt|mpg)"
-FIND_OPTS="-maxdepth 1 -regextype posix-egrep -iregex"
-
-# Ensure all folders exist
-mkdir -p $LOAD $IMAGES $DOC
-
-# Move images
-if [ "`find $LOAD/ $FIND_OPTS "$IMAGES_PATTERN" | wc -l`" != "0" ]; then
-  echo "Moving images into $IMAGES/$DATE ..."
-  mkdir -p $IMAGES/$DATE
-  find $LOAD/ $FIND_OPTS "$IMAGES_PATTERN" -exec mv {} $IMAGES/$DATE/ \;
-fi
-
-# Move doc
-if [ "`find $LOAD/ $FIND_OPTS "$DOC_PATTERN" | wc -l`" != "0" ]; then
-  echo "Moving docs into $DOC/$DATE ..."
-  mkdir -p $DOC/$DATE
-  find $LOAD/ $FIND_OPTS "$DOC_PATTERN" -exec mv {} $DOC/$DATE/ \;
-fi
-
-# Move noise
-if [ "`find $LOAD/ $FIND_OPTS "$NOISE_PATTERN" | wc -l`" != "0" ]; then
-  echo "Moving noise into $NOISE/$DATE ..."
-  mkdir -p $NOISE/$DATE
-  find $LOAD/ $FIND_OPTS "$NOISE_PATTERN" -exec mv {} $NOISE/$DATE/ \;
-fi
-
-# Move video
-if [ "`find $LOAD/ $FIND_OPTS "$VIDEO_PATTERN" | wc -l`" != "0" ]; then
-  echo "Moving video into $VIDEO/$DATE ..."
-  mkdir -p $VIDEO/$DATE
-  find $LOAD/ $FIND_OPTS "$VIDEO_PATTERN" -exec mv {} $VIDEO/$DATE/ \;
-fi
diff --git a/dict b/dict
deleted file mode 100755 (executable)
index 6d58fe9..0000000
--- a/dict
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Dictionary wrapper.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-DICT="/usr/bin/dict"
-
-# Dispatch
-if [ -x "$DICT" ]; then
-  $DICT "$@"
-else
-  if which surfraw &> /dev/null; then
-    surfraw wiktionary "$@"
-  else
-    echo "error: no suitable dictionary found in the system"
-    exit 1
-  fi
-fi
diff --git a/docshower b/docshower
deleted file mode 100755 (executable)
index 102baae..0000000
--- a/docshower
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash
-#
-# Fast way to browse documents stored in an archive.
-#
-
-# Parameters
-PROGRAM="$0"
-BASENAME="`basename $0`"
-DOCS="$HOME/data/doc"
-BIBLIO="$DOCS/bibliographies"
-FILELIST=".doclist"
-LIST="$DOCS/$FILELIST"
-DOC_PATTERN=".*\.(txt|doc|docx|rtf|pdf|sxc|csv|odt|odf|ods|xls|xlsx|ppt|epub|mobi|djvu|lit)"
-FIND_OPTS="-regextype posix-egrep -iregex"
-ARG="$1"
-EXTRA_ARG="$2"
-DATE="`date +%s`"
-MAX_AGE="86400"
-
-# Update the filelist
-function __update_filelist {
-  echo "Generating new filelist..."
-
-  # Unnanex if it was erroneously annexed
-  if [ -h "$LIST" ] && [ -d "$DOCS/.git/annex" ]; then
-    ( cd $DOCS && git annex unlock $FILELIST )
-  fi
-
-  # Refresh
-  cd $DOCS && find . -not -path '*.git*' $FIND_OPTS "$DOC_PATTERN" > $LIST
-
-  # Stage
-  git add $LIST
-}
-
-# Check
-if [ -z "$ARG" ]; then
-  echo "usage: $BASENAME [option] [<object>] [extra-args]"
-  echo "       $BASENAME --refresh"
-  echo "       $BASENAME --<program-name> <item-name>"
-  echo "       $BASENAME --open           <item-name>"
-  echo "       $BASENAME --rifle          <item-name> -p 4"
-  echo "       $BASENAME --koreader       <item-name>"
-  echo "       $BASENAME --watch          <subfolder>"
-  echo "       $BASENAME                  <item-name>"
-  exit 1
-
-elif [ "$ARG" == "--refresh" ]; then
-  __update_filelist
-
-elif [ ! -d "$DOCS" ]; then
-  echo "missing $DOCS folder"
-  exit 1
-fi
-
-# Check for filelist
-if [ ! -e "$LIST" ]; then
-  __update_filelist
-  CHANGED="`date +%s`"
-else
-  CHANGED="`stat --printf='%Y\n' $LIST`"
-fi
-
-# Automatically refresh lists older than $MAX_AGE
-#if ((($DATE - $CHANGED) >= $MAX_AGE)); then
-#  __update_filelist
-#fi
-
-# Dispatch
-#find $DOCS -iname "*$ARG*" | head -1 | while read entry; do xdg-open "$entry"; done
-if [ "$ARG" == "--search" ]; then
-  shift
-  grep -i -- "$*" $LIST
-
-elif [ "$ARG" == "--details" ]; then
-  shift
-  entry="`echo $* | sed -e 's/^@//'`"
-  if grep -qiR -- "$entry" $BIBLIO; then
-    grep -iR -- "$entry" $BIBLIO | cut -d : -f 1 | while read file; do
-      echo "At $file:"
-      echo ""
-      # Thanks https://tex.stackexchange.com/questions/28506/how-to-use-a-command-line-tool-to-extract-a-bibtex-reference-that-contains-a-sea
-      awk -v RS='\n@' "/${entry}/" $file
-    done
-  else
-    find $DOCS -name ${1}.bib -exec cat {} \;
-  fi
-
-elif [ "$ARG" == "--watch" ]; then
-  # Convert symlink to full path and start inotifywait loop
-  folder="`readlink -f $DOCS`"
-  subfolder="$EXTRA_ARG"
-  echo "Watching changes at $folder/$subfolder..."
-
-  #while inotifywait -e modify -e create -e move -e delete -r "$folder"; do
-  #while inotifywait -e modify -e move -r "$folder"; do
-  #while inotifywait -e modify -e move -r "$folder/$subfolder"; do
-  #while inotifywait -e modify -e create -e move -e delete -r "$folder/$subfolder"; do
-  #  $PROGRAM --refresh
-  #done
-  inotifier $PROGRAM --refresh
-
-else
-  shift 2
-  EXTRA_ARGS="$*"
-
-  # Allows for specifying a custom command to open the file
-  if [ "${ARG:0:2}" == "--" ] && [ ! -z "$EXTRA_ARG" ]; then
-    OPEN="${ARG:2}"
-    ARG="$EXTRA_ARG"
-
-    # Shortcuts for xdg-open
-    if [ "$OPEN" == "open" ] || [ "$OPEN" == "read" ]; then
-      OPEN="xdg-open"
-    fi
-  else
-    OPEN="xdg-open"
-    EXTRA_ARGS=""
-  fi
-
-  grep -i -- "$ARG" $LIST | while read entry; do
-    echo "Opening $entry..."
-    cd $DOCS && $OPEN $EXTRA_ARGS "$entry"
-  done
-fi
diff --git a/doi2bib b/doi2bib
deleted file mode 100755 (executable)
index b669737..0000000
--- a/doi2bib
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/python3
-# Adapted from https://scipython.com/blog/doi-to-bibtex/
-
-import os
-import sys
-import pycurl
-from io import BytesIO
-#import urllib.request
-#from urllib.error import HTTPError
-
-BASE_URL = 'http://dx.doi.org/'
-
-try:
-    doi = sys.argv[1]
-except IndexError:
-    print('usage: {} <doi>'.format(os.path.basename(sys.argv[0])))
-    sys.exit(1)
-
-url = BASE_URL + doi
-
-# Urllib version
-#req = urllib.request.Request(url)
-#req.set_proxy('socks5://localhost:9050', 'socks')
-#req.add_header('Accept', 'application/x-bibtex')
-
-# PyCurl version with Tor support
-# See http://pycurl.io/docs/latest/quickstart.html
-buffer = BytesIO()
-req    = pycurl.Curl()
-req.setopt(req.URL, url)
-req.setopt(req.HTTPHEADER, ('Accept: application/x-bibtex',))
-req.setopt(req.FOLLOWLOCATION, True)
-req.setopt(req.WRITEDATA, buffer)
-req.setopt(req.PROXY, 'socks5://localhost:9050')
-
-try:
-    #with urllib.request.urlopen(req) as f:
-    #    bibtex = f.read().decode()
-    #print(bibtex)
-
-    req.perform()
-    req.close()
-    body = buffer.getvalue()
-
-    # Body is a byte string.
-    # We have to know the encoding in order to print it to a text file
-    # such as standard output.
-    print(body.decode('iso-8859-1'))
-except HTTPError as e:
-    if e.code == 404:
-        print('DOI not found.')
-    else:
-        print('Service unavailable.')
-    sys.exit(1)
diff --git a/dupbackup b/dupbackup
deleted file mode 100755 (executable)
index f020c36..0000000
--- a/dupbackup
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-#
-# dupbackup: duplicity wrapper
-# feedback: rhatto at riseup.net
-#
-#  dupbackup 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 any later version.
-#
-#  common.sh is distributed in the hope that it will be useful, but WITHOUT ANY
-#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-#  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License along with
-#  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-#  Place - Suite 330, Boston, MA 02111-1307, USA
-
-# Usage: dupbackup <host> [option]
-
-USER="`whoami`"
-LOCAL_FOLDER="/mnt/crypt/home/$USER/"
-REMOVE_OLDER_THAN="3M"
-KEY=""
-HOST="$1"
-OPTION="$2"
-
-# Load configuration
-if [ -e "$HOME/.config/scripts/dupbackup" ]; then
-  source $HOME/.config/scripts/dupbackup
-fi
-
-if [ ! -z "$HOST" ]; then
-  DEST="/var/backups/remote/$USER/duplicity"
-  DEST="scp://$USER@$HOST/$DEST"
-else
-  DEST="file:///var/backups/users/$USER/duplicity"
-fi
-
-if [ -z "$OPTION" ]; then
-  OPTION="incr"
-fi
-
-mkdir -p $LOCAL_FOLDER/tmp/duplicity
-
-duplicity $OPTION -v6 --full-if-older-than $REMOVE_OLDER_THAN    \
-                      --allow-source-mismatch --encrypt-key $KEY \
-                      --sign-key $KEY $LOCAL_FOLDER $DEST        \
-                      --tempdir $LOCAL_FOLDER/tmp/duplicity      \
-                      --exclude $LOCAL_FOLDER/tmp/duplicity
-
-duplicity remove-older-than $REMOVE_OLDER_THAN $DEST --force
diff --git a/export-firefox-bookmarks b/export-firefox-bookmarks
deleted file mode 100755 (executable)
index 45878dd..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-#
-# Export Mozilla Firefox bookmarks.
-# Based on https://github.com/pirate/ArchiveBox/blob/master/bin/export_browser_history.sh
-#
-
-# Parameters
-BASENAME="`basename $0`"
-BASEDIR="$HOME/.mozilla/firefox"
-PROFILES="$BASEDIR/profiles"
-PROFILE="$1"
-#SECTION="moz_${2:-bookmarks}"
-
-# Export from a single database
-function export_firefox_bookmark {
-  sqlite3 $1 "SELECT \"[\" || group_concat(json_object('timestamp', b.dateAdded, 'description', b.title, 'href', f.url)) || \"]\" FROM moz_bookmarks AS b JOIN moz_places AS f ON f.id = b.fk"
-}
-
-# Check
-#if [ ! -e "$BASEDIR/profiles.ini" ]; then
-#  echo "$BASENAME: not found: $BASEDIR/profiles.ini"
-#  exit 1
-#fi
-
-#PROFILES="grep "^Name=" $BASEDIR/profiles.ini | cut -d = -f 2 | xargs"
-
-# There might be many places.sqlite on many profiles
-if [ -z "$PROFILE" ]; then
-  find $BASEDIR -name places.sqlite | while read file; do \
-    export_firefox_bookmark $file
-  done
-else
-  # Assumption: when a $PROFILE is given, search at $PROFILES
-  if [ -e "$PROFILES/$PROFILE/places.sqlite" ]; then
-    export_firefox_bookmark $PROFILES/$PROFILE/places.sqlite
-  else
-    echo "$BASENAME: file not found: $PROFILES/$PROFILE/places.sqlite"
-    exit 1
-  fi
-fi
diff --git a/export-koreader-note b/export-koreader-note
deleted file mode 100755 (executable)
index ae2e0ef..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env lua
---
--- Convert koreader metadata to markdown.
---
-
--- Sort by page number
-function compare(a, b)
-  return a.page < b.page
-end
-
--- Check if a file exists
--- Thanks https://stackoverflow.com/questions/4990990/check-if-a-file-exists-with-lua#4991602
-function file_exists(name)
-  local f=io.open(name,"r")
-  if f~=nil then io.close(f) return true else return false end
-end
-
--- Get filename
-file = arg[1]
-
--- Usage
-if file == nil then
-  print('usage: ' .. arg[0] .. ' <filename>')
-  os.exit(1)
-else
-  if not file_exists(file) then
-    print('file not found: ' .. file)
-    os.exit(1)
-  end
-end
-
--- Load metadata
-content   = assert(loadfile(file))
-data      = content()
-bookmarks = data.bookmarks
-
--- Sort
-table.sort(bookmarks, compare)
-
--- Iterate over bookmarks
-for key, item in ipairs(bookmarks) do
-  print('Page ' .. item.page .. ':')
-  print('')
-  print('> ' .. item.notes)
-  print('')
-end
diff --git a/export-pad b/export-pad
deleted file mode 100755 (executable)
index fd17d2a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-#
-# Export etherpad content into a file.
-#
-
-# Parameters
-URL="$1"
-FILE="$2"
-BASENAME="`basename $0`"
-
-# Check
-if [ -z "$FILE" ]; then
-  echo "usage: $BASENAME <url> <file>"
-  exit 1
-fi
-
-# Dispatch
-torify curl $URL/export/txt > $FILE
diff --git a/fixmes b/fixmes
deleted file mode 100755 (executable)
index dda4f82..0000000
--- a/fixmes
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# FIXME visualizer.
-# Run on itself for a nice result: fixmes `which fixmes`
-#
-
-# Basic params
-NAME="$0"
-BASENAME="`basename $NAME`"
-
-# Run
-if [ ! -z "$1" ] && [ -e "$1" ]; then
-  file="$1"
-else
-  file='-R *'
-fi
-
-grep -i "FIXME" $file | sed -e 's/^  *//'
diff --git a/inotifier b/inotifier
deleted file mode 100755 (executable)
index c4d7098..0000000
--- a/inotifier
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env bash
-#
-# Run commands when a folder content changes.
-#
-# Alternatives:
-#
-# * https://github.com/quitesimpleorg/adhocify
-# * https://tracker.debian.org/pkg/inotify-hookable
-# * https://metacpan.org/dist/App-Inotify-Hookable
-
-# Parameters
-BASENAME="`basename $0`"
-WATCHED="$1"
-COMMAND="$2"
-
-# Listened inotify events
-#
-# See inotifywait(0) for the full list and description of all supported events.
-#
-# By default, exclude "access", "close", "close_write", "close_nowrite", "open"
-# from the list of events
-INOTIFY_EVENTS="-e modify -e attrib -e moved_to -e moved_from -e move -e move_self -e create -e delete -e delete_self -e unmount"
-
-# Check
-if [ -z "$COMMAND" ]; then
-  echo "usage: $BASENAME <folder> <command> [args]"
-  exit 1
-elif [ ! -e "$WATCHED" ]; then
-  echo "error: file or folder not found: $WATCHED"
-  exit 1
-fi
-
-# Shift
-shift 2
-
-# Normalize folder name
-if [ -d "$WATCHED" ]; then
-  WATCHED="`cd $WATCHED &> /dev/null && pwd`"
-fi
-
-# UX
-echo "Watching $WATCHED to exec \"$COMMAND $*\" upon changes..."
-
-# Dispatch
-# Excluding any .git folder from being watched
-while inotifywait $INOTIFY_EVENTS --exclude '.*.git.*' -r $WATCHED; do
-  $COMMAND $*
-done
diff --git a/keyringer-export-pads b/keyringer-export-pads
deleted file mode 100755 (executable)
index 167c3a6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# Export etherpad content into a keyring.
-# This is currently too specific to be added into keyringer tree.
-#
-
-# Load functions
-#LIB="`dirname $0`/../functions"
-#source "$LIB" maintenance $* || exit 1
-
-# Parameters
-BASENAME="`basename $0`"
-KEYRING="$1"
-PAD="$2"
-
-# Procedure
-function keyringer_export_pad {
-  torify curl `keyringer $KEYRING decrypt pads/urls/$1 main 2> /dev/null`/export/txt | keyringer $KEYRING encrypt pads/exports/$1
-}
-
-# Check
-if [ -z "$KEYRING" ]; then
-  echo "usage: $BASENAME <keyring> [pad]"
-  exit 1
-fi
-
-# Dispatch
-if [ -z "$PAD" ]; then
-  for pad in `keyringer $KEYRING ls pads/urls`; do
-    echo "Exporting $pad..."
-  done
-else
-  echo "Exporting $PAD..."
-  keyringer_export_pad $PAD
-fi
diff --git a/mvln b/mvln
deleted file mode 100755 (executable)
index ec4c359..0000000
--- a/mvln
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-#
-# Move a file but keep a symlink behind.
-#
-# See http://www.linuxquestions.org/questions/linux-newbie-8/script-to-move-old-files-create-symbolic-link-728618/
-#     http://lifehacker.com/5270634/move-files-without-breaking-stuff
-#     https://stackoverflow.com/questions/9251818/bash-move-file-directory-and-create-a-link-of-it
-#     http://serverfault.com/questions/8108/move-a-file-and-leave-a-soft-link-behind
-
-# Parameters
-BASE="$(basename "$1")"
-ORIG="$(dirname "$1")"
-DEST="$2"
-
-# Check
-if [ ! -e "$ORIG/$BASE" ]; then
-  echo "File not found: $ORIG/$BASE"
-  exit 1
-fi
-
-# Proceed
-mkdir -p "$DEST"
-mv "$ORIG/$BASE" "$DEST" && ln -s "$DEST/$BASE" "$ORIG/$BASE"
index 48d83ca08287c3d3031d9a7815f5eca0a6ef0db3..8c525cdb85e81622f3bfa99fcb6bab1391d82537 100755 (executable)
@@ -11,7 +11,6 @@
 # * chlauber@bnc.ch
 #
 # Licensed under the GNU GPL
-# 
 
 [ -x /sbin/resolvconf ] || exit 0 
 
diff --git a/pw b/pw
deleted file mode 100755 (executable)
index cb389e1..0000000
--- a/pw
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-#
-# Simple password generator.
-#
-
-head -c ${1:-20} /dev/urandom | base64
diff --git a/quarter-timestamps b/quarter-timestamps
deleted file mode 100755 (executable)
index 8f1bab5..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-#
-# Determine the quarter's timestamps
-#
-
-# Parameters
-BASENAME="`basename $0`"
-DIRNAME="`dirname $0`"
-QUARTER="$1"
-YEAR="`echo $QUARTER | cut -d . -f 1`"
-QUARTILE="`echo $QUARTER | cut -d . -f 2`"
-
-# Syntax check
-if [ -z "$QUARTILE" ]; then
-  echo "usage: $BASENAME <quarter>"
-  echo "quarter format: YYYY.QQ"
-  echo "example: 2024.Q3"
-  exit 1
-fi
-
-# Lookup table
-case $QUARTILE in
-  Q1)
-    BEGIN="01-01"
-    END="03-31"
-    ;;
-
-  Q2)
-    BEGIN="04-01"
-    END="06-30"
-    ;;
-
-  Q3)
-    BEGIN="07-01"
-    END="09-30"
-    ;;
-
-  Q4)
-    BEGIN="10-01"
-    END="12-31"
-    ;;
-esac
-
-# Determine the UNIX timestamp for the beginning and end of the quarter
-QUARTER_BEGIN="`date -d "${YEAR}-${BEGIN} 00:00:00 UTC" +%s`"
-QUARTER_END="`date -d "${YEAR}-${END} 00:00:00 UTC" +%s`"
-
-# Output
-echo "Quarter begins at UNIX timestamp $QUARTER_BEGIN ($YEAR-$BEGIN)"
-echo "Quarter ends   et UNIX timestamp $QUARTER_END ($YEAR-$END)"
diff --git a/reminders b/reminders
deleted file mode 100755 (executable)
index a92ae83..0000000
--- a/reminders
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-#
-# Print a short summary of today's reminders.
-
-if [ -e "$HOME/.reminders" ]; then
-  cd 
-  remind $HOME/.reminders $* | grep -v '^No reminders.$' | sed -e '/^$/d'
-fi
diff --git a/repl b/repl
deleted file mode 100755 (executable)
index 4afca89..0000000
--- a/repl
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-#
-# Generic read-eval-print loop script.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-
-# Shell
-function _repl {
-  local last_exit_code="0"
-  local command="$1"
-
-  shift
-
-  # While Ctrl-C isn't typed, read STDIN and invoke a command
-  while read -rep "${last_exit_code} ${command}> " STDIN; do
-    history -s "$STDIN"
-    ${command} $* ${STDIN[@]}
-    last_exit_code="$?"
-  done
-}
-
-# Check
-if [ -z "$1" ]; then
-  echo "usage: $BASENAME <command> [base-args]"
-  exit 1
-fi
-
-# Dispatch
-_repl $*
diff --git a/scuttle b/scuttle
deleted file mode 100755 (executable)
index e065b48..0000000
--- a/scuttle
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-#
-# Post a link to a scuttle service.
-#
-
-# Thanks https://gist.github.com/cdown/1163649
-function urlencode() {
-  # urlencode <string>
-  old_lc_collate=$LC_COLLATE
-  LC_COLLATE=C
-
-  local length="${#1}"
-  for (( i = 0; i < length; i++ )); do
-    local c="${1:i:1}"
-    case $c in
-      [a-zA-Z0-9.~_-]) printf "$c" ;;
-      *) printf '%%%02X' "'$c" ;;
-    esac
-  done
-
-  LC_COLLATE=$old_lc_collate
-}
-
-# Parameters
-BASENAME="`basename $0`"
-URL="$1"
-TAGS="$2"
-shift 2
-DESC="$*"
-TMP="${TMP:=/tmp}"
-
-# Syntax
-if [ -z "$TAGS" ]; then
-  echo "usage: $BASENAME <url> <tags> [description]"
-  exit
-fi
-
-# Config
-source "$HOME/.custom/scuttle" || exit 1
-
-# See http://www.wired.com/2010/02/using_the_delicious_api/
-#CALL="$SCUTTLE_URL/api/posts/add?url=`urlencode $URL`"
-CALL="$SCUTTLE_URL/api/posts/add"
-
-# Tags
-TAGS="`echo $TAGS | sed -e 's/,/ /g'`"
-#TAGS="`urlencode "$TAGS"`"
-TAGS="`echo $TAGS | sed -e 's/%2C/,/g'`"
-#CALL="$CALL&tags=$TAGS"
-
-# Description
-if [ -z "$DESC" ]; then
-  # See http://stackoverflow.com/questions/3195851/ddg#3195895
-  DESC="`torify curl -L -s $URL | grep -i "<title>" | sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q' 2> /dev/null`"
-  echo "Fetched description: $DESC"
-fi
-
-# Full API call
-#CALL="$CALL&description=`urlencode "$DESC"`"
-
-# Write config
-CONF="`mktemp -t scuttle.XXXXXXXXXX -p $TMP`"
-echo "url = $CALL" > $CONF
-echo "user = $SCUTTLE_USER:$SCUTTLE_PASS" >> $CONF
-
-# Remove trailing slash which might lead to urlencode errors by curl (dunny why)
-URL="`echo $URL | sed -e 's|/$||'`"
-
-# Call curl
-# See https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command#2027690
-#curl -s -K $CONF &> /dev/null
-curl -s -K $CONF -G --data-urlencode "url=$URL" --data-urlencode "tags=$TAGS" --data-urlencode "description=$DESC" &> /dev/null
-
-# Status
-STATUS="$?"
-
-# Teardown
-rm $CONF
-exit $STATUS
diff --git a/status b/status
deleted file mode 100755 (executable)
index 51f9874..0000000
--- a/status
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/bin/bash
-#
-# Check the overall status of your work.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-
-# Usage
-function status_usage {
-  echo "usage: $BASENAME [-l|--long] [-d|--delay N] [project]"
-
-  if [ -z "$1" ]; then
-    exit 1
-  else
-    exit $1
-  fi
-}
-
-# See https://stackoverflow.com/questions/2721946/cross-platform-getopt-for-a-shell-script#4300224
-function status_options {
-  getopt -T > /dev/null
-  if [ $? -eq 4 ]; then
-    # GNU enhanced getopt is available
-    ARGS=`getopt --name "$BASENAME" --long loop,delay: --options ld: -- "$@"`
-  else
-    # Original getopt is available (no long option names, no whitespace, no sorting)
-    ARGS=`getopt ld: "$@"`
-  fi
-
-  if [ $? -ne 0 ]; then
-    echo "$BASENAME: usage error" >&2
-    status_usage 2
-  fi
-
-  eval set -- $ARGS
-
-  while [ $# -gt 0 ]; do
-    case "$1" in
-      l|--loop)
-        LOOP="yes";;
-      d|--delay)
-        DELAY="$2"
-        shift;;
-      --)
-        shift
-        break;;
-      *)
-        status_usage
-        ;;
-    esac
-    shift
-  done
-
-  if [ $# -gt 0 ]; then
-    PROJECT="$1"
-    shift
-  fi
-}
-
-# Calculate timestamp delta from a file
-function status_file_changed_delta {
-  local file="$1"
-
-  if [ -z "$file" ] || [ ! -e "$file" ]; then
-    echo 0
-  fi
-
-  local file_timestamp="`stat -c '%Z' $file`"
-  local timestamp="`date +%s`"
-
-  echo $(( timestamp - file_timestamp ))
-}
-
-# Run command if a file is older than a given number of seconds
-function status_run_if_file_older_than {
-  local file="$1"
-  local interval="$2"
-  local run="0"
-
-  shift 2
-
-  # Run command if there's still no file to test
-  if [ ! -e "$file" ]; then
-    run="1"
-  else
-    local age="`status_file_changed_delta $file`"
-    local interval="3600"
-
-    # Run command only when file is older or equal the interval
-    if (( $age >= $interval )); then
-      run="1"
-    fi
-  fi
-
-  # Run if criteria matches
-  if [ "$run" == "1" ]; then
-    $*
-  fi
-}
-
-# Run status
-function status_run {
-  if [ ! -z "$PROJECT" ]; then
-    # Check the status of the given project
-    cd $PROJECT &> /dev/null && git status
-  elif git status &> /dev/null; then
-    # Check the status of the current project
-    mr status
-  else
-    # Ensure we are in the home folder
-    cd
-
-    # Check your reminders
-    if which remind &> /dev/null && [ -e "$HOME/.reminders" ]; then
-      remind ~/.reminders | grep -iv '^no reminders.$' # | tr '[:upper:]' '[:lower:]'
-    fi
-
-    # Update your mrconfig and check all registered repositories
-    if which mr &> /dev/null; then
-      local mrconfig="$HOME/.custom/mrconfig-automatic"
-
-      status_run_if_file_older_than $mrconfig 3600 mrconfig-updater
-
-      # Pipe through cat so we don't have to deal with mr's dynamic output weirdness
-      #mr -m status | cat
-
-      # Replace eventual "/mnt/crypt/home/$USER" with "~/" from output
-      # Piping through sed also handles mr's dynamic output weirdness
-      mr -m status | sed -e "s|/mnt/crypt/home/$USER/|~/|" -e "s|$HOME|~|"
-    fi
-
-    # Use this as an opportunity to save our configs
-    if which git-config-save &> /dev/null; then
-      git config-save --sometimes &> /dev/null
-    fi
-
-    # Check your TODO lists, filtering only important tasks
-    # Convention here is to use uppercase "IMPORTANT", to be explicit and avoid false positives
-    todo list IMPORTANT
-
-    # Collected items that need to be moved somewhere else
-    #collector count
-    collector list
-
-    # Check if you have mails to send
-    postponed
-
-    # Check unread mails
-    unread-mails
-
-    # Alarms set
-    #xalarm list
-
-    # Check for spool files
-    if [ -e "$HOME/temp/log/spool.md" ] && [ "`wc -l $HOME/temp/log/spool.md | cut -d ' ' -f 1`" != "0" ]; then
-      echo "Spool file not empty: $HOME/temp/log/spool.md"
-    fi
-
-    # Check if are dangling downloaded files
-    if [ -e "$HOME/load" ] && [ ! -z "`ls -1 ~/load/`" ]; then
-      # Print a newline if needed depending of the output of the previous commands
-      if [ ! -z "`postponed`" ] || [ ! -z "`unread-mails`" ] || [ ! -z "`collector list`" ]; then
-        echo ""
-      fi
-
-      echo "Dangling files at ~/load:"
-      echo ""
-      ls -lh ~/load/
-    fi
-  fi
-}
-
-# Options
-status_options $@
-
-# Dispatch
-if [ "$LOOP" == "yes" ]; then
-  PROJECT=""
-
-  if [ -z "$DELAY" ]; then
-    DELAY="60"
-  fi
-
-  while true; do
-    clear
-    status_run
-    sleep $DELAY
-  done
-else
-  status_run
-fi
diff --git a/suser b/suser
deleted file mode 100755 (executable)
index 6d2eaaf..0000000
--- a/suser
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-#
-# A shorthand for changing to a user
-#
-
-# Parameters
-BASENAME="`basename $0`"
-USER="$1"
-
-if [ -z "$USER" ]; then
-  echo "usage: $BASENAME <user>"
-  exit 1
-fi
-
-sudo su $USER -s $SHELL
diff --git a/sync-from-kobo b/sync-from-kobo
deleted file mode 100755 (executable)
index 74b89ef..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-#
-# A mini-wrapper to sync a kobo folder into a local one.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-BASEFOLDER="$HOME/data/doc"
-COLLECTION="$1"
-
-# Check
-if [ -z "$COLLECTION" ]; then
-  echo "usage: $BASENAME <colletion>"
-  echo "available collections:"
-  echo ""
-  ls $BASEFOLDER
-  exit 1
-fi
-
-# Ensure collection exists
-if [ ! -d "$BASEFOLDER/$COLLECTION" ]; then
-  echo "error: no such collection $COLLECTION at $BASEFOLDER"
-  exit 1
-fi
-
-# Setup origin
-if [ "$COLLECTION" == "clipboard" ]; then
-  ORIGIN="/mnt/onboard/.adds/koreader/clipboard"
-else
-  ORIGIN="/mnt/sd/$COLLECTION"
-fi
-
-# Dispatch
-lftp -c "open sftp://kobo && mirror -L $ORIGIN $BASEFOLDER/$COLLECTION"
diff --git a/sync-to-kobo b/sync-to-kobo
deleted file mode 100755 (executable)
index 8d62859..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-#
-# A mini-wrapper to sync a local folder into kobo.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-BASEFOLDER="$HOME/data/doc"
-COLLECTION="$*"
-
-# Check
-if [ -z "$COLLECTION" ]; then
-  echo "usage: $BASENAME <colletion>"
-  echo "available base collections:"
-  echo ""
-  ls $BASEFOLDER
-  exit 1
-fi
-
-# Ensure collection exists
-if [ ! -d "$BASEFOLDER/$COLLECTION" ]; then
-  echo "error: no such collection $COLLECTION at $BASEFOLDER"
-  exit 1
-fi
-
-# Dispatch
-# Use --exclude with a egrep regexp
-lftp -c "open sftp://kobo && mirror --exclude=.*sdr --delete -L -R \"$BASEFOLDER/$COLLECTION\" \"/mnt/sd/$COLLECTION\""
diff --git a/task b/task
deleted file mode 100755 (executable)
index 60b116e..0000000
--- a/task
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-#
-# A very simple taskwarrior wrapper.
-#
-
-# Parameters
-TASK="/usr/bin/task"
-
-# Dispatch
-if [ -e ".task" ]; then
-  $TASK rc.data.location=.task "${@}"
-else
-  $TASK "${@}"
-fi
diff --git a/tasks b/tasks
deleted file mode 100755 (executable)
index 4ab3211..0000000
--- a/tasks
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-#
-# A taskwarrior wrapper.
-#
-
-# Basic params
-CONFIG="$HOME/.config/tasks"
-BASENAME="`basename $0`"
-PROJECT="$1"
-
-# Config
-if [ -e "$CONFIG" ] ; then
-  source $CONFIG
-fi
-
-# Custom params
-TODO_MAXDEPTH="2"
-WORKPATH="${WORKPATH:=~/}"
-FOLDERS="`echo $WORKPATH | tr ':' ' ' | sed -e "s|~|$HOME|g"`"
-
-# Check if first param is a project
-if [ ! -z "$PROJECT" ] && cd $PROJECT &> /dev/null || false; then
-  IS_PROJECT="true"
-  shift
-else
-  IS_PROJECT="false"
-fi
-
-cd - &> /dev/null
-
-# Check if project exists
-if [ "$IS_PROJECT" == "true" ]; then
-  cd $PROJECT &> /dev/null || exit 1
-
-  # Get full path
-  CWD="`pwd`"
-
-  # Call taskwarrior
-  if [ -d "$CWD/.task" ]; then
-    task rc.data.location=$CWD/.task rc.verbose=nothing $*
-  fi
-else
-  for folder in $FOLDERS; do
-    if [ ! -d "$folder" ]; then
-      continue
-    fi
-
-    find $folder/ -maxdepth $TODO_MAXDEPTH -xtype d -iname '.task' | while read task; do
-      if [ -z "$SILENT" ]; then
-        echo "Tasks from $task:"
-        echo ""
-      fi
-
-      task rc.data.location=$task rc.verbose=nothing $*
-    done
-  done
-fi
diff --git a/telneter b/telneter
deleted file mode 100755 (executable)
index acb9404..0000000
--- a/telneter
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/expect
-#
-# Simple telnet application to log in a server
-# WARNING: passphrase is sent in the clear!
-#
-
-spawn telnet example.org
-# Not absolutely necessary, but good to keep the spawn_id for later
-set telnet $spawn_id
-# Case insensitive, just in case..
-expect -nocase "login:"
-send  "user\r"
-# My telnetd insisted on an uppercase P. This works bothways
-expect -nocase "password:"
-send "SENHA\r"
-# Match the prompt (contains a $)
-expect -re {\$}
-# Get the environment variables
-send "env\r"
-# Wait for the prompt
-expect -re {\$}
-exit 
diff --git a/timew-shell b/timew-shell
deleted file mode 100755 (executable)
index 2ebbf28..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Timewarrior shell.
-#
-
-# Shell
-function timew_shell {
-  local last_exit_code="0"
-
-  # While a "quit" command isn't entered, read STDIN
-  while read -rep "$last_exit_code timew> " STDIN; do
-    history -s "$STDIN"
-
-    if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then
-      break
-    elif [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then
-      # If line is not empty or commented, process command
-      STDIN=($STDIN)
-
-      if [ "$STDIN" == "status" ] || [ "$STDIN" == "st" ]; then
-        timew
-      else
-        timew ${STDIN[@]}
-      fi
-
-      last_exit_code="$?"
-    fi
-  done
-}
-
-# Dispatch
-timew_shell
diff --git a/todo b/todo
deleted file mode 100755 (executable)
index c51d295..0000000
--- a/todo
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/bash
-#
-# Task list visualizer.
-#
-
-# Basic params
-CONFIG="$HOME/.config/todo"
-NAME="$0"
-BASENAME="`basename $NAME`"
-OPTION="$1"
-
-# Config
-if [ -e "$CONFIG" ] ; then
-  source $CONFIG
-fi
-
-# Custom params
-TODO_MAXDEPTH="2"
-WORKPATH="${WORKPATH:=~/}"
-FOLDERS="`echo $WORKPATH | tr ':' ' ' | sed -e "s|~|$HOME|g"`"
-
-# Iterate
-function todo_find {
-  for folder in $FOLDERS; do
-    if [ ! -d "$folder" ]; then
-      continue
-    fi
-
-    find $folder/ -maxdepth $TODO_MAXDEPTH -xtype f -iname 'todo*' | while read todo; do
-      # Ignore lists without tasks
-      if grep -q -e '\* \[ \]' -e '-' $todo; then
-        echo $todo
-      fi
-    done
-  done
-}
-
-function todo_list {
-  local status="$1"
-
-  # User's Taskwarrior
-  if which task &> /dev/null; then
-    if [ "`task status:pending count 2> /dev/null`" != "0" ]; then
-      echo "taskwarrior:"
-      #echo ""
-      task list 2> /dev/null
-      echo ""
-    fi
-
-    # Taskwarrior data from projects
-    if [ ! -z "$status" ]; then
-      taskstatus="+$status"
-      SILENT="true"
-    fi
-
-    SILENT=$SILENT tasks $taskstatus list 2> /dev/null
-    echo ""
-  fi
-
-  # User's Timewarrior
-  if which timew &> /dev/null; then
-    if ! timew | grep -q "^There is no active time tracking."; then
-      timew
-      echo ""
-    fi
-  fi
-
-  todo_find | while read todo; do
-    if [ "$todo" != "$NAME" ]; then
-      if [ ! -z "$status" ] && ! grep -q "\($status\)" $todo; then
-        continue
-      fi
-
-      path="`echo $todo | sed -e "s|^$HOME|~|"`"
-      delim="===`echo $path | sed -e 's|.|=|g'`"
-      #echo ""
-      echo In $path
-      echo $delim
-      echo ""
-
-      if [ ! -z "$status" ]; then
-        if echo $todo | grep -q $status; then
-        grep -e '\* \[ \]' -e '-' $todo
-        else
-          grep -e '\* \[ \]' -e '-' $todo | grep "\($status\)"
-        fi
-      else
-        grep -e '\* \[ \]' -e '-' $todo
-      fi
-
-      echo ""
-    fi
-  done
-}
-
-if [ "$OPTION" == "find" ]; then
-  todo_find | grep -v -e "^$NAME$" | sed -e "s|^$HOME|~|"
-elif [ "$OPTION" == "count" ]; then
-  todo_find | grep -v $NAME | wc -l
-elif [ "$OPTION" == "show" ] || [ "$OPTION" == "see" ] || [ "$OPTION" == "view" ]; then
-  if [ ! -z "$2" ] && [ -e "$2" ]; then
-    # Check TODO inside files
-    grep -i "todo" $2 | sed -e 's/^  *//'
-
-    # Check also for FIXMEs
-    fixmes $2
-  elif cd $2 &> /dev/null; then
-    (
-    cd $2 &> /dev/null
-    find -maxdepth 1 -xtype f -iname 'todo*' -exec cat {} \; | grep -e '*' -e '-'
-    )
-  fi
-elif [ "$OPTION" == "list" ]; then
-  todo_list $2
-elif [ "$OPTION" == "help" ]; then
-  echo "usage: $BASENAME [list|count]"
-  echo "       $BASENAME <show|see|view> <file|project>"
-else
-  todo_list
-fi
diff --git a/tomb-close b/tomb-close
deleted file mode 100755 (executable)
index 3ee08dd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# Close a Tomb.
-#
-
-# Parameters
-TOMBS="$HOME/data/tombs"
-KEYS="$HOME/.tombs"
-BASENAME="`basename $0`"
-TOMB="$1"
-
-# Check
-if [ ! -d "$TOMBS" ]; then
-  echo "error: no cemetery available at $TOMBS"
-  exit 1
-elif [ -z "$TOMB" ]; then
-  echo "usage: $BASENAME <tomb>"
-  echo "available tombs: `ls $TOMBS | xargs basename -a -s .tomb | xargs echo`"
-  exit 1
-elif [ ! -e "$TOMBS/$TOMB.tomb" ]; then
-  echo "tomb not found: $TOMBS/$TOMB.tomb"
-  exit 1
-#elif ! tomb list $TOMB &> /dev/null; then
-#  echo "tomb $TOMB is already closed"
-#  exit 1
-fi
-
-# Dispatch
-tomb close $TOMB
-
-# Annex
-if [ -d "$TOMBS/.git/annex" ]; then
-  ( cd $TOMBS && git annex add $TOMB.tomb )
-fi
diff --git a/tomb-create b/tomb-create
deleted file mode 100755 (executable)
index aa211c2..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env bash
-#
-# Create a Tomb.
-#
-
-# Parameters
-TOMBS="$HOME/data/tombs"
-KEYS="$HOME/.tombs"
-BASENAME="`basename $0`"
-TOMB="$1"
-SIZE="$2"
-
-# Check
-if [ ! -d "$TOMBS" ]; then
-  echo "error: no cemetery available at $TOMBS"
-  exit 1
-elif [ -z "$TOMB" ]; then
-  echo "usage: $BASENAME <tomb>"
-  exit 1
-elif [ -e "$TOMBS/$TOMB.tomb" ]; then
-  echo "tomb already exists: $TOMBS/$TOMB.tomb"
-  exit 1
-elif [ ! -e "$KEYS/$TOMB.tomb.key" ]; then
-  echo "missing keyfile $KEYS/$TOMB.tomb.key"
-  exit 1
-fi
-
-# Set
-if [ -z "$SIZE" ]; then
-  SIZE="16"
-fi
-
-# Create password
-keyringer default pwgen tombs/$TOMB.tomb.key.passwd
-
-# Dispatch
-tomb dig   $TOMBS/$TOMB.tomb -s $SIZE
-tomb forge $KEYS/$TOMB.tomb.key
-tomb lock  $TOMBS/$TOMB.tomb -k $KEYS/$TOMB.tomb.key
-
-# Add key into keyringer
-keyringer default encrypt tombs/$TOMB.tomb.key $KEYS/$TOMB.tomb.key
-
-# Annex
-#if [ -d "$TOMBS/.git/annex" ] && [ -h "$TOMBS/$TOMB.tomb" ]; then
-#  ( cd $TOMBS && git annex unlock $TOMB.tomb )
-#fi
diff --git a/tomb-open b/tomb-open
deleted file mode 100755 (executable)
index 5154215..0000000
--- a/tomb-open
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# Open a Tomb.
-#
-
-# Parameters
-TOMBS="$HOME/data/tombs"
-KEYS="$HOME/.tombs"
-BASENAME="`basename $0`"
-TOMB="$1"
-
-# Check
-if [ ! -d "$TOMBS" ]; then
-  echo "error: no cemetery available at $TOMBS"
-  exit 1
-elif [ -z "$TOMB" ]; then
-  echo "usage: $BASENAME <tomb>"
-  echo "available tombs: `ls $TOMBS | xargs basename -a -s .tomb | xargs echo`"
-  exit 1
-elif [ ! -e "$TOMBS/$TOMB.tomb" ]; then
-  echo "tomb not found: $TOMBS/$TOMB.tomb"
-  exit 1
-elif [ ! -e "$KEYS/$TOMB.tomb.key" ]; then
-  echo "missing keyfile $KEYS/$TOMB.tomb.key"
-  exit 1
-fi
-
-# Unnanex
-if [ -d "$TOMBS/.git/annex" ] && [ -h "$TOMBS/$TOMB.tomb" ]; then
-  ( cd $TOMBS && git annex unlock $TOMB.tomb )
-fi
-
-# Dispatch
-tomb open $TOMBS/$TOMB.tomb -k $KEYS/$TOMB.tomb.key
diff --git a/urlinfo b/urlinfo
deleted file mode 100755 (executable)
index 276a7bd..0000000
--- a/urlinfo
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-#
-# Retrieve and set basic URL info.
-#
-
-# Parameters
-BASENAME="`basename $0`"
-URL="$1"
-shift
-TAGS="$*"
-
-# Check
-if [ -z "$URL" ]; then
-  echo "usage: $BASENAME <url> [tag1] ... [tagN]"
-  exit 1
-fi
-
-# Dispatch
-DESC="`torify curl --max-redirs 10 -L -s $URL | grep -i "<title>" | sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q' 2> /dev/null`"
-
-# YouTube:
-#DESC="`torify curl youtube-dl -e $URL`"
-
-# Verify
-if [ -z "$DESC" ]; then
-  DESC="$URL"
-fi
-
-# Tag
-if [ ! -z "$TAGS" ]; then
-  IDENTIFIER="$URL $TAGS"
-else
-  IDENTIFIER="$URL"
-fi
-
-# Display
-if [ "$BASENAME" == "urlinfo" ]; then
-  echo "- title: \"$DESC\""
-  echo "  identifier:"
-  echo "    - $IDENTIFIER"
-elif [ "$BASENAME" == "urlmd" ]; then
-  echo "[$DESC]($URL)"
-fi
diff --git a/urlmd b/urlmd
deleted file mode 120000 (symlink)
index ea81d70..0000000
--- a/urlmd
+++ /dev/null
@@ -1 +0,0 @@
-urlinfo
\ No newline at end of file
diff --git a/urlsave b/urlsave
deleted file mode 100755 (executable)
index e58245c..0000000
--- a/urlsave
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# Save URL info in a file as a simple bookmarking service.
-#
-
-# Parameters
-CONFIG="$HOME/.custom/urlsave"
-
-# Load config
-if [ -e "$CONFIG" ]; then
-  source $CONFIG
-fi
-
-# Check
-if [ -z "$URLFILE" ] || [ ! -e "$URLFILE" ]; then
-  URLFILE="/dev/stdout"
-fi
-
-# Dispatch
-echo ""    >> $URLFILE
-urlinfo $* >> $URLFILE
diff --git a/urlssave b/urlssave
deleted file mode 100755 (executable)
index ff0dcf1..0000000
--- a/urlssave
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-#
-# Save multiple URLs using the same tags.
-#
-
-# Dispatch
-while read url; do
-  echo "Saving $url..."
-  urlsave $url $*
-done
diff --git a/vnc b/vnc
deleted file mode 100755 (executable)
index 94ce3d6..0000000
--- a/vnc
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-#
-# Wrapper around ssh and vncviewer
-#
-
-# Parameters
-BASENAME="`basename $0`"
-SERVER="$1"
-LOCALPORT="${2:-5901}"
-REMOTEPORT="${3:-5901}"
-
-# Clipboard options
-# In practice, clipboard limitations are not working as expected
-# So please do not use this script if you don't want to automatically share clipboard with the remote system
-# This is probably a bug on xtigervncviewer
-VIEWER_OPTS="-AcceptClipboard=off -SendClipboard=off -SetPrimary=off -SendPrimary=off"
-
-function usage {
-  echo "usage: $BASENAME <server> [localport] [remoteport]"
-  cat <<EOF
-
-setup instructions
-==================
-
-* in the remote:
-
-  sudo apt install tigervnc-standalone-server # install in the remote server
-  vncpasswd                                   # generate a ~/.vnc/passwd in the remote server
-
-* in the local box:
-
-  scp <server>:~/.vnc/passwd ~/.vnc/<server>.passwd # copy the secret
-  $BASENAME <server>                                      # use our magic script to do everything else
-
-EOF
-
-  exit 1
-}
-
-# Usage
-if [ "$1" == "--help" ]; then
-  usage
-fi
-
-# Check
-if [ -z "$SERVER" ]; then
-  if [ -h "$HOME/.vnc/default.passwd" ]; then
-    SERVER="$(basename `readlink $HOME/.vnc/default.passwd` .passwd)"
-  else
-    usage
-  fi
-fi
-
-# Check if vncserver is running in the remote server and start otherwise
-ssh $SERVER <<EOF
-  HOSTNAME="\$(cat /etc/hostname)"
-
-  if [ -e "\$HOME/.vnc/\$HOSTNAME:1.pid" ]; then
-    PID="\$(cat \$HOME/.vnc/\$HOSTNAME:1.pid)"
-
-    if ! ps \$PID &> /dev/null; then
-      /usr/bin/vncserver -alwaysshared -dpi 96 -localhost :1
-    fi
-  else
-    /usr/bin/vncserver -alwaysshared -dpi 96 -localhost :1
-  fi
-EOF
-
-# See http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/
-# Optional SSH compression
-#ssh -C -c blowfish -f -L 5901:127.0.0.1:5901 $SERVER sleep 10
-ssh -f -L $LOCALPORT:127.0.0.1:$REMOTEPORT $SERVER sleep 10
-
-# Run VNC client
-# Copy $SERVER:~/.vnc/passwd into $HOME/.vnc/$SERVER.passwd for passwordless login
-if [ -e "$HOME/.vnc/$SERVER.passwd" ]; then
-  vncviewer $VIEWER_OPTS -passwd $HOME/.vnc/$SERVER.passwd localhost:$LOCALPORT
-else
-  vncviewer $VIEWER_OPTS localhost:$LOCALPORT
-fi