Skip to content

Instantly share code, notes, and snippets.

View mapledyne's full-sized avatar

Michael Knowles mapledyne

View GitHub Profile
@mapledyne
mapledyne / Close All.scpt
Created July 28, 2015 17:16
Close open applications
tell application "System Events" to set quitapps to name of every application process whose visible is true and name is not "Finder"
repeat with closeall in quitapps
quit application closeall
end repeat
@mapledyne
mapledyne / bashrc
Last active November 7, 2016 23:34
A gradual list of bash aliases
export PATH=/Users/mknowles/Documents/BitBucket/belfry:/Users/mknowles/Dropbox\ \(Personal\)/Tech\ Tools/scripts:$PATH
export PYTHONPATH="${PYTHONPATH}:/Users/mknowles/git/skytap"
#export MAGICK_HOME="/usr/local/bin/ImageMagick-6.9.2"
#export PATH="$MAGICK_HOME/bin:$PATH"
#export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
# source ~/Git/liquidprompt/liquidprompt
# source /Users/mknowles/Dropbox\ \(Personal\)/Tech\ Tools/scripts/switch.sh
@mapledyne
mapledyne / bandwidth.rb
Created September 3, 2015 15:41
Cisco ASA Bandwidth usage widget for dashing.io
require 'rubygems'
require 'snmp'
# Populate the graph with some random points
@inbound_points = []
@outbound_points = []
@inbound_long = []
@outbound_long = []
@mapledyne
mapledyne / fontawesome.coffee
Created September 9, 2015 21:30
Fontawesome widget add on for Übersicht
refreshFrequency: false
render: () ->
return '''
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
'''
@mapledyne
mapledyne / environment.erb
Last active September 16, 2015 20:31
Dynamically creating dashing.io dashboards
<%
require 'rubygems'
require 'json'
class Widget
def initialize(id,title,view,order)
@widget_id = id
@widget_view = view
@widget_title = title
@widget_order = order
@mapledyne
mapledyne / check_github_mfa.py
Created January 12, 2016 18:14
Nagios check file to check for MFA use with users in our org
#!/usr/bin/python
import sys
import commands
import json
def update():
"""Return list of users without MFA, or an OK status."""
status, data = commands.getstatusoutput("curl -s -H \"Authorization: token YOUR_GITHUB_TOKEN\" https://api.github.com/orgs/ORG_NAME/members?filter=2fa_disabled")
@mapledyne
mapledyne / 0_reuse_code.js
Created March 4, 2016 05:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mapledyne
mapledyne / brewstart.sh
Last active November 7, 2016 22:13
Brew install script to sync up computers with apps I use
#!/bin/sh
brew install calc
brew install cowsay
brew install dockutil
brew install fish
brew cask install python
brew cask install python3
brew cask install imagemagick

Keybase proof

I hereby claim:

  • I am mapledyne on github.
  • I am mapledyne (https://keybase.io/mapledyne) on keybase.
  • I have a public key whose fingerprint is 0922 86AD E7F1 228C 17FD E7CF EF50 1549 2E77 3ADD

To claim this, I am signing this object:

@mapledyne
mapledyne / Text Substitutions.plist
Created December 2, 2016 00:01
Text substitutions for mac/ios
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>‽</string>
<key>shortcut</key>
<string>!?</string>
</dict>