Skip to content

Instantly share code, notes, and snippets.

View greenbicycle's full-sized avatar
🐈
maintaining a state of cat-like awareness

Jeff Davis greenbicycle

🐈
maintaining a state of cat-like awareness
  • University of Arizona
  • Tucson, AZ
View GitHub Profile
@greenbicycle
greenbicycle / gist:abceafbec3be09969ad5
Last active April 9, 2020 14:47
Quick script to scan multiple domains with wpscan
#!/bin/bash
#
# Use WPScan to scan sites running Wordpress
# and Store the output somewhere
#
domains='domain1.com example2.com example.com'
# Where do you want output to go? Better without trailing slash
@greenbicycle
greenbicycle / Instructions.md
Last active August 11, 2017 16:34
My basic gitconfig file.

Copy this file to ~/.gitconfig and replace the following:

%%name%% with your name (no quotes)

%%email%% your email address (no quotes)

%%gitconfig_global%% - the global gitignore file. It is usually named ~/.gitignore_global

@greenbicycle
greenbicycle / EvernoteAccountStatistics.scpt
Created December 18, 2015 13:29
Evernote Account Statistics
tell application "Evernote"
set AccountName to (name of current account)
set numberOfTags to count of tags
set numberOfNoteBooks to count of notebooks
set numberOfNotes to count of (find notes "*")
set strMessage to "Account Name: " & strAcctName & return & ¬
return & "Num of Notes: " & numNotes ¬
& return & "Num of Notebooks: " & numNB ¬
& return & "Num of Tags: " & numTags
set strMessageTitle to "Evernote Mac Account Statistics"
@greenbicycle
greenbicycle / list-top-ip-addresses
Created February 11, 2016 20:18
List top 10 ip addresses that are hitting wp-login in access log
#!/bin/bash
#
# List the top 10 IP addresses that are hitting wp-login.php, sorted by number of lines in access.log
#
# @tags: Wordpress, access, apache, ip addresses
grep wp-login access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 10
@greenbicycle
greenbicycle / install-rundeck-on-ubuntu.sh
Last active December 21, 2016 22:49
Install Rundeck on Ubuntu
#
# Installing Rundeck on Ubuntu 14.04
# http://rundeck.org
# http://digitalocean.com
# I am installing on a new digital ocean droplet
apt-get update && apt-get upgrade -y
# This is a require of rundeck
#!/bin/bash
# This will get the private networking address from a Digital Ocean droplet
# ifconfig | grep -C 1 eth1 | grep inet | awk -F' ' '{ print $2 }' | awk -F: '{ print $2 }'
# This will show all the ip addresses for this droplet
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
@greenbicycle
greenbicycle / get-yaml-from-markdown
Last active April 5, 2016 02:38
Parse yaml section from Markdown file
#!/usr/bin/env php
<?php
/*
* I like to use Markdown with embedded yaml to store certain info
* This is a quick and dirty first attempt. I probably will find some
* other chars to add to the preg_match_all pattern.
*
*/
$file=$argv[1];
@greenbicycle
greenbicycle / supervisor-config-notes.md
Last active May 5, 2016 19:21
Configuration Notes for supervisor

Copy the following to /etc/supervisor/conf.d/mysql.conf

[program:mysqld]
command=/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock

Add this to /etc/supervisor/supervisord.conf

@greenbicycle
greenbicycle / Slackhandler
Last active August 20, 2018 22:50
Make Laravel use SlackHandler for Logging
/*
I am using Laravel 5.2. This will probably work for many versions, but use at your own risk.
Instructions
- Make sure that you add SLACK_TOKEN, SLACK_CHANNEL, SLACK_USERNAME, SLACK_ICON in .env
- SLACK_ICON - you can use almost any emoji that Slack supports. See http://www.emoji-cheat-sheet.com/
- SLACK_USER - You can use any username you want to. It doesn't have to be an existing user
- SLACK_CHANNEL - I don't know what happens if you use a non-existent channel. I always make sure the channel exists first
- SLACK_TOKEN - You can find this in your Slack account somewhere
- Add the code below to the top of bootstrap/app.php
@greenbicycle
greenbicycle / wp-cli-update
Created September 8, 2016 03:16
wp-cli-update script
#!/bin/bash
# wp-cli-update
#
# Download the latest wp-cli and put it wherever it is supposed
# to go.
#
WPCLI_LOCATION=/usr/local/sbin/wp
curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \