Skip to content

Instantly share code, notes, and snippets.

Thomanphan Thomanphan

Block or report user

Report or block Thomanphan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:642317fe603899af7f8ff6f9f238cd96
nserver 208.67.222.222
nserver 208.67.220.220
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
daemon
# http(s)
#auth none
auth strong
View proxy.txt
190.2.140.41:37075
190.2.140.41:37076
190.2.140.41:37077
190.2.140.41:37078
190.2.140.41:37079
190.2.140.41:37080
190.2.140.41:37081
190.2.140.41:37082
190.2.140.41:37083
190.2.140.41:37084
View proxy.txt
190.2.140.41:37075
190.2.140.41:37076
190.2.140.41:37077
190.2.140.41:37078
190.2.140.41:37079
190.2.140.41:37080
190.2.140.41:37081
190.2.140.41:37082
190.2.140.41:37083
190.2.140.41:37084
View update_pdf_meta.sh
#!/bin/bash
SAVEIFS=$IFS
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
View linux_hosts.py
#!/usr/bin/python2.7
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
set myServer=azcaptcha.com
set toRedirect=2captcha.com
rem -------------------------
rem azcaptcha captcha gate
rem -------------------------
rem %toRedirect%
@Thomanphan
Thomanphan / ratelimiter.php
Created Aug 23, 2018 — forked from RobThree/ratelimiter.php
Simple, rude, rate limiter (using memcache).
View ratelimiter.php
<?php
/* Very simple, crude, rate limiter */
/*
Assumes _MEMCACHEDSITEPREFIX, _MEMCACHEDHOST and _MEMCACHEDPORT are `defined`:
define('_MEMCACHEDHOST', '127.0.0.1');
define('_MEMCACHEDPORT', 11211);
define('_MEMCACHEDSITEPREFIX', 'mysite');
*/
@Thomanphan
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: http://yourNginxProxy.com?uri=your.dynamic.jolokia.domain/jolokia/
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
Thomanphan / ReadMe.md
Created Jul 31, 2018 — forked from edm00se/ReadMe.md
Sample nginx.conf settings to perform reverse proxy functionality to.
View ReadMe.md

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.

Steps

  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.