Skip to content

Instantly share code, notes, and snippets.

View BrianMMcClain's full-sized avatar

Brian McClain BrianMMcClain

View GitHub Profile
@andypiper
andypiper / _vmc
Last active December 14, 2015 01:49
zsh plugin for vmc (pre-ng version) based on the brew zsh plugin, delete the stuff towards the end. install to .oh-my-zsh/custom/vmc and enable in .zshrc
#compdef vmc
#autoload
# vmc autocompletion for oh-my-zsh
# requires: the vmc gem (gem install vmc)
# author: Andy Piper (http://andypiper.co.uk)
_list_apps() {
for APP in `vmc apps | grep -oE '^\| [[:alnum:]-]+ . ' | grep -oE '[[:alnum:]-]+'`; do
compadd "$@" $APP
@radu-gheorghe
radu-gheorghe / log_backup.bash
Created July 26, 2012 08:31
Optimize&Backup Elasticsearch index. And restore.
#!/usr/bin/env bash
###############FUNCTIONS############
function prepare {
#optimize the index
echo -n "Optimizing index $INDEX_NAME..."
curl -XPOST "$ADDRESS/$INDEX_NAME/_optimize" 2>/dev/null| grep 'failed":0' >/dev/null
if [ $? -eq 0 ]; then
echo "done"
@pietern
pietern / mcf_nginx_11.sh
Created March 24, 2012 21:08
Upgrades nginx to 1.1.17 on Micro Cloud Foundry
#!/bin/bash -e
lua_url="http://www.lua.org/ftp/lua-5.1.4.tar.gz"
lua_tgz="lua-5.1.4.tar.gz"
lua_dir="lua-5.1.4"
echo "Downloading and extracting ${lua_tgz}..."
[ ! -f "${lua_tgz}" ] && wget -q -O ${lua_tgz} ${lua_url}
rm -rf ${lua_dir}
tar zxf ${lua_tgz}