Bear Grylls in a bog in scotland

General News No Comments »

http://www.youtube.com/watch?v=AyqZyacTtcU  - check this out, 6mins 11 seconds

This is so funny

ubuntu, how to install dbdesigner4 (Database designer)

General News No Comments »

Ubuntu - Install php5, mysql, apache2, ssl, pdo & pdo_mysql

Warning, this post is not yet complete

How to install dbdesigner4 for ubuntu.

Firstly, thanks to the following sites for resources

I am running Ubuntu 7.x.

I am going to setup DBDesigner4.

Read the rest of this entry »

Excel PHPMyAdmin, Convert Text to Number excell 2007

General News No Comments »

Just a quick tip. today i exported a load of a data from phpmyadmin to excell (excell 2007 in this case) and as usual all the data was as ‘text’ instead of being a ‘number’

Having had a detailed (45min) look around the interweb, i was struggeling, they all mentioned methods of converting text to number one cell at a time or using excell 2003-2006 which was useless really.

Anyway, heres how you do it:

Read the rest of this entry »

Ubuntu install / setup curl for php / php5

General News 16 Comments »

Ubuntu - Install php5, mysql, apache2, ssl, pdo & pdo_mysql

Hello person viewing this page :)

I recently had to use curl on my local ubuntu dev machine and you maybe trying todo so yourself and have found this page by looking for some information on ubuntu, installing / configuring or seting up curl to handle your php requests.

Well heres how i setup curl for ubuntu, and i hope it works for you to:

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

Then restart apache2 and you should be away, hope this helps.

Icom Web - Icomweb Shrewsbury

General News 3 Comments »

Having been trying to deal with icom web over at shrewsbury now for the past 3-4 weeks, i have found them highly unprofessional, disorganized and rude. Down with icom web in shrewsbury !
The story goes like this. .

Read the rest of this entry »

Ubuntu - Install php5, mysql, apache2, ssl, pdo & pdo_mysql

General News, ubuntu 28 Comments »

Ubuntu - Install php5, mysql, apache2, ssl, pdo & pdo_mysql

I recently tried SUSE enterprise 10 and although i found the GUI absoloutly excellent, wireless support and sound card support was such an effort to get working, i have come back to good ol’ ubuntu. The classic linux distro where stuff seems to ‘just work’.

The following is meant to be a tutorial for setting up a basic webserver on your ubuntu desktop.

Installation instructions / How to setup PHP5, Mysql, Apache2, SSL, Mod_rewrite, pdo and pdo_mysql

Overview / Index

The reason i have put this together, is so people don’t have to search for multiple things, and can find all the essentials here

I am running Ubuntu 7.10 and fresh installation (about 10 mins ago).

I am going to setup Apache2, PHP5, MySQL, SSL, PDO loading the PDO_MySQL driver. This document is ment to help people who struggle with any of these and provide a bit more of a ‘one stop shop’ to anyone trying to set these services up.

 

Step 1 > Apache2

ntom@localhost:~$ sudo apt-get install apache2

Incase you need to, you can find how to add extra repositories here

 

Step 2 > MySQL 5

ntom@localhost:~$ sudo apt-get install mysql-server libmysqlclient15-dev

 

Step 3 > PHP5

ntom@localhost:~$ sudo apt-get install php5 php5-common libapache2-mod-php5 php5-gd php5-dev curl libcurl3 libcurl3-dev php5-curl

 

Step 4 > PHPMyAdmin

ntom@localhost:~$ sudo aptitude install phpmyadmin

At this point, you should be able to go to http://localhost/ and see your webserver is now up and running.
You should also now see a folder called ‘phpmyadmin‘ which if you click on, and enter ‘root’ as the username, leave the password blank, and login, will give you access to your mysql db’s.

 

Step 5 > SSL certificate for Apache2

ntom@localhost:~$ sudo apache2-ssl-certificate

If you get back that it can’t find apache2-ssl-certificate .. then not to worry, this is a known bug, and please read my comment at the bottom.. direct link to the comment click here

Answer the questions

ntom@localhost:~$ sudo a2enmod ssl

This enables the ssl mod for apache2

ntom@localhost:~$ echo "Listen 443" | sudo tee -a /etc/apache2/ports.conf

 

ntom@localhost:~$ sudo ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl 

 

ntom@localhost:~$ sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl

To understand more about sites-enabled, sites-available click here

ntom@localhost:~$ sudo gedit /etc/apache2/sites-available/ssl

Select All (crt+a), delete, then paste in this:

NameVirtualHost *:443

<virtualhost *:443>
        ServerAdmin webmaster@localhost

        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/apache.pem

        DocumentRoot /var/www/
        <directory />
                Options FollowSymLinks
                AllowOverride None
        </directory>

        <directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # Commented out for Ubuntu
                #RedirectMatch ^/$ /apache2-default/
        </directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </directory>

</virtualhost>

Then we need to change the default file, so…

ntom@localhost:~$ sudo gedit /etc/apache2/sites-available/default

and make sure the following lines say this:

NameVirtualHost *:80
<virtualhost *:80>

&nbsp

You may also want to enable mod_rewrite.. todo so, follow the following steps:

ntom@localhost:~$ sudo a2enmod rewrite

 

You will also need to edit sites-available default, and ssl:

sudo gedit /etc/apache2/sites-available/default

And the same again for the ssl file.
Here you will need to change the section which says ‘AllowOverride None’ to:

AllowOverride All

 

Now restart apache

ntom@localhost~: sudo apache2 -k restart

 

Step 6 > PDO & PDO_MySql

First, we need to install PEAR, so…

sudo apt-get install php-pear

 

If you get anything about warning, ‘phpize’, this means you need php-dev, or if your using sypantic package manager, ‘php5-dev’.

