Skip to content

Instantly share code, notes, and snippets.

View ebirn's full-sized avatar

Erich Birngruber ebirn

View GitHub Profile
@ebirn
ebirn / install_performance.sh
Last active November 21, 2016 13:37
NetApp OnCommand Performance and Unified Manager
#!/bin/sh
echo ""
echo "to uninstall everything: yum erase 'netapp-*' 'ocie-*'i ocf-server"
echo ""
echo " prerequisites"
cat << EOF
ocie-serverbase >= 1.4.0
java-1.8.0-oracle >= 1.8.0.1 OR public JDK should also work?
@ebirn
ebirn / ssh_jumphost_config.txt
Last active July 25, 2018 10:42
ssh jump host forwarding config
#
# see also:
# https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing
# http://blog.scottlowe.org/2015/12/11/using-ssh-multiplexing/
#
# you may want to use connection multiplexing on the jumphost
Host jump-host
Hostname jump-host.example.com
ForwardAgent yes
ControlPath ~/.ssh/cm-%r@%h:%p
@ebirn
ebirn / tmpdir_maker.sh
Last active November 20, 2016 22:11
auto remove directory after SIGNAL or exit
#!/bin/sh
export MEM_ROOT=/dev/shm
export MEM_DIR=$MEM_ROOT/$PBS_JOBID
# create directory per job
mkdir -p $MEM_DIR
# cleanup function
function mem_dir_cleanup {
@ebirn
ebirn / eb2ynab.sh
Created May 31, 2014 13:49
convert EasyBank.at .csv data to YNAB .csv format
#!/bin/sh
EBFILE=$1
echo "Date,Payee,Category,Memo,Outflow,Inflow"
awk 'BEGIN { FS=";"} {
inflow=0
outflow=0
@ebirn
ebirn / runkexec
Last active November 15, 2017 05:20
kexec latest kernel on Centos 6
#!/bin/sh
VERSION=$(ls -t1 /boot/vmlinuz-* | cut -f 1 -d '-' --complement | head -1)
BOOT=/boot
KEXEC=/sbin/kexec
KERNEL=$BOOT/vmlinuz-$VERSION
INITRD=$BOOT/initramfs-$VERSION.img
@ebirn
ebirn / check_snapshot_creation
Created February 13, 2014 13:33
Nagios check for zfs snapshot creation date, checks the age of the most recent snapshot
#!/bin/sh
FSNAME=$1
WARNAGE=$2
CRITAGE=$3
NOW=$(/bin/date +%s)
ZFS="sudo /sbin/zfs"
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
@ebirn
ebirn / check_zfs.php
Created April 30, 2013 13:39
simple nagios check that returns zfs usage by dataset and snapshots (recursively added for children),
<?php
#
# check_zfs: zfs usage check
# Erich Birbngruber <ebirn@outdated.at>
# twitter: @ebirn
#
$opt[1] = "--vertical-label \"Usage\" -b 1024 --title \"ZFS usage host backups\" -l 0 --rigid ";
$def[1] = "DEF:var1=$RRDFILE[1]:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:var2=$RRDFILE[2]:$DS[2]:AVERAGE " ;
$def[1] .= "CDEF:total=var1,var2,+ " ;
@ebirn
ebirn / listgfs2quota.sh
Created March 6, 2013 14:12
list users/groups of gfs2 directory, sort by used space in GB
gfs2_quota -f /home list | awk '{ print $2 " " $8 " GB"}' | sort -k 2.1 -n
@ebirn
ebirn / mountimage.sh
Last active November 20, 2016 22:15
shellcript to mount/unmount VM images containing LVM volumes
#!/bin/sh
NAME=$1
if [ "$NAME" == "" ]; then
echo "usage: $0 <vmname>"
exit 1;
fi
MYSELF=$( hostname -s )