Skip to content

Instantly share code, notes, and snippets.

View julianeon's full-sized avatar

Julian Martinez julianeon

View GitHub Profile
@julianeon
julianeon / search-amazon.rb
Last active December 21, 2015 16:59
Amazon example script; an example of working with a much different API.
require "rubygems"
require "amazon_product"
req = AmazonProduct["us"]
req.configure do |c|
c.key = "fake"
c.secret = "also-fake"
c.tag = "another-fake"
end
@julianeon
julianeon / pd-search-name-in-schedules-print-file.rb
Last active December 25, 2015 01:19
A Ruby script to search all schedules for a given user name and output the names of the schedules that contain it.
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
@julianeon
julianeon / pd-annual-incidents-in-service.rb
Last active December 26, 2015 19:29
A Ruby script to list all the incidents in a service for the year and print it to IncidentsInService.txt.
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
@julianeon
julianeon / pd-schedule-maker.rb
Last active December 27, 2015 10:19
A tentative work in progress script to create schedules from the command line.
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
@julianeon
julianeon / pd-event-creator.rb
Last active December 27, 2015 17:29
Ruby code to trigger an event through the API.
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
@julianeon
julianeon / heroku-listener-emailer.js
Last active July 25, 2016 12:47
Event state change emailer. It listens for webhook updates and sends email updates (as they come in) to the email address given in your service's name. For now, it looks for one email address in the service line, then sends notifications to that address.
//Node.js script to act as a listener for webhooks.
//
// Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
// 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
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
@julianeon
julianeon / pd-trigger-incident.rb
Last active December 28, 2015 16:58
Ruby script to trigger incidents using the API.
# Ruby script to create events using the API.
#
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@julianeon
julianeon / pd-trigger-incident.py
Last active December 28, 2015 17:29
Python script to trigger incidents using the API.
# Python script to create events using the API.
#
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
@julianeon
julianeon / pd-get-schedule.rb
Last active December 31, 2015 01:39
Ruby script to get an individual schedule by its ID.
# Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com>
# 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
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.