Skip to content

Instantly share code, notes, and snippets.

View centminmod's full-sized avatar

George Liu (eva2000) centminmod

View GitHub Profile
@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
#!/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 / 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"
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 / 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:
@centminmod
centminmod / ghostsitemap.sh
Created November 10, 2013 02:28 — forked from vbtechsupport/ghostsitemap.sh
SHELL: ghostsitemap.sh
#!/bin/bash
##############################################
# modified version of original http://media-glass.es/ghost-sitemaps/
# for ghost.centminmod.com
# http://ghost.centminmod.com/ghost-sitemap-generator/
##############################################
url="ghost.centminmod.com"
webroot='/home/nginx/domains/ghost.centminmod.com/public'
path="${webroot}/sitemap.xml"
user='nginx' # web server user
@centminmod
centminmod / ghost1
Created November 10, 2013 02:28 — forked from vbtechsupport/ghost1
SHELL: ghost1 CentOS init.d script
#!/bin/bash
###########################################
# chkconfig: 2345 98 02
#
# description: PM2 next gen process manager for Node.js
# processname: ghost1
#
### BEGIN INIT INFO
# Provides: ghost1
# Required-Start:
#!/bin/sh
#
# ghost - this script starts the ghost blogging package
#
# chkconfig: - 95 20
# description: ghost is a blogging platform built using javascript \
# and running on nodejs
#
# Source function library.
# 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";
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;