Skip to content

Instantly share code, notes, and snippets.

/** 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 June 8, 2021 15:13
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 / tomcat@.service
Created March 11, 2018 22:52
Tomcat template unit file for systemd
# /etc/systemd/system/tomcat@.service
[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:

nginx

Reverse Proxy Headers:

proxy_set_header    Host                $host;                        ## CGI.HTTP_HOST
proxy_set_header    X-Original-URI      $request_uri;                 ## CGI.X_Original_URI     - URI before rewriting
proxy_set_header    X-Real-IP           $remote_addr;                 ## CGI.X_REAL_IP          - IP address that connected to nginx
proxy_set_header    X-Request-ID        $request_id;                  ## CGI.X_REQUEST_ID       - unique identifier for the request
proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;   ## CGI.REMOTE_ADDR        - via Tomcat RemoteIpFilter
@isapir
isapir / jvmdump.bat
Last active June 2, 2023 06:53
Dump Threads and Heap for a JVM that runs as Service
:: if the service is run in Session 0 then open a console for that session and run it from there
:: e.g. %PsExec% -s -h -d -i 0 cmd.exe
:: set the paths for your environment
set PsExec=C:\Apps\SysInternals\PsExec.exe
set JAVA_HOME=C:\Apps\Java\jdk1.8.0_121
set DUMP_DIR=C:\temp
@echo off
@isapir
isapir / Tasks.md
Last active March 22, 2017 19:41
Useful ConEmu Tasks

Environment

set PsExec=C:\Apps\SysInternals\PsExec.exe

set MSYS2=C:\Apps\msys64\usr\bin

set PATH=%ConEmuBaseDir%\Scripts;%PATH%;%MSYS2%

Tasks

@isapir
isapir / context-menu-st3.reg
Last active November 10, 2016 06:07
Windows Context Menu Open Directory with Sublime Text 3
Windows Registry Editor Version 5.00
; For folders.
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="&Open folder with Sublime Text"
"Icon"="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""