This file contains 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
############################################################################### | |
## Monit control file | |
############################################################################### | |
## | |
## Comments begin with a '#' and extend through the end of the line. Keywords | |
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
## | |
## Below you will find examples of some frequently used statements. For | |
## information about the control file, a complete list of statements and | |
## options please have a look in the monit manual. |
This file contains 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
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/htpasswd; |
This file contains 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 | |
add_filter( 'wp_get_attachment_url', function( $url, $id ){ | |
if( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
}); |
This file contains 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
def ignore_patterns_relative(*patterns): | |
"""Function that can be used as copytree() ignore parameter. | |
Patterns used can exclude with relative path names. | |
""" | |
def _ignore_patterns(path, names): | |
ignored_names = [] | |
for pattern in patterns: | |
relative_names = [os.path.join(path, name) for name in names] | |
matched_names = fnmatch.filter(relative_names, pattern) | |
ignored_names.extend(os.path.basename(name) for name in matched_names) |
This file contains 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 | |
photo_dir=$1 | |
limit_size=1000000000 # 1G | |
total_size=0 | |
archive_photo_file_names="" | |
archive_idx=1 | |
IFS=$(echo -en "\n\b") | |
echo "change dir to $photo_dir" |
This file contains 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 | |
function show_img_vars($html, $id, $caption, $title, $align, $url, $size, $alt) { | |
// round up all the variables that get passed so we can test them | |
$vars = "html = $html\n"; | |
$vars .= "id = $id\n"; | |
$vars .= "caption = $caption\n"; | |
$vars .= "title = $title\n"; // this will end up blank no matter what | |
$vars .= "align = $align\n"; | |
$vars .= "url = $url\n"; |
This file contains 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
more_set_headers "Access-Control-Allow-Origin: $http_origin"; | |
more_set_headers "Access-Control-Allow-Credentials: true"; | |
# OPTIONS indicates a CORS pre-flight request | |
if ($request_method = 'OPTIONS') { | |
more_set_headers "Access-Control-Max-Age: 1728000"; | |
more_set_headers "Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS"; | |
more_set_headers "Access-Control-Allow-Headers: Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since"; | |
more_set_headers "Content-Length: 0"; |
This file contains 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 Photon URL. | |
* | |
* @see http://developer.wordpress.com/docs/photon/ | |
* | |
* @param string $image_url URL to the publicly accessible image you want to manipulate | |
* @param array|string $args An array of arguments, i.e. array( 'w' => '300', 'resize' => array( 123, 456 ) ), or in string form (w=123&h=456) | |
* @return string The raw final URL. You should run this through esc_url() before displaying it. |
This file contains 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 | |
# Proftpd | |
#apt-get --force-yes -y update | |
#apt-get --force-yes -y upgrade | |
rm -rf /etc/proftpd | |
apt-get --force-yes -y install proftpd | |
echo " |
This file contains 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 | |
# Install and setup: new rtorrent user, apache2, XMLRPC, rTorrent, Libtorrent, ruTorrent. | |
# Tested on: Ubuntu Server 14.10 x64 / 4 Cores / 4GB RAM / 20 GB SSD | |
# ==> VARIABLES <== | |
# Software Versions | |
LIBTORRENT_VER="0.13.6" | |
RTORRENT_VER="0.9.6" | |
RUTORRENT_VER="3.7" | |
RUTORRENT_PLUGINS_VER="3.6" |
OlderNewer