This file contains hidden or 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; restclient - invoke REST API calls from within Emacs | |
(require 'restclient) | |
(eval-after-load "restclient" | |
(if (not (fboundp 'json-pretty-print-buffer)) | |
(defun json-pretty-print-buffer () | |
(json-prettify-buffer)))) |
This file contains hidden or 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
# -*- restclient -*- | |
# | |
# URLs for querying Apigee Edge | |
# Yes, this runs within emacs. | |
:edge-auth := (dino-netrc-basic-auth-header "api.enterprise.apigee.com") | |
:mgmtserver = https://api.enterprise.apigee.com | |
GET :mgmtserver/v1/o/deecee/apis/parity-test99/revisions | |
Authorization: :edge-auth |
This file contains hidden or 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
// TestWebRequest.cs | |
// ------------------------------------------------------------------ | |
// | |
// Author: Dino | |
// initialized on: Fri Feb 26 17:00:17 2016 | |
// | |
// last saved: <2016-February-26 17:19:13> | |
// ------------------------------------------------------------------ | |
// | |
// Copyright © 2016 Dino Chiesa |
This file contains hidden or 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 | |
# -*- mode:shell-script; coding:utf-8; -*- | |
# | |
# findApiKey.sh | |
# | |
# A bash script for finding a particular API Key in an Apigee Edge organization. | |
# | |
# Last saved: <2016-February-05 17:30:50> | |
# |
This file contains hidden or 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
RewriteCond %{SERVER_PORT} !=443 | |
RewriteRule .* https://%{HTTP_HOST}/$1 [R=301,L] |
This file contains hidden or 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
/* | |
* 2016 Jan 29 | |
* | |
* For redirecting to SSL site, from within PHP. | |
* | |
* This is useful if: | |
* - Your site is running behind a load-balancer, which | |
* means you cannot directly infer HTTPS, AND | |
* - you don't have the ability to modify | |
* .htaccess on your hosted site. |
This file contains hidden or 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
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
This file contains hidden or 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
$ brew update | |
$ brew install openssl |
This file contains hidden or 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
$ which openssl | |
/usr/bin/openssl | |
$ openssl version | |
OpenSSL 0.9.8zg 14 July 2015 | |
$ /usr/local/Cellar/openssl/1.0.2e_1/bin/openssl version | |
OpenSSL 1.0.2e 3 Dec 2015 |
This file contains hidden or 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
function computeHttpSignature(config, headerHash) { | |
var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"', | |
sig = template; | |
// compute sig here | |
var signingBase = ''; | |
config.headers.forEach(function(h){ | |
if (signingBase !== '') { signingBase += '\n'; } | |
signingBase += h.toLowerCase() + ": " + headerHash[h]; | |
}); |