Friday, August 28, 2009

Buzz words

I figured I would start posting some of the buzz words that I like hearing people talk about or I myself have opinions about here so that hopefully when people are googling them they might spawn a conversation with me about them.

SoC (Separation of Concerns) is my first one.

In a nutshell: no one part or layer of your stack should care about the other parts or layers or how they work. This does not need to imply separate physical or logical layers. it could pertinent only to the application layer itself like with many software engineering patterns such as MVC... there we go... another buzz word... Ill put that one in my next post.

Sunday, August 23, 2009

php 5.2.10 pecl problem: pear.php.net is using a unsupported protocal - This should never happen. install failed

A known issue with php 5.2.10 is the fact that it does not have the pecl channel installed. to install it create the following files:

vi /usr/local/lib/php/.channels/pear.php.net.reg #(you may have to create the channels directory)

paste the following in:

a:6:{s:7:"attribs";a:4:{s:7:"version";s:3:"1.0";s:5:"xmlns";s:31:"http://pear.php.net/channel-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schemaLocation";s:71:"http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd";}s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Extension and Application Repository";s:7:"servers";a:2:{s:7:"primary";a:1:{s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}s:6:"mirror";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"host";s:15:"us.pear.php.net";}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}}}}i:1;a:2:{s:7:"attribs";a:3:{s:4:"host";s:15:"de.pear.php.net";s:3:"ssl";s:3:"yes";s:4:"port";s:4:"3452";}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}}}}}}s:13:"_lastmodified";a:2:{s:4:"ETag";s:20:""2fe96-59a-31a3fc80"";s:13:"Last-Modified";s:29:"Tue, 02 Jun 2009 05:55:46 GMT";}}

then run:

pear channel-update pecl.php.net

and then you can run something like:

pecl install pdo pdo_mysql

Now you shouldn't see this anymore:

pear.php.net is using a unsupported protocal - This should never happen.
install failed

Adding Shared Objects to php and apache

Sometimes you get an install of apache and php and you realize you need a few things that weren't compiled in the first time. Let's say you don't feel like recompiling (figure out what compile switches were used the first time can be a bitch) so instead you can just add in the shared objects you want using pecl and apxs.

Here I add pdo, pdo_mysql and mod_rewrite:

sudo pecl install pdo pdo_mysql #(will compile and add compatible pdo.so and pdo_mysql.so modules to your php libs you will have to enable it in your php.ini)

(from within the root of a new copy of the apache src tree type the following (a new src tree for apache is needd because the first time apache compiled it might have cleaned out the c headers and source files for the modules that weren't included in the .configure)

/usr/local/apache2/bin/apxs -iac modules/mappers/mod_rewrite.c #(will compile and enable for you in the httpd.conf the mod_rewrite shared object)

Thursday, August 20, 2009

bash shell one liner for denying access to a specific user to all svn repos in a directory.

for i in $(find /Volumes/DATA/SubVersion/ -name svnserve.conf |xargs grep -L anon-access); do echo "anon-access = none" >> $i; done

Tuesday, August 11, 2009

Google Chrome for Mac OS X with Flash

Don't when/how this got updated but now its working! SWEET. Check out Ronald Jenkees in google chrome!



Here it is the processes while playing the flash movie.



And here they are when it is paused.

Tuesday, August 4, 2009

I want one of these!



http://www.usbgeek.com/prod_detail.php?prod_id=0905

Saturday, August 1, 2009

Hack VMware fusion to allow for the installation of mac osx

Vmware was bitching about my snow leopard install so I ran through the following to get it to shut up. NOTE: this does not modify the snow leopard server install disk in anyway so I think it avoids any license disagreements with apple.

sudo bash
cd “/Library/Application Support/VMware Fusion/isoimages”
mkdir original
mv darwin.iso tools-key.pub *.sig original
perl -n -p -e ’s/ServerVersion.plist/SystemVersion.plist/g’ < original/darwin.iso > darwin.iso
openssl genrsa -out tools-priv.pem 2048
openssl rsa -in tools-priv.pem -pubout -out tools-key.pub
openssl dgst -sha1 -sign tools-priv.pem < darwin.iso > darwin.iso.sig
for A in *.iso ; do openssl dgst -sha1 -sign tools-priv.pem < $A > $A.sig ; done
exit