Skip to content

Instantly share code, notes, and snippets.

Josh Gavant joshgav

  • Discover Financial Services
  • Chicago, IL
Block or report user

Report or block joshgav

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
joshgav /
Created May 28, 2019
mac app installers
# install tmux
# get tmux and libevent
curl -LO${TMUX_VER}/${TMUX_VER}.tar.gz
curl -LO${LIBEVENT_VER}-stable/libevent-${LIBEVENT_VER}-stable.tar.gz
tar -xzf "./tmux-${TMUX_VER}.tar.gz"
joshgav /
Created Mar 8, 2019
GitHub open project best practices

Open source on GitHub: what and why

  • Participants: users, contributors and maintainers.
    • We're looking for users.
    • and
  • Why open source?
    • Collect better feedback on our software from users.
    • Gather direct insights into how users use our software.
    • Developers are empowered to:
      1. fix problems and answer questions themselves and maybe even blog about it
      2. open detailed and actionable issues for us
joshgav /
Created Feb 13, 2019
Create an SMB file share in Azure Storage and mount in a Linux system.
#! /usr/bin/env bash
# requires cifs-utils - `apt install cifs-utils`
joshgav /
Last active Feb 1, 2019
Create an Azure Web App
# choose from: `az webapp list-runtimes --linux`
joshgav /
Last active Sep 27, 2018
Azure resource management helper shell scripts
declare prefix="azuregosdkjuglaptop"
# cleanup_groups requests deletion of groups with names starting with `prefix`
# it returns after request acceptance, i.e. it does not wait for deletion to actually finish
# `prefix` string "___": first letters of names of groups to delete
function cleanup_groups () {
declare prefix=${1:-"___"} # default to unlikely value for safety
# set up jmespath query
jmespath_query="[? starts_with(name, \`${prefix}\`)].name"
joshgav / gist:8a87200f1c333280cab66aab0be9dcea
Last active Dec 6, 2017
keyvault data plane methods in Go SDK
View gist:8a87200f1c333280cab66aab0be9dcea
## 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)
View gist:0a9b1e3f184a93f545ab6400b85e54de
## Install a necessary packages
$ sudo apt-get install kvm cloud-utils genisoimage
## URL to most recent cloud image of 12.04
$ img_url=""
$ 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 / weather_api.js
Created Jun 8, 2017
Simple Weather API (sample)
View weather_api.js
const http = require('http');
const url = require('url');
// assumes a sibling .env file with
const dotenv = require('dotenv').config();
const appid = process.env.OPENWEATHER_APIKEY;
function httpHandler (request, response) {
let parsed_url = url.parse(request.url, true);
joshgav /
Last active Nov 3, 2016
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.
You can’t perform that action at this time.