Skip to content

Instantly share code, notes, and snippets.

@mohshami
mohshami / command
Created August 17, 2024 03:14
Templating ssh_config with gomplate
jq -s '.' hosts/* | gomplate -f ssh_config.tmpl -d server=stdin:///in.json > ~/.ssh/config.inc
@mohshami
mohshami / gitdeploy.sh
Created December 1, 2013 11:22
Automatic deployment script for git, based on the work of EugeneKay, https://raw.github.com/EugeneKay/scripts/master/bash/git-deploy-hook.sh
#!/bin/sh
#Get the location of binary packages
export GIT=$(which git) #Location of git
export RSYNC=$(which rsync) #Location of rsync
export GIT_DIR=$(pwd) #Location of repository
export TMP="/tmp"
export TARFOLDER="${TMP}/git-deploy.$$"