Skip to content

Instantly share code, notes, and snippets.

@kishba
kishba / haproxy.conf
Last active September 13, 2023 19:04
Sample HAProxy HTTPS configuration for Moodle and Ellucian Colleague web apps -- anonymized from Mid Michigan Community College
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
#!/bin/bash
# Install
# This script need a API key from TinyPNG. See this page: https://tinypng.com/developers
# It also need jq library, which can be install thanks to: `brew install jq`
# Usage
# cd to your folder. This script will compress all PNG or JPG files recursively.
API_KEY="CHANGE_ME"
@sebz
sebz / grunt-hugo-lunrjs.md
Last active April 29, 2024 16:44
hugo + gruntjs + lunrjs = <3 search
@changeme
changeme / Install OpenSSH-HPN on CentOS
Created August 18, 2014 05:30
Install OpenSSH-HPN on CentOS
yum install zlib zlib-devel pam pam-devel openssl openssl-devel gcc patch make
cd /usr/src
wget http://www.thirdechelon.org/stuff/openssh-6.6p1-hpnssh14v5.diff.gz
wget http://www.thirdechelon.org/stuff/openssh-6.6p1.tar.gz
tar -xzvf openssh-6.1p1.tar.gz
cd openssh-6.1p1
zcat /usr/src/openssh-6.1p1-hpn13v14.diff.gz | patch
./configure –prefix=/usr –sysconfdir=/etc/ssh –with-pam
mv /etc/ssh/ssh_config /etc/ssh/ssh_config.original
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.original
@jeffgeiger
jeffgeiger / spamstats.pl
Created August 22, 2013 03:52
Munin-node spamstats plugin - enhanced
#!/usr/bin/perl
# -*- perl -*-
=head1 NAME
spamstats - Plugin to graph spamassassin throughput
=head1 CONFIGURATION
This plugin does not have any configuration
@danmilleruk
danmilleruk / check_cpanelports.sh
Last active August 24, 2017 22:18
Script to check cPanel ports based on an IP address or hostname given as arg1.
#!/bin/bash
# Port Alive Script for Nagios
# Standard cPanel Ports
# Dan Miller <dm@sub6.com>
ADDRESS=$1
TIMEOUT=5
PORTS=(
'2082' # cPanel
@TheSkorm
TheSkorm / volts.sh
Created January 6, 2013 10:49
SNMP grabs mikrotik volts reading.
#!/bin/bash
#Makes a CSV of UNIX Time, wget speed, and link speed from an SNMP router
VOLTS=`snmpwalk -OvQ -v2c -cpublic IP .1.3.6.1.4.1.14988.1.1.3.8.0`
TIME=`date +%s`
VOLTS=`echo "scale=3;$VOLTS/10"|/usr/bin/bc`
echo $TIME,$VOLTS V >> /home/mwheeler/scripts/volts.csv
@KartikTalwar
KartikTalwar / Documentation.md
Last active May 9, 2024 12:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@jtai
jtai / parse-tcpdump-udp-port-53.php
Last active January 16, 2019 16:06
Quick and dirty script to parse output of /usr/sbin/tcpdump -vvv -s 0 -l port 53
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}
@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)