Skip to content

Instantly share code, notes, and snippets.

@cabal95
cabal95 / diskerror.rb
Created March 30, 2014 19:56
Sample Facter plugin for sal that checks for disk I/O errors in the system.log and reports them.
require 'facter'
begin
errors = 0
File.open("/var/log/system.log").each_line do |line|
begin
if ( line.chomp =~ /disk.*: I\/O error/ )
errors = 1
break
end
@cabal95
cabal95 / rsnapshot-postflight.sh
Created July 26, 2014 23:51
Create user-friendly symlinks for rsnapshot names
#!/bin/sh
#
DIR="/mnt/servers/snapshots"
#
# Remove all existing symlinks.
#
for f in "$DIR"/*; do
if [ -L "$f" ]; then rm -f "$f"; fi
@cabal95
cabal95 / pro_tools_12_munki.sh
Last active December 29, 2016 21:42 — forked from rmanly/pro_tools_11_munki.sh
Updated script to work with Pro Tools 12
#!/bin/bash
# looks like they changed they name again
# https://groups.google.com/forum/#!topic/munki-dev/w38roCmEgH0
# I have 11.2.1.203 and it is now just 'shoe'
# Changed once again, 12.0.0.456 and it is 'shoetoolv120'
# Copy the com.avid.bsd.shoe Helper Tool
PHT_SHOE="/Library/PrivilegedHelperTools/com.avid.bsd.shoetoolv120"
@cabal95
cabal95 / RockIt-SDK-Upgrade.md
Last active March 24, 2017 21:45
Steps I had to take to upgrade RockIt SDK from 5.0 to 6.2
  1. Take a snapshot of your dev environment. I had to roll back a couple times even with following these steps.
  2. Update all projects in solution to reference DLLs inside the RockWeb folder rather than using NuGet package references.
    a. This means remove all the non-system (i.e. referencing C:\Program Files...) DLLs and re-add them to point at the RockWeb\bin*.dll version of the files.
    b. You will also need to remove any packages from the packages.config of the project(s).
  3. Update all projects in solution that reference RockWeb DLLs to be set to Copy Local = False
  4. Clean Solution from Build Menu
    a. Set Configuration to Debug and then Clean Solution.
    b. Set Configuration to Release and then Clean Solution.
    c. Set Configuration back to Debug.
#!/bin/bash
#
#
# COMPUTER_NAME_MAXLEN - Maximum length the computer name can be. If binding
# to Active Directory this should be 15.
#
# AD_BIND_TO_DOMAIN - If not empty, bind to the given AD domain.
#
# AD_MOBILE - Enable mobile user accounts ('enable' or 'disable').
@cabal95
cabal95 / SetupLinks.ps1
Last active March 26, 2018 20:48
PoweShell script to setup Hard Links for RockRMS Plugin
@cabal95
cabal95 / update_memberUid_to_member
Last active June 9, 2018 22:35
Give Apple Open Directory the member and memberOf attributes.
#!/bin/sh
#
LDAPURI="ldapi://%2Fvar%2Frun%2Fldapi"
BASEDN="dc=hdcnet,dc=org"
GROUPDN="cn=groups,$BASEDN"
USERDN="cn=users,$BASEDN"
#
@cabal95
cabal95 / PreBuildRockWeb.ps1
Last active October 5, 2023 03:27
A set of scripts to help build Rock. #Rock
class Project {
[Guid]$Id
[string]$Name
[Guid]$Type
[string]$ProjectFile
[Guid[]]$References
}
Function Get-NuGet-References {
param (
@cabal95
cabal95 / vm-backup.sh
Created July 25, 2015 17:53
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1