Skip to content

Instantly share code, notes, and snippets.

@scottames
scottames / VictorOps_Alert.ps1
Last active June 11, 2021 16:29
Microsoft System Center Operations Manager (SCOM) - VictorOps Alerting
<#
.SYNOPSIS
VictorOps Alerting from Microsoft System Center Operations Manager (SCOM) through PowerShell
Call this script from SCOM's command notification channel - be sure to update the API key (parameter #2). See Example for usage.
.DESCRIPTION
Post alerts to VictorOps from Microsoft System Center Operations Manager (SCOM) through PowerShell
.EXAMPLE
FULL PATH OF THE COMMAND FILE: C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
COMMAND LINE PARAMETERS: "C:\scripts\VO_Send-Alert_Test.ps1" '"$Data[Default='Not Present']/Context/DataItem/AlertId$"' '"$RoutingKey"' '"api-key"'
# !Change $RoutingKey to the routing key you would like to pass in or remove it alltogether to default to 'everyone'
@scottames
scottames / manual-splunkforwarder-install.sh
Last active January 31, 2024 01:03
Remote install splunk forwarder
#!/bin/bash
# server to install / configure splunkforwarder on (required)
SERVER=$1
# username to ssh with, default to current user (optional)
USERNAME=${2:-"$(id -u -n)"}
#NOTE: change the specifics of the function to match your environment, i.e. anything wrapped in <>
function install-splunk-forwarder () {
# Fix npm brew installation
```
brew update
brew uninstall node
brew install node
sudo brew postinstall node # brew error message provided this recommendation; only worked with sudo
```
to test that npm is working (tho appears to build an index, which not everyone may want):
@scottames
scottames / Get-PWDSet.ps1
Last active August 29, 2015 14:18
Get AD Password Expiration information
### Get-PWDSet - Get password change and expiration information for given user
function Get-PWDSet{
param([parameter(Mandatory=$true,Valuefrompipeline=$true)][string]$user)
$use = get-aduser $user -properties passwordlastset,passwordneverexpires
if($use.passwordneverexpires -eq $true){
write-host $user "last set their password on " $use.passwordlastset " this account has a non-expiring password" -foregroundcolor yellow
$d1 = $use.passwordlastset
@scottames
scottames / puppet-bootstrap-mac_os_x.sh
Last active August 29, 2015 14:22
This bootstraps Puppet on Mac OS X 10.7+
#!/usr/bin/env bash
#
# This bootstraps Puppet on Mac OS X 10.7+
# - adopted from: https://github.com/hashicorp/puppet-bootstrap/blob/master/mac_os_x.sh
#
# Optional environmental variables:
# - FACTER_PACKAGE_URL: The URL to the Facter package to install.
# - PUPPET_PACKAGE_URL: The URL to the Puppet package to install.
# - HIERA_PACKAGE_URL: The URL to the Hiera package to install.
#
@scottames
scottames / MaxScale+Pacemaker.on.CentOS.7.md
Last active August 5, 2020 12:02
MaxScale & Pacemaker on CentOS 7

MaxScale & Pacemaker on CentOS 7

Install packages on both nodes

sudo yum install corosync pcs pacemaker maxscale

Set the password for the hacluster user [both nodes]

@scottames
scottames / how_to_install_tmux_on_centos
Last active December 11, 2015 06:48 — forked from ekiara/how_to_install_tmux_on_centos
HOW TO: Install tmux on Centos release 6.5
## Install tmux on Centos release 6.x
### http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff
#
LIBEVENT_URL="https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz"
TMUX_URL="https://github.com/tmux/tmux/archive/2.1.tar.gz"
## MAKE SURE YOU HAVE BUILD TOOLS/COMPILERS TO BUILD STUFF FROM SOURCES
yum -y groupinstall "Development Tools"
## INSTALL NCURSES DEVEL
@scottames
scottames / s3ql_install-centos7.sh
Created March 16, 2016 23:05
s3ql - centos 7 install
#!/usr/bin/env bash
#
## Install s3ql on centos 7 machine
### https://bitbucket.org/nikratio/s3ql/
# yum packages
sudo yum install -y epel-release
sudo yum install -y \
bzip2 \
fuse \
fuse-devel \
@scottames
scottames / get_some_emojis.rb
Last active December 18, 2016 00:59
Get Some Emojis
# -*- mode: ruby -*-
# vi: set ft=ruby :
## download emojis
## - supports emojipacks (https://github.com/lambtron/emojipacks/tree/master/packs)
## usage
## ruby get_some_emojis.rb emojipack.yaml
## download all emojis in emojipack.yaml to emojipack/
## (creates a new folder if one doesn't exist)
require 'yaml'
require 'net/http'
### Keybase proof
I hereby claim:
* I am scottames on github.
* I am scottames (https://keybase.io/scottames) on keybase.
* I have a public key ASCxFxvHABJ6sOR-W1uJBgfJ5BXWdIikUfyLqKwsA8w5Zgo
To claim this, I am signing this object: