Skip to content

Instantly share code, notes, and snippets.

View rljohnsn's full-sized avatar
🙂

Lance Johnson rljohnsn

🙂
View GitHub Profile
param (
[Parameter(Mandatory=$true)]
[String[]]$OUPaths, #Comma separated list of OUPaths to which permissions should be applied
[Parameter(Mandatory=$true)]
[String]$UserName, #The name of the user to which the ACL should be applied
[String]$LogDir = "C:\log\",
[String]$Log = "AddOrganizationalUnitPermissions.XML"
)
function Init-Logging([string]$logDirectory,[string]$logFile,$scriptName) {
@rljohnsn
rljohnsn / opennms-hipchat-notifications.xml
Last active January 17, 2016 20:55
OpenNMS configuration to post messages to Hipchat
<!-- Notification configuration to map a high thresh hold exceeded event to a hipchat message -->
<!-- OPENNMS_HOME/etc/notifications.xml -->
<!-- Rule can be as specific as desired. Filter using categories or service checks. -->
<!-- I'm using a category that matches the Hipchat Room name and a category -->
<!-- indicating production (EnvironmentFilter) -->
<notification name="Hipchat - High Threshold Exceeded room specific filter" status="on" writeable="yes">
<uei>uei.opennms.org/threshold/highThresholdExceeded</uei>
<description>A monitored device has reached a high threshold</description>
<rule>(IPADDR != '0.0.0.0') &amp; (catincRoomfilter) &amp; (isServiceName) &amp; (catincEnvironmentFilter)</rule>
# Build Passes
curl -d "room_id=ourRoom&from=BuildBot&message=Build+Status:+Passing&color=green" https://api.hipchat.com/v1/rooms/message?auth_token=AUTH_TOKEN_HERE&format=json
# Build Fails
curl -d "room_id=ourRoom&from=BuildBot&message=Build+Status:+Failing&color=red&notify=1" https://api.hipchat.com/v1/rooms/message?auth_token=AUTH_TOKEN_HERE&format=json
#cloud-config
coreos:
update:
reboot-strategy: etcd-lock
etcd:
name: comp01
addr: 10.x.214.y:4001
peer-addr: 10.x.214.y:7001
fleet:
metadata: name=comp01,etcd_init=leader
@rljohnsn
rljohnsn / Apache Tomcat 8 Start stop script init.d script
Created November 3, 2015 19:58 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under
{
"filesystem2": {
"by_device": {
"/dev/xvda1": {
"kb_size": "8123812",
"kb_used": "2025396",
"kb_available": "5998168",
"percent_used": "26%",
"total_inodes": "524288",
"inodes_used": "54451",
================================================================================
Recipe Compile Error in /tmp/kitchen/cookbooks/os-hardening/recipes/default.rb
================================================================================
Chef::Exceptions::ValidationFailed
----------------------------------
Property package_name must be one of: String, Array! You passed {"version"=>"1.0.5", "release"=>"8.el6"}.
Cookbook Trace:
---------------
[root@dougu tmp]# rm -f ./testfile && dd if=/dev/zero of=./testfile bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 10.4005 s, 103 MB/s
[root@dougu tmp]# rm -f /tmp/testfile && dd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 8.47671 s, 127 MB/s
/tmp/kitchen/cache/cookbooks/eght_monit/providers/README.md:8: unterminated regexp meets end of file
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/mixin/from_file.rb:42:in `class_eval'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/mixin/from_file.rb:42:in `class_from_file'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/provider/lwrp_base.rb:64:in `build_from_file'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_compiler.rb:244:in `load_lwrp_provider'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_compiler.rb:235:in `block in load_lwrps_from_cookbook'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_compiler.rb:234:in `each'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_compiler.rb:234:in `load_lwrps_from_cookbook'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_comp
@rljohnsn
rljohnsn / .gitconfig
Last active March 31, 2018 21:38 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Lance Johnson
email = lance.johnsn@gmail.com
username = rljohnsn
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls