Skip to content

Instantly share code, notes, and snippets.

View calbrecht's full-sized avatar

Christian Albrecht calbrecht

View GitHub Profile
@calbrecht
calbrecht / PhpStormVagrantPhpUnit.php
Last active December 24, 2015 06:59
Run PhpUnit from wihtin PhpStorm through vagrant on virtual machine. Use this file as Custom Loader. See http://www.jetbrains.com/phpstorm/webhelp/phpunit.html
<?php
/** Full path to project dir on host */
isset($_SERVER['HOST_DIR']) or $_SERVER['HOST_DIR'] = realpath(__DIR__ . '/../../');
/** Full path to vagrant directory on host */
$_SERVER['VAGRANT_DIR'] = $_SERVER['HOST_DIR'] . '/vagrant';
/** Full path to project dir on virtual machine */
$_SERVER['GUEST_DIR'] = '/path/to/project/on/vm';
@calbrecht
calbrecht / test-vagrant-lxc.sh
Created September 8, 2013 18:15
vagrant-lxc provider test
#!/bin/bash
if [[ "root" != "$(whoami)" ]] ; then
echo 'Err: you must be root to run this script'
exit 1
fi
if [[ ! $(which vagrant >/dev/null) ]] ; then
wget http://files.vagrantup.com/packages/b12c7e8814171c1295ef82416ffe51e8a168a244/vagrant_1.3.1_x86_64.deb
dpkg -i ./vagrant_1.3.1_x86_64.deb
@calbrecht
calbrecht / node-version-manager.sh
Created August 10, 2013 09:50
nodejs Version Manager utilizing update-alternatives
#!/bin/bash
if [ "$EUID" != "0" ]; then
sudo $0 $@;
exit 1;
fi
BIN_DIR=/usr/bin
NODE_DIR=/usr/local/node;
NODE_VERSION=""
@calbrecht
calbrecht / php-version-manager.sh
Created August 10, 2013 09:49
PHP Version Manager utilizing update-alternatives
#!/bin/bash
if [ "$EUID" != "0" ]; then
sudo $0 $@;
exit 1;
fi
BIN_DIR=/usr/bin
PHP_DIR=/usr/local/php;
PHP_VERSION=""