Skip to content

Instantly share code, notes, and snippets.

@flakshack
flakshack / snapshot.vbs
Created July 19, 2017 15:41
NetApp SnapDrive Snapshot Management Script
Option Explicit
'-----------------------------------------------------------------
' Procedure: Snapshot.vbs
' Author: Scott Vintinner
' Last Edit: 07/19/2017
' Purpose: This script will manage NetApp snapshots for the
' specified drive(s) using SnapDrive.
'-----------------------------------------------------------------
@flakshack
flakshack / DiskUsedGB.vbs
Created January 11, 2017 16:01
SCOM DiskUsedGB Collection Script
'On Error Resume Next
CONST GB = 1073741824
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oArgs = WScript.Arguments
drive = oArgs(0)
strComputer = "."
Set oWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
@flakshack
flakshack / gist:652b38ba0bb4bd6404cc
Created January 19, 2015 17:17
Script to edit HTML files to remove hyperlinks from a specific domain
from BeautifulSoup import BeautifulSoup
import re
import glob
# Grab a list of all HTML files
path = "/some/path/tofiles/*.html"
for file_name in glob.glob(path):
print(file_name)
# Open the file and read the contents into a string
with open (file_name, "r") as file_handle:
@flakshack
flakshack / WUA_SearchDownloadInstall.vbs
Created July 16, 2014 15:50
Windows Update Randomizer
'#############################################################################
'# Procedure: WUA_SearchDownloadInstall.vbs
'# Author: Microsoft/Scott Vintinner
'# Last Edit: 07/14/2014
'# Purpose: This script will trigger a Windows Update on this computer
'# Notes: Must be run as administrator
'# Source: http://msdn.microsoft.com/en-us/library/aa387102%28VS.85%29.aspx
'#############################################################################
Option Explicit
Dim scriptShell, fs
@flakshack
flakshack / gist:3332724
Last active October 8, 2015 12:37
Outlook 2010 Style Reply Headers for quotefixformac (https://code.google.com/p/quotefixformac/)
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p style='margin:0in;margin-bottom:.0001pt;'><span style='font-family: Tahoma, sans-serif; font-size:10.0pt'><b>From:</b> ${message.from}
<b>Date:</b> ${message.sent.format('EEEE, MMM dd, yyyy HH:mm a')}
<b>To:</b> ${message.recipients.to}
{% if message.recipients.cc %}
<b>Cc:</b> ${message.recipients.cc}
{% end %}
<b>Subject:</b> ${message.subject}</span></p></div></div>
@flakshack
flakshack / Watch-MoveRequests.ps1
Created May 1, 2011 02:02
Powershell script to watch Exchange 2010 mailbox moves, write error logs to file, and email users when done.
#############################################################################
# Procedure: Watch-MoveRequests.PS1
# Author: Scott Vintinner
# Last Edit: 4/30/2011
# Purpose: This script will monitor the mailbox move process. Moves should
# be added to the queue using the following command:
#
# new-MoveRequest -Identity $identity -BadItemLimit 5 -Suspend:$true
#
# Alternately you could use my Start-SuspendedMoveRequests.PS1 script
@flakshack
flakshack / Start-SuspendedMoveRequests.ps1
Created May 1, 2011 01:55
Powershell script to start Exchange 2010 mailbox moves in suspended mode and email user.
#############################################################################
# Procedure: Start-SuspendedMoveRequests.PS1
# Author: Scott Vintinner
# Last Edit: 4/30/2011
# Purpose: This script will start a move request in suspended mode and
# email the selected user.
#
# PS Notes Computers must have Powershell scripts enabled by an admin:
# set-executionpolicy remotesigned
##
@flakshack
flakshack / pasteinto-.profile-.sh
Created April 25, 2011 13:33
.Profile Entry to stop or start Riverbed SteelHead Mobile processes on Mac OS X
stop-riverbed () {
sudo launchctl unload /Library/LaunchDaemons/com.riverbed.monitord.plist
sudo "/Library/Application Support/Riverbed/Steelhead Mobile/boot.sh" --stop
launchctl unload -S Aqua /Library/LaunchAgents/com.riverbed.useragentd.plist
ps x | awk '/[S]teelheadMobileMenu/ {print $1}' | xargs kill -3
}
start-riverbed () {
sudo launchctl load /Library/LaunchDaemons/com.riverbed.monitord.plist
sudo "/Library/Application Support/Riverbed/Steelhead Mobile/boot.sh" --start
launchctl load -S Aqua /Library/LaunchAgents/com.riverbed.useragentd.plist
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then