Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
jamiejackson / context.xml.diff
Created November 6, 2015 20:56
Tomcat 8: Allow Symlinks and Disable Jar Scanning
--- context.xml.20151105_160437.bak 2015-07-08 14:56:35.000000000 -0500
+++ context.xml 2015-11-05 17:59:41.063050250 -0600
@@ -17,6 +17,7 @@
-->
<!-- The contents of this file will be loaded for each web application -->
<Context useHttpOnly="true">
+ <Resources allowLinking="true" />
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
@jamiejackson
jamiejackson / CommentedTreeBuilder.py
Created November 5, 2015 15:24
Preserve Comments During XML Parsing in Python 2.7+
#!/usr/bin/env python
from xml.etree import ElementTree
class CommentedTreeBuilder ( ElementTree.XMLTreeBuilder ):
def __init__ ( self, html = 0, target = None ):
ElementTree.XMLTreeBuilder.__init__( self, html, target )
self._parser.CommentHandler = self.handle_comment
def handle_comment ( self, data ):
@jamiejackson
jamiejackson / curl_upload.sh
Last active September 29, 2015 17:36
Throughput Difference in Form File Upload vs. cURL Upload
# 1.75 MB/s
curl 'https://mysite.com/test/testUpload.cfm?which=fileUploadAll' -F 'filedata=@/cygdrive/e/garbage/GIS Toolkit 2014/GIS Toolkit 2014/CoC_GIS_State_Tool_IN_2014.zip' --compressed --insecure --limit-rate 1000M
@jamiejackson
jamiejackson / upgrade_mod_cfml.sh
Last active September 25, 2015 14:33
Upgrade from Perl-Based ModCFML in Lucee on Ubuntu
#!/usr/bin/env bash
# install module compiling prerequisite
sudo apt-get install apache2-threaded-dev
# get/compile/place new module
cd /tmp
wget -O mod_cfml-master.zip https://github.com/utdream/mod_cfml/archive/master.zip
unzip mod_cfml-master.zip
cd ./mod_cfml-master/C
<!--
~ Copyright (c) 2014-2015 Enrico M. Crisostomo
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ * Redistributions of source code must retain the above copyright notice, this
~ list of conditions and the following disclaimer.
~
@jamiejackson
jamiejackson / a_test.cfm
Created May 15, 2015 15:53
Lucee 4.5.1.000 Problem with S3 Directory Listing: "exists, but isn't a directory"
<cfscript>
base = "s3://MYKEY:MYSKEY@/files-stage.mysite.com";
writeDump(
var = directoryList( base ),
label = "directoryList(#base#)",
output = "console"
);
dir = base & "/reports";
@jamiejackson
jamiejackson / DynamicFunctionsTest.cfc
Last active August 29, 2015 14:20
Attempting to Create a Test Decorator for Running Dynamically-Generated Functions
/**
* @mxunit:decorators DynamicFunctionsTestDecorator
**/
component extends="mxunit.framework.TestCase" {
init();
private function init() {
dynamicFunctions = {};
12:24:06.164 EVENT Checking Resource aliases
12:24:06.196 EVENT Starting Jetty/4.2.19
===================================================================
SERVER CONTEXT
-------------------------------------------------------------------
- config:E:\Users\15037\git\lucee\lucee-java\lucee-debug\.\server\context
- loader-version:4.3
===================================================================
Sat Feb 28 12:24:06 EST 2015-570 using JRE Date Library
@jamiejackson
jamiejackson / Vagrantfile
Created February 24, 2015 20:54
Attempt at Installing RVM in Vagrant
$script = <<SCRIPT
su -c "source #{vm_script_dir}/utils/rvm_install2.sh \
--provisioned-dir=#{vm_provisioned_dir}
" vagrant
SCRIPT
# Install RVM
config.vm.provision "shell", inline: $script
@jamiejackson
jamiejackson / Vagrantfile
Created October 31, 2014 17:46
Vagrant Hostname Problems in Docker Provider
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
unless Vagrant.has_plugin?("vagrant-triggers")