Filed under: Uncategorized — jaydublu @ 2:13 pm

rickroll

Adventures with Amateur Radio

Filed under: Amateur Radio — jaydublu @ 12:29 pm

For the last year or so, I have been working through the various levels of Amateur Radio licences – as of a month or so ago I now hold a full UK Licence M0HPJ

Rather than pollute this blog with radio related stuff, I’ve started a new one http://m0hpj.wordpress.com/

My first post relates to a review of a selection of Amateur Radio apps for Android

XKCD- Wisdom of the Ancients

Filed under: web development — jaydublu @ 6:09 pm

All long help threads should have a sticky globally-editable post at the top saying 'DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far ...'

Been there – got the t-shirt.

Installing and XHProf to profile Drupal on Ubuntu

Filed under: drupal,web development — jaydublu @ 2:48 pm

The following recipe was used to install XHProf on a Ubuntu server running Drupal 6, inspired by http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/ – my PEAR installer complained about missing config.m4, and I couldn’t find Brian Mercer’s php5-xhprof Ubuntu package.

Download and manually install XHProf:

wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar xvf xhprof-0.9.2.tgz
cd ./xhprof-0.9.2/extension/
phpize
./configure --with-php-config=/usr/bin/php-config
make
make install
make test
cd ..
cp -rp xhprof_html /usr/share/php/
cp -rp xhprof_lib /usr/share/php/
mkdir /var/tmp/xhprof
chown www-data /var/tmp/xhprof

Optional – install graphviz for the Callgraph funtionality

apt-get install graphviz

Create /etc/php5/conf.d/xhprof.ini

[xhprof]
extension=xhprof.so
xhprof.output_dir="/var/tmp/xhprof"

Create/etc/apache2/conf.d/xhprof.conf

alias /xhprof_html "/usr/share/php/xhprof_html/"

Restart Apache

apache2ctl graceful

Configure Drupal in /admin/settings/devel

xhprof directory: /usr/share/php
xhprof URL: /xhprof_html

Now to get my head around what it all means!

GB0CMS – Caister Marconi Station

Filed under: Amateur Radio — jaydublu @ 9:38 am

Spot the good looking chap at the end – 2E0HPJ

Wget Voodoo

Filed under: tinkering,webcam — jaydublu @ 1:09 pm

I’m stumped by a supposedly simple problem with using wget to regularly fetch a snapshot from a webcam over a not-too-reliable network connection to then push to a website. If the connection fails wget overwrites a good file with a 0 byte one – how can I get it to leave the original intact?

Here’s my script (simplified – mine actually fetches 4 images and writes to two ftp accounts):

#!/bin/bash

# fetch images, store them locally
wget --user=#### --password=#### http://192.168.1.15/axis-cgi/jpg/image.cgi -O video2.jpg
# ... next images

# now push them to a webserver
ftp -in <<EOF
  open my.domain.co.uk
  user ##### #####
  bin
  put video2.jpg
# ... put other images
  close
  bye
EOF

Ideas I’ve had but not been able to realise yet …

  1. Scour the wget manpage for some option to only overwite the output file if sucessful
  2. Get wget to output to a temp file, wrap in script testing filesize to overwite the ‘real’ file if filesize > 0 bytes
  3. Get wget to output to a temp file, wrap in script testing wget repose to overwite the ‘real’ file if response contains ‘saved’
  4. Somehow put logic in the ftp script to only upload files > 0 bytes

Campfire

Filed under: Uncategorized — jaydublu @ 10:41 am

100 years later, this story remains terrifying--not because it's the local network block, but because the killer is still on IPv4.

100 years later, this story remains terrifying–not because it’s the local network block, but because the killer is still on IPv4.

Proxying with Apache2 on Ubuntu

Filed under: tinkering,ubuntu,webcam — jaydublu @ 4:01 pm

Further to earlier problems with using Apache2 on Ubuntu to proxy web requests to devices inside my local network, I think I’ve now sussed it.

Specifically, I’m trying to get Apache to enable external access to a webcam inside my network, where for some reason I can’t enable access to it directly using my router.

I’m now relatively confident that the appropriate way to do it is to enable mod_proxy and mod_proxy_http with sudo a2enmod proxy_http, this then allows use of ProxyPass directive within a vhost for example:

ProxyPass /webcam http://192.168.1.15/

