Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Edwards justinledwards

View GitHub Profile
View prometheus.yml
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [address, port]
target_label: __address__
replacement: '${1}:${port}'
View garzaservo.ino
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
View relay.rb
require 'discordrb'
bot_token = ENV['BOT_TOKEN']
bot = Discordrb::Bot.new token: bot_token
bot.message(in: 492479830240133161) do |event|
mentions = event.message.role_mentions
mentions.each do |mention|
if mention.name == 'raids'
puts "raids was mentioned"
bot.channel(492480199489749006).send "#{event.author.nickname}: #{event.message} #{Time.now.strftime("%I:%M %p")}"
elsif mention.name == 'exraids'
View randsample.html
<html>
<head>
<title>Random Sample</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<label>Range Start: </label> <input id="range_start" value="1"></input>
<label>Range End: </label> <input id="range_end" value="100"></input>
<label>Sample Size: </label> <input id="sample_size" value="50"></input>
@justinledwards
justinledwards / converter.cr
Created Jun 9, 2017
Advice required for first crystal app
View converter.cr
# Recorded OTA Conversion App
files = [] of String
Dir.cd "/mnt/MediaArchive/TV-Optimized/"
directory = Dir.glob("**/*")
directory.each do |file|
# TODO, filter files listed to a new array for things that need converting
files << file if /\.ts$/ =~ file
end
@justinledwards
justinledwards / Gemfile
Created Sep 30, 2016
Gemfile for sidewalker
View Gemfile
source 'https://rubygems.org'
gem 'cinch'
gem 'require_all'
gem 'ruby-hackernews'
gem 'money'
gem 'google_currency'
gem 'ruby-units'
gem 'wolfram-alpha'
@justinledwards
justinledwards / broke.log
Created Jun 29, 2016
thews broke things on single node flynn cluster
View broke.log
ws@flynn-01:~$ sudo flynn-host ps
ID STATE CREATED CONTROLLER APP CONTROLLER TYPE ERROR
flynn01-c28b950f-bbae-42ca-bf3e-8fb8aab8093f running 1 seconds ago discoverd app
flynn01-ceb14fcf-9cea-4736-bdd5-17751f03c62c running 2 seconds ago logaggregator app
flynn01-aa433fdb-2dfc-4349-a296-bd54ab278014 running 5 seconds ago status web
flynn01-20719210-9c6d-4a31-a615-0663cde88676 running 5 seconds ago dashboard web
flynn01-c7300a5f-8158-48cb-b9a2-1c9cb3f63edd running 5 seconds ago controller worker
flynn01-c679d43d-2245-49ea-a113-eaedd7ab44ac running 5 seconds ago router app
flynn01-1a6bcaaf-af63-4164-a44a-9786316f64de running 7 seconds ago gitreceive app
flynn01-6ca8db39-725b-4915-8ab7-1151f2e6fd25 running 9 seconds ago blobstore web
@justinledwards
justinledwards / zfshealthcheck.rb
Created May 26, 2016
Ruby ZFS Health Notification Script
View zfshealthcheck.rb
#!/usr/bin/env ruby
zpool_status = `sudo zpool status`
pool = ''
state = ''
category = ''
category_i = 0
status = ''
action = ''
see = ''
@justinledwards
justinledwards / blinkdrive.sh
Last active May 23, 2016
ubuntu lsi sas 3008 drive blink
View blinkdrive.sh
first=$(sas3ircu 0 display | grep -B 8 $1)
second=$(sas3ircu 1 display | grep -B 8 $1)
third=$(sas3ircu 2 display | grep -B 8 $1)
CARD=""
if [[ "$first" ]]; then
CARD="0"
fi
if [[ "$second" ]]; then
CARD="1"
fi
@justinledwards
justinledwards / README.md
Last active May 23, 2016
Ubuntu LSI SAS 3008 drive blink
View README.md