Monday, October 12, 2009

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: ,