Skip to content

Instantly share code, notes, and snippets.

@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
@efmde
efmde / xenserver-6.5-softraid-install.md
Created September 10, 2015 08:43
Install XenServer 6.5 on softraid

Install XenServer 6.5 on softraid

Warning! From default installation of XenServer 6.5 modules of raid, nfs and etc in kernel disabled. "Thanks for developers." In this variation: XenServer 6.5 withoud patches and service packs, kernel 3.10.0+2, 2 disks WD 2 TB

Turn on raid support##

  • Make module file (change raidX for you raid level):
 # echo "modprobe raid1" > /etc/sysconfig/modules/raid.modules
@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
@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)
#!/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"
@gschueler
gschueler / Curl job run.md
Created January 18, 2011 04:07
How to run a rundeck job using curl

Run a Job using Curl

This document describes how to use CURL to interact with the RunDeck server to invoke a Job to run.

The steps are as follows:

  1. Authenticate to the RunDeck server and acquire a session cookie.
  2. Submit run request for particular Job ID, sending session cookie.
@udibagas
udibagas / step-by-step-migrating-postfix-to-zimbra.md
Created December 21, 2015 10:43
step by step migrating postfix to zimbra

Langkah migrasi mail server postfix ke zimbra

Migrasi account

Copy script berikut dan beri nama backup.php. Simpan ke server lama.

#!/usr/bin/php

// Postfixadmin (http://postfixadmin.sourceforge.net/) to Zimbra
@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