sudo pecl install pdo

This installs pdo.

The next thing you want todo is install the pdo_mysql drivers. Do this by doing the following:

sudo pecl install pdo_mysql

If however you get a error somthing along the lines of:

checking for MySQL support for PDO... yes, shared
checking for mysql_config... not found
configure: error: Cannot find MySQL header files under
ERROR: `/tmp/tmpRiQ5ax/PDO_MYSQL-1.0.2/configure' failed

Then you should download and install the following packages:

sudo apt-get install libmysqlclient15-dev

and then try to re-install pdo_mysql.

Once this is finished and sucessful (it was for me), its best to then run the following code:

sudo updatedb
sudo gedit /etc/php5/apache2/php.ini

Inside the php.ini, at the bottom, add the following lines:

extension=pdo.so
extension=pdo_mysql.so

 

The end

I hope this has been helpfull to many people out there. I hope it has saved people endless hours looking at different sites for different aspects of this tutorial.

Please be sure to leave some comments :)

PDOException thrown “SQLSTATE[HY093]: Invalid parameter”

General News 2 Comments »

Recently just had the ” PDOException thrown “SQLSTATE[HY093]: Invalid parameter” ” error.

This caused due to me having a query like this.

$dbq->prepare(’some query with :some vars in it like :this’)
$dbq->bindParam(:some, ’some string’);
$dbq->bindParam(:this, ‘another string’);
$dbq->bindParam(:oops, ‘this string is not in the prepared statement’);
$dbq->execute();

When i removed the :oops bind param it worked. Hope this helps someone else and saves time. PHP v 5.2, Mysql v5

Unable to contact Ebay, Amazon and Paypal

General News 2 Comments »

Are you like me and fed up with being unable to contact web companies?

Ebay

I recently had some items removed from being listed on ebay, however when i tried to  contact ebay, there was no telephone number, and no email, instead only a multitude of contact forms.

This is basically a series of questions you have to answer as to what your contacting ebay about.

I my scenario it was regarding items removed from ebay listing, and you end up picking the nearest thing, such as ‘ebay listing help’ then you have to answer a subquestion which gets even more away from topic, like ‘ebay listing help’ -> ‘adding images’  .. .  FINALLY when you actually get to write a message, ebays policy is to merly forward you an automatic email poiting you to the help pages on their website based on the topic and subtopic you have chosen. You then have to reply to this to actually get a human to respond.

Amazon

This is another culprit, the story goes like this:

  • Bought a book
  • Recieved an email to say it would not be with me for 3 months
  • 3 months later recieved an email to say it was still not in stock or somthing and wouldn’t be with me for another 3 months

I then tried to contact them and tell them they can shove their order but their telephone is completly absent from their website, as is the ebay telephone number.

Paypal

Again, like amazon, and ebay, they also seem to have this fascination with hiding their telephone number and contact details.

WHY do these companies try to annoy their existing or potential customers by hiding their contact details ? 

I hate this with a passion, and as a result, will never deal with any of these companies ever again no matter what. I now always check for a telephone number before hand and speak to someone.

Bottom line:

  • Ebay has warm sloppy shit customer support
  • Paypal has warm sloppy shit customer support
  • Amazon has dried cold shit customer support, you can easily clean it of your shoes, but its still shit !

ebay shit customers support  amazon has shit customer supportpaypal has shit customer support

Chess board, Pound Coins and how high.

General News No Comments »

A question:

If i have a chess board and place a pound coin on the first square, and double the pound coins on the next square, how high will the pile of pound coins be on the final square ?

Using google as a reference for measurements and sizes, i thought i’d work it out… working as follows…

The correlation

Here is a table showing the correlation of the number of coins to each square..

Square # of Coins Relationship
1 1 1
2 2 1 * 2
3 4 1 * 2 * 2
4 8 1 * 2 * 2 * 2

So clearly the relationship is staring us in the face;

number of coins = n
square number = s

n = 1 * 2s - 1

The final square

So on the final square of a chess board (the 64th square), the amount of coins will be:
1 * 263 = 9223372036854775808

a quick google search reveals to us that pound coin is: 3.15mm heigh.

to the total height in mm will be:
9223372036854775808 x 3.15 = 29053621916092543795.2mm

another google search tells us how many km in a light year,
1 light year = 9.4605284 × 1012 kilometers… or 9460524840000km.

So lets convert our height in mm into km, (divide by 1 million)

total height of coins in km: 29053621916092.5437952 km

Finally, coin height in light years…

So our final calculation is:
coin height in km / distance of one light year in km = total coin height in light years.
29053621916092.5437952km / 9460524840000 = 3.0710370098338586250358600612268

Final height of the 64th square: 3.07 light years high.

Now thats impressive doubling.

Virgin Active Gym, SA vs UK

General News 1 Comment »

A letter to Virgin Active UK

For those who don’t know, I have recently been enjoying the glorious sunshine and lifestyle that is South African white man living.

Virgin Active Solihull

Part of this lifestyle involves going to the gym on a regular basis, doing the following routine:

  • Squash- 40mins - 1hour
  • Bike - 15-20mins
  • Rowing- 10-15mins (personal best is: 2510m in 10mins, averaging 1:55.5/500m)
  • Mixed weights- 1 hour.

So, once i got back to the UK, keen to stay on track with my fitness regieme, i looked into the opening times for the local VA gym (using the SA pass, pretending i’m a member gets me in free for a limited period (which can be extended if there is a different person on reception ) ).

After seeing the opening time was 6:30am, i was most disapointed as this isn’t early enough to go before work, so i wrote a letter to the UK VA website, ranting about my frustration. Read the rest of this entry »

WP Theme & Icons by N.Design Studio & Shamefully P0wered by WordPress
Entries RSS Comments RSS Log in