Skip to content

Instantly share code, notes, and snippets.

View jnewland's full-sized avatar

Jesse Newland jnewland

View GitHub Profile
require 'net/http'
require 'json'
require 'time'
# Set the API token, organization, pipeline, and created_from date
API_TOKEN = ENV['API_TOKEN']
ORG_SLUG = ENV['BUILDKITE_ORGANIZATION_SLUG'] || 'your-org'
PIPELINE_SLUG = ENV['BUILDKITE_PIPELINE_SLUG'] || 'your-pipeline'
PER_PAGE = 100
@jnewland
jnewland / danger_day.rb
Created February 6, 2023 00:30
From May of 2008, for historical purposes: a Twitter bot that allowed sharing your location on Fire Eagle (RIP) via DMs
# Tiny Twitter Bot.
#
require 'rubygems'
require 'xmpp4r-simple'
require 'active_record'
require 'fireeagle'
require 'kconv'
require 'shorturl'
require 'uri'
@jnewland
jnewland / README.md
Last active November 3, 2020 13:43
Using renovate to automate updating the version of basically anything in an infra as code GitHub repo

Usage

Setup https://github.com/renovatebot/github-action and add renovate.json (below) to your repository. The versions of Terraform modules and providers, FROM statements in Dockerfiles, and image fields in Kubernetes configuration matching deployments/*.yaml will be automatically detected and update PRs will be created automatically.

To supplement this configuration, the regexmanagers in the included renovate.json enable automatic updates of most things that a) release versions in a format compatible with a supported datasource (like GitHub tags or releases) and b) configure their version in a YAML file or shell script.

Comment-annotated YAML Version Keys

jobs:
@jnewland
jnewland / repl.py
Last active January 2, 2016 05:26
python-openzwave repl
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of **python-openzwave** project https://github.com/OpenZWave/python-openzwave.
:platform: Unix, Windows, MacOS X
:sinopsis: openzwave wrapper
.. moduleauthor:: bibi21000 aka Sébastien GALLET <bibi21000@gmail.com>
#!/bin/bash
#/ Usage: bench.sh <setup> <command> <teardown> <repeats>
set -e
[ $# -lt 4 ] && {
tail -n +2 "$0" |
grep "^#/" |
cut -c4-
exit 2
}
testing1234567
# CheckGraphite
# A simple framework for writing nagios checks based on Graphite data.
# Usage
# -----
#
# $ cat /tmp/page-queue.coffee
# CheckGraphite = require('check-graphite')
#

The Ack Bar

Brainstorming an ideal landing page for indicating the status of working an Ops/Nagios/PagerDuty alert.

First, indicate your initial thoughts on the alert

I know, bro

#!/bin/bash
prog="remote_syslog"
config="/etc/log_files.yml"
pid_dir="/var/run"
EXTRAOPTIONS=""
pid_file="$pid_dir/$prog.pid"