Skip to content

Instantly share code, notes, and snippets.

View mapledyne's full-sized avatar

Michael Knowles mapledyne

View GitHub Profile
@mapledyne
mapledyne / application.scss
Created July 1, 2015 16:18
Will mark stale widgets in Dashing
$background-stale-color-1: #cc9999;
$background-stale-color-2: #333333;
$text-stale-color: #fff;
@-webkit-keyframes status-stale-background {
0% { background-color: $background-stale-color-1; }
50% { background-color: $background-stale-color-2; }
100% { background-color: $background-stale-color-1; }
}
@mapledyne
mapledyne / delete-widget.rb
Created June 30, 2015 21:07
Delete a Dashing widget
require 'rubygems'
SCHEDULER.every '10s' do
widget = 'oba'
puts 'Deleting widget: ' + widget
Sinatra::Application.settings.history.delete(widget)
end
@mapledyne
mapledyne / dashing-clear.rb
Created June 30, 2015 19:05
Clear Dashing widgets
require 'rubygems'
SCHEDULER.cron '0 0 * * *' do
Sinatra::Application.settings.history.clear()
end
@mapledyne
mapledyne / nagios-dashing.erb
Created June 30, 2015 19:02
nagios display in dashing
<li data-row="1" data-col="1" data-sizex="3" data-sizey="1">
<div data-id="nagios-fulcrum" data-view="Iframe" data-service="Nagios Fulcrum" data-title="Nagios" data-url="http://<nagios server>/Naglite3/"></div>
</li>
@mapledyne
mapledyne / oba.rb
Created June 30, 2015 18:30
Local bus info widget in Dashing
require 'rubygems'
require 'nokogiri'
require 'open-uri'
widget = 'oba'
walktime = 5
SCHEDULER.every '1m' do
soonest = 20
@mapledyne
mapledyne / widget-count.rb
Last active August 29, 2015 14:24
Get widget count in Dashing
require 'rubygems'
widget_count = "widget_count"
SCHEDULER.every '30s' do
widgets = Sinatra::Application.settings.history
total = widgets.length
puts "sending " + widget_count.to_s + " : " + total.to_s
@mapledyne
mapledyne / skytap_info
Created February 24, 2015 23:20
Get a Skytap configuration URL from IP address
#!/bin/bash
# A simple script that wraps a call to the Skytap metadata service. This will pull the configuration URL
# from the metadata service. Useful when you have the IP address of the server, but not easy translation to
# what configuration it is.
# It just passes the first parameter into SSH, so use the formatting as apporpriate:
# Example:
# skytap_info [email protected]