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 | |
# /etc/init.d/mjpg_streamer.sh | |
# v0.2 phillips321.co.uk | |
### BEGIN INIT INFO | |
# Provides: mjpg_streamer.sh | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: mjpg_streamer for webcam |
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
<?php | |
spl_autoload_register('load_api'); | |
function loadFileCache() | |
{ | |
if(!file_exists(dirname(__FILE__) . '/cache.dat')) { | |
return array(); | |
} | |
$s = file_get_contents(dirname(__FILE__) . '/cache.dat'); |
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
Param = "Value" | |
sed -r "s/(Param *= *\").*/\1NewVal\"/" c.conf | |
Param Value | |
sed -r "s/(Param *).*/\1NewVal/" c.conf |
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 the PHPUnit directory to NetBeans's PHP global include path. This will provide code completion in NetBeans for all projects. | |
Open Tools : Options | |
Switch to the PHP tab | |
Click Add Folder... next to the Global Include Path box | |
Enter /usr/share/php/PHPUnit or navigate to where PEAR installed PHPUnit's source files | |
Click Open | |
Click OK |
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
<?php | |
class TestHelper | |
{ | |
public static function callProtectedMethod($obj, $methodName, array $args) | |
{ | |
$class = new \ReflectionClass($obj); | |
$method = $class->getMethod($methodName); | |
$method->setAccessible(true); |
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
cd existing_git_repo | |
git remote add origin [email protected]:caius/foo.git | |
git config --add branch.master.remote origin | |
git config --add branch.master.merge refs/heads/master | |
git pull |
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
echo ServerName $HOSTNAME > /etc/apache2/conf.d/fqdn | |
or | |
echo ServerName $HOSTNAME > /etc/apache2/conf-enabled/fqdn.conf |