Skip to content

Instantly share code, notes, and snippets.

View centminmod's full-sized avatar

George Liu (eva2000) centminmod

View GitHub Profile
@centminmod
centminmod / php_apc_
Created February 11, 2014 08:23
APC Cache munin plugin
#!/usr/bin/perl
#
# Magic markers:
#%# family=auto
#%# capabilities=autoconf
use strict;
use Munin::Plugin;
need_multigraph();
@centminmod
centminmod / apc_info.php
Created February 11, 2014 08:24
APC Cache Munin plugin php file
<?php
/**
* TODO: File header.
* TODO: Code comments.
*/
if(function_exists("apc_cache_info") && function_exists("apc_sma_info")) {
$time = time();
@centminmod
centminmod / gist:8935394
Created February 11, 2014 14:04
Nginx vhost for Ghost blog 0.4+ with Ghost Blog installed as a subdirectory at domain.com/blog
server {
server_name yourghostdomain.com www.yourghostdomain.com;
access_log /home/nginx/domains/yourghostdomain.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/yourghostdomain.com/log/error.log;
root /home/nginx/domains/yourghostdomain.com/public;
location /blog {
include /home/nginx/domains/yourghostdomain.com/proxy.conf;
include /home/nginx/domains/yourghostdomain.com/proxycache.conf; }
@centminmod
centminmod / readme.txt
Last active August 29, 2015 13:56
Instructions to switch from Centmin Mod Nginx based Wordpress WP-FFPC plugin configuration to Wordpress Super Cache plugin configuration. This is a quick and rough how to until the full auto installer outlined at https://blog.centminmod.com/194 is ready for release.
Just deactivate WP-FFPC like any WP plugin and delete it. Then need to adjust your Nginx domain's Nginx vhost domain.conf file to format for WP Super Cache. Quick manual method for WP Super Cache install are the following commands via WP-CLI tool.
Assuming /home/nginx/domains/domainname.com/public/wp is your Wordpress install directory. If you haven't installed Wordpress yet follow only step #2 outlined at http://centminmod.com/nginx_configure_wordpress_ffpc_plugin.html
then type following commands in SSH window editing just your WPDIR variabvle to point to your domainname.com path where wordpress is installed.
WPDIR='/home/nginx/domains/domainname.com/public/wp'
CHOWNDFT='nginx:nginx'
cd $WPDIR
@centminmod
centminmod / btsync
Last active August 29, 2015 13:56
btsync init.d for CentminMod.com installations
#! /bin/sh
##########################################
# /etc/init.d/btsync
# btsync init.d for CentminMod.com installs
##########################################
DEBUG='n'
##########################################
SERVICE=btsync
BITDIR='/usr/bin'
##########################################
@centminmod
centminmod / btsync install
Last active April 7, 2017 19:01
bittorrent sync CentminMod.com Nginx vhost for SSL + SPDY secure reverse proxy for bittorrent sync installation.
#################
for 64bit OS only
pushd /svr-setup/
mkdir bittorrentsync
wget http://download.getsyncapp.com/endpoint/btsync/os/linux-glibc23-x64/track/stable -O bittorrentsync/bittorrentsync.tar.gz
pushd bittorrentsync
tar xzfv bittorrentsync.tar.gz
cp btsync /usr/bin/
chmod /usr/bin/btsync
@centminmod
centminmod / gist:9003270
Last active August 29, 2015 13:56
centmin mod 1.2.3-eva2000.06 quick fix to properly disable ngx_pagespeed download process when centmin.sh has NGINX_PAGESPEED=n set
nginxpgspeedtarball() {
if [[ "$NGINX_PAGESPEED" = [yY] ]]; then
cd $DIR_TMP
# official github master zip renamed
if [[ "$NGINX_PAGESPEEDGITMASTER" = [yY] ]]; then
cecho "Download release-${NGXPGSPEED_VER}.tar.gz ..." $boldyellow
@centminmod
centminmod / gist:9034414
Created February 16, 2014 13:43
Wordpress Multi Site Nginx configuration template for CentminMod.com Nginx - based on Sam Smith's configuration at https://plus.google.com/b/104831941868856035845/106999818358907937014/posts/YN2sCBjxg2A
server {
server_name domain1.com www.domain1.com domain2.com www.domain2.com;
# ngx_pagespeed & ngx_pagespeed handler
include /usr/local/nginx/conf/pagespeed.conf;
include /usr/local/nginx/conf/pagespeedhandler.conf;
include /usr/local/nginx/conf/pagespeedstatslog.conf;
access_log /home/nginx/domains/domain1.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/domain1.com/log/error.log;
@centminmod
centminmod / gist:9088754
Created February 19, 2014 09:29
addons/linfo.sh quick fix for changed tarball
quick fix would be to edit linfo.sh and replace this line
tar -xzf linfo-${LINFO_VER}.tar.gz
with these 2 lines
mkdir -p linfo-${LINFO_VER}
tar -xzf linfo-${LINFO_VER}.tar.gz -C linfo-${LINFO_VER}
edit and change version number to 1.10
@centminmod
centminmod / downloadlinks.inc
Created February 19, 2014 12:14
downloadlinks.inc - extracted all inc/downloads.inc download links to their own file for easier management