#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl tor
Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
/** | |
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload | |
According to Parsing HTML documents - The end, | |
The browser parses the HTML source and runs deferred scripts. | |
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window. | |
The browser loads resources (like images) that delay the load event. | |
A load event is dispatched at the window. | |
Therefore, the order of execution will be | |
DOMContentLoaded event listeners of window in the capture phase | |
DOMContentLoaded event listeners of document |
<?php | |
/* | |
* Custom filter to remove default image sizes from WordPress. | |
*/ | |
/* Add the following code in the theme's functions.php and disable any unset function as required */ | |
function remove_default_image_sizes( $sizes ) { | |
/* Default WordPress */ | |
unset( $sizes[ 'thumbnail' ]); // Remove Thumbnail (150 x 150 hard cropped) |
# Sample Nginx config with sane caching settings for modern web development | |
# | |
# Motivation: | |
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
# and juicy version of your assets available. | |
# At some point, however, you want to show your work to testers, your boss or your client. | |
# After you implemented and deployed their feedback, they reload the testing page – and report | |
# the exact same issues as before! What happened? Of course, they did not have developer tools | |
# open, and of course, they did not empty their caches before navigating to your site. |
/* | |
############################## | |
########### Search ########### | |
############################## | |
Included are steps to help make this script easier for other to follow | |
All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10 | |
I also updated this work to include XSS and SQL injection projection | |
[list_searcheable_acf list all the custom fields we want to include in our search query] | |
@return [array] [list of custom fields] |
<?php | |
function file_get_contents_ex($url, $cookie = null, $proxy = null, $auth = null) | |
{ | |
$opts = array( | |
'http' => array( | |
'method' => 'GET', | |
'user-agent'=> 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36', | |
'header' => "Accept-language: en\r\n" . | |
(!empty($auth) ? "Proxy-Authorization: Basic {$auth}\r\n" : '') . |
# redirects | |
server { | |
listen 80; # 443 | |
# ssl | |
root /xxx/public; | |
server_name domain.org; |
<?php | |
/* build a new wp_query */ | |
$classes = new WP_Query( | |
array( | |
'post_type' => 'wpmark_class_time', // post type to query | |
'posts_per_page' => -1, // get all the posts not limited | |
'meta_query' => array( | |
'relation' => 'AND', | |
'day' => array( // give the first meta key array an array key | |
'key' => '_wpmark_day', |
(function(){ | |
if(document.querySelector("#_CRIT_CSS")){return;} | |
var container = document.createElement("div"); | |
container.id = "_CRIT_CSS"; | |
container.innerHTML = '<textarea cols=80 rows=20></textarea><button id="CRIT_FIND">Find Critical CSS</button><button id="CRIT_CLOSE">Exit</button>'; | |
container.style.position = "fixed"; | |
container.style.top = 0; | |
container.style.left = 0; | |
container.style.right = 0; | |
container.style.backgroundColor = "#FFF"; |
location ~* ^/static/(.*) { | |
set $s3_bucket 'your_bucket.s3.amazonaws.com'; | |
set $url_full '$1'; | |
# Not sure if I need the following options or not, need to look into it. | |
proxy_http_version 1.1; | |
proxy_set_header Host $s3_bucket; | |
proxy_set_header Authorization ''; | |
proxy_hide_header x-amz-id-2; | |
proxy_hide_header x-amz-request-id; |
#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl tor
Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.