- Published:
- January 30, 2008 – 8:01 am
- Author:
- By Dave
The goal here is to watermark all images in a certain directory, except for thumbnails or other selection. You can either do this on each file prior to placing on your webserver – which is probably wise for CPU load issues – but let’s just say you want to do this for all files served in a single directory dynamically, a gallery for example. The first step is to create a .png file with transparency which holds your watermark image. For this exercise, I’ve created this image: (I’ve added the border to stand the image out from the background of the page). Here is the original image we are going to test with: After we have our watermark and sample image, we need to write a php file to use PHP’s GD function to apply this image to our original image. The particular function we use is imagecopy(). Here is….
Categories: Code Samples,PHP
Tagged: apache, gallery, gif, htaccess, jpeg, no cache, PHP, USD, watermark, web server
- Published:
- September 17, 2007 – 10:21 am
- Author:
- By Dave
If you need to compile ffmpeg for PHP (for example, to allow PHP to process video similar to how YouTube does) – then follow this Howto from Nazly. For a CentOS machine with custom PHP, it works great. Ffmpeg PHP Extension Compile Instructions
Categories: Linux,PHP
Tagged: PHP, YouTube
- Published:
- September 11, 2007 – 10:53 pm
- Author:
- By Dave
Found an encyclopedic list of “stupid” .htaccess tricks. Includes many useful ones such as being able to stop hotlinking of images and replacing with your own, increasing speed and security and general good-to-know htaccess information. Stupid htaccess tricks
Categories: Code Samples,Configurations,PHP,Security,System Administration,Webdesign
- Published:
- June 27, 2007 – 8:57 am
- Author:
- By Dave
Joomla! 1.0.12 appears to have a pathway bug. If you use a component other than com_frontpage for the “Home page” of Joomla – meaning the first link in mainmenu and the page that appears when you load the root of the Joomla! site – then when you click on an article you get a “Double pathway”, for example the pathway will state “Home > Home > Title of article”. The Home, or whatever you named this link, part will be duplicated. It isn’t a big problem but it does look unprofessional on your site! I looked for ages for a fix to this problem, and eventually found it but the site I can not find the site I originally downloaded this fix from. It is courtesy of Reinhard Hiebl – www.hieblmedia.de (whos site is in German, one reason why I’m saving it here). I thought I would throw it online….
Categories: Code Samples,Joomla,PHP,Webdesign
Tagged: PHP, Reinhard Hiebl, whos site, www.hieblmedia.de
- Published:
- October 24, 2006 – 1:32 pm
- Author:
- By Dave
This one is neat – you can control those APC PDU Power Poles over the network via SNMP. This works for the APC Switched Rack Unit PDU, but it may work for others. I use this on a PDU with Network Management Card AOS version v2.6.4 and Rack PDU APP v2.6.5, so of course this is not guaranteed for any other versions. First, set up the PDU on the network. Then, you need to configure the SNMP write string. You do this by navigating the menu (default username password is apc/apc): Control Console->Network->SNMP Change one of the strings to Write+ and preferable change it from public/private to your own string. You can also limit access from certain hosts for extra security. I always keep the APC PDUs on a private network since the APC telnet/web interface is so insecure. Once you have that set up, your PDU is read to….
Categories: Code Samples,Configurations,PHP,System Administration
Tagged: PHP, private network, SNMP, telnet/web interface