Skip to content

Instantly share code, notes, and snippets.


Kingsley Felix iamkingsleyf

View GitHub Profile
imchairmanm / gist:fd033191941cb27251b6a3a7ac1f051c
Last active Aug 30, 2016
Let's Encrypt Nginx server block
View gist:fd033191941cb27251b6a3a7ac1f051c
server {
listen 80;
return 301 https://$host$request_uri;
server {
listen 443 ssl;
iamkingsleyf /
Last active Aug 29, 2015 — forked from Globegitter/
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - | 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 trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src trusty nginx" | sudo tee -a /etc/apt/sources.list
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
* Adding Custom post type counts in 'Right now' Dashboard widget.
* Acording this changes :
* -
* -
* 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
A5hleyRich / nginx.conf
Last active Mar 19, 2016
Hosting WordPress Yourself Multiple Sites
View nginx.conf
user ashley;
worker_processes 1;
pid /run/;
events {
worker_connections 1024;
multi_accept on;
http {
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.
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
tomazzaman / hhvm.conf
Last active Feb 20, 2020
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
dlsniper /
Last active Feb 28, 2020
How to build nginx from sources on Ubuntu
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
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
enabled = true
filter = wp-login
action = iptables-multiport[name=wp-login, port="http,https"]
sendmail[dest="", sendername="Fail2Ban", sender="fail2ban", name="wp-login"]
logpath = /var/www/vhosts/system/*/logs/access*_log
maxretry = 5
findtime = 60
bantime = 1200
lukebranch / 4GB-4Core-VPS-my.cnf
Created Oct 22, 2014
/etc/my.cnf config for 4GB RAM 4 Core VPS - Wordpress
View 4GB-4Core-VPS-my.cnf
# Generated by Percona Configuration Wizard ( version REL5-20120208
# Configuration name server-1 generated for Luke at 2014-10-22 09:47:40
port = 3306
socket = /var/lib/mysql/mysql.sock
markjaquith / nginx.conf
Last active Jul 14, 2019
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_protocols TLSv1 TLSv1.1 TLSv1.2;
You can’t perform that action at this time.