Skip to content

Instantly share code, notes, and snippets.

View fridaynext's full-sized avatar
🍰
Building out functionality in CakePHP, jQuery, and SCSS!

Casey Friday fridaynext

🍰
Building out functionality in CakePHP, jQuery, and SCSS!
View GitHub Profile
2014/10/08 09:43:13 [error] 17757#0: *806353 open() "/usr/share/nginx/html/MyAdmin/scripts/setup.php" failed (2: No such file or directory), client: 69.174.245.163, server: localhost, request: "GET /MyAdmin/scripts/setup.php HTTP/1.1", host: "66.228.55.78"
2014/10/08 09:43:53 [error] 17757#0: *806415 open() "/usr/share/nginx/html/clientaccesspolicy.xml" failed (2: No such file or directory), client: 54.87.115.21, server: localhost, request: "GET /clientaccesspolicy.xml HTTP/1.1", host: "23.239.26.96"
2014/10/08 09:44:57 [error] 17757#0: *806509 open() "/usr/share/nginx/html/clientaccesspolicy.xml" failed (2: No such file or directory), client: 54.162.91.212, server: localhost, request: "GET /clientaccesspolicy.xml HTTP/1.1", host: "66.228.55.78"
2014/10/08 09:45:28 [error] 17757#0: *806579 open() "/usr/share/nginx/html/clientaccesspolicy.xml" failed (2: No such file or directory), client: 54.92.179.225, server: localhost, request: "GET /clientaccesspolicy.xml HTTP/1.1", host: "23.239.26.162"
2014/10/08 09:45:
casey@cosmos:public$ sudo tail -f /var/log/php5-fpm.log
[08-Oct-2014 12:21:56] NOTICE: [pool www] child 28141 exited with code 0 after 434.084591 seconds from start
[08-Oct-2014 12:21:56] NOTICE: [pool www] child 28757 started
[08-Oct-2014 12:22:09] NOTICE: [pool www] child 28142 exited with code 0 after 443.448802 seconds from start
[08-Oct-2014 12:22:09] NOTICE: [pool www] child 28763 started
[08-Oct-2014 12:22:57] NOTICE: [pool www] child 28143 exited with code 0 after 488.970214 seconds from start
[08-Oct-2014 12:22:57] NOTICE: [pool www] child 28794 started
[08-Oct-2014 12:24:03] NOTICE: [pool www] child 28179 exited with code 0 after 506.394305 seconds from start
[08-Oct-2014 12:24:03] NOTICE: [pool www] child 28798 started
[08-Oct-2014 12:24:26] NOTICE: [pool www] child 28530 exited with code 0 after 503.282439 seconds from start
casey@cosmos:public$ sudo find . -type d -exec chmod 750 {} ;
server {
server_name caseyfriday.com www.caseyfriday.com;
return 301 https://caseyfriday.com$request_uri;
}
server {
listen 23.239.26.162:443 default ssl;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:EECDH+RC4:RSA+RC4:!MD5";
ssl_session_timeout 10m;
casey@cosmos:~$ sudo apt-cache depends nginx
nginx
Depends: libc6
Depends: libpcre3
Depends: libssl0.9.8
Depends: zlib1g
Depends: lsb-base
Depends: adduser
Conflicts: nginx:i386
Xeon 1240v3 = $250 after coupon
Quadro K2000 = $349
16GB ECC RAM CT2KIT102472BD160B = $180
ASRock E3C226D2I Mini ITX Mobo = $225
PSU =~ $40
Water cooler (H80i) = $80
Case = $20
Total = $1144
<?php
/* Friday Next Extra Functions */
add_filter( 'rewrite_rules_array', 'fn_rewrite_rules' );
function fn_rewrite_rules( $rules ) {
$newRules = array();
$newRules[ 'selection/(.+)/(.+)/(.+)/?$' ] = 'index.php?product=$matches[4]'; // my custom structure will always have the post name as the 5th uri segment - will change to 4th on live site
$newRules[ 'selection/(.+)/?$' ] = 'index.php?product_types=$matches[1]';
return array_merge( $newRules, $rules );
<?php
/* Friday Next Extra Functions */
add_filter( 'rewrite_rules_array', 'fn_rewrite_rules' );
function fn_rewrite_rules( $rules ) {
$newRules = array();
$newRules[ 'selection/(.+)/(.+)/(.+)/?$' ] = 'index.php?product=$matches[4]'; // my custom structure will always have the post name as the 5th uri segment - will change to 4th on live site
$newRules[ 'selection/(.+)/?$' ] = 'index.php?product_types=$matches[1]';
return array_merge( $newRules, $rules );
// custom taxonomy permalinks
add_filter('post_link', 'deb_permalink', 10, 3);
add_filter('post_type_link', 'deb_permalink', 10, 3);
function deb_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%taxonomy_name%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;
// custom taxonomy permalinks
add_filter('post_link', 'deb_permalink', 10, 3);
add_filter('post_type_link', 'deb_permalink', 10, 3);
function deb_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%taxonomy_name%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;