Skip to content

Instantly share code, notes, and snippets.

View mapledyne's full-sized avatar

Michael Knowles mapledyne

View GitHub Profile
@mapledyne
mapledyne / uberdog.py
Created March 29, 2018 16:00
Uberdog: get data dog status and display for Ubersicht
"""
Uberdog returns a small clip of HTML for of Datadog monitors.
This script gets the Datadog status of monitors and creates a small clip of
HTML which can then be displayed by Ubersicht. This widget leverages
FontAwesome since they make great web icons.
Three environment variables to be aware of:
* DATADOG_API: Your DataDog API key
* UBERDOG_APP: The APP key specific to this app_key
@mapledyne
mapledyne / test.rb
Created June 6, 2017 17:13
test datadog statsd
require 'datadog/statsd'
statsd = Datadog::Statsd.new
stat = 100
while true do
puts("Running channels: #{stat}")
statsd.gauge('iguana.channels.running', stat)
sleep(10)
@mapledyne
mapledyne / default.rb
Last active May 19, 2017 20:45
Add new Windows event log source via Chef.
# Note: You may want to change 'Application' in here, or make it more general,
# if you're wanting your data sources to be put somewhere else.
powershell_script 'Custom Event Log' do
code "new-eventlog -logname Application -source '#{name}'"
guard_interpreter :powershell_script
not_if "[System.Diagnostics.EventLog]::SourceExists('#{name}')"
end
@mapledyne
mapledyne / default.rb
Created May 11, 2017 22:26
datadog attribute chef file excerpt
def iis_sites
require 'win32ole'
web_admin = WIN32OLE.connect('winmgmts:root\\WebAdministration')
site = web_admin.InstancesOf('Site')
site
rescue WIN32OLERuntimeError
[]
end
@mapledyne
mapledyne / default.rb
Created May 11, 2017 22:23
datadog chef recipe excerpt
require 'ipaddr'
include_recipe 'datadog::dd-agent'
include_recipe 'datadog::dd-handler'
if node['platform'] == 'windows'
chef_gem 'win32-service' do
compile_time false
end
@mapledyne
mapledyne / yaaz_options.md
Last active May 1, 2017 17:20
Yaaz options
@mapledyne
mapledyne / led-fade.ino
Last active April 20, 2017 19:19
untested multi-led loop
unsigned long previous_time = 0;
int velocity_max = 15;
int rate_of_change = 25;
int led_max_brightness = 255;
int led_count = 2;
// This set could be improved with a struct, but not doing that to make it
// easier to read for someone who hasn't used structs:
int led_pins[2] = {5, 6};
@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>

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 / 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