Skip to content

Instantly share code, notes, and snippets.

View joshgav's full-sized avatar

Josh Gavant joshgav

View GitHub Profile
@joshgav
joshgav / gist:8a87200f1c333280cab66aab0be9dcea
Last active December 6, 2017 01:02
keyvault data plane methods in Go SDK
## data plane
func New() ManagementClient
func NewWithoutDefaults() ManagementClient
func (client ManagementClient) BackupKey(vaultBaseURL string, keyName string) (result BackupKeyResult, err error)
func (client ManagementClient) BackupSecret(vaultBaseURL string, secretName string) (result BackupSecretResult, err error)
func (client ManagementClient) CreateCertificate(vaultBaseURL string, certificateName string, parameters CertificateCreateParameters) (result CertificateOperation, err error)
func (client ManagementClient) CreateKey(vaultBaseURL string, keyName string, parameters KeyCreateParameters) (result KeyBundle, err error)
func (client ManagementClient) Decrypt(vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error)
func (client ManagementClient) DeleteCertificate(vaultBaseURL string, certificateName string) (result DeletedCertificateBundle, err error)
@joshgav
joshgav / gist:0a9b1e3f184a93f545ab6400b85e54de
Created July 7, 2017 18:49 — forked from smoser/gist:4756561
boot a cloud image in kvm
## Install a necessary packages
$ sudo apt-get install kvm cloud-utils genisoimage
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
$ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img"
## download the image
$ wget $img_url -O disk.img.dist
## Create a file with some user-data in it
@joshgav
joshgav / weather_api.js
Created June 8, 2017 18:00
Simple Weather API (sample)
const http = require('http');
const url = require('url');
// assumes a sibling .env file with
// OPENWEATHER_APIKEY=your_key
const dotenv = require('dotenv').config();
const appid = process.env.OPENWEATHER_APIKEY;
function httpHandler (request, response) {
let parsed_url = url.parse(request.url, true);
@joshgav
joshgav / node_env_mgr.md
Last active November 3, 2016 21:23
Justification for managing Node environment managers in the Node Foundation.

Environment managers like Python's venv/virtualenv, Ruby's rvm, and Node's nvm make it easy for users to install and configure a runtime's versions and constituent components. Each virtual environment can support a specific runtime version and configuration and an independent set of global modules. In fact, some runtimes, such as .NET Core, can bundle and refer to a specific runtime configuration for each app. To summarize, environment managers enable developers to:

  • install the runtime with a specific configuration.
  • change runtime configurations for test and other needs.
  • manage runtime and component updates.