Skip to content

Instantly share code, notes, and snippets.

View steadystatic's full-sized avatar

Mike Wabst steadystatic

View GitHub Profile
@steadystatic
steadystatic / destroy-buncha-images.sh
Last active November 2, 2015 22:20
Destroy multiple DigitalOcean images with bash array and tugboat
#!/bin/bash
#Array of image ids, find these by checking `tugboat images`
images=("14191201" "14191223" "14191250" "14191302" "14191377" "14191400" "14191425" "14191441" "14191462" "14191483" "14191505" "14191517" "14191537" "14191615" "14191636" "14191655" "14191674" "14191698" "14191729" "14191747" "14191793" "14191768" "14191812")
#Array length
imageLength=${#images[@]}
for (( i=0; i<${imageLength}; i++));
do
@steadystatic
steadystatic / git-tag-diff-md
Created November 2, 2015 22:10
Quick way to log differences in a Markdown format
#!/bin/sh
#Path to your git needs to be here
PATH=/usr/local/bin:/usr/bin
#6 columns markdown table doc
echo "|PR TAG|DATE|AUTHOR|SHA|ORIGINAL BRANCH|MESSAGE|" > demo-diff.md
# TAGS USED BELOW ARE STATIC, ADJUST
# Ensure pretty format has same amount of columns as above echo, this appends into that file
@steadystatic
steadystatic / jira-filter-sort.js
Created November 5, 2015 06:09
Filter and Sort Jira Issues Based on PR title string
(function() {
var demoRelated = jQuery('tr > td:contains("DEMO")').parent();
var par = jQuery('tr > td:contains("DEMO")').parents('#pull-requests-table');
var demoCollector = [];
var orderedItems = [];
var patReg = /[0-9]+/;
for (var i = 0; i < demoRelated.length; i++) {
var demoItemText = jQuery(demoRelated[i]).find('a:contains("DEMO")').text().match(patReg);
var demoItemSelector = jQuery(demoRelated[i]).data('pullrequestid');
var demoItem = {
@steadystatic
steadystatic / cherry-picker.sh
Created November 5, 2015 18:32
Quick script for when you have to cherry pick a bunch...
#!/bin/bash
#Use cautiously, cherry picks can end up in merge conflicts...and cherry-pick --continue abort etc.
#Array of SHAs to cherry pick
shas=("6736214" "6364c9c" "b25a80e" "6af051f" "571bf75" "5099a13" "c2caa98")
#Array length
shasLength=${#shas[@]}
@steadystatic
steadystatic / getmcsnap.js
Last active November 13, 2015 08:15
Quick way to get latest Minecraft snapshot from NodeJS
var request = require('request'),
baseUrl = "https://s3.amazonaws.com/Minecraft.Download/versions/",
queryUrl = baseUrl + "versions.json",
downloadUrl = "https://s3.amazonaws.com/Minecraft.Download/versions/";
request(queryUrl, function(error, response, body) {
var mcReply = JSON.parse(body);
console.log(downloadUrl + mcReply.latest.snapshot + "/minecraft_server." + mcReply.latest.snapshot + ".jar");
});
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLSessionTickets Off
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
Header always set X-Frame-Options DENY
Header always set X-Content-Type-Options nosniff
# Requires Apache >= 2.4
SSLCompression off
SSLUseStapling on
@steadystatic
steadystatic / .editorconfig
Created January 14, 2016 22:29
Sample EditorConfig File
# No .editorconfig files above the root directory
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@steadystatic
steadystatic / jboss-wrap.sh
Last active January 27, 2016 22:04
Start JBoss or if it's already running tail the log
ps -ef | grep "standalone" | grep -v -e 'grep\|Java'; if [[ $? -eq 1 ]]; then; sh /usr/local/opt/jboss-eap-6.4/bin/standalone.sh; else; tail -f /usr/local/opt/jboss-eap-6.4/standalone/log/server.log; fi;
@steadystatic
steadystatic / log-notify.sh
Created March 14, 2016 22:38
Monitor JBoss
#!/bin/sh
#Script requires 'md5' and 'terminal-notifier' to be installed
JBOSS_LOG=/usr/local/opt/jboss-eap-6.4/standalone/log/server.log
#Monitors JBoss logfile for keyword, notifies
while x=0;
fileHash=$(md5 $JBOSS_LOG | cut -d "=" -f2)
sleep 1
@steadystatic
steadystatic / amazon-only-imgs.js
Last active April 14, 2016 16:28
Quick Little Amazon Picker (hides everything but product images)
//Paste into your URL bar in Chrome, remove this comment line (make sure you keep the "javascript:" bit, it might get stripped):
javascript: var imgList = document.querySelectorAll('.s-access-image'); document.querySelector('body').innerHTML = ''; for (i=0; i < imgList.length; i++) {document.querySelector('body').innerHTML += imgList[i].outerHTML.replace('src', 'onclick="this.parentNode.removeChild(this)" src');}