Skip to content

Instantly share code, notes, and snippets.

@danmilleruk
danmilleruk / aws-saml-search.js
Created August 4, 2020 09:52
Tampermonkey script to add a search box to the AWS SAML login screen
// ==UserScript==
// @name AWS Shib SSO Search
// @namespace signin.aws.amazon.com
// @description Provides SAML search functionality
// @include https://signin.aws.amazon.com/saml
// @version 1
// @grant none
// ==/UserScript==
$('fieldset').before('<div id="searchbox"><input type="text" placeholder="Account Search..."></div>');

Keybase proof

I hereby claim:

  • I am danmilleruk on github.
  • I am deehem (https://keybase.io/deehem) on keybase.
  • I have a public key whose fingerprint is 8CEA 5AB4 1A00 239C BCF5 2498 170D F145 8F27 DC67

To claim this, I am signing this object:

# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>

Keybase proof

I hereby claim:

  • I am Deehem on github.
  • I am deehem (https://keybase.io/deehem) on keybase.
  • I have a public key whose fingerprint is 8CEA 5AB4 1A00 239C BCF5 2498 170D F145 8F27 DC67

To claim this, I am signing this object:

#!/usr/bin/perl
use cPanel::PublicAPI;
use Getopt::Long;
&Getopt::Long::config('bundling');
# Options args
my $conf = GetOptions(
"H|hostname=s" => \$conf_host,
"P|port=i" => \$conf_port,
@danmilleruk
danmilleruk / findusers.sh
Created August 30, 2013 10:05
Finds cPanel users that no longer exist on a particular system, but where the home directory is still intact.
#!/bin/bash
# Find removed accounts
# Dan Miller <dm@sub6.com>
cd /home
LS=`ls -1 | grep -v 'aquota.user\|cagefs\|quota.user\|lost+found\|cpbandwidth\|cprestore\|cpeasyapache'`
echo ""
@danmilleruk
danmilleruk / amazon_ref_convert.php
Created August 28, 2013 20:30
Convert amazon UK links to a referral tag.
<?PHP
$tag = "danmil-21";
if($_POST['submit'])
{
// Gather variables to store the submitted data and explode the values as needed
$url = $_POST['url'];
$array = explode("/", "$url");
@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
@danmilleruk
danmilleruk / senderbase.php
Last active May 6, 2016 13:07
senderbase.org nagios plugin via PHP CLI. ./senderbase <ipaddress>
#!/usr/bin/php
<?php
# Senderbase Monitoring Plugin for Nagios
# Dan Miller <dm@sub6.com>
error_reporting(E_ERROR | E_PARSE);
# Function to swap the octets of an IP...
# ..address around in to ARPA formatting.
@danmilleruk
danmilleruk / quota_check.php
Last active December 20, 2015 20:49
Checks for accounts with Unlimited Quota on cPanel servers.
#!/usr/bin/php -q
<?php
# Unlimited Quota Check Script
# Dan Miller <dm@sub6.com
$email = 'dm@sub6.com'; # Email address to send to
$hostn = gethostname(); # Machine hostname without a line break
$count = 0; # Ignore