Skip to content

Instantly share code, notes, and snippets.

View iamkingsleyf's full-sized avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
@iamkingsleyf
iamkingsleyf / hhvm.conf
Created October 7, 2015 03:27 — forked from tomazzaman/hhvm.conf
Monit configurations for commonly used services
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 September 28, 2015 16:40 — forked from A5hleyRich/nginx.conf
Hosting WordPress Yourself Multiple Sites
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
@iamkingsleyf
iamkingsleyf / Install WordPress Blog.md
Created September 22, 2015 20:50 — forked from janikvonrotz/Install WordPress Blog.md
Step by Step: Install WordPress Blog #PHP #MySQL #Nginx #phpMyAdmin #WordPress #Markdown #Ubuntu

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 September 8, 2015 13:47 — forked from MikeRogers0/backup-to-s3.sh
A method of backing up your website to Amazon S3.
#!/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
#!/bin/sh
echo 'Started'
date +'%a %b %e %H:%M:$S %Z %Y'
s3cmd sync --recursive --preserve /srv s3://nameofyours3bucket
s3cmd sync --recursive --preserve /etc s3://nameofyours3bucket
s3cmd sync --recursive --preserve /home s3://nameofyours3bucket
s3cmd sync --recursive --preserve /var s3://nameofyours3bucket
dpkg --get-selections > dpkg.list
s3cmd sync --recursive --preserve dpkg.list s3://nameofyours3bucket
date +'%a %b %e %H:%M:$S %Z %Y'
@iamkingsleyf
iamkingsleyf / README.md
Last active September 6, 2015 22:56 — forked from oodavid/README.md
Backup MySQL to Amazon S3

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

@iamkingsleyf
iamkingsleyf / my.cnf
Last active September 1, 2015 00:18 — forked from petemcw/my.cnf
Ubuntu MySQL 5.1 Configuration - 4GB RAM, Heavy InnoDB
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
@iamkingsleyf
iamkingsleyf / 4GB-4Core-VPS-my.cnf
Last active August 29, 2015 12:28 — forked from lukebranch/4GB-4Core-VPS-my.cnf
/etc/my.cnf config for 4GB RAM 4 Core VPS - Wordpress
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
# Configuration name server-1 generated for Luke at 2014-10-22 09:47:40
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
@iamkingsleyf
iamkingsleyf / gfpc_prev_next_nav.php
Last active August 29, 2015 14:28 — forked from cpaul007/gfpc_prev_next_nav.php
Replacing default prev/next arrow with font awesome icon
<?php
//* Do not add this opening tag
/**
* Replacing default Prev/Next arrow with Font Awesome icon
*
* Add the following codes in functions.php file
*
* @author Genesis Developer
* @link http://genesisdeveloper.me
@iamkingsleyf
iamkingsleyf / gist:7f9cec2ffb90f45f79b4
Last active August 29, 2015 14:27 — forked from krohn/gist:00ea01e56588823da52f
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>