2014 New Year's Resolutions

  • Visit 2 countries I haven’t been to before
  • Learn to play the piano
  • Buy a home and at least 1 buy to let
  • Improve spanish

How to set up ircd-hybrid and hybserv on ubuntu 12.04

When setting up the Start-Up Chile IRC chatroom I found it difficult to get an up to date tutorial on how to set up and IRC server and getting Chanserv and Nickserv operational.

This blog post details how to set up Hybrid IRC and Hybserv (which provides nickserv and chanserv) on Ubuntu 12.04.

PHPUnit on OSX10.8

I recently came across the below phpunit error after upgrading to osx10.8 mountain lion.

PHP Warning:  require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/local/share/pear/PHPUnit/Autoload.php on line 45
PHP Fatal error:  require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:/usr/lib/php/pear') in /usr/local/share/pear/PHPUnit/Autoload.php on line 45

How to Make a Web App Promo Video

I recently had to create a web promo video for Recensus from scratch and I’m pretty happy with the result (see below).

Jenkins setup with Git Tutorial

A few quick commands to setup Jenkins with a git repo, plus a troubleshooter when not working for Github or BitBucket on Ubuntu.

Wordpress Auto Updates without FTP on Ubuntu

I enjoy the wordpress autoupdates or plugins, themes and core however when I moved a blog to an ubuntu server it kept asking me for the ftp details (which I did not have). So after a bit of looking around and reading up the simplest solution was to change the whole directory to have the owner www-data and group www-data.

Wordpress Plugin For The EU Cookie Law

Below an email I wrote to someone asking about the cookie law and whether there are any Wordpress Plugin to solve the issue.

Hi Alistair,

The cookie law is much more complicated than a simple plugin as there are many interpretations, and depending on where the site owner lives the law is slightly different.

I've had a quick look and there are a number of plugins, if the client is willing to go down the implied consent route (ICO says it's ok to do this, but it might still be breaking EU law) they can use this plugin:

To be honest to implement the cookie law fully requires changes to, the server the website is hosted on, any analytics code (e.g. google analytics), any logs the server keeps (as although nick-named the cookie law actually refers to any tracking technology) and a warning on every page. I think one of the only website that has implemented it fully is

I can discuss the subject further in the course if your client wants, however to be honest I'm not really an expert on the matter.

Hope that helps,



