Skip to content

Instantly share code, notes, and snippets.

View nmische's full-sized avatar

Nathan Mische nmische

  • Philadelphia, PA
  • 19:24 (UTC -04:00)
View GitHub Profile
@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 / 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
# 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 / Cheffile
Last active December 12, 2015 02:59
Shibboleth IdP Vagrant Setup
site 'http://community.opscode.com/api/v1'
cookbook 'apt'
cookbook 'rng-tools'
cookbook 'java'
cookbook 'tomcat'
cookbook 'shibboleth-idp',
:git => 'https://github.com/wharton/chef-shibboleth-idp.git'
cookbook 'simple_iptables',
:git => 'https://github.com/nmische/cookbook-simple-iptables.git',
:ref => 'nat'
coldfusion10_config "set_colfire_debugging" do
action :bulk_set
config ( {
"debugging" => {
"debugProperty" => [
{"propertyName" => "enableDebug", "propertyValue" => true }
]
}
} )
end
@nmische
nmische / default.rb
Created March 7, 2013 19:47
Tests for simple_iptables
# Reject packets other than those explicitly allowed
simple_iptables_policy "INPUT" do
policy "DROP"
end
# The following rules define a "system" chain; chains
# are used as a convenient way of grouping rules together,
# for logical organization.
# Allow all traffic on the loopback device
@nmische
nmische / rename_tag.sh
Created March 14, 2013 17:53
One liner to clean up bad cookbook tags
git tag -l | while read line; do if [[ $line == v* ]]; then git tag ${line:1:5} $line && git tag -d $line && git push origin :refs/tags/$line; fi done
@nmische
nmische / cfjedis.cfc
Last active December 15, 2015 07:38
Jedis Wrapper
<cfcomponent name="cfjedis" displayname="Jedis" hint="This CFC handles communication with Redis">
<cffunction name="init" access="public" returntype="Any" output="no">
<cfargument name="serverName" type="string" required="true" />
<cfargument name="port" type="numeric" required="true" />
<cfset variables.pool = createObject("java","redis.clients.jedis.JedisPool").init(JavaCast("string",arguments.serverName), JavaCast("integer",arguments.port)) />
<cfreturn this>
</cffunction>
<cffunction name="getResource" access="private" returntype="Any" output="no">
@nmische
nmische / wsconfig
Created April 8, 2013 01:25
Output from ColdFusion 10 wsconfig -help
Usage:
To use GUI:
java -jar wsconfig.jar
To use property file to specifiy options:
java -jar wsconfig.jar -f <property-file-path>
To use command line to specify options:
java -jar wsconfig.jar [options]
Options
To install web server connector:
@nmische
nmische / jira_msg_filter.sh
Created April 22, 2013 16:05
Update git history for JIRA
# CM is the project key
git filter-branch --msg-filter 'sed "s/#\([0-9]*\)/#\1 [CM-\1]/g"'