Make text PHP safe

Posted on December 21, 2006 on 2:20 pm by glen | In General, PHP | 1 Comment

Have you ever copied and pasted some text from somewhere for use in a PHP string? You have? Well, you know that there can be some problems if the text contains single or double quotes. That’s where this little tool will come in handy:

PHP String Quoter

Just enter your text, and it will return a version of it ready to use in either single or double quoted PHP strings.

Optimizing MailScanner

Posted on December 18, 2006 on 2:05 pm by glen | In General, RedHat, Email, MailScanner | No Comments

Our MailScanner installation is pretty heavily utilised, scanning 20,000+ messages a day. I’m always looking for ways of improving it’s performance, so the following document has proved useful:

Optimization tips

  1. Use a ramdisk (tmpfs) for MailScanner’s working directory.
  2. Make sure you have enough ram
  3. Set the noatime flag on your spool and log partitions
  4. Use a local DNS caching nameserver
  5. No syncs on logs
  6. Use DCC as a daemon
  7. Tweak your # of max child processes
  8. Running your own copy of RBLs, and servers for DCC, Pyzor and Razor
  9. Consider dropping unknown recipient emails on the inbound MailScanner MTA

Enabling GD library for PHP 4.4.4 on Mac OS X

Posted on December 16, 2006 on 2:21 am by glen | In MySQL, PHP, Apache, Mac | 4 Comments

For some reason, GD is not enabled in the default Mac OS X build of PHP 4.4.4. Here’s an easy way to install. Make sure you have the following fink packages installed:

  • libpng3
  • libjpeg

1. Download the source code for PHP 4.4.4

PHP 4.4.4 source

2. Unpack the source

tar jxvf php-4.4.4.tar.bz2
cd php-4.4.4

3. Compile and install the GD extension


cd ext/gd
phpize
./configure --with-jpeg-dir=/sw --with-png-dir=/sw --with-zlib-dir=/usr
make
sudo make install

This last stage will install the GD shared object into /usr/lib/php/extensions/no-debug-non-zts-20020429/

4. Pull in the GD module at startup

Edit /etc/php.ini and add the following line:

; Enable gd extension module
extension=gd.so

and make sure the following line is commented out:

;extension_dir = "./"

5. Restart Apache

sudo apachectl graceful

Bingo!

GD info

Perfect Harmony?

Posted on December 14, 2006 on 8:51 pm by glen | In General, Design, XHTML, Mac | No Comments



Perfect Harmony?, originally uploaded by lonesome cowboy glen.

The latest version of Parallels Desktop for Mac offers a feature called Coherence which means that you can run Windows apps on your Mac desktop. It’s really handy, especially when you need to do some browser testing. Also, it means Windows XP is hidden from your view which is a nice bonus :)

Sending encrypted mail with Apple Mail

Posted on December 12, 2006 on 10:22 pm by glen | In General, Mac | 1 Comment

Apple Mail has a nice feature that allows you to digitally sign and encrypt your messages. This is extremely important if you are sending sensitive information via e-mail because messages are usually sent over an unencrypted channel. This means that there is the potential of your message being intercepted by a third-party. By encrypting your messages, it means that only the recipient of the message can read them.

The process of setting this up is fairly straightforward. First you need a Secure Email Signing Certificate (Digital ID). The good news is that you can get one for free:

Personal E-mail Certificates - secure e-mail communications

Once you’ve gone through the fairly lengthy registration process, you will be able to request a certificate.

Making a certificate request

Types of certificate
Select the Mozilla Firefox option and go through the request process. Eventually your browser will download your certificate, and if you are using Safari, import it into Keychain Access.

When you now use Apple Mail, your outgoing messages will be signed by default. When you receive signed messages from other people, their public certificates will be automatically imported into Keychain Access allowing you to send them encypted messages. Just click the lock icon when you create a new mail! Bingo!

Encrypted and signed message

For more information:

Mac OS X 10.3: Mail - How to Use a Secure Email Signing Certificate (Digital ID)

Run multiple versions of Internet Explorer on Windows

Posted on December 7, 2006 on 3:26 pm by glen | In General, Design, CSS, XHTML, Mac | 1 Comment

Windows has always been a bit of a pain when it comes to Internet Explorer versions: it only allows you to have one installed. This makes testing problematic: it means, for instance, that I have to have several Windows XP installations in Parallels Desktop and load them up when needed. However, there now seems to be a solution:

Run IE5, IE6, and IE7 at the Same Time - Even On a Mac

Just three installs and you are done! IE3, 4, 5, 5.5, 6 and 7 on one copy of Windows! Lovely!

Lot's of IE's

PHP syntax check on Save

Posted on December 7, 2006 on 10:29 am by glen | In PHP, Mac | No Comments

John Gruber has produced a nice little AppleScript to check your PHP documents for syntax errors. I have found that you can use this as a nice safety net so not to save any PHP documents with errors by attaching the script to the Save option in the File menu:

1. Install the AppleScript into ~/Library/Application Support/BBEdit/Scripts/
2. Make an Alias to this script and name it File•Save You can get the round character between File and Save by holding the option key and pressing 8.
3. Move this Alias to ~/Library/Application Support/BBEdit/Menu Scripts/
4. Restart BBEdit

Now, whenever you try and save a PHP script, it will perform a syntax check. If there are any problems, then it will tell you what line number the problem has occurred on, which you can then fix. Useful, yes?

Ultra Firefox

Posted on December 6, 2006 on 10:31 pm by glen | In General | No Comments

Okay, so I was bored one night so I started messing around with Firefox. I basically installed the 100 most popular add-ons for the Mac version this year, and this is the result. Amazingly, it still runs pretty well, though the small browsing area is a bit of a pain. I think I’ll stick with Safari, though :)

Update 7th December 2006: Okay, this guy has trumped me big time :(

New Site Launched For Client

Posted on December 1, 2006 on 4:48 pm by james | In General | No Comments

We recently completed a site for a client called Casvor.

www.casvor.com

They are resellers of iPod accessories.

The project involved designing the interface and also developing an order form.

The order form was integrated in to their Protx account.
This enables them to take online payments by Credit and Debit card.

We installed an SSL Certificate on the site to ensure their customers data was secure when entering personal details. This encrypts data at 128 bit.

Casvor had scheduled national advertising, so we were on a tight deadline to deliver.

PHP Developer

Posted on December 1, 2006 on 2:12 pm by james | In Job Vacancies | No Comments

We are currently hiring at Design Solution.

You will have 2-5 years experience using PHP, developing secure and robust web applications.

In addition, the successful candidate will posses excellent knowledge of MySQL, XHTML, CSS, JavaScript, and Linux.

Please email your CV to team@designsolution.co.uk

Feeds: Entries | Comments