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 | |
| /** | |
| * @package Custom_queries | |
| * @version 1.0 | |
| */ | |
| /* | |
| Plugin Name: Custom queries | |
| Plugin URI: http://wordpress.org/extend/plugins/# | |
| Description: This is an example plugin | |
| Author: Carlo Daniele |
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
| /* | |
| Increase memory and execution time for WP admins | |
| You can add code to your php.ini, .htaccess, or wp-config.php | |
| to increase execution times and memory limits to get WordPress | |
| and PMPro to work when it needs more memory, time, or both. | |
| However, sometimes you only need the extra memory and time | |
| when doing something an admin would be doing... like exporting | |
| a members list or orders table. |
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 | |
| /** | |
| * Plugin Name: NGINX FastCGI cache purge | |
| * Version: 0.1 | |
| * Description: Flush NGINX FastCGI cache purge | |
| * Author: The Shipyard Crew | |
| * Author URI: https://theshipyard.se/ | |
| * Plugin URI: https://theshipyard.se/ | |
| * Text Domain: nginx-fastcgi-cache-purge |
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 | |
| // Generates a strong password of N length containing at least one lower case letter, | |
| // one uppercase letter, one digit, and one special character. The remaining characters | |
| // in the password are chosen at random from those four sets. | |
| // | |
| // The available characters in each set are user friendly - there are no ambiguous | |
| // characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
| // makes it much easier for users to manually type or speak their passwords. | |
| // | |
| // Note: the $add_dashes option will increase the length of the password by |
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 | |
| //source: http://www.zedwood.com/article/php-curl-connect-with-ssl-client-certificate | |
| class SecureRequest | |
| { | |
| private m_publicCertPath; //"/public_cert.pem" | |
| private m_privateCertPath; //"/private.pem") | |
| private m_caInfoPAth; //"/etc/ssl/certs/ca-certificates.crt" | |
| public function init($publicCertPath, $privateCertPath, $caInfoPath) { | |
| $this->m_publicCertPath = $publicCertPAth; |
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
| curl -H "Host: example.com" -I http://IP.ADD.RE.SS/path/to/file/or/folder/ |
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 | |
| DBUSER="root"; | |
| DBPASS=""; | |
| DBHOST="localhost"; | |
| DB_OLD=mydatabase | |
| DB_NEW=clone_mydatabase | |
| DBCONN="--host=${DBHOST} --user=${DBUSER} --password=${DBPASS}"; |
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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/gorilla/mux" | |
| "github.com/gorilla/securecookie" | |
| "net/http" | |
| ) | |
| // cookie handling |
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
| -- Tit Petric, Monotek d.o.o., Tue 03 Jan 2017 06:54:56 PM CET | |
| -- | |
| -- Delete nginx cached assets with a PURGE request against an endpoint | |
| -- supports extended regular expression PURGE requests (/upload/.*) | |
| -- | |
| function file_exists(name) | |
| local f = io.open(name, "r") | |
| if f~=nil then io.close(f) return true else return false end | |
| end |
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
| -- Tit Petric, Monotek d.o.o., Thu 27 Oct 2016 10:43:38 AM CEST | |
| -- | |
| -- Delete nginx cached assets with a PURGE request against an endpoint | |
| -- | |
| local md5 = ngx.md5 | |
| function file_exists(name) | |
| local f = io.open(name, "r") | |
| if f~=nil then io.close(f) return true else return false end |