Skip to content

Instantly share code, notes, and snippets.

View jaydansand's full-sized avatar

Jay Dansand jaydansand

  • Nsight/Cellcom
  • Appleton, WI
View GitHub Profile
@jaydansand
jaydansand / docker-shell.sh
Last active June 28, 2022 21:18
Launch a shell in a Docker container/image
#!/bin/sh
# Author: Jay Dansand
# URL: https://gist.github.com/jaydansand/29744bd44d6ea68611e430a401cb7d14
# Date: May 29 2019, modified June 28 2022
CONTAINER="$1"
if [ -z "$CONTAINER" ]; then
echo "Usage: `basename $0` container|service [shell command]"
echo " Executes shell command (default bash || sh) in a container. If CONTAINER"
echo " is not a running Docker container (appearing in 'docker ls -a') then it"
@jaydansand
jaydansand / wp_allow_update_notifications.php
Last active January 3, 2022 17:45
WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
<?php
/*
Plugin Name: Allow Update Notifications
Plugin URI: https://gist.github.com/jaydansand/2e41490a8b040a199db4
Description: WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
Version: 1.0
Author: Jay Dansand, Technology Services, Lawrence University
Author URI: https://gist.github.com/jaydansand
*/
/* Copyright 2014 Lawrence University
@jaydansand
jaydansand / ssl_test.sh
Last active December 14, 2021 13:36
Use OpenSSL to scan a host for available SSL/TLS protocols and cipher suites
#!/bin/bash
# Author: Jay Dansand, Technology Services, Lawrence University
# Date: 10/17/2014
# OpenSSL requires a port specification; default to 443.
SERVER="$1:443"
SERVER_HOST=$(echo "$SERVER" | cut -d ":" -f 1)
SERVER_PORT=$(echo "$SERVER" | cut -d ":" -f 2)
if [[ -z "$SERVER_HOST" || -z "$SERVER_PORT" ]]; then
echo "Usage: $0 host[:port] [ciphers [delay in ms]]"
@jaydansand
jaydansand / xmlrpc-slowdown.php
Last active August 18, 2020 21:06
Quick and dirty WordPress plugin to rate-limit XMLRPC calls (especially on login failure)
<?php
/*
Plugin Name: XMLRPC Slowdown
Plugin URI:
Description: Deliberately introduce some delay into XMLRPC calls to rate limit brute-force and DoS attacks.
Version: 1.0
Author: Jay Dansand, Technology Services, Lawrence University
Author URI: https://gist.github.com/jaydansand
*/