Skip to content

Instantly share code, notes, and snippets.

View chrismeller's full-sized avatar

Chris Meller chrismeller

View GitHub Profile
@chrismeller
chrismeller / ping.conf
Created February 9, 2013 20:02
My PHP-FPM pool.d config files.
[www]
ping.path = /ping
@chrismeller
chrismeller / gist:fa9d7fcc1393e209c3882041b6c7296d
Last active December 9, 2020 09:14
Yandex Weather uBlock Origin Rules
!right-hand ads on the main page
yandex.*##:xpath(//div[ contains( @class, 'content__bottom' ) ]/following-sibling::div[1])
yandex.*##:xpath(//div[ contains( @class, 'content__bottom' ) ]/following-sibling::div[2])
!row-level ads on the main page
yandex.*##:xpath(//div[ contains( @class, 'card' ) and not(contains( @class, 'maps' )) and descendant::script ])
!right-hand ads on the monthly page
yandex.*##:xpath(//div[ contains( @class, '__content' ) and descendant::div[ contains( @class, 'page30days' ) ] ]/following-sibling::div[1])
!bottom ads on the monthly page
yandex.*##:xpath(//section[ contains( @class, 'content__section' ) and descendant::script ][2])
@chrismeller
chrismeller / gist:4747105
Created February 9, 2013 21:02
status.conf
[www]
pm.status_path = /status
@chrismeller
chrismeller / gist:4747102
Created February 9, 2013 21:02
socket.conf
[www]
listen = /var/run/php5-fpm.socket
@chrismeller
chrismeller / gist:4746697
Created February 9, 2013 19:29
Default php-fpm.conf on Ubuntu
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamicaly changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
id,user_id,type_id,severity_id,message,data,timestamp,ip
27643,1,28,6,"PDOStatement::execute(): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "habari__commentstatus" does not exist
LINE 1: SELECT id, name FROM habari__commentstatus;
^ in system/classes/databaseconnection.php:292",,1380326701,208.30.96.37
27644,1,28,6,"array_flip() expects parameter 1 to be array, boolean given in system/classes/comment.php:494",,1380326701,208.30.96.37
27646,1,28,6,"array_flip() expects parameter 1 to be array, boolean given in system/classes/comment.php:530",,1380326701,208.30.96.37
27647,1,28,6,"PDOStatement::execute(): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "habari__commentstatus" does not exist
LINE 1: SELECT id, name FROM habari__commentstatus;
^ in system/classes/databaseconnection.php:292",,1380326701,208.30.96.37
27648,1,28,6,"array_flip() expects parameter 1 to be array, boolean given in system/classes/comment.php:494",
@chrismeller
chrismeller / wxr-parser.php
Last active December 13, 2015 16:39
Crappy WXR Parser using PHP DOM
<?php
date_default_timezone_set('UTC');
error_reporting(-1);
ini_set('display_errors', true);
$file = '/Users/chris/Downloads/wordpress-wxr-example.xml';
@chrismeller
chrismeller / gist:4748208
Last active December 12, 2015 08:59
https vhost
server {
# the same as for non-ssl, except we indicate that when listening on port
# 443, it should use ssl
listen [::]:443 ssl;
server_name blog.chrismeller.com new.chrismeller.com;
# specify the certificate (chain) and key file to be used for this vhost
ssl_certificate ssl/chrismeller.com.2012.pem;
ssl_certificate_key ssl/chrismeller.com.2012.key;
@chrismeller
chrismeller / gist:4748175
Last active December 12, 2015 08:59
http vhost
server {
# we want to listen on port 80 on all IPs on our system - both IPv4 and IPv6
listen [::]:80;
# our primary server name is the first, aliases simply come after it. you can also include wildcards like *.example.com
server_name blog.chrismeller.com new.chrismeller.com;
# where are our site files stored?
root /media/www/public_html/blog.chrismeller.com/public;
# define our access and error logs for this vhost
@chrismeller
chrismeller / gist:4748101
Created February 10, 2013 02:35
uploads.conf
client_max_body_size 32m;