Skip to content

Instantly share code, notes, and snippets.

Avatar

Danny Sheehan dannysheehan

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dannysheehan on github.
  • I am dannys (https://keybase.io/dannys) on keybase.
  • I have a public key whose fingerprint is ED3B 7F8F 35BB CD8F CC06 B2B8 C48A 57DD B696 74A8

To claim this, I am signing this object:

@dannysheehan
dannysheehan / gist:68d34b70ec6c633a5a0f
Created Jul 9, 2014
/etc/nginx/enabled/ftmon.org.conf
View gist:68d34b70ec6c633a5a0f
server {
listen 127.0.0.1:8080;
server_name ftmon.org;
port_in_redirect off;
return 301 $real_scheme://www.ftmon.org$request_uri;
}
server {
listen 127.0.0.1:8080;
@dannysheehan
dannysheehan / gist:03af98b3b9274bbbb1f6
Created Jul 9, 2014
errors logs from website thumbnail services causing redirect loops for NGINX -> HAPROXY -> PHP5-FPM configuration
View gist:03af98b3b9274bbbb1f6
These are the errors of redirect issues i am having with *some* php based website thumbnail services thumbnailing my site.
## HAPROXY errors
~~~
[09/Jul/2014:10:27:33.724] backend www (#6) : invalid response
frontend www (#2), server php1 (#1), event #3
src 144.76.43.70:51530, session #380, session flags 0x000004ce
@dannysheehan
dannysheehan / gist:ab98f0d2f9dfc3496802
Created Jul 9, 2014
/etc/nginx/common/wpffpc.conf - recommended nginx memcached ffpc caching wordpress plugin
View gist:ab98f0d2f9dfc3496802
# http://centminmod.com/nginx_configure_wordpress_ffpc_plugin.html#220813
# try to get result from memcached
location @memcached {
default_type text/html;
set $memcached_key data-$real_scheme://$host$request_uri;
set $memcached_request 1;
# exceptions
# avoid cache serve of POST requests
View gist:5344d70d018a79085990
#---------------------------------------------------------------------------
# @(#)$Id$
#title :/etc/nginx/common/wpcommon.conf
#description :ftmon cluster nginx common configurations for Wordpress.
#author :Danny W Sheehan
#date :July 2014
#website :ftmon.org
#
# This is a work in progress. A lot of trial and error and man hours have
# gone into this configuration. I have referenced sources that have been
@dannysheehan
dannysheehan / gist:d26067dcc3599c4226aa
Created Jul 9, 2014
/etc/nginx/common/nginx.conf basic NGINX location rules common to all website platforms. Should be included in all virtual site configurations.
View gist:d26067dcc3599c4226aa
#---------------------------------------------------------------------------
# @(#)$Id$
#title :/etc/nginx/common/nginx.conf
#description :ftmon cluster nginx common config for all sites.
#author :Danny W Sheehan
#date :July 2014
#website :ftmon.org
#
# This is a work in progress. A lot of trial and error and man hours have
# gone into this configuration. I have referenced sources that have been
@dannysheehan
dannysheehan / gist:afe330b28ed22c822471
Created Jul 9, 2014
/etc/nginx/nginx.cfg ftmon cluster configuration. For KVM with 1GB memory and 1 cpu. Assumes HAPROXY front end load balancer and php5-fpm backend.
View gist:afe330b28ed22c822471
#---------------------------------------------------------------------------
# @(#)$Id$
#title :/etc/nginx/nginx.cfg
#description :ftmon cluster nginx config. HAPROXY frontend.
#author :Danny W Sheehan
#date :July 2014
#website :ftmon.org
#
# This is a work in progress. A lot of trial and error and man hours have
# gone into this configuration. I have referenced sources that have been
@dannysheehan
dannysheehan / gist:9d67adb67eeef6ad1413
Last active Oct 8, 2018
haproxy.cfg configuration for 1Gb KVM with 1 CPU with backend NGINX and percona /mariadb cluster.
View gist:9d67adb67eeef6ad1413
#---------------------------------------------------------------------------
# @(#)$Id$
#title :/etc/haproxy/haproxy.cfg
#description :ftmon cluster haproxy config. NGINX and XtraDB Cluster backend
#author :Danny W Sheehan
#date :July 2014
#website :ftmon.org
#
# This is a work in progress. A lot of trial and error and man hours have
# gone into this configuration. I have referenced sources that have been
@dannysheehan
dannysheehan / gist:ddca8cedb6e0851d432f
Created Feb 21, 2014
Add REMOTE_HOST functionality to NGINX mod-security - ngx_http_modsecurity.c
View gist:ddca8cedb6e0851d432f
static inline u_char *get_rdns_hostname(ngx_http_request_t *r);
//ctx->connection->remote_host = NULL;
ctx->connection->remote_host = (char *)get_rdns_hostname(r);
static inline u_char *
get_rdns_hostname(ngx_http_request_t *r){
@dannysheehan
dannysheehan / gist:9107830
Created Feb 20, 2014
Find users missing .profile and .bashrc files and copy them from /etc/skel
View gist:9107830
#!/bin/bash
for h in `ls -d1 /home/*`
do
TUSER=`basename $h`
if ! getent passwd $TUSER 2> /dev/null | awk -F: '{print $7}' | grep -v "/bin/bash"
then
if [ -d $h -a ! -e $h/.profile ]
then
( su - $TUSER -c "cp /etc/skel/.profile $h" ) && ls -1d $h/.profile
else