Skip to content

Instantly share code, notes, and snippets.

@joeashcraft
joeashcraft / test_not_group_write.py
Created September 24, 2021 18:59
Test if a file exists and is not group-writable
#!/usr/bin/python
"""Test if a file exists and is not group-writable.
AUTHOR: joe.ashcraft@rackspace.com
"""
from __future__ import print_function
import os, stat, sys
type : remote.http
label : HTTP WAN-IP example.com
disabled : false
period : 60
timeout : 30
target_alias : access_ip1_v4
monitoring_zones_poll : [ mzdfw, mziad, mzord, mzlon ]
details :
url : "http://example.com"
@joeashcraft
joeashcraft / gist:94668c5aba852e2b147d
Created January 22, 2016 19:56
lookup a list of domains, return IP's (follow CNAME's to the last A) or NONE
for d in google.com www.google.com rackspace.com www.rackspace.com ; do
echo -n "$d : "
result=$(dig +short "$d" | tail -n1)
if [ -z "$result" ]; then
echo NONE
else
echo "$result"
fi
done | column -t
@joeashcraft
joeashcraft / users.sh
Created January 22, 2016 19:19
list lines from "/etc/passwd" for non-system users
#!/bin/bash
getent passwd | awk -F':' '{ if ($3 >= '$(awk '/^UID_MIN/ {print $2}' /etc/login.defs)') print }'
exit 0
@joeashcraft
joeashcraft / agent_mysql.yaml
Created December 7, 2015 20:49
config file for agent.mysql check with 1 alarm
type : agent.mysql
label : "MySQL Metrics"
disabled : false
period : 60
timeout : 30
details :
username : "raxmon"
password : "password"
alarms:
alarm1:
@joeashcraft
joeashcraft / apache2buddy.pl
Last active October 20, 2020 06:27
Apache2 Buddy (2018-09-26)
#!/usr/bin/perl
eval "use diagnostics; 1" or die("\n[ FATAL ] Could not load the Diagnostics module.\n\nTry:\n\n sudo apt-get install perl-modules\n\nThen try running this script again.\n\n");
use Getopt::Long qw(:config no_ignore_case bundling pass_through);
use POSIX;
use strict;
use File::Find;
############################################################################################################
# __ ___ __ __ __ __
# ____ ____ ____ ______/ /_ ___ |__ \ / /_ __ ______/ /___/ /_ __ ____ / /

Keybase proof

I hereby claim:

  • I am joeashcraft on github.
  • I am joeashcraft (https://keybase.io/joeashcraft) on keybase.
  • I have a public key whose fingerprint is AF3B 884B E749 F82C 94A1 A126 F484 FA94 C201 0643

To claim this, I am signing this object: