1

1 - 5   [5]

New Distance Surfing World Record

Relates to Surf and Travel

Huge congratulations to our bore surfing buddy Sergio Laus who broke the official Guiness world record for distance surfing on Friday with a ride of 10.1km on the Araguari Pororoca in Amapa state. Sergio announced his goal to set a new record when we visited him in Brazil back in March and it has taken considerable cost and organisation to arrange a trip to the remote Araguari with an official adjudicator. So I am stoked Sergio succeeded on a falling Solstice tide. It is also the first time the record has been torn away from the Severn since its official inauguration back in the 1970s and Sergio extended Dave Lawson's nine year old record by another kilometre.

With some big tides building for this autumn and next spring there should be plenty of opportunity to challenge Sergio's distance in both the upper and lower reaches of the Severn. It is great to have a new inter-atlantic rivalry in distance surfing.

Posted on Jun 28, 2005 at 14:25:37. [Comments for New Distance Surfing World Record- 0]

Cat-man-do

Relates to Surf and Travel

First it was the agile board walking Twinkle Toes, then, following some lone explorations into the darker voids of the Severn reaches it became Lone Wolf. More recently, following infamous hoarding antics in France, it became The Squirrel, and now for reasons I am yet to discover, my bore surfing nomenclature has become Cat-man-do.

In fact the day in question could not have been better - a lone morning surf on the Severn followed by an excursion to Southerndown for a glassy clean 2-3' ocean swell (on the second hottest day of the year) washed down with an evening beer at the White Hart Inn and another river ride with the rest Wizard, Owl and the rest of the local crew - the first time the river (and air) have actually been warm enough to wear boardshorts.

Posted on Jun 28, 2005 at 14:10:21. [Comments for Cat-man-do- 0]

Verify Sudo in Script Execution

Relates to Apache and UNIX, OSX

Earlier I was setting up a couple of shell scripts to allow me to quickly switch between PHP versions on the Apache web server and enable/disable my unit testing environment in OS X. Along the lines of:


apachectl stop
httpd -f /usr/local/php5/httpd.conf

Since such scripts must be run as root user I wanted to concote a little script to check I had used sudo to run the commands (as I have a habit of forgetting!). Firstly I came up with the following:


