A little bundle of possibilities….

Ok so I might be a bit slow but after wandering around and looking at various ‘lite’ web servers, I had settled with Nginx, or Lighttpd.

But! after accidentally typing ‘httpd’ at the command line of my PogoPlug, I found out that BusyBox had a minimum HTTP daemon. Nice with a little more searching I came across ‘Haserl’ which allows you to write CGI scripts using the command shell. Now for me this solves my issues of putting a web server on my PogoPlug and not trashing the facilities of the PogoPlug.

So my additions to the PogoPlug have been the following;

  • making mtdblock3 jsff2 formated and mounted as /opt
  • installing optware package management tool
  • installing ‘Haserl’

By creating a directory on one of the external drives then mapping that as the httpd root directory I can seen the web server via http and also make changes to the files via the PogoPlug web interface.

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

jQuery connections to YQL data

The team I’m mentoring/training at the FT are going to be transferring from Flash/ActionScript to HTML5 JavaScript CSS3. So here are some of the code examples I’ve given them for usage when connecting to remote data.

Fro XML only and no CORS.

$(document).ready(function(){
$.get(‘FT500dataset2.xml’, function(data){
$(data)
.find(‘dataset > dataUnit’)
.each(
function(i){
alert(‘position=’ + i);
}
);
});
});

For JSONP-X

$(document).ready(function(){

var yql = ‘http://query.yahooapis.com/v1/public/yql?q=’;
yql += encodeURIComponent(“select * from xml where url=’” + rData + “‘”);
yql += ‘&format=xml&diagnostics=true&callback=?’;

$.getJSON(yql,function(ds){
})

.success( function(data){

alert($(data.query.results));
});
});

For straight JSON

$(document).ready(function(){

var yql = ‘http://query.yahooapis.com/v1/public/yql?q=’;
yql += encodeURIComponent(“select * from xml where url=’” + rData + “‘”);
yql += ‘&format=json&diagnostics=true&callback=?’;

$.getJSON(yql,function(ds){
})

.success( function(data){

$(data.query.results.dataset.dataUnit)
.each(
function(i){
alert(‘position=’ + i);
}
);
});
});

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

JavaScript: code snippet

note for self: a piece of code to enable me to write ‘console.log’ and not have IE get unhappy :/

// this creates the console object if it’s not present – most useful for IE7,8,9
if (! (“console” in window) || !(“firebug” in console)) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group" , "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i <names.length; ++i) window.console[names[i]] = function() {};
}

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

Google Chrome addons

found these two

https://chrome.google.com/extensions/detail/cgjalgdhmbpaacnnejmodfinclbdgaci

https://chrome.google.com/extensions/detail/ljgkhjkajfkphkgndbhokcoglecihaia

really useful :)

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

Pogoplug cont’d

So after a bit of a play, I found you can install Arch Linux and Debian Linux on this device. Not too sure about Arch Linux, probably because I’m more at home with Debian. Like the iPhone app :) also like the desktop app nice.

Posted in Embedded, linux | Leave a comment

Pogo Plug v2

So I’m playing with a Pogo Plug v2, the features that it comes with as standard are great. More on this as I continue to play with this great little device. As it only uses about 6 watts and has enough processing power to replace my very old Cobalt Qube 3 Pro, and a lot less power.

Posted in Embedded, linux | Leave a comment

A javascript nugget..

I should say this is only for browsers and environments which support E4X ( so not IE7-8-9)

So you import your xml in and then you want to use E4X to manipulate it but for some reason it just won’t happen. In firefox there is a bug which the following code fix

$(document).ready(function() {
$.ajax({
url: ‘boe_ser.xml’,
success: function(xmlObj){
var xmlString = (new XMLSerializer()).serializeToString(xmlObj);
xmlString = xmlString.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, “”);
var xmlData = new XML(xmlString);

},
dataType: ‘xml’
});
});

It would appear that Firefox has an issue with the <?xml tag… ! who knew

Posted in javascript | Leave a comment

sshfs to only way to go… !

So I use vmware fusion on my mac, have a number of websites and remote connection to my home nas. So after various tools tried, and another set of software I have finally settled on using sshfs for all. So for Mac I use MacFUSE and for windows I use Dokan library and SSHFS.

I like reliable easy to use tools, and I think the issue over security of ftp and ftp servers this is all round a good solution.

See what you think but for me I like a life less complicated.

p.s. it’s raining in Dorset at the moment.

Posted in user tools | Leave a comment

more YQL…

note for self when drilling down in data must use the correct xpath/path

HTML == xpath

XML == path

Still very good technology like this, one idea is to use this for converting a .csv file on your own server and then using JavaScript client side and you could have yourself a server side code free catalogue :)

 

Posted in html, javascript, YQL | Leave a comment

Yahoo! YQL

YQL what a great piece of technology, thank you Yahoo! Such a great way to data scrap, I can think of a number of uses for this. One that sticks in my mind is scraping data and combining data to produce infographics.

Posted in YQL | Leave a comment