Monday, October 12, 2009

This blog has moved is now being updated at zzapper.co.uk

Filter out an email address from a pipe

tel blenkinsop | grep -o "[[:alnum:][:graph:]]*@[[:alnum:][:graph:]]*"

Where tel is a simple address book script, in this case I just want the email address and not the whole address

Labels:

Friday, October 09, 2009

A Baby Could Install Ubuntu! (FUD)

Our communal room Windows XP PC which everyone uses but nobody owns was infested with viruses , and although I kept eradicating them with various virus programs things got worse and then finally Windows refused to boot. So I had a choice reinstall XP, re-download the service packs, Open Office etc etc or try Ubuntu.

So with nothing to lose I went to the Ubuntu website downloaded the CD image and blew it to a CD (if that worries you they will send you a CD for free). Inserted it in the CD drive (had to press F12 to get it to boot from the CD) and it asked if I wanted to install or just try Ubuntu out.

Cautiously selected try it out and it fired up straight away, I opened Firefox and could immediately browse the Internet. Amazingly I could see the old Windows file structure and I download all photo and files to a portable hard-drive.
Then everything being OK selected full install. The only thing I have to select was Time Zone! Now here's the beauty you get a fully working system with Open Office etc.

It was absolutely painless; now why didn't I do this years ago? Well it was because I'd read all these FUD articles (Fear Uncertainty Doubt) in the technical press, where the writers had made out they'd had trouble with Linux/Ubuntu, now I wonder if these articles weren't ahem sponsored by Microsoft!?

Labels:

Thursday, October 08, 2009

Solution: PHP Form Not Working in Internet Explorer (IE)

What happens is that fill out the form click submit and the form page is returned totally blanked, however works just fine if Firefox etc. Now are you using an IMAGE instead of the default gray submit button? YES then BINGO you are probably checking in your code to see if the submit button has been pressed and you didn't know that IE as usual does it differently. IE only returns the X,Y co-ordinates of where you clicked on the Image Button, it appends _x and _y to the submit button name. So say the button is called submit_button

So IE returns submit_button_x,submit_button_y

While FF returns submit_button AND submit_button_x,submit_button_y


So Browser proof PHP Code :

if( isset( $_REQUEST["submit_button"] ) or isset( $_REQUEST["submit_button_x"] ) )

This has caught me out several times!!

Labels: ,

Monday, September 21, 2009

Replace/overwrite files in a hierarchy

I needed to replace a file in a hierarchy with a new version:-
Here is a script which works in most shell variants bash, zsh etc but apparently not csh.

for f in */include/dbcommon.php; do;cp dbcommon.php $f; done

Labels: , ,

Tuesday, September 08, 2009

The Nokia E71 Smart Phone, Finally My Perfect Mobile Gadget?

I have bought so many Gadgets and Gizmos in my time all have ultimately disappointed me. An early Psion which of course had no connectivity. An early laptop with no hard-drive just floppies, then another with a hard disk. But I got fed up of transporting these around along with the box full of cables, spare batteries, power cable. I then bought the first Notebook PC which cost a fortune, but battery life was miserable. Then I bought an expensive Nokia Navigator about the size of a glasses case, connectivity was still poor and I never really got on with it.

My latest toy though the Nokia E71 Smart Phone seems to have it all, compact, Internet, Wi-Fi, email, camera, music, radio but very importantly for me "Easy Note Taking Ability" . This is because it has a Qwerty keyboard. this is the great difference with iPhone which concentrates on providing as much screen as possible and making everything touch control which is great for browsing.

So while sitting in a waiting room, or my favorite cafe I can now write to do lists, write bullet points for a presentation, write draft reports etc, and all that with the minimum of fuss a few clicks and I can start. I can then transfer my notes via the memory card, or by preference email.

Click below to see my review of the E71 , my diary reporting the learning curve and my progress, and whether it really is the perfect mobile all-in-one information! system

My Review and Learning Curve Using the Nokia E71 Smart Phone

Labels: ,

Wednesday, September 02, 2009

A Neat Customizable CSS Box for your Blog

Use the box to highlight a quote, an important paragraph, a sales message or a block of code
<style>
div.box { border: solid; border-width: thin; width: 80%; border-color: #0000FF; margin:5px 5px 5px 5px;
padding: 5px;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
background-color: #EEEEEE;
}
</style>
Simply surround the text/code you wish to box with
<div class="box">
...These are also called Johnson Boxes
... you can easily customize this box
</div>

Labels: , , ,

Friday, August 21, 2009

GoToMyPC allows me to have a longer Vacation
In fact I had a whole month, I was able to check my emails, pay bills, do my work as a technical web designer and still pass the late afternoons at the beach. In fact I rely on GoToMyPC to check out my emails and handle service issues for my various Internet businesses when I am away for a few days or visiting relatives.

Now there is one tip I have learned over the years; you need someone with a key access to your office who can occasionally restart your PC after a powercut, reset your router etc.
Try GoToMyPc for free here

Labels: ,

Thursday, August 20, 2009

Happy 40th Birthday Unix

Unix, Linux is more than an operating system for us Techies it's a kind of way of life. I get great intellectual pleasure from finding clever ways to write scripts using Bash, Zsh, Perl, AWK or whatever. These days I spend more time using Cygwin on Vista which kind of gives me the best of both worlds. I would like to abandon Microsoft completely but have to work with so many clients that just have Windows.

I've recently had some fairly horrific experiences of using Microsoft software Visual Studio, ASP etc and found myself having download 100's of MB of code just to set a few miserable flags. Everything Microsoft do seems to overloaded with bureaucratic heaviness, endless series of black boxes, wizards where I feel I control very little.

Anyway thank heavens for LAMP Linux-Apache-MySQL-PHP/Perl and the wonderful community of users that surround it

Labels: , , , ,

Wednesday, August 19, 2009

Periodically Reviewing Which Files you Backup

It's not good enough just to regularly backup your files, you ALSO have to double check that the crucial files are being saved. You do this by periodically retrieving your backed-up files and checking all is well.

I use a backup script to automatically zip up my important files, I found that this wasn't up to date as several files had changed location or name in between times. Remember the shock horror and disappointment you will feel if you need to recover files from a backup only to find they are corrupt, missing, or out of date is equivalent or worse than finding that your car's spare wheel is flat on a rainy night on a deserted road.

Backing up files is such a thankless task that it is easy to skip or say I'll do that when I get a spare moment. The weak part of backup systems is when they require human intervention, that's why I use a totally automatic Internet backup service . This back's up about 2 GB of my files at 3am every morning. Mozy provide the service which is free up to 2GB, you can learn more about this service here . Internet backup also solves the proble of ensuring that your backup media say DVDs are off the premises!

Labels: , ,

Monday, August 10, 2009

Solution: IE8 does not connect to the Internet

There are many complaints that IE8 (a recent automatic upgrade) does not connect to the Web, ie cannot access any website.

People have been dismantling their Firewalls, virus checkers but no success. Happily there is Firefox so we can browse for a solution.

Here is the solution that worked for me:-

in IE8 go to Tools->Internet Options->Advanced

and click on both Restore Advanced Settings and Reset Internet Explorer settings, you might want to see if pressing just the Advanced Button is good enough.

Then restart IE8

This warns that you about to lose all your settings but that was no no problem for me as I have very few, being mostly a Firefox or Opera person

Hope that Helps

Labels: , ,