Thursday, December 10, 2015

Note To Self: Display Raspberry Pi CPU Temperature


I have recently been messing around with a raspberry pi at work (a Pi2 model B) for driving display screens for our In-Venue product of which I am the product owner. And very exciting it is too, because the real world is the new frontier (this pdf is also a good primer). If you see what I mean, but more on that another time.

So.. I had to overclock the Pi to improve browser performance to even get near to acceptable speed and smoothness of animations. Pro Tip, the Pi is not a graphics device! Having done this and got acceptable results for a clunky prototype to demo with, and load averages that stayed on the sane side of normal I thought I'd better see if I was frying the CPU. And because I will inevitably forget this useful command I'm saving it here for posterity. Here's how I got the temperature reading..

/opt/vc/bin/vcgencmd measure_temp

Enjoy!


Friday, February 27, 2015

Put code in your google docs


I'm writing a technical document using google docs, and I want to put code snippets into it.
I thought this would be hard, before I discovered http://hilite.me/

This awesome, and awesomely simple, web app converts snippets of code into coloured HTML.
It can format a comprehensive range of languages and apply an equally impressive variety of styles.

Here's a snip of javascript, I just copied and pasted it straight in here, so it doesn't handle the overflow well, but you have to admit that its pretty cool for something that has a quick copy/paste/click/copy/paste workflow:


for (var i = 0; i < dataObj.eventData.children.length; i++) {
  if (dataObj.isProduction){
   dataObj.eventData.children[2].outcome.coupling = "1";
  }
  if (dataObj.eventData.children[i].outcome.coupling.length > 0) { 
    outcomeData = dataObj.eventData.children[i].outcome;
    priceBoost[counter] = Object.create(priceBoostObject);
    priceBoost[counter].createPriceBoostHTML(outcomeData);
    priceBoost[counter].applyPriceBoost(outcomeData);
    priceBoost[counter].applyExtraCss(outcomeData);
    priceBoost[counter].initialiseAnimatedImages('animated-' + outcomeData.id, 'images/test.png', 'test.html');
    priceBoost[counter].checkTextWidth(outcomeData.id);
    counter++;
  }
}


Friday, January 16, 2015

Privacy In Public III


Google Glass Explorer Program Shuts Down

I'm not going to say a lot about this, except that I'm glad, and I hope that the next step for this tech takes seriously into account the privacy-in-public implications of people walking around with cameras streaming whatever they see.
Anyone who was ever concerned with the level of surveillance in modern society by CCTV, helmet cams, the hacking of web-cams, and the use this can be put to by the nefarious activities of GCHQ and the US NSA, will be pleased that the headlong rush to turn us all into autonomous surveillance drones has paused for thought.
Lets hope Google use the pause to reflect on this.


Thursday, May 30, 2013

note to self, how to fix "requires installation of untrusted packages" in Ubuntu


I tried to install a couple of updates on my work laptop, running Ubuntu 12.04, a minute or two ago when prompted by the update manager, and I got the "requires installation of untrusted packages" error. I've since dicovered that there are two ways round this, one is to allow untrusted packages by doing the update as root or via sudo, and saying "y" when asked

Install these packages without verification [y/N]?
But I don't like that, you don't know who might be spoofing you with what fake packages. The better way is to rebuild the apt cache. I found the instructions here, I'm claiming no credit for solving the problem, just reproducing them below so that I can be sure to find them again next time I need them. Hopefully some of you who read this in the future will also benefit.

sudo apt-get clean
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get clean 
sudo apt-get update

Enjoy!


I know nothing, I'm not a fortune teller, and you'd be insane to think that I am. This disclaimer was cribbed from an email footer I once received. It is so ridiculous I had to have it for myself.

Statements in this blog that are not purely historical are forward-looking statements including, without limitation, statements regarding my expectations, objectives, anticipations, plans, hopes, beliefs, intentions or strategies regarding the future. Factors that could cause actual results to differ materially from the forward looking statements include risks and uncertainties such as any unforeseen event or any unforeseen system failures, and other risks. It is important to note that actual outcomes could differ materially from those in such forward-looking statements.

Danny Angus Copyright © 2006-2013 (OMG that's seven years of this nonsense)