Skip to content

Instantly share code, notes, and snippets.

Avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
@iamkingsleyf
iamkingsleyf / wp-config.php
Created Jul 15, 2017 — forked from ryanjbonnell/wp-config.php
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
View wp-config.php
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
View gist:6866d55e5eccb70787aa63063b2842c1
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.com www.example.com;
@iamkingsleyf
iamkingsleyf / putty-gce.md
Created Oct 9, 2015 — forked from feczo/putty-gce.md
How to use Compute Engine - GCE with putty
View putty-gce.md
@iamkingsleyf
iamkingsleyf / nginx.conf
Created Oct 8, 2015 — forked from markjaquith/nginx.conf
My WordPress Nginx setup
View nginx.conf
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@iamkingsleyf
iamkingsleyf / tutorial.md
Created Oct 8, 2015 — forked from dlsniper/tutorial.md
How to build nginx from sources on Ubuntu
View tutorial.md
export LANGUAGE="en_US.UTF-8" 
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
locale-gen en_US.UTF-8 
dpkg-reconfigure locales

apt-get install unzip libpcre3 libpcre3-dev libssl-dev libpcrecpp0 zlib1g-dev debhelper dh-systemd libgeoip-dev autotools-dev libgd2-noxpm-dev libluajit-5.1-dev libmhash-dev libpam0g-dev libperl-dev po-debconf libexpat-dev libxslt1-dev
@iamkingsleyf
iamkingsleyf / hhvm.conf
Created Oct 7, 2015 — forked from tomazzaman/hhvm.conf
Monit configurations for commonly used services
View hhvm.conf
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@iamkingsleyf
iamkingsleyf / nginx.conf
Created Sep 28, 2015 — forked from A5hleyRich/nginx.conf
Hosting WordPress Yourself Multiple Sites
View nginx.conf
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
@iamkingsleyf
iamkingsleyf / Install WordPress Blog.md
Created Sep 22, 2015 — forked from janikvonrotz/Install WordPress Blog.md
Step by Step: Install WordPress Blog #PHP #MySQL #Nginx #phpMyAdmin #WordPress #Markdown #Ubuntu
View Install WordPress Blog.md

Finishing this guide you'll get:

  • A running WordPress installation
  • Nginx proxy with PHP and Fast CGI
  • MySQL server accessible with phpMyAdmin

Specification of latest running installation:

  • Date: 03.03.2014
@iamkingsleyf
iamkingsleyf / backup-to-s3.sh
Last active Sep 8, 2015 — forked from MikeRogers0/backup-to-s3.sh
A method of backing up your website to Amazon S3.
View backup-to-s3.sh
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="you@yourdomain.com"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@iamkingsleyf
iamkingsleyf / README.md
Last active Sep 6, 2015 — forked from oodavid/README.md
Backup MySQL to Amazon S3
View README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

You can’t perform that action at this time.