Skip to content

Instantly share code, notes, and snippets.

View centminmod's full-sized avatar

George Liu (eva2000) centminmod

View GitHub Profile
@centminmod
centminmod / custom_config.inc
Last active December 16, 2022 19:54
Custom Config options available for Centminmod.
# CENTMINMOD CUSTOM CONFIGURATIONS OPTIONS FILE
# PLEASE NOTE: This file serves as a file with all the possible options, NOT what should be used in a production enviornment!!!!
# https://centminmod.com
# Creating a custom_config.inc file it will override default setting for upgrades and software installs.
# Location: /etc/centminmod/custom_config.inc
EMAIL='' # Server notification email address enter only 1 address
PUSHOVER_EMAIL='' # Signup pushover.net push email notifications to mobile & tablets
CMGIT='https://github.com/centminmod/centminmod.git'
@centminmod
centminmod / redisinfo.sh
Last active July 29, 2022 10:00
redis server info and stats for Centmin Mod installs centminmod.com. If redis password is set in /etc/redis.conf, edit the variable REDISPASSWORD='your_redis_password'
#!/bin/bash
VER=0.0.2
#########################################################
# redis server info script for CentminMod.com
# written by George Liu (eva2000) vbtechsupport.com
#########################################################
# redis password set by requirepass in /etc/redis.conf
REDISPASSWORD=''
SOCKET=n
TRINSICTIME=10
@centminmod
centminmod / README.md
Created May 27, 2016 00:41 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is also explained at the Nginx ngx_http_fastcgi_module page document page.

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (i.e. it's not shared memory).

The related Nginx options are:

@centminmod
centminmod / rclone.bat
Created October 29, 2016 02:55
Install rclone in Windows
REM 1. Create C:\Program Files\rclone
REM 2. Download rclone http://rclone.org/downloads/ and unzip it to C:\Program Files\rclone
REM 3. Save this file as C:\Program Files\rclone\rclone.bat
REM 3. Set the blank variables seen below.
REM 3.1 Set RCLONE_ROOT_FOLDER_NAME to the name of the folder in ACD where you want all backups to go. "Backup".
REM 3.2 Set RCLONE_FOLDER_NAME to the name of this machine's backup.
REM 4. Create C:\Program Files\rclone\sources.txt file with a line for each source. C:\Users\admin\Desktop;Desktop
REM 4.1 Before the ";" is the source path. After the ";" is the destination in ACD.
REM 5. Create C:\Program Files\rclone\excludes.txt file with a line for each globally excluded pattern.
REM 5.1 "Photo Booth Library"
@centminmod
centminmod / user-timing-rum.js
Created June 16, 2020 10:41 — forked from pmeenan/user-timing-rum.js
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
test gist!
@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;
~ # /tmp/zramtest3.sh test6 /tmp/ffmpeg-1\:2.6.1-1-x86_64.pkg.tar
zram test6 Sat Apr 4 09:50:06 GMT 2015
comp_algorithm [lzo] lz4 snappy
real 0m 0.20s 0.20s 0.24s avg: 0.214s
real 0m 1.45s 1.42s 1.42s avg: 1.430s
compr_data_size 30504972 30504968 30504947 30504962
comp_algorithm lzo [lz4] snappy
@centminmod
centminmod / taskset_child_threads.sh
Created March 11, 2019 18:18 — forked from neomantra/taskset_child_threads.sh
Invokes `taskset` on the child threads of the specified processes.
#!/bin/bash
# Copyright 2013-2019 Neomantra BV. All rights reserved.
# Released under the MIT License.
usage()
{
cat >&2 <<EOF
usage: $0 [-h] [-v] [-c cpulist] ppid1 [ppid2 [...]]
Given a list of parent process IDs, this script finds their child
@centminmod
centminmod / tomjn_http2_push.php
Created February 4, 2019 13:07 — forked from tomjn/tomjn_http2_push.php
A naive and incomplete, but functional approach to http2 push
<?php
/**
* Plugin name: HTTP2 Push scripts
* Author: Tom J Nowell
*/
function tomjn_get_dep_url( /*\WP_Dependency*/ $dep ) {
global $wp_version;
$relative = str_replace( site_url(), '', $dep->src );
$ver = $dep->ver;