Skip to content

Instantly share code, notes, and snippets.

@a12b
a12b / selenium-tor-proxy.py
Created October 27, 2019 15:14
Selenium Fake IP Address with Tor Network
#Install Tor Browser, open Tor Browser, run selenium with Chrome Browser and Tor Exit Node.
CHROME_GOOGLE = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = CHROME_GOOGLE
chrome_options.add_argument('--proxy-server=socks5://127.0.0.1:9150')
driver = webdriver.Chrome(DRIVER_PATH, chrome_options=chrome_options)
driver.get('https://check.torproject.org/')
@subfuzion
subfuzion / curl.md
Last active June 20, 2024 13:48
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jamsesso
jamsesso / routing.js
Created August 30, 2014 20:24
Versioned API routing example
var express = require('express');
var http = require('http');
var app = express();
// Simple user controller implementation.
var users = [
{ username: 'jamsesso', age: 20, gender: 'M' },
{ username: 'bettycrocker', age: 20, gender: 'F' }
];
@magnetikonline
magnetikonline / README.md
Last active December 14, 2023 06:45
Nginx FastCGI cache configuration example.

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
@mikhailov
mikhailov / gist:9639593
Last active November 10, 2023 22:04
Nginx S3 Proxy with caching
events {
worker_connections 1024;
}
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
@korczis
korczis / the-scratch.conf
Created September 7, 2013 13:57
Nginx Node.js Proxy with caching, websockets, gzip
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=cache:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_the_scratch {
server 127.0.0.1:3000 weight=1 fail_timeout=60s;
}
# the nginx server instance
server {