Skip to content

Instantly share code, notes, and snippets.

View mikeggrant-eumetsat's full-sized avatar

Mike Grant mikeggrant-eumetsat

  • EUMETSAT
  • Germany
View GitHub Profile
@mikeggrant-eumetsat
mikeggrant-eumetsat / isilon_recursive_fsa.sh
Last active November 3, 2020 13:01
Script to do a recursive du on an isilon cluster using the FSA reporting
#!/bin/bash
#
# if you have to manage an EMC Isilon cluster and want to use the
# File System Analytics (FSA) tool to do a "du --depth X", you'll quickly
# realise they unbelievably haven't implemented a recursive scan.
# This script does that.
#
# Must be run on the isilon cluster machines with sufficient privileges to
# access the FSA reports
#
@mikeggrant-eumetsat
mikeggrant-eumetsat / redirect_mail_port_for_docker_network.sh
Created December 4, 2018 17:12
This sets up iptables rules to mangle packets from a docker network to the host's mail daemon (locked to localhost) ; used for a rocketchat, but easy to modify
#!/bin/sh
#
# we want a rocketchat in a docker container to be able to access this machine's mailer daemon
# but it only accepts connections on the local interface (127.0.0.1)
# we can't change the mailer config, because that belongs to someone else and they'd be annoyed
# so we forward packets from this machine's docker network interface to localhost
# This script sets up the necessary packet mangling
# if our argument is "delete", then remove rules
if [ "$1" == "delete" ] ; then
@mikeggrant-eumetsat
mikeggrant-eumetsat / mongo-backup.service
Created December 4, 2018 15:32
systemd unit files for backing up the mongo database of a standard rocket.chat docker install
[Unit]
Description=Run a backup-dump of the mongo database in the mongo docker container
Requisite=mongo.service
After=mongo.service
[Service]
Type=oneshot
User=root
# have to escape the %s or systemd replaces them
ExecStart=/bin/docker exec -t mongo bash -c 'mongodump --archive=/data/dump/$(date +%%Y%%m%%d%%H%%M%%S).gz --gzip'