<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.7" -->
<rss version="0.92">
<channel>
	<title>Optimus Pete</title>
	<link>http://tech.petegraham.co.uk</link>
	<description>yes i love technology</description>
	<lastBuildDate>Thu, 28 Jun 2007 17:33:10 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>PHP monitor server log</title>
		<description>PHP monitor server log

Occasionally you'll be working on a webserver and not have SSH access to it. Below is a simple script I've written that reads a server log (in this case the error log) and outputs a portion of it to a webpage.

[php]

$no_lines = 25;

$filename = $_SERVER['DOCUMENT_ROOT']."/../logs/error.log";
$handle = fopen($filename, ...</description>
		<link>http://tech.petegraham.co.uk/2007/06/28/php-monitor-server-log/</link>
			</item>
	<item>
		<title>Mailto Hyperlinks Stop Spam Bots!</title>
		<description>Everyone hates spam, I hate it even more than most people. If you put an email address on a website, as a mailto hyperlink, then it's likely that spam bots will find this address and start sending annoying emails.

One way to get around this is to use a clever technique ...</description>
		<link>http://tech.petegraham.co.uk/2007/06/28/mailto-hyperlinks-stop-spam-bots/</link>
			</item>
	<item>
		<title>Vim Key Mappings</title>
		<description>One of the things I always found awkward about Vim is stretching for the ESC key to get out of insert mode.

Here's a little trick that I like to add into my .vimrc file:

[code]
map   i
imap  
[/code]

This will let you escape insert mode by pressing shift and space ...</description>
		<link>http://tech.petegraham.co.uk/2007/06/05/vim-key-mappings/</link>
			</item>
	<item>
		<title>IE7 Clicky Sounds Do my Nut in!</title>
		<description>I'm not a fan of applications that use sounds effects, one of the first things I do when configuring a new PC is to set the Windows Sound scheme to 'No Sounds'. IE7 has the hugely annoying feature where a click sound is made when you click a link with ...</description>
		<link>http://tech.petegraham.co.uk/2007/06/05/ie7-clicky-sounds-do-my-nut-in/</link>
			</item>
	<item>
		<title>PHP: File Downloads HTTP Headers</title>
		<description>In PHP you can provide file downloads by using a PHP page to “pass through” the file. Of course you could just link to the actual file, however this technique means your file can kept outside of your website root. Another advantage is you can integrate this system into a ...</description>
		<link>http://tech.petegraham.co.uk/2007/05/16/php-file-downloads-http-headers/</link>
			</item>
	<item>
		<title>Away with Applications: The Death of Desktop</title>
		<description>There is a great talk that went up on Google Videos earlier this month called Away with Applications: The Death of Deskop. In it the speaker, Aza Raskin points out that no work is carried out actually using the computers desktop. He also points out the failing of desktop applications, ...</description>
		<link>http://tech.petegraham.co.uk/2007/05/15/away-with-applications-the-death-of-desktop/</link>
			</item>
	<item>
		<title>PHP: Get First Index in Associative Array</title>
		<description>The other day I was programming in PHP and needed to get the first index in an associative array. There doesn’t appear to be a built in function to deal with this so I wrote my own.

[php]
function getArrayFirstIndex($arr)
{
foreach ($arr as $key => $value)
return $key;
}
[/php]

Here's a bit of code you can ...</description>
		<link>http://tech.petegraham.co.uk/2007/05/15/php-get-first-index-in-associative-array/</link>
			</item>
	<item>
		<title>JS: Execute JavaScript on Page Load</title>
		<description>Recently I’ve been making an effort to improve my JavaScript skills, I’m not a JavaScript-Jedi yet but I have been picking up a few, tips, tricks and techniques.

One thing that I find extremely useful is using an init function to call other functions when the page has loaded. I have ...</description>
		<link>http://tech.petegraham.co.uk/2007/05/14/js-execute-javascript-on-page-load/</link>
			</item>
	<item>
		<title>Vim: Search and Replace, Insert new line</title>
		<description>Vim has some really useful commands, especially search and replace ones. Unfortunately I'm always forgetting the finer details of how to use them so here's an example:

[code]

:%s/$/\rthis is a new line

[/code]

To break down whats happening above:

	: switches Vim into command mode
	% means we're going to apply this command to every ...</description>
		<link>http://tech.petegraham.co.uk/2007/05/03/vim-search-and-replace-insert-new-line/</link>
			</item>
	<item>
		<title>It’s internet with a small ‘i’ now</title>
		<description>When I was doing my Computer Science degree our lectures used to make a big deal about making sure you spell Internet with a capital ‘I’, because it’s important and it’s the name of a thing. Apparently it’s now been decided that it should be spelt with a lowercase ‘i’, ...</description>
		<link>http://tech.petegraham.co.uk/2007/04/30/it%e2%80%99s-internet-with-a-small-%e2%80%98i%e2%80%99-now/</link>
			</item>
</channel>
</rss>
