Skip to content

Instantly share code, notes, and snippets.

View blakewrege's full-sized avatar

blake blakewrege

View GitHub Profile
@blakewrege
blakewrege / monitoring_sample_config.jsonnet
Created July 27, 2023 00:38 — forked from gkumarau/monitoring_sample_config.jsonnet
This file demonstrates the use of variables and loops for object and arrays in the JSON configuration using Jsonnet.
local environments = [ 'prod', 'test', 'dev' ];
local services = [ 'service1', 'service2', 'service3', 'service4' ];
{
environments: [
{
name: env,
services: [
'https://%s.%s.example.com' % [service, env]
for service in services
private static void WebRequest( string serverAddress, string Nick, string Pass)
{
string WEBSERVICE_URL = serverAddress;
try
{
var webRequest = System.Net.WebRequest.Create(WEBSERVICE_URL);
if (webRequest != null)
{
webRequest.Method = "GET";
webRequest.Timeout = 1200;
@blakewrege
blakewrege / Module1
Last active September 1, 2016 13:03
Macro for saving and closing an excel sheet after inactivity
' Insert this code in a excel vba module
Dim DownTime As Date
' Sets the timer for the spreadsheet
Sub SetTimer()
DownTime = Now + TimeValue("00:10:00")
Application.OnTime EarliestTime:=DownTime, _
Procedure:="ShutDown", Schedule:=True
End Sub
@blakewrege
blakewrege / NodeData.txt
Last active April 27, 2016 22:12
Parallel Prims Algorithm for Spark
50,70
1,8,10
2,17,10
2,34,17
3,35,16
3,38,1
4,5,6
4,22,8
4,25,3
5,12,13
@blakewrege
blakewrege / NodeData.txt
Last active November 6, 2022 14:59
Parallel Prims Algorithm for Spark Graphx
4,6
1,2,5
1,3,8
1,4,4
2,3,8
2,4,7
3,4,1
@blakewrege
blakewrege / config
Last active November 13, 2015 17:54
slack config for irc
IRSSI
/network add -nick blake -user blake.j.wrege@wmich.edu -realname blake acs
/server add -auto -ssl -network acs wmu-acs.irc.slack.com 6667 YOURPASSWORD
WEECHAT
/server add acs wmu-acs.irc.slack.com/6667 -autoconnect -ssl -ssl_dhkey_size=512 -username=blakewrege -nicks=blake -password=YOURPASSWORD
@blakewrege
blakewrege / 0_reuse_code.js
Created October 12, 2015 18:30
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
@blakewrege
blakewrege / rssht.sh
Created October 9, 2015 05:52
reverse tunnel ssh script
#!/bin/bash
# Script: rssht (Reverse SSH Tunnel)
# Author: Khizer Naeem (khizernaeem(x)gmail.com)
# Created : 09 Sep 2012
# Version: 1.04
# Latest Revision: 10 Feb 2013
# Tested on: Centos/RHEL 6, Centos/RHEL 5,
# Description: A bash script to maintain reverse ssh tunnel with remote port forwardings.
# URL: http://kxr.me/scripts/rssht_v1.03
#
@blakewrege
blakewrege / urlpath.js
Created September 28, 2015 17:12
Fixes url base path
<!-- Change base dependent on system -->
<p id="test"></p>
<script>
function urlpath() {
var hosts = window.location.href;
if (hosts.indexOf("brp9209") > -1) {
var strLink = "https://cs.wmich.edu/~brp9209/CS3500/";
} else if (hosts.indexOf("pmp2439") > -1) {
var strLink = "https://cs.wmich.edu/~pmp2439/CS3500/";
} else {
@blakewrege
blakewrege / sudobrew.rb
Created September 23, 2015 14:25
Install Homebrew as root
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/Homebrew/homebrew/tarball/master anywhere you like or
# change the value of HOMEBREW_PREFIX.
HOMEBREW_PREFIX = '/usr/local'
HOMEBREW_CACHE = '/Library/Caches/Homebrew'
HOMEBREW_REPO = 'https://github.com/Homebrew/homebrew'
module Tty extend self
def blue; bold 34; end