Skip to content

Instantly share code, notes, and snippets.

View nmische's full-sized avatar

Nathan Mische nmische

  • Philadelphia, PA
  • 04:24 (UTC -05:00)
View GitHub Profile
# This script allows Powershell Session Users to access services remotely
# Get Powershell Session Users SID
$objUser = New-Object System.Security.Principal.NTAccount("Powershell Session Users")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
# Get Current ACL for scmanager
$strOldACL = sc.exe sdshow scmanager | Out-String
# Find the ACL for interactive users
@nmische
nmische / shibbolethidp.rb
Created January 23, 2013 20:16
Getting a value from data bag or node attribute.
class Chef::Recipe::ShibbolethIdP
def self.get_keystore_password(node)
begin
if Chef::Config[:solo]
begin
shibboleth_idp_data_bag = Chef::DataBagItem.load("shibboleth","idp")['local']
keystore_password = shibboleth_idp_data_bag['keystore_password']
rescue
@nmische
nmische / jenkins_copy.bat
Created January 22, 2013 22:00
Jenkins ROBOCOPY
ROBOCOPY %WORKSPACE%\project \\server\share$\project /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30
IF ERRORLEVEL 8 GOTO sub_fail
IF ERRORLEVEL 4 GOTO sub_housekeeping
IF ERRORLEVEL 1 GOTO sub_ok
GOTO :eof
:sub_fail
ECHO Something failed
GOTO :eof
@nmische
nmische / hosts
Created January 7, 2013 20:11
Hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
@nmische
nmische / gist:4454920
Created January 4, 2013 18:51
Chef Output
[2013-01-04T17:13:25+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: ark[mysql-connector-java] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql_connector/providers/j.rb line 21) had an error: Mixlib::ShellOut::ShellCommandFailed: /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/mixlib-shellout-1.1.0/lib/mixlib/shellout.rb:248:in `invalid!': Expected process to exit with [0], but received '2'
---- Begin output of tar -xzf '/tmp/vagrant-chef-1/mysql-connector-java.tar.gz' -C '/usr/share/tomcat6/lib' mysql-connector-java-5.1.21-bin.jar; ----
STDOUT:
STDERR: tar: mysql-connector-java-5.1.21-bin.jar: Not found in archive
tar: Exiting with failure status due to previous errors
---- End output of tar -xzf '/tmp/vagrant-chef-1/mysql-connector-java.tar.gz' -C '/usr/share/tomcat6/lib' mysql-connector-java-5.1.21-bin.jar; ----
Ran tar -xzf '/tmp/vagrant-chef-1/mysql-connector-java.tar.gz' -C '/usr/share/tomcat6/lib' mysql-connector-java-5.1.21-bin.jar; returned 2
@nmische
nmische / debug.conf
Created December 11, 2012 20:00
Logstash Config for IIS Advanced Logging
input {
tcp {
type => "iis_advanced_full"
port => 3333
}
}
filter {
grok {
type => "iis_advanced_full"
@nmische
nmische / default.rb
Created December 4, 2012 20:16
FW1 Recipe
#
# Cookbook Name:: fw1
# Recipe:: default
#
# Copyright 2012, Courtney Wilburn, John Piotrowski
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@nmische
nmische / gist:3060161
Created July 6, 2012 13:31
Mura Chef Cookbook Recipe
#
# Cookbook Name:: mura
# Recipe:: default
#
# Copyright 2012, Nathan Mische
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@nmische
nmische / providers-config.rb
Created June 20, 2012 19:49
ColdFusion Config LWRP
#
# Cookbook Name:: coldfusion902
# Providers:: config
#
# Copyright 2012, Nathan Mische
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@nmische
nmische / irule_select_pool_member.tcl
Created June 7, 2012 16:07
iRule to allow clients to select a pool member based on a parameter set in the HTTP query string.
# irule_select_pool_member
#
# v1.0 - 7 June 2012 - nmische
# Rewritten from v0.2 at: https://devcentral.f5.com/wiki/irules.Select_pool_member_based_on_HTTP_query_string_parameter.ashx
#
# Purpose:
# Allows wharton wired clients to select a pool member based on a parameter set in the HTTP query string.
#
# Notes:
# Only works with pools with up to 9 members. Uses event command to disable all events so may not be safe to use with other iRules.