kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Alternate ‘Messing with time and date on Linux’

Posted on December 20, 2011

Following up from a previous post, some hypervisors like Xen are a bit fruity when trying to control the time via NTP. Here's how we managed it.

Firstly, if your installation doesn't have ntp install. Install that.

  1. yum install ntp

New Site: Lizzie Lane – Hand Selected Beautiful Jewellery and Gifts

Posted on December 8, 2011

Today I completed work on another customer's site: Lizzie Lane - Hand Selected Beautiful Jewellery and Gifts.

My tasks were to develop some custom templates for it's Thesis based theme, many Shopp modifications including fixing an XSS issue in Shopp, making Shopp work with SSL (something it does not do out of the box), some CSS work and various other Shopp modifications.

 

Tagged as: , , No Comments

WordPress Auto Install Script for cPanel

Posted on December 5, 2011

I have released version one of my WordPress Auto Install Script for cPanel.

This script can be run from /scripts/postwwwacct to automatically download, install WordPress and create the required database and database username.
No 3rd party licenses, scripts, FTP sessions. No outdated versions, always grabs the latest version from WordPress.org

This script is available upon request for £50. Get in touch for details.

 

Installing FFmpeg and ffmpeg-php on CentOS

Posted on December 5, 2011

Whilst installing FFmpeg and ffmpeg-php for a client that required server-side MP4 processing, I ran into a few errors.

The error I came across was while compiling ffmpeg-php

TimThumb upscale fix: stop timthumb from upscaling small images

Posted on December 5, 2011

 Ever found that TimThumb is upscaling your small images and looking crap? As of version 2.8.1 TimThumb does not check if the image is smaller than the specified proportions before resizing.

Here's a fix thanks to Rein Aris, slightly updated to work with version 2.8.1

Embedding Videos with TinyMCE

Posted on December 1, 2011

By default TinyMCE strips out any code that you would use to embed videos or Flash into your site. To allow videos to be embedded you need to change how TinyMCE init's.

Mainly, the valid_elements, extended_valid_elementsvalid_child_elements parts of the code.

Use the following code

How to install the nslookup, host OR dig commands in Linux?

Posted on November 25, 2011

Sometimes you are unable to use the nslookup, host OR dig command on your Linux server and receives the following message

  1. -bash: nslookup: command not found -bash: host: command not found -bash: dig: command not found

The reason is the package required for the commands to work isn’t installed during the OS installation.

These are all DNS related commands useful to check the DNS report of a domain/IP.

You need to install the package bind-utils which offer the commands like nslookup, host, dig and others.

SSH to your server as root and execute

  1. yum install bind-utils

Done!

Tagged as: , , , No Comments

Make an SEO friendly URL in PHP

Posted on November 20, 2011

Just like WordPress creates it's slugs or friendly URLs, I had to write some code to achieve the same for a customer running a custom web application.

Here's how I did it.

Tagged as: , , , Continue reading

[Snippet] Whois Client on CentOS

Posted on November 10, 2011

I can never remember how to install a whois client on CentOS.

  1. yum install jwhois

Thats it!

Filed under: CentOS, Linux No Comments

PHP Header Redirects

Posted on November 4, 2011

There's a few ways to redirect a page in PHP. Well, two. A right and a wrong.

Wrong Way

  1. header('Location: foo.php ');

Right way

  1. header('HTTP/1.0 302 Found');
  2. header('Location: foo.php ');

This is evident on IIS6 and IIS7 where the wrong redirect will just fail.

Even if you are not using IIS6 or IIS7 its good practice to set the headers correctly and exit the script.

Tagged as: , No Comments
Page 2 of 3412345...102030...Last »