Skip to content

Instantly share code, notes, and snippets.

View mo6020's full-sized avatar
🐐
Shaving all of the yaks.

Ed Morgan mo6020

🐐
Shaving all of the yaks.
View GitHub Profile
@mo6020
mo6020 / gist:7889813
Last active December 30, 2015 21:49
Quick bash script to find and move any files older than 2 years into an archive folder...
# Ed Morgan [ed.morgan@ansgroup.co.uk]
# v 0.1 - DIRTY HACKS
FROMDIR="/Volumes/HITACHI"
TODIR="/Volumes/HITACHI/archive"
tmp="~/movelist.$$"
cd "$FROMDIR"
find . -depth -mtime +730 -printf "%Y %p\n" >$tmp
sed 's/^. //' < $tmp | cpio --quiet -pdm "$TODIR"
@mo6020
mo6020 / vmware_cfg_check.ps1
Last active December 23, 2015 14:29
Check VMware settings across hosts in a cluster
######################################################################################################################################
#VMware config checking script, originally written by http://www.peetersonline.nl/2009/01/check-vmware-configuration-with-powershell/
#Updates by CH September 2012.
#Updates by Ed Morgan [ed.morgan@ansgroup.co.uk] - September 2013
#
#Use this script to check VMware deployments that all datastores and all networking is the same across all hosts in a cluster.
#Uses VMware PowerCLI to use which is available on VMware website.
######################################################################################################################################
#Change this variable to the output location.
$outputFile = 'C:\output.html'
@mo6020
mo6020 / halt_on_power_fail.ps1
Created September 21, 2013 10:56
Shuts down controllers when UPS failure detected..
<#
.DESCRIPTION
To be run from UPS monitoring server via Windows NT triggers
.EXAMPLE
.\halt_on_power_fail.ps1
.DATE
08-08-2013
.VERSION
0.1
.AUTHOR
@mo6020
mo6020 / check_lun_clone.vbs
Created September 20, 2011 14:32
Simple script to check SAN vFiler for existence of LUN clones.
'#----- Check_LUN_Clone.vbs -----
'#----- -----
'# author: Ed Morgan [ed.morgan@hp.com] -----
'# version: 0.1 - 19/09/2011 -----
'# changelog: 0.1 - First Draft -----
'# -----
'# requires: ontapi.exe & vLAN access to SAN -----
'#-----------------------------------------------------------
'# Next functionality - check for locked snapshots
@mo6020
mo6020 / clonebase_status.sh
Created August 15, 2011 10:51
Sanitized NetApp scripts pulled from Will Foster on G+
#!/bin/bash
# finds clonebases without flexclone dependencies
# replace orahome/appltop with what makes sense for you
FILER="YOURFILER"
for vol in $(ssh root@$FILER df -h | grep clonebase | egrep -v '(snapshot|orahome|appltop)' | awk -F'/' '{print $3}'); do
ssh root@YOURFILER vol status $vol | \
awk '
/^clonebase/ {printf "%s: ",$1}
/Volume has clones/ {gsub(/,/, ""); for(i=4;i<=NF;i++){printf "%s ", $i}}