This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# A simple script to open a new tab in Terminal in the current directory | |
# Author: Eric Allen | |
osascript -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' > /dev/null 2>&1 | |
osascript -e "tell application \"Terminal\" to do script \"cd $PWD && clear\" in window 1" > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PLEX_APP='/Applications/Plex Home Theater.app/Contents/MacOS/Plex Home Theater' | |
COUNT=0 | |
PLEX_CPU=0 | |
LOOP=1 | |
while [ $LOOP -le 14 ] ; do | |
PLEX_CPU=`ps aux | grep "$PLEX_APP" | awk '{print $3}' | head -n 1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start and stop headless VMs | |
# put this on your path as save it as vm or vm.sh. | |
# no need to turn your vmware on when running on Mac | |
# just run as vm start and it will list all the available vm images. | |
# then choose which one you want to start. perfect for running Linux under OSX | |
# in headless mode for development | |
# Note:, some of this script is from gist (72638254422dc741b299) | |
# Some rework and enhancement to make it work better and handle windows | |
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# pylink - Link a Python module to your site packages directory. | |
# Found at: See http://gist.github.com/21649 for updates. | |
# Small enhacements | |
# Usage: Save this gist as pylink and put it on your path | |
# pylink somedirectory | |
# Now somedirectory is on your python path (in site packages directory) | |
# Check that an argument has been given. If not, print usage string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# pyunlink.sh - Remove a pylinked module from your site packages directory. | |
# See http://gist.github.com/21650 for updates. | |
# You may also want to see pylink at http://gist.github.com/21649. | |
# Save this gist as pyulink and put it somewhere on your path | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then | |
echo "Usage: `basename $0` <link_name>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# github:norm:homedir:bin/df | |
# -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*- | |
# | |
# Present the output of `df` in a more understandable fashion. | |
# Save this gist as df and put it on your path | |
/bin/df -h "$@" 2>/dev/null | perl -e ' | |
$prefix = <>; | |
$longest_fs = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#=== Add VirtualEnv ======= | |
# add local bin to path | |
PATH=$HOME/projects/bin:$PATH | |
export PATH | |
# virtualevnwrapper | |
export VHOME_DIR=$HOME/projects | |
export WORKON_HOME=$VHOME_DIR/.$HOSTNAME-virenv | |
export PIP_DOWNLOAD_CACHE=$VHOME_DIR/.pip_cache_dir | |
source /usr/local/bin/virtualenvwrapper.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Basic daemon config | |
ServerRoot "/etc/apache2" | |
PidFile ${APACHE_PID_FILE} | |
User ${APACHE_RUN_USER} | |
Group ${APACHE_RUN_GROUP} | |
ServerTokens ProductOnly | |
ServerAdmin [email protected] | |
### Listen on localhost:8000 (behind the proxy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_replication(): | |
""" | |
Begin Postgresql standby | |
""" | |
# Stop pg on the slave machine. | |
with settings(host_string=env.db_slave): | |
run('service postgresql-9.0 stop') | |
# Create the backup on the master machine | |
with settings(host_string=env.db_master): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Nagios plugin to check PostgreSQL 9 streaming replication lag. | |
Requires psycopg2 and nagiosplugin (both installable with pip/easy_install). | |
MIT licensed: | |
Copyright (c) 2010 Jacob Kaplan-Moss. All rights reserved. |
OlderNewer