Skip to content

Instantly share code, notes, and snippets.

Val Neekman un33k

View GitHub Profile
un33k /
Created Sep 26, 2010 — forked from epall/
OSX: Start a new terminal with PWD=current directory
#!/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
un33k /
Last active Sep 24, 2015
Plex on OSX often falls into a tight loop and consumes %100 of the CPU. This watchdog is to restart Plex to avoid running the CPU hot for an extended period of time.
PLEX_APP='/Applications/Plex Home Home Theater'
while [ $LOOP -le 14 ] ; do
PLEX_CPU=`ps aux | grep "$PLEX_APP" | awk '{print $3}' | head -n 1`
un33k /
Created Jun 3, 2011
Script to run Linux vmware image on Mac OSX in headless mode
# Start and stop headless VMs
# put this on your path as save it as vm or
# 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
un33k / pylink
Created Jun 3, 2011
Put Current Directory on Python Path (for quick testing)
View pylink
un33k / pyulink
Created Jun 3, 2011
Remote a directory from the python path (site packages directory)
View pyulink
un33k / df
Created Jun 3, 2011
Directory information cleaned up for dispaly
View df
# 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;
un33k / virtualenv_instruction
Created Jun 3, 2011
Setup your virtualenv & virtualenvwrapper to create directory for each work item
View virtualenv_instruction
#=== Add VirtualEnv =======
# add local bin to path
export PATH
# virtualevnwrapper
export VHOME_DIR=$HOME/projects
export PIP_DOWNLOAD_CACHE=$VHOME_DIR/.pip_cache_dir
source /usr/local/bin/
View apache2.conf
### Basic daemon config
ServerRoot "/etc/apache2"
ServerTokens ProductOnly
### Listen on localhost:8000 (behind the proxy)
un33k /
Created Jun 4, 2011 — forked from jacobian/
A fab task to start pg9 hot standby.
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):
un33k /
Created Jun 4, 2011 — forked from jacobian/
Nagios plugin to check PostgreSQL 9 streaming replication lag.
#!/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.
You can’t perform that action at this time.