Skip to content

Instantly share code, notes, and snippets.

View mdcollins05's full-sized avatar

MDCollins mdcollins05

View GitHub Profile
@mdcollins05
mdcollins05 / settings.yaml
Created June 9, 2022 02:28
srt-auto-edit rules
---
rules_directory: ./rules.d
rules:
- name: Remove formatting
type: regex
pattern: '</?(font|b|i|u).*?>'
action: replace
value: ""

Keybase proof

I hereby claim:

  • I am mdcollins05 on github.
  • I am mdcollins05 (https://keybase.io/mdcollins05) on keybase.
  • I have a public key ASDQvcOg1DQ3h2CNnD52UqVV5BbGW_WbyZ6uyS00Pe750go

To claim this, I am signing this object:

#!/usr/bin/env python
import requests
import json
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# Your PagerDuty API key. A read-only key will work for this.
api_key = 'ENTER_API_KEY'
#!/usr/bin/python
# Python script to create recurring maintenance windows in PagerDuty
#
# Copyright (c) 2015, PagerDuty, Inc. <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
#!/usr/bin/env ruby
require 'rubygems'
require 'faraday'
require 'json'
require 'csv'
class PagerDutyAgent
attr_reader :requester_id
attr_reader :token
#!/usr/bin/python
import requests
import sys
import json
import pprint
from time import sleep
#This is the user ID going on vacation
vacationing_user = 'PR2D0IM'
@mdcollins05
mdcollins05 / import_users.rb
Last active January 12, 2017 23:35 — forked from baskarp/import_users.rb
A simple Ruby script to import users into PagerDuty from a CSV file
#!/usr/bin/env ruby
require 'rubygems'
require 'faraday'
require 'json'
require 'csv'
class PagerDutyAgent
attr_reader :requester_id
attr_reader :token
@mdcollins05
mdcollins05 / users-without-sms.py
Created July 27, 2015 19:03
This will generate a CSV containing user's names and email addresses if they do not have at least one SMS notification rule.
#!/usr/bin/python
import requests
import sys
import json
#Your PagerDuty API key. A read-only key will work for this.
auth_token = 'API_KEY_HERE'
#The PagerDuty subdomain
#!/usr/bin/env python
import requests
import sys
import json
from datetime import date, timedelta
#Your PagerDuty API key. A read-only key will work for this.
AUTH_TOKEN = 'YOUR_API_KEY'
#The API base url, make sure to include the subdomain
@mdcollins05
mdcollins05 / check_pd_mailserver_ips.sh
Last active August 29, 2015 14:16
For use in a cron job. It will echo the new IPs to stdout if there are changes.
#!/bin/bash
## This script is designed to be run via a cron job with the MAILTO variable set to generate an email when output occurs (an IP is added/removed/changed)
if [ -f "mailservers_result.txt" ]; then
mv mailservers_result.txt mailservers_result.txt.old
fi
dig +short mx acme.pagerduty.com | sed 's/.$//g' | sed 's/^[0-9][0-9]* //g' | xargs dig +short | sort > mailservers_result.txt