This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* REDIRECT TO COMING SOON PAGE FOR NOT ALLOWED VISITORS | |
* Allow admin people or custom visitor IP to visit the site, otherwise, | |
* people are redirected to a specific page such as coming-soon.html | |
* Code to copy/past in functions.php in theme folder. | |
*/ | |
// Disallow access to website if not admin: | |
remove_filter('template_redirect','redirect_canonical'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CLASS LIMIT LOGIN ATTEMPTS | |
* Prevent Mass WordPress Login Attacks by setting locking the system when login fail. | |
* To be added in functions.php or as an external file. | |
*/ | |
if ( ! class_exists( 'Limit_Login_Attempts' ) ) { | |
class Limit_Login_Attempts { | |
var $failed_login_limit = 3; //Number of authentification accepted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete Product term relationships | |
DELETE | |
term_relationships.*, | |
term_taxonomy.*, | |
terms.* | |
FROM wp_term_relationships AS term_relationships | |
INNER JOIN wp_term_taxonomy AS term_taxonomy | |
ON term_relationships.term_taxonomy_id=term_taxonomy.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON term_taxonomy.term_id=terms.term_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying product content in the single-product.php template | |
* | |
* Override this template by copying it to yourtheme/woocommerce/content-single-product.php | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 1.6.4 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WOOCOMMERCE ALLOW SHIPPING COUNTRIES | |
* Make orders to be shipped only in specific country, display message if the customer don't choose an allowed one. | |
*/ | |
function custom_checkout_process() { | |
global $woocommerce; | |
// Block orders to be shipped to other country than New Zealand, United States and Australia | |
$allowed_shipping_countries = array( 'AU', 'NZ', 'US' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update WordPress folder with the latest version, backup files and SQL | |
# Usage: sh update-wordpress "wordpress-directory-to-update" | |
# Define variables | |
BLOG_DIR=/home | |
BACK_DIR=/home/wp-backups | |
DATE=`date +%Y%m%d` | |
INSTANCE=${1} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set /p folder="Enter name of the folder where the files are: " %=% | |
set /p excludeFile="Enter txt file name where the list of files to keep are: " %=% | |
for /f "eol=: delims=" %%F in ('dir /b /a-d %folder% ^| findstr /vibg:%excludeFile%') do ( | |
echo "Deleting file %folder%\%%F" | |
del "%folder%\%%F" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Replace html comment tag by content of file, e.g: | |
// e.g: "<!-- partial: partials/header.html -->" will be replaced by the content of "partials/header.html" | |
// Then using grunt in command line: "grunt partials" | |
// Not the best idea ever, but when you have sometimes restriction or to simulate server-side SSI (Server Side Includes), that can be useful. | |
module.exports = function (grunt) { | |
grunt.initConfig({ | |
partials: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all IPs, count | |
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' ./**/*.json | sort | uniq -c | sort -nr > ips.txt | |
# Whois on each ips | |
cat ips.txt | awk '{print $2}' | head -n 50 | xargs -n1 whois |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016-04-11 09:02:14 | |
Full thread dump OpenJDK 64-Bit Server VM (25.72-b15 mixed mode): | |
"Attach Listener" #2961 daemon prio=9 os_prio=0 tid=0x00007fee500d9800 nid=0x145b waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
Locked ownable synchronizers: | |
- None | |
"BrokerService[go-server] Task-93" #2960 daemon prio=5 os_prio=0 tid=0x00007fee45fbe000 nid=0x144a waiting on condition [0x00007fedd69e8000] |
OlderNewer