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 / 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}}
@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 / 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 / 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 / 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 / vcentre_setup_db.sql
Last active January 3, 2016 11:09
Setup vCentre DB & Schema...
/*
Change DB name, location, and vpxuser password to whatever you wish.
Ed Morgan [ed.morgan@ansgroup.co.uk] - 16/01/2013
*/
use [master]
go
CREATE DATABASE [vCentre_Server] ON PRIMARY
(NAME = N'vCentre_Server', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\vCentre_Server.mdf' , SIZE = 3000KB , FILEGROWTH = 10% )
LOG ON
@mo6020
mo6020 / ucs_serialcollector.ps1
Created April 2, 2014 15:27
Pull UCS serial numbers
##################################################
# Joe Martin
# Cisco Systems, Inc.
# UCS Serial Number Collector v0.8
# 3/10/13
#
# Code provided as-is. No warranty implied or included.
# This code is for example use only and not for production
#
# This script will create an excel file of all UCSM based
#!/usr/bin/env sh
tweetbot_running() {
ps x | grep -v grep | grep Tweetbot > /dev/null
}
clean_tweetbot_cache() {
rm -rf ~/Library/Containers/com.tapbots.TweetbotMac/Data/Library/Caches/com.tapbots.TweetbotMac
}

Keybase proof

I hereby claim:

  • I am mo6020 on github.
  • I am mo6020 (https://keybase.io/mo6020) on keybase.
  • I have a public key whose fingerprint is 8B53 93E5 0A09 0E64 D1F8 E411 A340 FCCC 0982 94C2

To claim this, I am signing this object:

@mo6020
mo6020 / homebrew.sh
Last active November 21, 2015 22:56
#!/usr/bin/env bash
# Ed Morgan [ed@edmorgan.info]
# version 1.2
# 11/09/2015
# Install Hombrew first!
# Make sure we’re using the latest Homebrew
echo "Updating brews..."
brew update