Exclude Files When Using Grep

Uncategorized No Comments »

grep -ir –exclude=*.{ext1,ext2,ext3} ‘searchterm’ .

I needed this when searching for terms that were in javascript and SQL files.

It’s not pretty when they’re included.

Debug: file_get_contents($url);

Uncategorized 1 Comment »

There is a variable $http_response_header

It contains the header reply information from the server…

$var = file_get_contents($url);


This really helped me figure out some problems when trying to cache google charts.

Dear TV Licensing…

Uncategorized 3 Comments »

To whom it may concern,

I have a TV License for my place of residence, however, you continue to send me various warnings and threats about an unlicensed property.

I appreciate that in all likelihood these communications are automatically generated but I would criticise that you do not provide a free of charge method for me to inform you that your address database is incorrect.

I am especially distraught that you have sent a further letter to ‘the legal occupier’ of an invalid address with my post code ensuring that my local court is preparing to summon me.

I have provided my license number in this contact form and my telephone number and I would be grateful if one of your representatives could contact me in order to discuss the offending address(s) in your database.

Frankly I am entirely dissatisfied with your persistent and unjust harassment of an actual license holder.

Bridgnorth Mug

Uncategorized 1 Comment »

Whilst still a student I worked in a pharmacy in Bridgnorth one summer for eight weeks. I really enjoyed the placement and the people there, although, not always the work. The daily commute was a pain but the people made up for it. When I left we all went for a drink in one of the local pubs. One of the presents they bought for me was a mug with the town hall of Bridgnorth on. I’ve since been working in and around Tamworth. I took the mug with me as a reminder of the fond memories I had in Bridgnorth.

A couple of nights ago I found myself dreaming I was in a multi-storey car park with a now ex-boyfriend. For some reason I was desperate to get away from him and escape in my car but I couldn’t get to it and exclude him as we were both so near to it. I decided to run up a spiralling staircase. He chased me. Initially this was playful like previous mock fights we engaged in.

Read the rest of this entry »

South Korean Flag Dimensions

Uncategorized No Comments »

Flag of South Korea Construction Sheet

Isn’t its simplicity beautiful.

404 with jquery.gritter SOLVED

Uncategorized No Comments »

Gritter is a really good extension of jQuery’s functionality that is used to display information boxes to users. If you use firefox’s extension Firebug though or you look in your server logs then you may see that it’s causing 404 errors.

Whilst annoying the errors aren’t fatal. My applications have worked for long enough without solving the problem but it IS annoying and finally today I decided to do something about it. I found the solution on this blog and Duck Ranger gives much more sensible reasons for fixing the problem.

The error is caused by a Gritter’s CSS file creating a GET request to solve an IE bug but the request is for the current (CSS) directory which is forbidden.

Read the rest of this entry »

HowTo: Mac OS X Flush DNS Cache

Uncategorized No Comments »

While playing with my /etc/hosts file for testing a new server setup I needed to flush my DNS cache. As ever, terminal came to my aid.

dscacheutil -flushcache

Now all is well in the world of DNS.

Connecting to MySQL over SSH

Uncategorized No Comments »

The last couple of days I’ve been thinking about setting up a local copy of my websites on my laptop so that I can develop them before I make them live.

Last night I enabled PHP on the apache server built into Mac OSX on my new laptop and installed MySQL on it. I also set up some bash aliases to rsync commands so that I could synchronise the websites from the server to the laptop and back again.

Now that I had local copies of the sites that are synchronised it was time to turn my attention to synchronising the databases between the server and my local machine. I could of configured the server’s MySQL installation to allow remote connections, however, I did not want to do this for security reasons. I decided that I would connect to the MySQL server over SSH by forwarding a port on my local machine to a remote port on the server.

First I needed to create an SSH tunnel using the following command

ssh -fNg -L 3307: server.host.name Read the rest of this entry »

Using mysqladmin to change the root password

Uncategorized No Comments »

If you have never set a root password for MySQL, the server does not require a password at all for connecting as root.

To setup root password for first time, use mysqladmin command at shell prompt as follows:

$ mysqladmin -u root password NEWPASSWORD

However, if you want to change (or update) a root password, then you need to use following command

$ mysqladmin -u root -p’oldpassword’ password newpass

HowTo: Change a User’s Default Shell

Uncategorized No Comments »

At the beginning of the week I purchased a new MacBook Pro In between working I’m in the process of configuring it as I like it and one of the things that was bugging me was the default shell for the root user. I was foolishly trying to set the the prompt PS1 value in .bash_profile when the default root shell isn’t even bash.

The solution is to switch to the superuser (root) and issue the following command…

chsh -s /bin/bash

That will change the default shell to bash and the prompt will change as per your configuration.
Just for information my root PS1 is…

PS1=’\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ‘

Happy Configuring!

WP Theme & Icons by N.Design Studio | Akismet has gobbled 347,538 spam comments...Mmmm Tasty :-)
Entries RSS Comments RSS Log in