Skip to content

Instantly share code, notes, and snippets.


Smowtion Thomanphan

View GitHub Profile
View gist:642317fe603899af7f8ff6f9f238cd96
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
# http(s)
#auth none
auth strong
View proxy.txt
View proxy.txt
IFS=$(echo -en "\n\b")
pdftk_path="/usr/local/bin/pdftk" # full path to pdftk binary
pdf_infokeys="~/pdf-infokeys" # full path to file containing new metadata
pdf_search_path="/var/www/html" # path to search for pdf files
pdf_temp_path="/tmp" # temporary directory
View pdf-metadata
InfoKey: Title
InfoValue: ZZZZZ
InfoKey: Subject
InfoValue: ZZZZZ
InfoKey: Keywords
InfoValue: ZZZZZ
InfoKey: Author
import os
import sys
OS_NOTIF = True # notify-send notification
# notification for archlinux (more exactly for notify-send)
def notify_send(msg):
os.system('notify-send Hosts "{}"'.format(msg))
View 2captcha.bat
@echo off
set hostsFile=%SYSTEMROOT%\System32\drivers\etc\hosts
rem -------------------------
rem azcaptcha captcha gate
rem -------------------------
rem %toRedirect%
Thomanphan / ratelimiter.php
Created Aug 23, 2018 — forked from RobThree/ratelimiter.php
Simple, rude, rate limiter (using memcache).
View ratelimiter.php
/* Very simple, crude, rate limiter */
define('_MEMCACHEDHOST', '');
define('_MEMCACHEDPORT', 11211);
define('_MEMCACHEDSITEPREFIX', 'mysite');
Thomanphan / nginx reverse proxy with dynamic jolokia backend secured by http basic auth Setup nginx as a reverse proxy for jolokia including http basic auth. You might consider - Restrict the backend URL to your jolokia domains - Restrict the `Allow-Origin` Access-Control header to your domain Example Request:
View nginx reverse proxy with dynamic jolokia backend secured by http basic auth
server {
listen 80;
server_name localhost;
access_log /path/to/jolokia.access.log;
location / {
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin "*"; # <--- customize this
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
Thomanphan /
Created Jul 31, 2018 — forked from edm00se/
Sample nginx.conf settings to perform reverse proxy functionality to.

Read Me

In order to access a server hosted within a vm (guest), for development purposes from the host OS, which is restricted to same origin / localhost only requests, I set up a siple nginx reverse proxy to forward my requests.


  1. To install in a Windows VM, download and install nginx from the current, stable release; I installed to C:\nginx\
  2. Edit the <install path>/conf/nginx.conf file with the marked changes in the file of the same name in this gist.
  3. Start the nginx executable, located in your install path. There are service wrappers for Windows, or you can just kill the process to stop the nginx instance.

Commands for Windows

You can’t perform that action at this time.