RSS

Archive | Technology RSS feed for this section

Excluding folders when creating a tarball

13. September 2006

0 Comments

When creating a tarball, to exclude folders one simply uses the –exclude= flag: For example to tar up the contents of /var/log but to exclude /var/log/apache & /var/log/mail/ tar -jcvf logfiles.tar.bz2 /var/log/* --exclude=/var/log/apache/* --exclude=/var/log/mail/* Just in case you didn’t already know then the ‘j’ flag in the ‘jcvf’ tells tar to use bzip2 compression.

Continue reading...

Perl MySQL backup script.

11. September 2006

0 Comments

I’m in the middle of migrating a lot of websites from one server to another. Here’s a small script I knocked up to take a dump of all the MySQL databases on that machine: [perl]#!/usr/bin/perl -w use strict; my $dumpDir = “/tmp/foo”; my $dumpUser= “root”; my $mysqlBin = “/usr/local/mysql/bin”; my $mysqlPassword = “bar”; foreach (`ls -F /usr/local/mysql/var`) { [...]

Continue reading...

Emulating PHP’s substr() with Smarty [sort of]

7. September 2006

2 Comments

Today I had a requirement to strip off the first 9 digits from a string from within a Smarty template. The system using Smarty is *totally* locked down so no access to plugins or using php functions as modifiers so I could not simply do $string=substr($string,9); or even {assign var=”shorterThing” value=$thing|substr:9} In the end I used [...]

Continue reading...

RSS to Email

29. August 2006

0 Comments

I can’t be arsed with RSS feeds; they are too high maintenance and I just don’t have the time to read them any more, especially so since I became a freelance web developer again and all my time is spent working or trying to get work. I thought the Google Reader might work for me but [...]

Continue reading...

Midlands interweb groups

22. August 2006

0 Comments

I’ve only been living in the midlands for a few months now but have already found two promising groups: The Multi Pack and PHP West Midlands. Multipack seems to be a bit more designery but they are organised, have a great website and put on meet-ups. It seems that some of the organisers are also involved [...]

Continue reading...

Web Design

1. July 2006

0 Comments

I launched my new web design company today, Siftware. Based in Upton-upon-Severn I shall be doing the same work as I was when running web design company Exponetic, but keeping things much smaller so I have more time to spend with my family. You may wish to take a look at my freelance web design cv credentials. [...]

Continue reading...

Sad PHP poem

26. June 2006

0 Comments

Disclaimer: You have to be a geek to find the following even mildly interesting or heaven forbid, amusing. List: php-general Subject: [PHP] Sad PHP Poem From: “Martin Alterisio” Date: 2006-06-26 4:25:20 A sad poem of an algorithm where [...]

Continue reading...

BASH for loop

22. June 2006

0 Comments

[code]#!/bin/sh for FOO in a b c d e f; do echo $FOO done[/code] Outputs a b c d e f

Continue reading...

All your APIs in one place

26. May 2006

0 Comments

This is what looks to be a superb developers resource: gotAPI.com All Ajaxy and customisable, with the ability to add your own tabs. I’ve currently got PHP, MySQL, HTML and CSS tabs.

Continue reading...

Disable the F Lock key on Microsoft Keyboards

23. May 2006

1 Comment

If you’ve got a MS keyboard then you probably have come across the annoyance where the functions keys have to be switched on using the F Lock key. Well be annoyed no more: The F Lock key is a hardware switch in the keyboard. Its state cannot be controlled programmatically. Its default condition is “off”. As a [...]

Continue reading...