Skip to content

Instantly share code, notes, and snippets.

/** print stack trace */
Thread = createObject("java", "java.lang.Thread");
Arrays = createObject("java", "java.util.Arrays");
systemOutput(Arrays.toString(Thread.currentThread().getStackTrace()), true, true);
systemOutput(callStackGet("text"), true, true);
<cfscript>
algorithm = "PBKDF2withHmacSha512";
passphrase = "The passphrase is passphrase";
// 16 random characters
salt = left(replace(createUUID(), "-", "", "all"), 16);
// approx. 300ms at the time of testing
component {
this.algorithms = {
"HS256" : "HMACSHA256"
};
/**
* initializes the object with the secret that is used to sign the JWT
*/
/** Because `eval(q)` is too easy... Based on the post
https://www.linkedin.com/feed/update/urn:li:activity:6531594043288358912 */
/** Token types */
var TYPES = {
EOF : -1
,UNKNOWN : 0
,NUM : 1
,OP : 2
};
/** Create test table */
drop table if exists dupes;
create temporary table dupes(word text, num int, id int);
/** Add test data with duplicates */
insert into dupes(word, num, id)
values ('aaa', 100, 1)
,('bbb', 200, 2)
,('ccc', 300, 3)
,('bbb', 400, 4)
## BUILD:
#
# docker build [--build-arg LUCEE_VERSION=5.2.9.37-SNAPSHOT] -t isapir/lucee-52937 .
# docker push isapir/lucee-52937
## RUN:
#
# groupadd -g 8080 --system lucee
# useradd --system -u 8080 lucee -g lucee
# export WEBROOT=/webroot
@isapir
isapir / startup.bat
Last active August 8, 2024 22:12
Lucee Configuration Files for Tomcat
@echo off
:: set the path to Tomcat binaries
:: set CATALINA_HOME=C:\Apps\tomcat\apache-tomcat-9.0.11
:: set the path to the instance config, i.e. current directory if this file is in the CATALINA_BASE directory
set CATALINA_BASE=%CD%
:: set title to the last part of the current directory
for %%f in (%CD%) do set CUR_DIR=%%~nxf
@isapir
isapir / [email protected]
Created March 11, 2018 22:52
Tomcat template unit file for systemd
# /etc/systemd/system/[email protected]
[Unit]
Description=Tomcat %I
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
# Tomcat config files
Environment=CATALINA_BASE=/etc/tomcat/%i
@isapir
isapir / dependencies.txt
Last active June 10, 2017 05:05
Tomcat Project settings for IntelliJ-IDEA
../tomcat-idea/lib
ant-1.9.9.jar
ecj-4.6.3.jar
geronimo-spec-jaxrpc-1.1-rc4.jar
wsdl4j-1.6.2.jar
../tomcat-idea/lib-test
easymock-3.4.jar
run `ant deploy` to build the project to the "output/build" directory, which will then be used as the Working Directory at run configurations.
## URL_BASE is found by inspecting the link at http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html
DIR_DOWNLOAD=~/Downloads
DIR_DEST=/usr/java
URL_BASE=http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441
## download server-jre
JAVA_ARCHIVE=server-jre-8u121-linux-x64.tar.gz
## to download JDK instead, use: