Skip to content

Instantly share code, notes, and snippets.

View kshpytsya's full-sized avatar

Kyrylo Shpytsya kshpytsya

View GitHub Profile
@kshpytsya
kshpytsya / vagrant-docker-git-build
Last active September 3, 2019 11:12
Build docker image from local git working copy on a vargant box identified by vargant directory
#!/bin/bash
set -euo pipefail
if [ "$#" -lt 3 ]; then
cat << _END_
usage:
$0 <git dir> <vagrant dir> <docker tag> [<extra docker args>...]
note: needs "vcssh", available as https://gist.github.com/kshpytsya/d401ee95268b16f568da6bd6b4cadc1d
@kshpytsya
kshpytsya / vcssh
Last active January 14, 2019 14:06 — forked from rogual/vcssh
wrapper for Vagrant ssh that manages a ControlMaster for instant ssh connections
#!/bin/bash
# ssh to vagrant hosts can be slow due to Ruby overhead of running
# 'vagrant ssh' and ssh overhead to setup the network connection.
#
# This wrapper uses that slow setup routine once to create a reusable ssh
# ControlMaster socket. Subsequent connections invoke the ssh executable
# directly (bypassing Ruby) and connect over the ControlMaster socket
# (bypassing the connection setup) so are almost instantaneous.
#