Books that changed my life

Filed under: Uncategorized — jaydublu @ 12:06 pm

I’ve been thinking a lot about this recently; that most of the key changes in my life have a book associated with them, and the process of compiling this list has been quite enlightening.

  • Maplin Electronics Catalogue – Early 1980’s and I’m a schoolboy having been introduced to electronics by the gift of an electronics kit one Christmas – of all the sources of information available to me the Maplin Catalogue had to be my favourite – I devoured every page, tried to understand every component and product and what they could do, and fantasised about building many of the projects – alas it was mostly fantasy and ‘window shopping’ – but I must have learnt something in those days. Strangely, there’s almost nothing on the Internet about them (other than other people looking) – am I the only one with fond memories of the 1980’s Maplin Catalogues with their futuristic sci-fi covers?
  • I Robot – of all the Asimov books, this has to be my favourite, and I credit it with my belief that nothing is impossible – taking the premise of the elegant ‘three laws of robotics’ that you would think covered all eventualities, what would the result be of some unimaginable situation – of course with hindsight it all makes sense, but who could forseen a robot lying as a result of the accidental ability to read minds for instance?
  • Programming the Z80 by Rodney Zaks – not that I did much Z80 programming – my first computers were 6502 based – but this book helped me take the fundamental leap from a basic understanding of digital electronics to an appreciation of the inner workings of microprocessors. I first learned to program on an Acorn Atom with 2K of RAM (yes, 2048 bytes!!!) and the disciplines of squeezing every last ounce out of available resources set me up for later career in embedded systems – I still enjoy the ability to work in assembler even though most of my time is spent in much higher level languages with unimaginable resources to squander. I wonder how the next generations of geeks and techies will cut their teeth in the fundamentals, in the age of ‘GUIs’ and ‘IDEs’ and ‘RAD’ and ‘frameworks’? Would anyone now be able to shoehorn a game such as Elite onto the meagre resources offered by the BBC Micro?
  • CGI Programming with Perl – This was the main book that helped me take the leap onto the Internet – whilst I now predominantly use PHP I still have a fondness for Perl (perhaps related to my love of lower level languages as described above) and it was through learning how to use Perl as a CGI scripting language to develop dynamic websites that helped me understand the ‘pleasures’ of the Internet, client / server architectures etc. Again, I wonder whether the next generation of developers who don’t have to go through this process will get as full an understanding of ‘why’ to go with ‘how’?
  • How to be Idle by Tom Hodgkinson – it’s probably a bit early to claim this as a life changing book as I’ve not yet finished reading it, but it symbolises a change I feel coming. I don’t know if this is a mini midlife crisis but I’ve recently been reviewing the way I life my life and my attitudes to the world and those around me. This book suggests that much that is wrong with the world comes from how unnatural the 9-5 ‘must achieve’ worth ethic is. Many quotes from philosophers, thinkers (and idlers) have been striking a real chord, and helping me come to the conclusion that it’s OK to be content with what I do achieve while living a happy life, rather than feeling guilty because of course I could work harder and achieve more yet be miserable.

One thing is for certain, I’m looking forward to finding out what the next phase of my life will bring, and wondering what the accompanying books will be.

Don’t let the b******d machines win!

Filed under: Uncategorized — jaydublu @ 4:35 pm

Believe it or not, I don’t think I really like computers – they’re the most frustrating, irritating, stress inducing devices I can imagine. But, it seems I do have a particular talent for getting them to do what I, or others, want them to do.

Of course I would like to say that part of my apparent success is due to years of study and experience having given me the ability to ‘think like a machine’ – or more accurately to be able to appreciate at quite a high level what’s going on inside the little black boxes – but I would also say that another part is an innate stubbornness and determination not to be beaten by a sliver of silicon.

Some days, no mater how hair-brained an idea you come up with might be – it just ‘works’. Other times, even the simplest most proven task fights back and you get nowhere, or as is often the case seem to go backwards. But I hold a strong belief that if machines and the things they do for us are to be worth anything, they should work for us rather than us having to work around how the machines want to do things.

Of course I’m not really suggesting that there’s some deep ‘conspiracy of the machines’, or that they have to handled like some wayward puppy you’re trying to house train, but I would suggest that to succeed in getting the most out of machines you do have to persevere and for goodness sake don’t let them see any fear in your eyes!

Next Page »