Skip to content

Instantly share code, notes, and snippets.

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\""
@isapir
isapir / TwitterAPI.cfc
Last active October 28, 2016 16:10
TwitterAPI for Lucee
/**
* @Author - Igal Sapir
* @Description - a client for Twitter ReST API v1.1 https://dev.twitter.com/rest/public
*/
component {
/**
* API Key / API Secret - for both Application-Only-Auth and OAuth-Signed Requests
*
* APIkey = "xxxxxxxxxxxxxxxxxxxxxxxxx";
@isapir
isapir / jquery.dragchanged.js
Last active July 22, 2016 23:08
jQuery Plugin That Detects When Drag Begins and Ends
/** simple jQuery plugin that fires an event named "drag:changed" and a boolean
* parameter of isDragging when drag on the passed elements begins or ends
*/
(function($) {
$.fn.dragchanged = function(){
var notDragging = { isDragging: false, isDown: false, offsetX: -1, offsetY: -1 };
return this.each(function(){
# $Id$
# Maintainer: Dan McGee <dan@archlinux.org>
# Contributor: Daniele Paolella <dp@mcrservice.it>
_realname=virtualenv
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
#pkgname=('python-virtualenv' 'python2-virtualenv')
pkgver=14.0.1
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by PostgreSQL configure 9.5.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
@isapir
isapir / threads.cfm
Last active May 11, 2021 15:45
Show Running Threads in Lucee
<html>
<head>
<title>Threads</title>
<style>
body { font-family: sans-serif; }
.vtop td { vertical-align: text-top; }
tr:nth-child(even) { background-color: #f0f0f0; }
tr:nth-child(odd) { background-color: #f8f8f8; }
td, th { padding: 0.25em 0.5em; }
REM ***** BASIC *****
function getScriptVersion()
getScriptVersion = 1.04
end function
function contains(str1 as Variant, str2 as Variant)