Skip to content

Instantly share code, notes, and snippets.

@spudfkc
spudfkc / gerrit-add-reviewer.sh
Last active August 3, 2017 10:21
Uses Gerrit's REST API to add a reviewer to a change
#!/bin/bash
USERNAME="<HTTP-USERNAME>"
PASSWORD="<HTTP-PASSWORD>"
BASE_URL="<GERRIT-URL>"
REVIEWER="<DEFAULT-REVIEWER-EMAIL>"
CURL=$(which curl)
if [ -z "$CURL" ]
@spudfkc
spudfkc / virtualenvActivate.sh
Created January 3, 2014 04:01
Activates the virtualenv for the project that the script is in assumes the directory name and the virtualenv name are the same script should be in root directory of project run with `. ./virtualenvActivate.sh`
#!/bin/bash
VIRTUALENVS={PATH TO VIRTUALENVS}
PROJECT_NAME=$(basename $(dirname $0))
if [[ $PROJECT_NAME == "." ]]; then
PROJECT_NAME=$(basename $(pwd))
fi
source $VIRTUALENVS/$PROJECT_NAME/bin/activate
@spudfkc
spudfkc / .vimrc
Last active November 28, 2017 21:58
vim configuration file
syntax on
syntax enable
set background=dark
set cryptmethod=blowfish
set nocompatible
set relativenumber
set number
set t_Co=256
@spudfkc
spudfkc / Monokai.vim
Created January 3, 2014 22:42
Monokai colorscheme for vim
" Vim color file
" Converted from Textmate theme Monokai using Coloration v0.3.2 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
# SOURCE: http://www.ludeke.net/2013/12/run-docker-commands-without-sudo.html
# Add the docker group if it doesn't already exist.
sudo groupadd docker
# Add the connected user "${USERNAME}" to the docker group.
# Change the user name to match your preferred user.
# You may have to logout and log back in again for
# this to take effect.
sudo gpasswd -a ${USERNAME} docker
@spudfkc
spudfkc / virtualenvActivate.sh
Created February 13, 2014 02:21
activates a python virtual environment based off the name of the current directory (usage: . ./virtualenvActivate)
#!/bin/bash
#
# Activates a given virtualenv. If no name is specified, the current directory
# is assumed to be the name.
#
STORE="/home/$USER/.virtualenv/env"
VE_SCRIPT="bin/activate"
@spudfkc
spudfkc / mkvirtualenv.sh
Created February 13, 2014 02:22
makes a python virtualenv from the name of the current directory. stores all virtualenvs in a common location
#!/bin/bash
#
# usage: mkvirtualenv [any virtualenv params]
#
# Creates a virtualenv in the directory defined by STORE using the current
# directory's name as the virtualenv name.
#
STORE="/home/$USER/.virtualenv/env"
#!/bin/bash
git filter-branch -f --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "user@host" ];
then
GIT_AUTHOR_NAME="spudfkc"
GIT_COMMITTER_NAME="spudfkc"
GIT_COMMITTER_EMAIL="[email protected]"
GIT_AUTHOR_EMAIL="[email protected]"
git commit-tree "$@"
else
@spudfkc
spudfkc / ucd.sh
Created July 29, 2014 18:33
Script for redeploy, deploy static, upgrade/install of UrbanCode Deploy dev server
#!/bin/bash
#
# author: ncc
#
readonly PROGNAME=$(basename $0)
readonly PROGDIR=$(readlink -m $(dirname $0))
readonly ARGS="$@"
VERSION=dev
@spudfkc
spudfkc / update-all-remotes.py
Last active March 26, 2017 09:22
Update all git repos in current directory
#!/usr/bin/env python
# pre-req: pip install gitpython
import os
from git import *
from multiprocessing import Pool
def git_remote_update(repodir):
print ''.join(['Creating Repo at ', repodir])