Skip to content

Instantly share code, notes, and snippets.

View AndrewRose's full-sized avatar

Andrew Rose AndrewRose

View GitHub Profile
@AndrewRose
AndrewRose / PKGBUILD
Created January 22, 2018 16:14
MariaDB 10.2 Branch PKGBUILD Arch Linux
# $Id$
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Maintainer: Christian Hesse <mail@eworm.de>
pkgbase=mariadb
pkgname=('libmariadbclient' 'mariadb-clients' 'mytop' 'mariadb')
pkgver=10.2.12
pkgrel=1
arch=('x86_64')
license=('GPL')
@AndrewRose
AndrewRose / gist:9a725ce7706e771303b8
Created August 27, 2015 09:48
megacli has been superseded by storcli .. below is a quick and dirty method of monitoring your megaraid.. drop into /etc/cron.d/hourly for instance and be sure to have a mail server running and update with your email address.
#!/bin/bash
storcli64 /c0 show events type=sincereboot filter=warning,critical,fatal > /etc/storcli/status.tmp
if ! diff -q /etc/storcli/status /etc/storcli/status.tmp > /dev/null ; then
cat /etc/storcli/status.tmp | mail -s "RAID Problem on hostname!" user@example.com,anotheruser@example.com
mv /etc/storcli/status.tmp /etc/storcli/status
fi
@AndrewRose
AndrewRose / PKGBUILD
Last active August 29, 2015 13:57
PKGBUILD for ZTS wxPHP (includes wxWidgets, pthreads, event and runkit)
pkgname=wxphp
true && pkgname=(
'wxphp'
'wxphp-wxwidgets'
'wxphp-pecl-wxwidgets'
'wxphp-pecl-event'
'wxphp-pecl-runkit'
'wxphp-pecl-pthreads'
)
@AndrewRose
AndrewRose / gist:8805629
Last active August 29, 2015 13:56
quickstore
<?php
/*
create table store(
id int primary key,
value blob -- 65535 bytes
);
*/
@AndrewRose
AndrewRose / gist:6542509
Last active December 22, 2015 22:49
Quick and dirty example of how to interface with SpamAssassin using sockets in PHP.
<?php
/*
Copyright 2013 Andrew Rose http://andrewrose.co.uk
*/
class spamc
{
private static $version = 'SPAMC/1.2';
public static function test($email, $cmd='CHECK', $user='default', $ip='127.0.0.1', $port=783)