#!/bin/sh
# verify-su
umask 222
touch /tmp/user-status
echo `whoami` 2> /dev/null >| /tmp/user-status
if [ $? -ne 0 ] ; then
  if [ $# -eq 0 ] ; then
    "This command must be run with root privileges!"
  else
    "$1 must be run with root privileges!"
  fi
  exit 1
fi

\rm /tmp/user-status

exit 0

A file is created with read only permissions (by temporarily changing umask) and then the script attempts to write to it. The output redirection to file will only succeed if the script is run as root (the superuser).

In running this without the rm command I discovered that a script executed with sudo will return root from the whoami command instead of the user name I am currently logged in with. So this could actually be simplified considerably to:


if [ `whoami` != 'root' ] ; then
  # etc … 
  exit 1
else
  exit 0
fi

There is always a simpler way to do things!

Posted on Jun 20, 2005 at 20:12:51. [Comments for Verify Sudo in Script Execution- 1]

PHP Function Lookup from XEmacs

Relates to PHP and Apache, IDEs, X11

Ok, I have gone all XEmacs, and am really impressed. For the best part of two years now I have been using UltraEdit for must web scripting with a little bit of Eclipse on the side for command line testing with PHP5 development. With a large amount of the development work now migrated to my IBook, it was time to seek out a new editor. Currently I am undecided between Eclipse, BBEdit, Vim, Quanta, Kate and XEmacs, although I am very drawn to the latter.

Despite the learning curve, with a bit of Lisp knowledge in hand, the power of XEmacs quickly becomes apparent. Of course an essential feature for any scripting language is syntax highlighting and efficient function lookup. The first is easy enough - add the prog-modes package (which includes an Emacs lisp file for PHP major mode) and all other dependant packages from the package manager. I also enabled syntax highlighting by default in ~/.xemcas/init.el with:


(require 'font-lock)

While perusing the settings for PHP mode from the Options menu (and directly from the package file prog-modes/php-mode.el) I discovered that the key command sequence Ctrl C Ctrl F performs a search for the function currently selected at php.net. This was a problem since the machine is not going to be on a permanant connection. So, I decided to store the PHP Documentation on my local server. Nothing out of the ordinary, except it give me the opportunity to use the RewriteMap directive in the Apache configuration.

  1. Grab the multi-file PHP documentation from php.net. And extract all files to a suitable location on disc (note there are over two thousand separate HTML files and they will all be extracted to same directory, so make sure it is the right place!)
  2. Create a name-based virtual server to access the documentation locally by first adding a new machine name (eg phpdocumentation) to the Netinfo Database in OSX.
  3. Add a virtual server entry to the httpd configuration file. I currently have the system configured to reboot Apache with a different principle conf file for each PHP version - as with my Window 98 box - so I put virtual server directives in one of the user conf files (from /etc/httpd/users) instead.

    
    <VirtualHost 127.0.0.1>
      ServerName phpdocumentation
      
      # Rewrite Directives will go here…
      
      DocumentRoot "/path/to/php/documentation/dir"
      <Directory "/path/to/php/documentation/dir">
        AllowOverride All
        Options +FollowSymLinks
      </Directory>
    </VirtualHost>
    
  4. Now, instead of hacking the Lisp code in php-mode.el, which could readily be destroyed by a future update of prog-modes, I decided to throw in a rewrite rule to fix the request URI. From XEmacs the request would be for http://phpdocumentation/function_name, so the following might work:

    
    RewriteEngine On
    RewriteRule  ^([-_a-z0-9])$ /function.$1.html
    

    Sadly not! All function help files take the form function.[the-function-name].html. And that is where I hit the stumbling block! Underscores are replaced by hyphens in the HTML file names for functions.

I was reluctant to resort to Lisp hacking, so decided to try one of the rewrite directives I have had little use for previously - RewriteMap.

  1. Create an executable script that can be called in the rewriting process to replace the underscores. I choose Perl and, due the simplicity of the rewrite, only needed one more line of code than the actual Apache manual:

    
    #!/usr/bin/perl
    # php-func-map.pl
    
    # avoid buffered I/O
    $| = 1;
    
    while (<STDIN>) {
      # globally change the underscore to a hyphen
      s/_/-/g;
      print $_;
    }
    
  2. Then set up the rewriting directives - for RewriteMap these have to go under the VirtualHost directive in the conf rather than in .htaccess file.

    
    RewriteEngine On
    RewriteMap php-func-map prg:/path/to/php-func-map.pl
    RewriteRule /([-_a-z0-9]+)$ /function.${php-func-map:$1}.html
    

And that is that. The magic is in ${php-func-map:$1} which will pass the pattern match $1 to the file defined by php-func-map and get back a PHP manual friendly file name. Of course this could be extended further to perform searches beyond just the manual's function set but servers my purpose well for the time being. So, now when I forget if the needle or the haystack goes first, a quick key combination and the manual entry is available.

Posted on Jun 15, 2005 at 18:58:33. [Comments for PHP Function Lookup from XEmacs- 0]

Longwave, The History of Bore Surfing

Relates to Surf and Travel

This year we celebrate the 50th anniversary of Tidal Bore Surfing from its roots on the Severn, and to coincide with the planned events for September, the eagerly awaited Longwave has finally gone to edit. The film not only documents the revolution in bore surfing of the last 10 year, as a small international community of dedicated bore riders has flourished, but, following extensive research, the film hopes to shed light on the early years when the likes of Rod Sumpter, Pete Jones and Stuart Matthews were notable faces on the river. Not forgetting those famous two faces who have forged their lives around the ebb and flow of the tides and the gravitational lure of a full or new moon - Dave Lawson and Steve King. Culminating with the recent gatherings of international bore riders on the Gironde Mascaret and Mearim Pororoca.

From the creators of UK2K, expectations are high for an exciting and captivating history of this exclusive branch of surfing. Keep up to date with all the latest buzz from Donny as the film takes shape.

Posted on Jun 14, 2005 at 03:34:55. [Comments for Longwave, The History of Bore Surfing- 0]

Breadcrumbs Trail

[ Home ] -> TW Blog -> Archives for June 2005
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.007 seconds