Skip to content

Instantly share code, notes, and snippets.

Avatar

Jay Dansand jaydansand

  • Lawrence University
  • Appleton, WI
View GitHub Profile
@jaydansand
jaydansand / docker-shell.sh
Last active May 15, 2020
Launch a shell in a Docker container/image
View docker-shell.sh
#!/bin/sh
# Author: Jay Dansand, Technology Services, Lawrence University
# URL: https://gist.github.com/jaydansand/29744bd44d6ea68611e430a401cb7d14
# Date: May 29 2019, modified Jan 10 2020
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 Jun 29, 2020
WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
View wp_allow_update_notifications.php
<?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 May 1, 2021
Use OpenSSL to scan a host for available SSL/TLS protocols and cipher suites
View ssl_test.sh
#!/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 Aug 18, 2020
Quick and dirty WordPress plugin to rate-limit XMLRPC calls (especially on login failure)
View xmlrpc-slowdown.php
<?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
*/