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
joshgav / install.sh
Created May 28, 2019
mac app installers
View install.sh
# install tmux
TMUX_VER=2.9a
LIBEVENT_VER=2.1.10
PREFIX=${HOME}/.local
# get tmux and libevent
curl -LO https://github.com/tmux/tmux/releases/download/${TMUX_VER}/${TMUX_VER}.tar.gz
curl -LO https://github.com/libevent/libevent/releases/download/release-${LIBEVENT_VER}-stable/libevent-${LIBEVENT_VER}-stable.tar.gz
tar -xzf "./tmux-${TMUX_VER}.tar.gz"
@joshgav
joshgav / github_practices.md
Created Mar 8, 2019
GitHub open project best practices
View github_practices.md

Open source on GitHub: what and why

  • Participants: users, contributors and maintainers.
    • We're looking for users.
    • README.md and CONTRIBUTING.md
  • 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
joshgav / create_file_share.sh
Created Feb 13, 2019
Create an SMB file share in Azure Storage and mount in a Linux system.
View create_file_share.sh
#! /usr/bin/env bash
# requires cifs-utils - `apt install cifs-utils`
group_name=joshgav-oryx-test-group
group_location=westus2
storage_account_name=joshgavoryxsharetest
storage_account_group_name=${group_name}
storage_account_location=${group_location}
share_name=intermediate
@joshgav
joshgav / create_azure_web.sh
Last active Feb 1, 2019
Create an Azure Web App
View create_azure_web.sh
app_name=your-unique-name
app_repo_url=https://github.com/your-name-here/your-repo-here
location=westus
# choose from: `az webapp list-runtimes --linux`
runtime='NODE|10.10'
env_vars=(
APPINSIGHTS_INSTRUMENTATIONKEY=af4b1113-bc85-41d0-be2b-343c3f178b7b
YOUR_ENV_VAR=test
)
@joshgav
joshgav / azurerm.sh
Last active Sep 27, 2018
Azure resource management helper shell scripts
View azurerm.sh
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
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="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 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
// 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 Nov 3, 2016
Justification for managing Node environment managers in the Node Foundation.
View node_env_mgr.md

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.