using PHP to get a remote template page

Having looked around I wanted something that would retrieve a remote page, with just a basic PHP install I could have just used cURL. But me being me I wanted something more, so after a little bit or research I found phpQuery and with a little bit of code and using the syntax from YQL I have a running example which will retrieve a remote page, apply a CSSPath to the html and then wrap that up in a JSONP wrapper and deliver it.

So smug :) worked so well and without too much effort!

Posted in Uncategorized | Leave a comment

underscore.js Object functions (replacement 2)

_.isArray(object) === if(object instanceof Array)

_.isObject(value) === if(object instanceof Object)

_.isFunction(object) === if(object instanceof Function)

_.isString(object) === if(object instanceof String)

_.isNumber(object) === if(object instanceof Number)

_.isBoolean(object) === if(object instanceof Boolean)

_.isDate(object) === if(object instanceof Date)

_.isRegExp(object) === if(object instanceof RegExp)

Posted in Uncategorized | Leave a comment

underscore.js Array functions (replacements 1)

_.first === array[0]

_.initial === array.slice(0, array.length-1)

_.last === array[array.length-1] === array.slice(x, array.length-1) n.b. where x = start position in array


Posted in Uncategorized | Leave a comment

My pet project!

So I want to produce a remote weather station using off the shelf technology, so after a look around I purchased a WH3081 a number of months ago. The thing that finally decided it for me was that it was solar powered and rechargeable battery life is expected at 2yrs, and it’s wireless, and the base station has a USB port. I know the list is long ;)

So comments on the weather station, think it’s based on the Dallas one wire weather station design. Would be nice to know, from the manufacturer who I’ve emailed. If assembled as per instruction way too much cable, going to have to revived an old skill and lace it all properly. Connection and configuration really easy, and even in my cottage with 2ft think walls the time clock signal worked :)

So off the shelf free software and I ended up with pywws (I really meant off the shelf, no compiling!). A few round the houses and I ended up with working, and a connection to Weather Underground -


More later …

Posted in Uncategorized | Leave a comment

Pogoplug :: adding crond

So need to have crond running of my pogoplug, found a couple of useful links but all expected another part to be done! so here’s the list assuming that your usb drive had mounted at mnt_sda1 most likely if it’s the only drive on there

  1. mount -o remount,rw /
  2. mkdir -p /tmp/.cemnt/mnt_sda1/spool/cron/crontab
  3. ln -s /tmp/.cemnt/mnt_sda1/spool /var/spool
  4. crond
  5. nano /etc/init.d/rcS
  6. add ‘ln -s /tmp/.cemnt/mnt_sda1/spool /var/spool’
  7. add’crond’
  8. close and save
  9. restart pogoplug

Your Pogoplug now has crond running :)


Posted in Embedded, linux, user tools | Leave a comment

SAPUI5 => SAP HMTL5 CSS3 JavaScript

Ok just downloaded the SAPUI5, installed it on my mac and did a bit of looking around!

jQuery and a number of versions… ? why not sure yet but more on that later.

First looks yeah nice, looks like a lot of work has gone into this, need to find a name to acknowledge for the work I think there. (more later on that).

Like the focus thou :)


n.b. you have to register to get this so not sure on the restrictions if you could use this outside of the SAP environment :(

Posted in css, html, javascript, user tools | Leave a comment

Catch up day :)

Well after a long time I’d got some time to go through my blog and actually do some admin. Having written content yet not published it have a huge backlog going back 2yrs, ouch :(

Posted in Uncategorized | Leave a comment

Favourite JavaScript libraries

So it’s been a long time writing JavaScript, from my earliest dabbling in the Netscape browser, at the same time Netscape had a web server product which also had Server side JavaScript, wrote pages with that, then used the classic ASP pages but again only wrote in JavaScript. My logic was that why should I write in different languages server side and client side? Then along came BroadVision and again writing in Server side JavaScript, solved a lot of issues with that product!

Over all these years my love for this language has been strong, what always made me pull my hair out used to be the differences between the browsers. Which basically created the bad reputation of this language.

I find it very strange why people try to put classes into a functional based language, why fight the language and the way it works?

Anyway I digress, my favourite libraries are jQuery and Underscore. To add to these there are a few snippets from myself, and looking at apps/single page web apps undecided between Ember.js and Backbone.js.

Currently to fix the browser issues using Modernizr this is almost like a lot of my snippets to fix problems.

More thoughts…

Posted in javascript | Leave a comment

configuring BusyBox httpd

So PogoPlug now has all the requirements just now need to configure the httpd in BusyBox and we’re away, well almost!

If we set the httpd to run on port 80 the wonderful features of the PogoPlug go so we must use port 8080 as our web server port. The next is that I want to have access to the files so I can upload them via the interface.

  1. So via your interface add a folder on you USB drive wwwroot
  2. enter the  wwwroot folder and create two folders cgi-data and www
  3. enter the www folder and create a cgi-bin folder

All done with that part painless really ;) and you should put an index.htm page in the www folder so you can see something later!

Next log in via SSH and a enter the following ‘/usr/sbin/httpd -p 8080 -h /tmp/.cemnt/mnt_sda1/www ’

So now if you have a fixed IP Address like me just enter it and add :8080 at the end and away you go!

Not got a fixed IP address? :( right you need to look at your router admin pages to see if it has the ability to run a ‘Dynamic DNS’ service.

Then same thing ‘


Posted in Embedded, linux, user tools | Leave a comment

Answer to some questions!

  1. get yourself connected to the Pogoplug via SSH, if you don’t know what SSH is stop now!!!
  2. ‘cd /’
  3. run ‘flash_eraseall -j /dev/mtd3′ this erases and formats the block to jffs2 structure
  4. ‘mkdir /opt’
  5. ‘mount /dev/mtdblock3 /opt’
  6. ‘wget‘ current version as of 2012/01/20
  7. ‘tar xvzf ipkg-opt_0.99.163-10_arm.ipk’
  8. ‘tar xvzf data.tar.gz’ this should place all the items in the /opt directory
  9. now you need to clean up ‘rm *.ipk’ and ‘rm *.gz’
  10. ‘echo ‘src cross’ >> ipkg.conf’
  11. ‘PATH=$PATH:/opt/bin:opt/sbin’
  12. ‘ipkg install Haserl’
  13. so now you need to find out where the PogoPlug has mounted your external harddrive, try /tmp/.ceadmin/sda ?

More later :)

Posted in Embedded, linux, user tools | Leave a comment