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 / snsToSlack.js
Created April 2, 2016 21:23 — forked from terranware/snsToSlack.js
AWS Lambda function to Slack Channel hookup
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws-sns",
"username": "AWS SNS via Lamda :: DevQa Cloud",
@centminmod
centminmod / gist:f0efe35946515f6868580226ca3b1b0b
Created May 17, 2016 00:09 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel
OPENSSL="openssl-1.0.2h"
NGINX="nginx-1.9.15-1"
mkdir -p /opt/lib
wget https://www.openssl.org/source/$OPENSSL.tar.gz -O /opt/lib/$OPENSSL.tar.gz
tar -zxvf /opt/lib/$OPENSSL.tar.gz -C /opt/lib
@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 / configure
Created August 25, 2016 19:33 — forked from shinnya/configure
This is excerpt from configure for PHP and describes how configure script decides OPENSSL_LIBDIR.
# If you specify --with-openssl-dir=yes, pkg-config is used and found_openssl is set to true.
if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
found_openssl=yes
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
else
as_fn_error $? "OpenSSL version 0.9.6 or greater required." "$LINENO" 5
fi
@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 / gist:a59b40beaa20e9c8048367049ec0eb3d
Last active July 21, 2017 18:34 — forked from paulmaunders/gist:3e2cbe02c07b6393f7ef0781eed9f97b
Installing VirtualBox and Vagrant on CentOS 7
# Some notes from installing VirtualBox on CentOS 7.
# These exact steps haven't been tested, as I ran them in a different order when manually installing.
# Install dependencies
yum -y install gcc make patch dkms qt libgomp epel-release
yum -y install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
# Install VirtualBox
cd /etc/yum.repos.d
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
@centminmod
centminmod / ca.md
Created May 7, 2018 18:03 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@centminmod
centminmod / serviceworker.js
Created July 21, 2018 05:59 — forked from ngokevin/serviceworker.js
Service Worker Template - cache-else-network + network-else-cache
var VERSION = 'v1';
var cacheFirstFiles = [
// ADDME: Add paths and URLs to pull from cache first if it has been loaded before. Else fetch from network.
// If loading from cache, fetch from network in the background to update the resource. Examples:
// 'assets/img/logo.png',
// 'assets/models/controller.gltf',
];
@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;