Skip to content

Instantly share code, notes, and snippets.

@prufrock
prufrock / robossh.sh
Last active August 29, 2015 14:27
Rename this to ssh and put it some place where it will override ssh(but don't delete ssh) and you'll get robo backgrounds in your iterm. A modification of the ImageMagick script at http://kpumuk.info/mac-os-x/how-to-show-ssh-host-name-on-the-iterms-background/
#!/bin/bash
# SSH with host name and IP address in background (only in iTerm.app)
# First, check to see if we have the correct terminal!
if [ "$(tty)" == 'not a tty' ] || [ "$TERM_PROGRAM" != "iTerm.app" ] ; then
/usr/bin/ssh "$@"
exit $?
fi
@prufrock
prufrock / gist:666401
Created November 7, 2010 20:27
A patch for amqp.c in the PHP AMQP extension hosted on PECL.
964c964
< if (result <= 0) {
---
> if (result < 0) {
977c977
< if (result <= 0) {
---
> if (result < 0) {
994c994
< if (result <= 0) {
@prufrock
prufrock / tcpdump example
Created March 18, 2011 16:36
An example of how to use tcpdump
nohup tcpdump -n -w <Name of file> -s0 -C 100 -i eth0 port 5060 &
@prufrock
prufrock / installPhpMd.sh
Created March 19, 2011 06:25
installs PHPMD through pear
#!/bin/sh
sudo pear channel-discover pear.phpmd.org
sudo pear channel-discover pear.pdepend.org
sudo pear install --alldeps phpmd/PHP_PMD-alpha
@prufrock
prufrock / simple.c
Created March 27, 2011 21:57
a simple program for testing gcc in chroot
#include <stdio.h>
int main()
{
printf( "Hello World!\n" );
return 0;
}
@prufrock
prufrock / lucid-i386
Created March 27, 2011 23:03
a schroot configuration file for Ubuntu 10.04 Lucid
[lucid-i386]
description=Ubuntu 10.04 Lucid for i386
directory=/srv/chroot/lucid-i386
root-users=david
groups=root
type=directory
users=david
@prufrock
prufrock / chrootForSflPhoneBuild.sh
Created March 28, 2011 14:57
packages installed into a bare ubuntu chroot to build sflphone
#!/bin/sh
package=sflphone_20110328-1_amd64.deb
packageDir=sflphone_20110328-1_amd64
apt-get install libtool autoconf pkg-config libasound2-dev libpulse-dev libsamplerate0-dev libcommoncpp2-dev libccrtp-dev libzrtpcpp-dev libssl-dev libexpat1-dev libpcre3-dev libgsm1-dev libspeex-dev libspeexdsp-dev libyaml-dev
cd /opt/SFLWebService/sflphone-0.9.11/sflphone-common/libs/pjproject
./autogen.sh
./configure
make dep && make
cd /opt/SFLWebService/sflphone-0.9.11/sflphone-common
./autogen.sh
@prufrock
prufrock / copyIso.bat
Created March 29, 2011 02:28
copy iso files to a windows file share
copy *.isp \\server\home\ubuntu\iso
@prufrock
prufrock / incrementVersion.sh
Created March 30, 2011 03:39
uses perl in an awk like manner to increment a version number
#!/bin/sh
perl -i -pe ';s/(Version: [0-9]+\.[0-9]+\-)([0-9])//; if($1){print $1 . ($2 + 1)}' package/DEBIAN/control
@prufrock
prufrock / SkeletonControllerTest.php
Created March 31, 2011 03:08
A skeleton for Zend Framework controller tests.
<?php
if(!defined('TEST_PATH')){
DEFINE('TEST_PATH', '../..');
}//if
require_once TEST_PATH . '/library/ControllerTestCase.php';
require_once APPLICATION_PATH . '/controllers/SkeletonController.php';
/**
* Test class for SkeletonController.
*/