PHP Sandbox

I’ve been working on this slowly before but never did much with it, so I thought I would just get it out there for other people to work on.

I’m going to licence this under lgpl v2 I think but for the moment it’s public domain / unlicenced

This is not intended to be the be all and end all of security for your untrused PHP code but it does make life just a little safer if you need to run client / untrusted code with in a PHP page.

Currently it’s only been tested on Linux, you can find it on GitHub https://github.com/fregster/PHPSandbox

Eclipse + SVN Project How to

Quite a few people have asked me for this information recently so I thought I would just post it.

Eclipse with PDT (PHP Development Tools)
http://downloads.zend.com/pdt/all-in-one/
Subversive (SVN Client for Eclipse)
http://www.eclipse.org/subversive/downloads.php
Just extract Eclipse some where and run the Eclipse exe / java
You will need to install the SVN Plug-in and the Connector. If running Eclipse Helios or higher this is not required.
From Help -> Software Update -> Find and Install
Search for New
Create a new remote site
Name SVN
URL http://download.eclipse.org/technology/subversive/0.7/update-site/
Create a second new remote site
Name SVN Connectors
URL http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
Finish, wait
Tick both boxes (You may have to go into one and untick Mylan intergration (It will have a red cross against it anyway))
SVN Settings
Create a new PHP Project in Eclipse (Call it what ever you want), you may have to choose ‘Other’ the first time and search for ‘PHP Project’
Enable project specific settings PHP5 >
Finish
Right click on your new project – select ‘Team’ -> ‘Share Project’ -> Select SVN -> Create a new repository
First Tab
  • URL: https://svn.url/project
  • username: Your SVN Username
  • password  Your SVN Password
Seccond Tab
  • Empty Project name
  • Use Repository Layout
Finish
Allow the svn to overwrite any content already in your project
Warning: Eclipse and other SVN tools will store settings locally specific to your project, don’t commit these.

Debian Update Log

To be able to monitor what updates are waiting on my servers I thought I would share some scripts I use developed by BitFolk.

There are 2 scripts, one to tell cron what to do (local-apt.sh) and is saved in /etc/cron.daily/local-apt with the permissions 755 and the main file local-apt.pl is saved in /usr/local/sbin/ and needs to be executable (I use chmod 740).

Then each day the script runs and if there are any update you get a nicely formatted email like the one below:

Package Upgrades Available

Package                                                     Installed                  Available
—————————————————————————-
linux-image-2.6.26-2-xen-686         2.6.26-19lenny1    2.6.26-19lenny2
linux-modules-2.6.26-2-xen-686     2.6.26-19lenny1     2.6.26-19lenny2

The files have a .txt extension for download please remove them else they will not work.

local-apt.sh

local-apt.pl

Spensierato Developments

I have been working hard on the integration of a shopping cart and PayPal payments, page and elements tagging is now working in the backend, just the interface to add and then online shops should be working yay. CSS inheritance works now for skins.

There is now a working auto search (The style is quite http request heavy at the min as transparent CSS sprites are a little tricky, but it’s quite a nice proof of concept). Check out Smart Performance Engines for a working example (Note the known bug below)

There are still some bugs, like the YUI compressed MooTools produces errors which crash IE’s JavaScript, the new menu code (

) needs re-skinning in the default template.

Unfortunately these updates require quite large schema updates, sorry.

I have been working on a new template which I might make the default it is based on the CSS work by Position Everything author Alex Robinson

Anyway should not be long before Alpha 2, there has been quite a change to the road map with these new features but as there community driven (and client!), I think there for the best.

Rover V8 updates

It’s been a long time since I last posted anything, life’s sometimes just to busy.

Anyway I though I would upload some photos of the V8 restoration.

Since the last update I have gotten around to rebuilding and fitting my Austin Princess 4 pot callipers with EBC Greenstuff pads and EBC turbogrove (blind drilled and grooved) discs.
The discs are now 30% thicker than stock and with the 4 pots, the car actually stops now more than once!

I have also just picked up a Borg-Werner T5 from an RS Cosworth with a quickshift from ebay for 275 quid, bargin really. Just need to crack it open and have a good look at the internals to decide on the extent of the rebuild required.Pully end of the bottom end Rover v8 blockUpside down Rover v8 bottem endBlock in part washer 2Block in part washer

Trac

I have set-up Trac at trac.spensierato.net you can use your svn user names and passwords to login.
Please feel free to start uploading data, bug reports etc.

She Runs!

Finally got a few hours to play with my V8, surprisingly after pouring in some oil and spining the oil pump, just bolting on the starter, sprayed some petrol down the carb and in less than 1 crank is started!

Now just to clean it, strip it, megasquirt it at this rate should have it done by 2030

PHP Caching system

I have developed a PHP caching class, it currently uses memcached and supports fallback to session stores, other systems to come.

It’s very simple to use, include and use persistantcache::singleton()->save($name, $data, ‘optional max time in secconds’); and persistantcache::singleton()->get($name); to retrive your data.

PHP Persistent Cache V2 or view the latest in my SVN at http://svn.fryer.org.uk/websvn/filedetails.php?repname=cms&path=%2Ftrunk%2Fcms%2Finc%2Fclasses%2Fpersistantcache.inc

XPC

Well after a failed firmware upgrade on the N2100, I decied it was best to just go out and get an x86 platform. I picked up a Shuttle XPC G5 with an AMD 959 socket, I now have it running Debian and the normal services.

The XPC is almost as quite as the N2100 but with out the annoying hum, running an AMD 3200+ its very quick and runs MD for the software RAID, which works well if I take the disk out. I am still trying to decide the best backup method other than tar.gz and upload to the VPS as the file size is starting to grow, perhaps Rsync over SSH?

Excel to XML using just PHP

I found an excellent script written by Vadim Tkachenko (Included), which is based on Andy Khan‘s work.

I have written a quick class to access it and return the contents of the of the file, including all of the worksheets as XML.

See the example.php file it should explain it all quite well, all of my code in this s public domain.

Download Excel to XML in PHP

Older Entries »