Skip to content

Instantly share code, notes, and snippets.

@cwood
cwood / clone-mysql-database
Created July 30, 2014 14:46
Create a clone of a database on a local server and grant app permissions
#!/usr/bin/env zsh
autoload -U colors
if [[ -z $1 ]]; then
read "database_name?Databse Name: "
else
database_name=$1
fi
### Keybase proof
I hereby claim:
* I am cwood on github.
* I am cwood (https://keybase.io/cwood) on keybase.
* I have a public key whose fingerprint is 5EEF 1B67 0422 73B4 BB59 E897 BD0A 9EF6 1073 C427
To claim this, I am signing this object:
@cwood
cwood / update-virtualenvs.zsh
Created November 5, 2013 19:46
Upgrade a package for a bunch of virtualenvs
#!/bin/zsh
autoload -U colors && colors
if [[ -z $1 ]]; then
read "upgradePackage?Which pacakge to upgrade? "
else
upgradePackage=$1
fi
VIRTUALENV_INSTALLS="/var/virtualenvs"
@cwood
cwood / restart-salt-minions.sh
Created December 18, 2012 14:38
restart all salt minions
#!/bin/bash
SALTMINIONS=$(sudo salt-key -L | grep -v "Rejected:" | grep -v "Accepted Keys:" | grep -v "Unaccepted Keys:")
echo -n "Remote hosts [sudo] password: "
read -s remote_password
echo
for minion in $SALTMINIONS
do