Skip to content

Instantly share code, notes, and snippets.

View nickadam's full-sized avatar

Nick Vissari nickadam

View GitHub Profile
@nickadam
nickadam / export-api-info.sh
Created April 4, 2015 17:41
Export API info from .net assemblies
#!/usr/bin/env bash
appDir=application_dir;
appDirMetadata=application_dir_metadata;
find appDir | grep \.dll$ | while read file;
do
#The target folder where the dll's xml will go
folder="$(echo "$file" | sed 's/\/[^\/]\+$//' | sed 's/^$appDir/$appDirMetadata/')";
mkdir -p "$folder";
@nickadam
nickadam / ubuntu-docker_failover_pair_1_base_packages.sh
Created January 27, 2016 14:12
Ubuntu-Docker Failover Pair 1 Base Packages
#!/usr/bin/env bash
# Install openmanage
echo 'deb http://linux.dell.com/repo/community/deb/latest /' | tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list
gpg --keyserver pool.sks-keyservers.net --recv-key 1285491434D8786F
gpg -a --export 1285491434D8786F | apt-key add -
apt-get update
apt-get install -y srvadmin-all
# Install docker
@nickadam
nickadam / ubuntu-docker_failover_pair_2_configure_ad.sh
Created January 27, 2016 15:21
Ubuntu-Docker Failover Pair 2 Configure AD
#!/usr/bin/env bash
###########################################################
#
# This script will install and configure samba and
# windbind and join the system to the hcpss.org AD
# domain. The configuration has been tested on Ubuntu
# 14.04 and is designed to work exclusively with SSH.
#
# nvissari@hcpss.org
###########################################################
@nickadam
nickadam / btrfs-snapshot
Created January 27, 2016 15:29
BTRFS Snapshot
#!/bin/bash
# Parse arguments:
SOURCE=$1
TARGET=$2
SNAP=$3
COUNT=$4
QUIET=$5
# Function to display usage:
@nickadam
nickadam / drbd-autopromote
Created January 27, 2016 15:45
DRBD Autopromote
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "Please specify resource to promote."
echo " drbd-autopromote r0"
exit 1
fi
resource="$1"
mountpoint="/mnt/btrfs"
@nickadam
nickadam / drbd-autodemote
Created January 27, 2016 15:48
DRBD Autodemote
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "Please specify a resource"
echo " drbd-autodemote r0"
exit 1
fi
resource="$1"
@nickadam
nickadam / failover_container_install
Created January 27, 2016 15:54
Failover Container Install
#!/usr/bin/env bash
# no prompts
export DEBIAN_FRONTEND=noninteractive
# fix https on apt-get
apt-get install -y apt-transport-https software-properties-common
# Set locale and timezone
@nickadam
nickadam / docker-restart-failover-container
Created February 1, 2016 18:03
Docker Restart Failover Container
#!/usr/bin/env bash
# Usage
if [ -z "$2" ] || [ "$1" == "--help" ]
then
echo "Please specify a container and pipework IP string"
echo " docker-restart-failover-container server-b-fo 10.0.0.11/16@10.0.0.1"
exit
fi
@nickadam
nickadam / failover
Created February 1, 2016 18:18
Failover
#!/usr/bin/env bash
# Usage
if [ -z "$4" ] || [ "$1" == "--help" ]
then
echo "Please specify host (the system going down), failover host (where the failover container"
echo "lives), the failover container, and the drbd resource"
echo " failover server-b server-a server-b-fo r1"
exit
fi
@nickadam
nickadam / failback
Created February 1, 2016 18:24
Failback
#!/usr/bin/env bash
# Usage
if [ -z "$4" ] || [ "$1" == "--help" ]
then
echo "Please specify host (the system coming back), failover host (where the failover container"
echo "lives), the failover container, and the drbd resource"
echo " failover server-b server-a server-b-fo r1"
exit
fi