Skip to content

Instantly share code, notes, and snippets.

View centminmod's full-sized avatar

George Liu (eva2000) centminmod

View GitHub Profile
@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 / 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 / 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 / ip_blacklist.lua
Created November 29, 2015 21:30 — forked from chrisboulton/ip_blacklist.lua
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
h2o version 0.9.0
Usage:
h2o [options]
Options:
-c, --conf FILE configuration file (default: h2o.conf)
-t, --test tests the configuration
-v, --version prints the version number
-h, --help print this help
@centminmod
centminmod / mtr_graph.gp
Last active August 29, 2015 14:11 — forked from hjst/mtr_graph.gp
# Use a stacked column histogram
set style data histograms
set style histogram rowstacked
# Columns are 60% of max width (i.e. not touching, set 1.0 for touching)
set boxwidth 0.6
# Define colours - 1:yellow 2:orange 3:red
unset style line
set style line 1 linetype 1 linecolor rgb "#ffff99"
#!/usr/bin/perl -w
use strict;
use diagnostics;
use File::Temp;
# Matches Fingerprints from sshd logs (sshd on loglevel VERBOSE) against
# authorized_keys for the respective user.
die "Please specify input file!\n" unless ($ARGV[0]);
@centminmod
centminmod / monitrc
Last active August 29, 2015 14:03 — forked from palpalani/monitrc.sh
Forked instructions
//Monitor CentMinMod server using Monit
//About Monit
Monit is a helpful program that automatically monitors and manages server programs to ensure that they not only stay online consistently, but that the file size, checksum, or permissions are always correct. Additionally monit comes with a basic web interface through which all of the processes can be set up. This tutorial will cover the most basic setup and configuration.
//Install Monit on CentOS 6.5
//STEP 1: Installation
//packages needed
yum install pam-devel
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
backend default {
.host = "blog-jniedbalski.rhcloud.com";
.port = "80";