Skip to content

Instantly share code, notes, and snippets.

View nmische's full-sized avatar

Nathan Mische nmische

  • Philadelphia, PA
  • 03:41 (UTC -05:00)
View GitHub Profile
@nmische
nmische / Example
Last active September 25, 2015 06:58
Simple time based limiter
<!--- set up app --->
<cfapplication name="ratelimit"/>
<cfif not StructKeyExists(application,"limiter") or StructKeyExists(url,"reset")>
<cfset application.limiter = CreateObject("component","TimeBasedRateLimiter")/>
</cfif>
<!--- check our limiter --->
<cfif application.limiter.requestsRemaining() gt 0>
<cfset application.limiter.push() />
<p>Request was successful.</p>
@nmische
nmische / FlashPolicyFileHandler
Created November 12, 2011 00:22
A HttpHandler for Flash policy files
package org.riaforge.websocketgateway;
import java.nio.charset.Charset;
import org.webbitserver.HttpControl;
import org.webbitserver.HttpHandler;
import org.webbitserver.HttpRequest;
import org.webbitserver.HttpResponse;
public class FlashPolicyFileHandler implements HttpHandler {
@nmische
nmische / Vagrantfile
Created February 29, 2012 19:21
Firewall setup for coldfusion9 cookbook
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "chef/cookbooks"
chef.roles_path = "chef/roles"
chef.add_role "cfserver"
chef.json = {
"nfs" => {
"exports" => [
"/opt/coldfusion9 *(rw,insecure,all_squash,anonuid=65534,anongid=2)"
]
@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.
@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 / 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 / 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 / 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 / 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 / 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