This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PDupdate = function(e) { | |
ajax( | |
{ | |
url: 'http://'+subdomain+'.pagerduty.com/api/v1/incidents/count?'+ | |
'status=triggered,acknowledged&assigned_to_user='+user_id, | |
type: 'json', | |
headers: { | |
Authorization: 'Token token='+token, | |
contentType: 'application/json; charset=utf-8' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param ( | |
[String]$servicekey, | |
[String]$EventType, | |
[String]$AlertID, | |
[String]$AlertDesc = "No Description provided", | |
[String]$WebLink = "http://www.pagerduty.com/", | |
[String]$AlertName = "No Name provided", | |
[String]$AlertSourceName = "No Source provided" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script> | |
// Step 1. Put the URL from <form action="URL"> here: | |
var form_url = "https://docs.google.com/a/euri.ca/forms/d/1V6pF3NGpEev0Pl8p22V2fmfHtx-09UtF0bnyAuFoN5E/formResponse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initiate PDJS: | |
PDJS = new PDJSobj({ | |
subdomain: config["subdomain"], | |
token: config["token"], | |
}) | |
loadIncidents = function () { | |
//Hit the incidents API: | |
PDJS.api({ | |
res: "incidents", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
me="$0" | |
#This function will alert PagerDuty that our script failed | |
alertonfail() { | |
if [ "$1" -ne "0" ]; then | |
echo "Error $1 on $me" | |
curl -H "Content-type: application/json" -X POST \ | |
-d '{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// As always configure PDJS with your subdomain and api-key | |
PDJS = new PDJSobj({ | |
subdomain: "webdemo", | |
token: "CkNpsqH9i6yTGus8VDzA", | |
}) | |
// Here's the minimum possible UI: | |
printf = function (str) { | |
console.log(str) | |
$("#output").append(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is the button I'm using to trigger the incident: | |
<input type="button" onclick="PDTrigger(prompt('Incident Description'))" value="Trigger Incident"> | |
*/ | |
// Set up the library | |
PDJS = new PDJSobj() | |
function PDTrigger(description) { | |
// Trigger via the rest API | |
PDJS.trigger({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
David Hayes dave@euri.ca | |
Quasi-minimal viable Raplet: | |
// */ | |
$in = $_GET; //raplet.php?email=rahul@rapportive.com&name=Rahul%20Vohra&twitter_username=rahulvohra&callback=jsonp123456789 | |
$jsonContainer = $in['callback']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
David Hayes dave@euri.ca | |
Quasi-minimal viable Raplet: | |
// */ | |
$in = $_GET; //raplet.php?email=rahul@rapportive.com&name=Rahul%20Vohra&twitter_username=rahulvohra&callback=jsonp123456789 | |
$jsonContainer = $in['callback']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$img = imageCreateTrueColor(512, 512); | |
for ($i=0; $i < 512; $i++) { | |
for ($j=0; $j < 512; $j++) { | |
$c=mt_rand(0,255); | |
$col = imageColorAllocate($img, $c, $c, $c); | |
imagesetpixel($img, $i, $j, $col); | |
} | |
} | |
header("Content-Type: image/png"); | |
imagepng($img); |
OlderNewer