Skip to content

Instantly share code, notes, and snippets.

Kingsley Felix iamkingsleyf

Block or report user

Report or block iamkingsleyf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@krohn
krohn / gist:00ea01e56588823da52f
Created Sep 17, 2014
block humans.txt scans
View gist:00ea01e56588823da52f
# 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>
View my.cnf-2GB
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
@iamkingsleyf
iamkingsleyf / custom_posttype_glance.php
Last active Aug 29, 2015 — forked from feryardiant/custom_posttype_glance.php
Adding Custom post type counts in 'Right now' Dashboard widget in Wordpress 3.8 or above
View custom_posttype_glance.php
<?php
/**
* Adding Custom post type counts in 'Right now' Dashboard widget.
* Acording this changes :
* - https://core.trac.wordpress.org/ticket/26571
* - https://core.trac.wordpress.org/ticket/26495
* now you can't use 'right_now_*' action API to show your custom post type count from your Dashboard.
* But if you running WP 3.8 or above, you can use 'dashboard_glance_items' instead.
*
* @package Wordpress
@iamkingsleyf
iamkingsleyf / nginx-latest.sh
Last active Aug 29, 2015 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
View nginx-latest.sh
# 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
@bradp
bradp / gist:2e71455f9795fb2e6b2d
Last active Oct 6, 2015
Nginx + HHVM Configuration
View gist:2e71455f9795fb2e6b2d
# 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
@gbot
gbot / wp-login-jail.local
Last active Oct 10, 2015
Fail2Ban WordPress login failure Jail and Filter. Notes:The log path uses 'access*_log' to monitor http and https logins. This will only work if WordPress is installed the webroot. Tweaking the failregex would be required to work with installs in sub-directories.
View wp-login-jail.local
[wp-login]
enabled = true
filter = wp-login
action = iptables-multiport[name=wp-login, port="http,https"]
sendmail[dest="name@domain.com", sendername="Fail2Ban", sender="fail2ban", name="wp-login"]
logpath = /var/www/vhosts/system/*/logs/access*_log
maxretry = 5
findtime = 60
bantime = 1200
@A5hleyRich
A5hleyRich / nginx.conf
Last active Mar 19, 2016
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 {
@imchairmanm
imchairmanm / gist:fd033191941cb27251b6a3a7ac1f051c
Last active Aug 30, 2016
Let's Encrypt Nginx server block
View gist:fd033191941cb27251b6a3a7ac1f051c
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;
@jameskoster
jameskoster / style.css
Created Apr 3, 2014
Our Team - Apply layout to the shortcode output
View style.css
.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,
@janikvonrotz
janikvonrotz / Enable Piwik geolocation support with GeoIP PECL.md
Last active Feb 13, 2017
Ubuntu: Enable Piwik geolocation support with GeoIP PECL #Piwik #Markdown
View Enable Piwik geolocation support with GeoIP PECL.md

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
You can’t perform that action at this time.