Skip to content

Instantly share code, notes, and snippets.

View iamkingsleyf's full-sized avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
@ryanjbonnell
ryanjbonnell / wp-config.php
Created March 12, 2014 15:51
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
// 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];
}
@janikvonrotz
janikvonrotz / Enable Piwik geolocation support with GeoIP PECL.md
Last active February 13, 2017 13:27
Ubuntu: Enable Piwik geolocation support with GeoIP PECL #Piwik #Markdown

Introduction

By default Piwik uses the provider location to guess a visitor's country based on the language they use. This is not very accurate, so they recommend installing and using GeoIP.

Requirements

  • Ubuntu server
  • libgeoip-dev
  • Nginx
  • Nginx minimal website
@jameskoster
jameskoster / style.css
Created April 3, 2014 13:27
Our Team - Apply layout to the shortcode output
.widget_woothemes_our_team .columns-2,
.widget_woothemes_our_team .columns-3,
.widget_woothemes_our_team .columns-4,
.widget_woothemes_our_team .columns-5,
.widget_woothemes_our_team .columns-6 {
overflow: hidden;
zoom: 1;
}
.widget_woothemes_our_team .columns-2 .team-member,
.widget_woothemes_our_team .columns-3 .team-member,
@feczo
feczo / putty-gce.md
Last active July 23, 2020 13:14
How to use Compute Engine - GCE with putty
@bradp
bradp / gist:2e71455f9795fb2e6b2d
Last active October 6, 2015 11:27
Nginx + HHVM Configuration
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@stayallive
stayallive / install.sh
Last active May 4, 2018 19:59
Install PHP 5.6.7 on Plesk 11.5 & 12 (CentOS 6)
#!/bin/bash
# Make sure you are up to date
yum -y update && yum -y install wget
# Install EPEL repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Get us a clean working directory
mkdir /php
@Globegitter
Globegitter / nginx-latest.sh
Last active May 7, 2022 18:19
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
@krohn
krohn / gist:00ea01e56588823da52f
Created September 17, 2014 10:13
block humans.txt scans
# block humans.txt scans
# http://perishablepress.com/protect-against-humans-txt-query-string-scans/
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} http\:\/\/www\.google\.com\/humans\.txt\? [NC]
RewriteRule .* - [F,L]
</IfModule>
@markjaquith
markjaquith / nginx.conf
Last active December 25, 2022 15:55
My WordPress Nginx setup
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;