Skip to content

Instantly share code, notes, and snippets.

View wookietreiber's full-sized avatar
🎸

♫ Christian Krause ♫ wookietreiber

🎸
View GitHub Profile
@wookietreiber
wookietreiber / swap-per-process.scala
Last active December 11, 2015 00:59
linux swap per process command line printer based on /proc
#!/bin/sh
exec scala "$0" "$@"
!#
import java.io.{ File, FilenameFilter, FileNotFoundException }
import scala.util.control.Exception._
if (List("-h", "-?", "-help", "--help") exists argv.contains) {
Console.println("""
|Print swap usage per process.
# this gist has been superseded by
# https://github.com/idiv-biodiversity/archive
#!/bin/bash
# ------------------------------------------------------------------------------
# Grid Engine Submit Parameters
# ------------------------------------------------------------------------------
#$ -N extract-split-tar-gz
#$ -S /bin/bash
#$ -pe smp 2-
#$ -l h_rt=120:00:00
@wookietreiber
wookietreiber / keytool-import
Last active December 19, 2015 21:29
Downloads an SSL certificate and imports it into a Java keystore.
#!/bin/bash
KT_HOST=${KT_HOST:-$1}
KT_PORT=${KT_PORT:-${2:-443}}
KT_ALIAS=$KT_HOST:$KT_PORT
KT_STORE=${KT_STORE:-$3}
[[ -z $KT_HOST ]] && {
echo "usage: $(basename $0) host [port] [store]" > /dev/stderr
exit 1
@wookietreiber
wookietreiber / inotify-action.sh
Last active December 30, 2018 11:44
do something when a file is modified, e.g. convert markdown to pdf: $ inotify-action foo.md pandoc -o foo.pdf foo.md
#!/usr/bin/env bash
declare -a watches
while [[ -n $1 && $1 != "--" ]]
do
watches+=("$1")
shift
done
@wookietreiber
wookietreiber / qload.scala
Last active August 10, 2018 12:54
list overloaded and underutilized compute nodes of SGE managed clusters, see full collection: https://github.com/wookietreiber/grid-engine-tools
// this gist has been superseded by
// https://github.com/idiv-biodiversity/grid-engine-tools
@wookietreiber
wookietreiber / qjutil.scala
Last active August 10, 2018 12:55
list jobs incorrectly using their requested slot amount of SGE managed clusters (compares accumulated cputime with runtime * slots), see full collection: https://github.com/wookietreiber/grid-engine-tools
// this gist has been superseded by
// https://github.com/idiv-biodiversity/grid-engine-tools
@wookietreiber
wookietreiber / qmemload.scala
Last active August 10, 2018 12:55
compare and list free memory vs consumable memory of compute nodes of SGE managed clusters, see full collection: https://github.com/wookietreiber/grid-engine-tools
// this gist has been superseded by
// https://github.com/idiv-biodiversity/grid-engine-tools
@wookietreiber
wookietreiber / imap-check.scala
Last active August 29, 2015 13:57
Checks your IMAP folders for new and unread messages.
#!/bin/bash
cd "$(dirname "$0")"
[[ ! -d lib ]] &&
mkdir lib
[[ ! -e lib/java-mail.jar ]] &&
wget -q -O lib/java-mail.jar http://search.maven.org/remotecontent?filepath=com/sun/mail/javax.mail/1.5.1/javax.mail-1.5.1.jar