Skip to content

Instantly share code, notes, and snippets.

Mike xyntrix

  • Arizona
Block or report user

Report or block xyntrix

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ss.go
// +build windows
package screen
import (
"fmt"
"image"
"reflect"
"syscall"
"unsafe"
View collectd_install_centos6.sh
PKGS="collectd collectd-apache collectd-curl collectd-dns collectd-ipmi collectd-netlink collectd-ping collectd-redis collectd-write_redis"
/usr/bin/yum -q -y install ${PKGS}
CNFFILE="/etc/collectd.conf"
CNFDIR="/etc/collectd.d"
BACKUPDIR="/root/collectd.`date +%s`"
mkdir -p ${BACKUPDIR}
mv -v ${CNFDIR}/* ${BACKUPDIR}/
cp -v ${CNFFILE} ${BACKUPDIR}/
mkdir -p ${CNFDIR}/
@xyntrix
xyntrix / goodbad.sh
Last active Aug 29, 2015
Ad-hoc Sensu Alarm
View goodbad.sh
function bad () {
# { short_hostname, alarm_name, handler_name}
# default: hostname -s, alarmtest, enterprise_mws
[ -z ${1} ] && ahost="`hostname -s`" || ahost=${1}
[ -z ${2} ] && check="alarmtest" || check="${2}"
[ -z ${3} ] && handler="enterprise_mws" || handler="${3}"
echo "`date`: badding ${ahost}, ${check}"
echo '{ "source": "'${ahost}'", "handlers": [ "'${handler}'" ], "name": "'${check}'", "issued": "'`date +%s`'", "output": "CRITICAL: '${ahost}' is sad.", "status": 2 }' | nc -w1 127.0.0.1 3030
}
function good () {
@xyntrix
xyntrix / slackmsg.sh
Created Jul 2, 2015
Slack notify script
View slackmsg.sh
#!/bin/sh
# must set:
# - slacktoken (token part of slack hook url)
# - slackchannel (channel to send to)
# - slackbotname (bot name)
# - slicon (default bot icon)
# - slacknotice (true/false, false - supress sending slack notices)
#
if [ -z "${slacktoken}" ]; then
@xyntrix
xyntrix / gist:5e542c73df6abe6edbce
Created Apr 22, 2015
MegaCli? More like, MegaCrazy..
View gist:5e542c73df6abe6edbce
$ rpm -qp MegaCli-8.07.14-1.noarch.rpm --scripts
postinstall scriptlet (using /bin/sh):
touch /opt/MegaRAID/MegaCli/install.log
if [ -f /opt/MegaCli ]
then
echo "Warning! Previous MegaCli package is already installed under /opt directory"
fi
if [ -f /usr/sbin/MegaCli ]
then
View client.json
{
"client": {
"safe_mode": false,
"address": "XXIP",
"subscriptions": [
"linuxhost",
"XXSHORTHOSTNAME",
"XXSOME_PRODUCT_HOSTTYPE_IDENTIFIER",
"XXANOTHER_PRODUCT_HOSTTYPE_IDENTIFIER"
],
View gist:2ac65e48413160e5196b
- document test/development process for enterprise checks
- secure hardware / os platforms for testing
View gist:34716a3d5aea2f7af41c
#showtooltip Rebuke
/cast [harm] Rebuke [target=targettarget,harm] Rebuke
/run local a=UnitCastingInfo("target")_=a and SendChatMessage("Interrupted %t; casting ["..a.."].","SAY")
View gist:eb479019a3f40d9b06c9
[root@vultr ~]# hdparm -tT /dev/vda
/dev/vda:
Timing cached reads: 27278 MB in 2.00 seconds = 13655.17 MB/sec
Timing buffered disk reads: 1366 MB in 3.00 seconds = 455.25 MB/sec
[root@vultr ~]# hdparm --direct -tT /dev/vda
/dev/vda:
Timing O_DIRECT cached reads: 872 MB in 2.00 seconds = 435.08 MB/sec
Timing O_DIRECT disk reads: 1276 MB in 3.00 seconds = 424.78 MB/sec
@xyntrix
xyntrix / storage.patch
Created Aug 26, 2014
Fix for CLUSTER_SERVERS on Graphite-web v0.9.12, on Linux, when net.ipv4.ip_nonlocal_bind = 1 (usually set when using keepalived)
View storage.patch
--- storage-orig.py 2014-08-25 19:24:37.357155937 -0700
+++ storage.py 2014-08-25 19:26:04.100154924 -0700
@@ -98,22 +98,18 @@
if ':' in host:
host = host.split(':',1)[0]
- for port in xrange(1025, 65535):
- try:
- sock = socket.socket()
- sock.bind( (host,port) )
You can’t perform that action at this time.