Recensus (, a  web application that has multiple components, a downloadable javascript widget for clients, a backend web application, a command line interface and a brochure websites all built using Symfony2. The Recensus widget comes in two forms, a cross domain auto resizing iframe and a button with lightbox, both being 100% responsive (and mobile compatible) with the javascript being delivered from the Recensus server. The widget would also have access to an API to pull the content onto the page using server site code, for search engine friendly content. Finally the widget would use Facebook oauth for authenticating users. To accompany  the widget, a web application admin area for Merchants to control their widgets and a brochure website to promote the service. Finally, a command line interface for crontabs to run in the background to ensure the data is managed correctly.

How to install mcrypt on mac osx10.7 and osx10.6

There a lot of php opensouce software that requires mcrypt and it took me a few hours to get mcrypt installed and working natively on my mac, after reading many many tutorials. I originally tried to go down the homebrew (package manager) route but this didn't work. So here are the steps I followed.

mod_rewrite not working on a mac osx

So I recently had an issue of mod_rewrite not working on my mac osx after setting up my vhost and going through my httpd.conf and replacing all “override none” with “override all”. So a couple of things that I learnt:

Firstly unless you going into System Prefernces -> Sharing and turn on Web Sharing OSX, apache will not read you httpd.conf or vhost file, it will just redirect everything to the folder /usr/htdocs (which didn’t even exist for me).

Secondly, you also need to change the file etc/apache2/users/USERNAME.conf to following.

<Directory "/Users/USERNAME/Sites/">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride All
    Order allow,deny
    Allow from all

Install pear on mac OSX10.7

After upgrading to OSX 10.7, I discovered that both PEAR and PECL had gone. After some considerable searching online Ruggero De Pellegrini on Google+, so I’m putting it here for anyone who needs it (including myself when I get a new mac).

Download the installer "curl > go-pear.php"
Start the installation "sudo sudo php -q go-pear.php"
Press 1 and "installation base ($prefix)" and change it to /usr/local
Press enter and continue.
Copy the default php.ini file "sudo cp /etc/php.ini.default /etc/php.ini"
In /etc/php.ini change the include_path = ".:/usr/local/share/pear"

Type pecl or pear in and see if it works.

British Red Cross

A bespoke ecommerce website ( with CMS. Full integration with a 3rd party fulfilment company utilising their API and payment gateway. Branding and design kept in line with Red Cross brand guidelines along with level 3 accessibility standards.

PHP How to convert all links to have target blank

I needed to convert all links to have target blank if they didn’t already have it. I was going to go down the str_pos and str_replace etc but DOMDocument is a much quicker and easier route. See below:

function addTargetBlankToLinks($html)
    $dom = new DOMDocument();

    $xpath = new DOMXpath($dom);
    foreach ($xpath->query('//a[not(contains(@href, "protected"))]') as $node) {
        $node->setAttribute('target', '_blank');

    return $dom->saveHtml();

How to disable root on Ubuntu

Warning: The following instructions worked for me however may brick your server. Please find a professional network admin to play around with a live/production server. If something bad happens I am not to blame, you have been warned!

How to make a Symfony2 Twig Extension

I couldn't find a decent tutorial online that explained twig extensions in a simple way so for those of you in need here is a step by step guide on how to create a twig extension for Symfony2.

Xampp Check List

My checklist for setting up a local environment with Xampp

I've Just Applied to Seedcamp

Seedcamp is basically the UK answer to Y Combinator or TechStars.

In a nutshell these programs can provide seed funding, monitoring and network events for tech startups, an awesome idea! I’ve known about Seedcamp for a while however never felt the need to apply as when setting up my last company Welford Media Ltd (2006 prior to Seedcamp) there was no need to go after funding, I bootstrapped the whole thing and it worked out ok.

This is different. Recensus is a web app that requires as much help as it can get, that includes mentoring from people who’ve done it before, very experienced developers who can build something scaleable and cutting edge, and as much press as possible. I’ve been following Seedcamp for a while and from what I’ve seen, out of any program in the UK, they will help us the most and give us the best chance of success.

Anyway, I’ve submitted my application (with 4 hours to spare) and can only cross my fingers and hope for the best. Last time I spoke to my key developer and soon to be co-founder was before Christmas so I emailed over the applications to him and this was his response “Looks good, I read it through and am excited about the product again! I want to build it now ;)”. Hopefully that’s what the judges at Seedcamp will think too.

Sendmail on Ubuntu

A step by step guide on how to install sendmail on Ubuntu

Adobe Air with Netbeans

I love Netbeans, it’s by far my favourite IDE for developing PHP applications. Recently, I’ve needed to create an Adobe Air application and from what I remember the best free IDE on windows for this was Aptana, which is ok however I found it a little slow (and I already know all the Netbeans shortcuts). So what I really wanted to do was developed Adobe Air with Netbeans, and you can…

Best Firefox Plugins for SEO aka Addons

Probably the best browser for SEO and Web Development (although prefer Chrome for surfing the net). This is mainly because of the wide variety of addons/plugins available.

Recommended Addons for SEO:

  • Firebug
  • Page Speed
  • SEOQuake
  • SEO For Firefox
  • Google Toolbar (for page rank - doesn’t work on FF7+)
  • Search Status
  • SEOMoz Toolbar
  • User Agent Switcher

If you have any other suggestions and I’ll add them to the list.

Changing Plesk Fast CGI to Apache PHP with ZF

So recently I’ve had to change the php mode from Fast CGI to Apache Module in plesk due to the http authenticate functions in php not working. This caused my Zend Framework website to produce a 500 error, in my case it was something to do with:

How to Access PUT data in Zend Framework

So I have followed a few tutorials online on how to build a RESTful API in Zend Framework ( and everything seemed to go swimmingly except when it came to retrieveing the PUT request data. Took me a while to find this however there is a controller plugin pre-built in Zend Framework that you have to enable (Zend_Controller_Plugin_PutHandler). Basically it add the PUT data into the standard request object so you can access the data via getParams() or getParam(‘var’).

Vortex Vid

VortexVid Logo

VortexVid (, a web application for Recruitment Agencies and HR departments to interview candidates online over video. Video uploads are done through a javascript/flash based uploader with a progress bar, and encoded via a 3rd party (through their API). VortexVid has multiple levels of administrators and users as well as a comprehensive configuration page and an offline demo mode.

Wordpress & SEO Trainer

In 2009 I was awarded a contract to produce and deliver courses that helps businesses in Yorkshire embrace online tools. The courses were chosen from 28 entries by 20/20 Digital, a government initiative to help organisations “do business online”. Immediately afterwards I was offered a contract to deliver a wide variety of web technology courses to local businesses on behalf of Leeds Metropolitan University. These courses included a two day Wordpress User Course, a one day Wordpress Developer Course, a two day HTML/CSS Course and a Search Engine Optimisation (SEO) Course. I ran these courses of behalf of Leeds Metropolitan University for over two years. During the two year period I trained hundreds of business personnel on how to use these web technologies to advance their business.

Install APC on Xampp

  • READ THIS BIT CAREFULLY AS THE WEBSITE ABOVE IS CONSTANTLY UPDATED. Look for a file that starts with “php_apc” and then something like “-3.1.10” (APC version) then “-5.3” (Your Xampp PHP version) then “-vc9” (unimportant) then “-x86” (32 bit pc) () .zip
  • At the time of writing if you were running xampp with php 5.3 then you would want this file
  • Download and unzip this file
  • Copy php_apc.dll to C:\xampp\php\ext
  • Open php.ini (C:\xampp\php\php.ini) and add extension=php_apc.dll

Sagepay Test Card Details

Whenever I need to test Sagepay (ex Protx) payment gateway integration I have to try and retrieve the test card numbers I can never find the correct pdf. This means trying to find them on Google (which I never can) or loggin into sagepay and downloading about 3 pdfs before I find the right one. So to save me and others time here see below:

Share Folders on Unbuntu VBox with Windows

These instructions assure you are using Windows as your host and Ubuntu as the client machine. I am using vbox 4 and Ubuntu 10.04 LTS. I had loads of issues getting this to work with other tutorials and forum posts. I kept getting errors like:

How to delete a book from kindle library

I think a lot of other people on the web have bought kindle books they wish they could delete from the kindle library. I know that I have bought books I will never read again (because it was a rubbish book) and more than a couple of times I’ve clicked “buy” simply because it was free.


A web application (SaaS) that would record and track staff time on projects, used initially internally at Welford Media Ltd however now offered to external companies with similar needs. Features  include, RESTful API, AJAX forms, project, task and time analysis, user restricted permissions, project/task manager and integration with invoice software. TimeSheetHQ also has an accompanying desktop application (AirTime, build in Adobe Air) to ensure the submission of time by staff is as easy as possible. AirTime was built using a combination of javascript, jQuery and Adobe Air javascript API. Features of the AirTime app include, popup reminders if no time was being tracked, ajax API project and task calls, automatic stop when idle and multiple time tracking windows.

Invoice Atom

InvoiceAtom (, a web application for small businesses manage invoicing and recurring billing. Feature include, managing contacts, quotes, trackable emails, recurring payment gateway, multiple frequency calendar based recurring invoices, automatic late reminders, turnover analysis, client analysis, Wordpress CMS for brochure website and brandable white labelled solution for resellers.

How to Install InstantSSL on Plesk

To install an Comodo InstantSSL on plesk you need to do two steps, 1. create a csr then upload it, 2. install the certificate comodo send to you (this is the bit that Comodo’s documentation is crap).

How to Show File Extension in Windows 7

Was simple in Windows XP but took a little bit of effort for find how to show file extensions in Windows 7. Anyway just in case you need to know, do the following:

How to Enable SSL on Xampp with Vhosts

If you need to enable SSL on Xampp whilst stilling using vhosts, follow the next few steps. It assumes that you already have vhosts enabled.

Leeds Met University

A website that would accept applications for a prestigious arts award from students based in the north of England. Multiple application types, from both students and teachers as well as multiple categories submission, all automatically allocated to industry specific judges. The admin area also allowed judges to view, download, shortlist and rate submission. The website had to be load balanced across multiple servers along with file storage with Amazon AWS S3 storage during peak times.

Genie Gadgets

Genie Gadgets, an ecommerce website originally built on the X-Cart platform, then re-developed using the Magento Commerce platform. Payment Gateway integration with SagePay, PayPal and Google Checkout. Search Engine Optimisation which resulted in 1st page ranking for the term ‘Gadgets’. Custom module built for expansive voucher scheme which outgrew the platforms capabilities.

The Perfect PHP Framework

I’ve been looking at a lot of framework recently, Zend Framework, Symfony, CodeIgniter, Yii, Prado, Lithium, KohanaPHP, Recess Framework, Akelos, Fuse Framework, Solar Framework, Seagull Framework, Fuse Framework, PHP on Trax, etc and haven’t found one that suit my all my needs. I’ve been using Zend Framework for a couple of years now and am pretty happy with it, however recently I’ve been creating web apps which mainly deliver content through a REST API, which ZF does not support out the box.

My Perfect Future

I’m currently reading 59 seconds by richard wiseman and the first task is to write about my perfect future as apparently this will help improve my happiness. Also I think it will be useful in the future to look back and see what my hopes and dreams were.

How to Take your Start-Up to the Next Level

I’m always on the look out for new great “how to” videos or books for setting up and marketing web apps. I’ve always liked the presentations and talks from Aaron Patzer from, which he started and sold for $170 Million within 3 years. He’s talks are very open and frank and I think they make a lot sense.

The Best Wordpress Social Sharing Plugin

I’ve never found a social sharing plugin for wordpress that I liked. With my old site I resorted to adding the social sharing icons (Digg and Reddit) manually to the html and php but since then a few more social shares have popped up: Facebook like, Facebook share, Twitter share, Google Buzz etc.

The Agency Dream

The agency I have now is not the agency I wished for!

What do I mean by that? I had a dream of being the ‘best’ agency around, with work that everyone would envy, designs that would make people say wow to, an agency that people who are passionate about the web would aspire to design like and want to work for, basically an awesome agency. Don’t get me wrong, I’ve got great staff, I’ve got a great office environment and we work with some great clients but we’ve bent too many of my/our morals on the way.

iPad vs Kindle Review

I been trying to decide whether to buy an iPad or kindle for a while now. I thought I would write up a quick explanation of why I ended up buying an ipad for anyone else out there trying to decide between the two.

Setting up a Cron with Plesk using a PHP File

I have a Server with a Plesk control panel and I wanted to automate a PHP script using a cron (or crontab). Within Plesk it’s called a scheduled task. The problem is its not that user-friendly (but like everything it’s very easy once you know how) so below is how to do it.

Plesk Cron PHP

In the above screenshot you will see that the fields look pretty straight forward however there are a few tricks you need to know. To get a cron to run every minute, hour, day or month you need to use a asterisk.

Once you’ve set the frequency of the cron you need to call a command. For PHP files you need to do the following:

  • Give the path to the php folder, (usually just php)
  • Type in “-q” (this suppresses the HTTP header output)
  • Finally, give the path to you php file

The example above runs the following script every day at 00:07 in the morning.

php -q httpdocs/crons/stats.php

If you just put the php file into the command it will throw an error.

Installing LAMP on Ubuntu

So I been getting rather annoyed with CentOs recently, mainly due to the lack of PHP support above 5.1.6, especially with all the cool features of 5.3. Also I always seem to have massive trouble installing anything like Mcypt or Memcache.

Installing Memcached on Centos 5

The following post is a tutorial on how to install memcached and memcache php extension on Centos 5. Before you start there are a few useful points that might come in handing if you come across any errors.

How to install Memcached on Xampp on Windows 7

For one of my Zend Framework web applications I’m going to install memcached. I am currently using file cache however think memcached is a much better way to go. This post is one in a series:

  • Installing Memcached on Windows 7 and Xampp
  • Setting up Memcached Cache in Zend Framework
  • Installing Memcached on Centos 5.

Enable mod_rewrite in xampp

For some reason my install of XAMPP didn’t have mod_rewrite automatically enabled? Not really sure why  but basically below are the instructions on how to enable .htaccess mod_rewrite in xampp.

PHP Soap Server Error - Procedure not present

I’m currently building a soap service using zend framework. I am developing on a local windows envirment using xampp. When adding a new method to the web service class I was able to call it locally and everything worked a treat, however as soon as I uploaded it to the Centos box it broke with the following error:

Wordpress Hacked

I’ve been hearing a lot of buzz recently about Wordpress sites being hacked, however apart from the occasional tweet I haven’t actually seen any articles describing the problem but then again I haven’t really been looking.

My Wordpress installation is running the most recent version and I assumed it was just one of those security holes that only affected people running older version. I think I might be wrong. I host most of my Wordpress sites with Rackspace and I receive an email from their support saying that they may have found suspicious values in my Wordpress DB. So I got a little worried and started searching a little harder.

Anyway I came across this excellent article about this particular hack and how to find out whether your Wordpress site has been hacked, specifically with the Phara Hack.

The worrying thing is that is article seems to suggest that nobody knows how the hackers are getting into the Wordpress sites. Although, I guess it could have been a hack from a previous version of Wordpress but just activated now?

It also ends with a link to another excellent article on how to make your Wordpress installation more secure.

Luckily I didn’t find any of the tell-tell signs mentioned.

Hopefully you won’t need this information but I thought I mention it anyway,  hopefully Wordpress will find the security holes if there is one and patch it quick and hopefully Wordpress 3.0 will be out soon.

Great American Psycho Quote

A great quote:

“We have to end apartheid and slow down the nuclear arms race, stop terrorism and world hunger. Ensure a strong national defence, prevent the spread of violence within central urban areas, work on the middle east settlement, prevent US military involvement overseas. We have to ensure that the US is respected as one of the world’s economic leaders. Now that’s not to belittle our domestic problems, which are equally important, if not more. Better and more affordable long -term care for the elderly , control and find the cure for the AIDS epidemic, clean up environmental damage from toxic waste and pollution, improve the quality of primary and secondary education, strengthen laws to crack down on crime and illegal drugs. We also have to ensure university education is affordable to everyone and protect the Medical Health Service for everyone plus conserve natural resources and areas of nature beauty and reduce the influence of political action committees.”“But economically we’re still a mess. We have to find a way to hold down the inflation rate and reduce the national debt. We also need to provide training and jobs for the unemployed as well as protecting existing US jobs from unfair foreign imports. We have to make England and the rest of the US a leader in new technology and at the same time preserve our historical companies. We need to promote economic growth and business expansion and hold the line against income tax and hold down interest rates while promoting opportunities for small businesses and control mergers and big corporate takeovers.”

“We cannot ignore our social needs either. We have to stop people for abusing our welfare system, while still providing food and shelter for the homeless. We need to oppose racial discrimination and promote civil rights while also promoting equal rights for women but change abortion laws to protect the right to life yet still maintain women’s freedom of choice. We have to control the influx of illegal immigrants. We have to encourage a return to traditional moral values and curb graphic sex and violence on TV, in the movies, in popular music, everywhere, but allow freedom of choice to those above a consenting age. Most importantly we have to promote general social concerns and less materialism in young people.”

Patrick Bateman

My Wish List

There are a few cool things in the world that would really love to try, I’m not just talking about the latest tech from the big players like Apple, Google or Microsoft. I think the heavily funded small guys have some really innovative ideas.

2010 New Year's Resolutions

My new year resolution for 2010.

  • Visit 2 countries I haven’t been to before
  • Learn to play an instrument
  • Learn to do a back flip off a wall
  • Learn Ballroom Dancing
  • Get a resting pulse rate of below 55bpm - (Done Jan 15th)
  • Drink more water
  • Pay all standard personal outgoings through recurring passive income
  • Eat less red meat
  • Read at least a book a month
  • Reduce alcohol intake to within Government recommended amounts

South East Asia Travel

I’ll just come back from travelling and I’ve had a couple of friends email me asking how to get around China and South East Asia so just in case anyone else wants to know below is the info:

South East Asia Travel

I’ll just come back from travelling and I’ve had a couple of friends email me asking how to get around China and South East Asia so just in case anyone else wants to know below is the info:

Round the World Travel Plans

So I’m pretty much going to give up everything to go travelling around the world for 9 month. I’ve sold my car, taken a sabbatical from my company and told all freinds and family.

I consider this a huge step but one that had to be taken before I got tied
down as then I would never be able to go.

Getting .htaccess to work on windows apache

Could figure out how to actually write the .htaccess file in windows as when i tried to rename the txt file I created to .htaccess it popped up an error saying “You must type a file name”.


I would like to share a new great service that I’ve stumbled across, reCAPTCHA. Most people will know what CAPTCHA is, a program that can tell whether its user is a human or a computer. You’ve probably seen them a colorful images with distorted text at the bottom of Web registration forms.

Wow - Google Reader

I’ve never really been into feeds in a big way, i know the benefits of them it’s just I’ve never had the time to really set things up to make my life easier. In total I’ve got over 1200 bookmarks, the majority of which I don’t visit regally but a lot of the sites I wish I could, if only I could be arsed.

Ranking factors

Top 10 Ranking Factors in 2007:

  • Keyword Use in Title Tag (4.9)
  • Global Link Popularity of Site (4.5)
  • Anchor Text of Inbound Link (4.4)
  • Link Popularity within the Site’s Internal Link Structure (4.1)
  • Age of Site (4)
  • Topical Relevance of Inbound Links to Site (3.9)
  • Link Popularity of Site in Topical Community (3.9)
  • Keyword Use in Body Text (3.9)
  • Global Link Popularity of Linking Site (3.7)
  • Topical Relationship of Linking Page (3.6)

X-cart breakdown of files

I started to use x-cart a little for some of my clients so everything I learn about the file structure, style design, programming etc I will continually add to this post.

The best Firefox addons for a web developer

If you read my last post “I used to love Firefox” you will already know my favorite Firefox addons, however you will also know that by installing a load of addons your browser speed will suffer. I can’t live without my addons so here is my recommended list of Firefox addons a web developer needs without slowing his/her firefox down too much.

SSH Commands for FTP

Ok so one of my servers is with 1and1 and they provide free backup space via ftp. However you can only access it via the server you have with them, this means logging into your server using putty (SSH) from your desktop then logging into the backup server.

I used to love firefox

I installed Firefox (FF) way back in early 2005 and since then haven’t touched Internet Explorer (IE) until now. I used to find that FF loaded pages much quicker and kept up with new CSS techniques unlike IE. Furthermore I love the add-ons you can get and, for me, web development would have been a real pain without them but alas things have changed with the release of IE7.

SSH Mysql command line

Ok so i had a huge amount of trouble trying to upload a sqldump file (large sql file) into the mysql database with phpmyadmin. It kept timing out, even when I increased the timeout and upload file size larger in the php.ini file. So logged in using Putty and used the following SSH commands.

SSH Commands

Common SSH Commands

passwd : Change your SSH account's password, options follow after typing to change account password.

nano [option] [file]: friendly, easy to use file editor
nano w /home/aquhome/public_html/index.php : your now editing index.php with non wrapping of long lines

mkdir [directory_name] : Make a directory with proper default permissions
mkdir aquhome : Makes the directory aquhome in what ever directory your currently in

df : [attribute]
df -h[B] : will show how much disk space is available in human readable format (Megabytes and Gigabytes!)
cd : change directory
cd ~ : go to your home directory
cd  : go to the last directory you was viewing
cd ../ : go up a directory
cd [directory path]
cd /home/aqhome/public_html

ls: lists files &amp; directories in a directory
ls: shows all files with detailed attributes

vi : an advanced editor, tons of features, but much harder to use then nano
vi /home/aquhome/public_html/index.php : now we’re editing that index.php file again!

ln : creates sys links between files and directories
ln  /usr/local/apache/conf/httpd.conf /etc/httpd.conf : Now you can edit the /etc/httpd.conf rather than the original, changes will effect the original instantly, however you can delete the link without deleting the original.

wall : broadcast message
wall [message]
wall so whens the server being restarted?

top : shows continuously updating system processes in a table.

w : shows who is currently logged in and there ip address.

ps : displays processes running. It’s similar to the top command, and it’s used to show currently running processes and their PID.

touch : creates a empty file.
touch [file]
touch index.html : creates a empty index.html

kill : terminate a system process
kill -9 [PID] : You can get a PID by using Top.
kill -9 100545

cp : copy a file
cp yourfile yourfile.copy : copies yourfile to yourfile.copy
cp a /home/aquhome/public_html/* /home/aquhome/public_ftp/ : copies all of the files in public_html to /public_ftp

du : shows disk usage
du sh : shows a summary, in human-readable form, of total disk space used in the currently directory, including subdirectories

netstat : shows all current network connections
netstat -rn : shows routing tables for ip's.
netstat -an : shows all connections to the server.

chown : commands for system that changes the owner of a file
chown [attribute] newowner.newowner filenames
chown -R aquhome.aquhome /home/aquhome/public_html/index.php

chmod : [-r] permissions filenames
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.
Numeric Permissions:
CHMOD can also to attributed by using Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody
CHMOD 755 /home/aquhome/public_html/index.php

last : displays last logins to the system

rm : delete a file
rm filename.txt : deletes filename.txt, will more than likely ask if you really want to delete it
rm -f filename.txt : deletes filename.txt, will not ask for confirmation before deleting.
rm -rf tmp/ : recursively deletes the directory tmp, and all files in it, including subdirectories. BE VERY CAREFULL WITH THIS COMMAND!!

grep : looks for patterns in files
grep root /etc/passwd : shows all matches of root in /etc/passwd
grep -v root /etc/passwd : shows all lines that do not match root
wc : word count
wc -l filename.txt : tells how many lines are in filename.txt

mv : Moves a file.
mv -f /home/pen/ram.php /root/ Moves ram.php to the directory root

Basic Extracting

tar xvfz imagick-0.9.11.tgz (extracts the .tgz file)

bzip2 and bunzip: Files With .bz2 Extensions

bzip2 filename.txt : zips filename.txt to filename.txt.bz2

bunzip2 filename.txt.bz2 : unzips filename.txt.bz2 to filename.txt

[B]Important Service Commands

Restart apache:
service httpd restart

Restart MySQL:
service mysql restart

Restart exim:
service exim restart

Restart Cpanel:
service cpanel restart

Note: "restart" can be replaced with "stop" to quit the service and "start" to start a stopped service.

Restart apache:
service httpd restart
Restart MySQL:
service mysql restart
Restart exim:
service exim restart
Restart Cpanel:
service cpanel restart