Skip to content

Instantly share code, notes, and snippets.

View mrunyon's full-sized avatar

Michael Runyon mrunyon

  • Internet Business Solutions
  • South Bend, IN
View GitHub Profile
@mrunyon
mrunyon / wp.sh
Created April 4, 2017 19:20 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@mrunyon
mrunyon / endomondo-api.curl
Created May 18, 2016 19:40
endomondo API Example
https://www.endomondo.com/rest/v1/users/14984220/workouts/latest
@mrunyon
mrunyon / gen-xkcd-pass
Last active April 6, 2017 17:44 — forked from l0s/gen-xkcd-pass
XKCD password generator for BSD / Mac OS X
# adapted from: https://pthree.org/2015/09/05/password-generation-in-the-shell/
# which is inspired by: https://xkcd.com/936/
# Modified to use a list of 10,000 most common English words.
# Outputs exactly 4 words, separated by a dash
gen-xkcd-pass() {
[ $(echo "$1"|grep -E "[0-9]+") ] && NUM="$1" || NUM=1
DICT=$(LC_CTYPE=C grep -E "^[a-zA-Z]{3,6}$" /Users/mrunyon/words-common.txt)
for I in $(seq 1 "$NUM"); do
WORDS=$(echo "$DICT"|gshuf -n 4|paste -sd ' ' -)
XKCD=$(echo "$WORDS"|sed 's/ /-/g')
@mrunyon
mrunyon / pam-authenticate.py
Created March 29, 2013 16:56
Script to test authentication against a *nix system using PAM and pexpect. Takes 2 arguments from the command line for username and password. Modified from original to support CentOS4 more explicitly. Original source; jay_t @ stackoverflow.com : http://stackoverflow.com/questions/5286321/pam-authentication-in-python-without-root-privileges
#!/usr/bin/python
import sys, getopt, pexpect
def main(argv):
username = ''
password = ''
try:
opts, args = getopt.getopt(argv,"hu:p:",["username=","password="])
except getopt.GetoptError:
print 'check-pwd.py -u <username> -p <password>'
sys.exit(2)