f-log

just another web log

23 Oct 2015:
radnom 2014 eclipse on gentoo blog
And now a feature I am calling "Random blog post I forgot to post". This one is from 2014 when I was interested in creating an Android app and I guess I was expecting to expand on it before posting. It got canned, but for posterity here it is.

After following this guide I failed to get Eclipse to install the Android tools, appears the version available in the bog-standard Gentoo is 5 years old. But I did manage to install the Android SDK.

There are some alternatives in the Gentoo community but none seemed ideal, so I downloaded the latest version of Eclipse

and as it is Java it just runs, then the Android tool kit "just" installed and then the Android SDK seemed to install again.

Then when it came time to run the emulator (from Eclipse) the CPU/ABI was missing so I could not create and image. This was a minor issue and easily rectified with another visit to the SDK manager which showed everything ticked except the CPU/ABI.
23 Oct 2015:
Fun and educational map projection game
Cannot remember where I found this https://gmaps-samples.googlecode.com/svn/trunk/poly/puzzledrag.html
but it is a Google maps JavaScript presentation where all you have to do is match the country shapes to the real countries. But there's a catch the country shapes change size based on the map projection, so things shrink around the equator and grow huge at the poles.

Fun and educational.
21 Oct 2015:
minecraft party highs and lows
We had a Minecraft party for one of the kids and although I stole a lot of ideas from the internet a couple of original games and activities made it ours.
For instance from here http://www.buzzfeed.com/morganshanahan/birthday-party-ideas-that-will-blow-your-minecraft we took No. 6 Minecraft your windows and No. 16 Water blocks, neither of which worked out ;)
Also No. 18 Edible gems that was expensive for what it was but of course the kids loved the novelty, they tasted of nothing and had a funny rubbery texture, I really expected boiled sweets not jellies.
We did No. 26 Minecraft faces but with cut up paper not post-it notes and I wanted to do No. 27 Pin the tail on the [insert Minecraft creature], they suggest Pig we wanted Ender Dragon, but ran out of time.
We did like the food ideas from here http://parties4ever.blogspot.co.uk/2013/03/minecraft-party.html like Cheese Lava
From here https://ichooseawesome.wordpress.com/2012/12/03/epic-minecraft-party/
I definitely took the Minecraft YouTube video idea which was a major hit! They also had the windows, food, Water and pixel masks.
I loved the Creeper cups from here http://abritofhappiness.blogspot.co.uk/2013/02/a-fun-minecraft-party.html but the electrical tape or the cups made keeping them stuck on difficult. We also wanted to do the crispy coal but again ran out of time. With all the Creeper madness that is what we ended up doing as the cake design.
From there we got the "Potion of Healing" and TNT Diet Coke and Mentos. More on them below.

So what worked and what did not?
Well, we left this all the last minute and I was up to Early O'clock cutting/sticking and other preparation. So number one thing, get everything ready well in advance!
Minecraft music videos were a HUGE hit and a great help. There are hundreds of Minecraft music videos on YouTube and I downloaded about 25 of them. After reading in a blog that the language can be questionable I pre-screened all the videos and edited out the odd naughty bits. Then it was just a matter of showing them on the telly. I thought this would be so easy that I left it until the day of the party and then found all sorts of problems.
I had a Raspberry Pi and I expected to install Kodi(which is the new name for RASPMC) and then stream on to our Humax box. I had done it in the distant past and it had worked well. But, the Raspbian OS currently does/did not have Kodi so I just installed VLC. But the video quality was terrible, even though this was a Raspberry Pi 2 B with four processors and 1GB ram. I thought about buying a codec pack but then I remembered the Omxplayer can run the full screen MP4s. Worked perfectly and I was able to run all the videos in a loop.

The pixel masks were hard work for me. I got a couple of big foam backing boards from Hobbycraft and a load of coloured paper and then spent some hours measuring and cutting to make sure everyone would be able to make an 8x8 mask. I was quite surprised how much the collection of 8-9 year old boys liked this activity with only one choosing not to take part and that may have been just because the room was so crowded. The kids loved being able to take them home at the end of the party.

The kids went absolutely nuts over the very simple water bottles that we had wrapped "Healing potion" labels around. Not one child complained that only water was on offer and many came back for multiple bottles during the day.

I had bought these two Minecraft paper kits to simply decorate the rooms, but there were so many bits to make we did not even open the big one until the party. Then the kids had lots of fun making blocks and items. This gave us something to shoot at with Nerf guns(had no Nerf bows). At the end the kids were able to take the blocks home. Strangely some kids found the waiting in line to shoot the guns to much and went off to make more blocks.

One of my original ideas that worked really well was Mine-Block-Race. Simple printed out six Minecraft block patterns with the names and thumb tacked them to six parts of the fence around the garden. Then with everybody in the middle rolled one of the Minecraft paper blocks that had written the name of the element, Gold, Iron, Stone, Creeper etc. Everyone ran to that poster and last one was eliminated. This got more involvement than any other activity and although we had only planned on one game the kids organised it to have extras, even though there was only ever one prize.

I have always wanted to try the Mentos and Diet Coke fountains and one of these party blogs mentioned marking the bottles as TNT. We used 500ml Diet Pepsi bottles with 3 mentos per child, this made a rather unimpressive 10-15cm burst and I thought the experiment was a bust. But, the kids loved it! FYI by hand we could not get more than three sweets into a bottle before it detonated.

Before we got to the food Sarah had suggested we get a movie to let the kids calm down and as the party was for four hours I had gone and bought the latest kids DVD Shawn the sheep. This film is quite slow and before 30mins half the kids had started an impromptu football match and I do not think anyone survived to the end.

Then the food. I had printed out lots of labels like "Sticks", "Lava" etc. that were in fact Twiglets and cheese cubes. To be honest I am not sure the kids noticed the labels were quite small. I really liked the idea of "Water cubes" made from blue jelly but 1) I added blue food dye to lemon jelly that made it a bit green and 2) we had no square bowls and 3) I forgot they were in the fridge :(
Finally the cake was just a sponge square with green pre-made icing and some black squares to make a Creeper face.

All in all everyone was very happy, Sarah and I were completely knackered and all the kids not only got a party bag but a Minecraft pixel mask and a few paper cubes.
So were are all the pictures? we were just to busy to take any!

Some printing and consolidation resources
http://www.thepartyanimal-blog.org/free-printable-minecraft-party-banner/
http://coolmompicks.com/blog/2014/03/25/minecraft-birthday-party-ideas/
http://burntapple.com/2013/08/13/minecraft-birthday-party-ideas/
http://catchmyparty.com/blog/free-minecraft-party-printables-from-printabelle
http://blog.catchmyparty.com/wp-content/uploads/2013/11/minecraftwaterbottlelabels.png
http://blog.catchmyparty.com/wp-content/uploads/2013/11/minecraftfoodcards.png
FYI I had all the above links open in my browser for the week after the party in the vague hope I would write this blog post, and at least one of them used up serious amounts of CPU and memory. You have been warned!
21 Oct 2015:
pi geckoboard auto start success story
The development team at work wanted an easy way of visualising the number of issues in various queues. This was back before Raspberry Pis so we opted for an LED sign mounted on the wall. There were certainly a number of problems with this approach. Firstly the sign was pretty cheap and could only be programmed via a serial cable from Windows XP.
Still, it was not difficult to find a machine up to the job and remote desktop in. Secondly the serial protocol was propitiatory so we had to reverse engineer it. Eventually I managed to build the nice command line tool that would update the sign in multi-colours with the correct information.

The development team was very happy, but not so the design team that got distracted every time the sign flashed and blinked as it scrolled. So that was scrapped, which was extra annoying as I had already built a basic bitmap library to display arbitrary images.

Skip forward a few months, the Raspberry Pi was released and my bosses boss got two and the budget for a couple of HDMI TVs with wall mounting brackets. He based this purchase arrangement on a service called GeckoBoard which shows custom dashboards.

Originally the Raspberry Pi running Chromium was the preferred way of running a GeckoBoard but the single core 256mb machines(these were very early Pis) could not cut it and kept just dying, requiring a power cycle. I did try setting up the watchdog as well as scheduled daily reboots but they got worse and worse until GeckoBoard stopped supporting them.

Fast forward to present day, I requested and was surprised to receive a Raspberry Pi 2 4 core 1GB ram. This is how I got it set up.

This is with the latest NOOBS with Raspbian and Jessie (systemd)

First up there are no Chromium builds available at the moment, grrrr! Lets try Firefox instead or its namesake Iceweasel.
sudo apt-get install iceweasel
Works well with the GeckoBoard JavaScript that tripped up all the other non Chrome browsers. But, wait iceweasel has no full screen command line switch, grrrr!
sudo apt-get install xdotool

xdotool key --clearmodifiers F11


Sends to the F11 command as if you had typed it and if Iceweasel is the in-focus application then it switches to full screen!

Now to get it to auto start
vi .config/lxsession/LXDE-pi/autostart
note: another up to date Pi had that file outside the users folder
sudo vi /etc/xdg/lxsession/LXDE-pi/autostart

I then commented out the lines that run the screen saver and desktop and added in xset calls that stop the automatic screen blanking and a call to shell script to run Iceweasel and my python code(more on that later).
#@lxpanel --profile LXDE-pi
#@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
#disable screen blanking for kiosk mode
@xset s off
@xset -dpms
@xset s noblank
#manage iceweasel including full screening
@sh /home/pi/.config/lxsession/LXDE-pi/iceweasel.sh
#@sh ${HOME}/.config/lxsession/LXDE-pi/autokey.sh
#Run some python code to record the IP address the Pi is given and send it to dropbox
@python /home/pi/Python/identify.py


The script file was necessary as systemd makes it impossible(or at least very difficult) to till when things are ready. Hence all the sleeps.
#!/bin/sh
sleep 15
iceweasel https://my.geckoboard.com/dashboards/DEADBEEF00FF &
sleep 15
xdotool key --clearmodifiers F11


Rebooting now meant the Pi came up then ran Iceweasel with the dashboard page and then 15 seconds later switched to full screen. Though in practice it is a lot less than 15 seconds.

This was great but I need to get the IP address that the Pi would use at work from the WiFi network. After the success with DropBox and Python on a previous Pi project I copied that code and added the value for the IP address.

Install prerequisites
sudo apt-get install python-pip
sudo pip install dropbox


and the identify.py file looks like this.
#update file with date and IP address and upload to dropbox
#expected to be called when Pi reboots and loads X
import dropbox
import datetime
import socket

def get_ip_address():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect(("8.8.8.8", 80))
    return s.getsockname()[0]
client = dropbox.client.DropboxClient('DROPBOXAUTHKEYGETYOURSFROMYOURDROPBOXACCOUNT')

fileHandle = open('/home/pi/logs/ipaddress.log', 'ab')
fileHandle.write(get_ip_address())
fileHandle.write(datetime.datetime.now().strftime(" %Y/%m/%d %H:%M:%S UP\n"))
fileHandle.close()
fileHandle = open('/home/pi/logs/ipaddress.log', 'rb')
response = client.put_file('/ipaddress.txt', fileHandle, overwrite=True)


That appends the new IP address and date to the file before re-uploading it to DropBox

Setting up WiFi was as easy as following my previous WiFi on the Pi notes

Worked at home when I tested it! Took it into work and plugged it in, waited and ... nothing in my DropBox :( After much messing about, as I could not just plug the Pi into a screen(it's screwed to the wall) I connected it up to a projector to find ... dum dum DUM the SD card had come unseated and nothing was loading. After pushing it back in everything worked and the IP address appeared in my DropBox.
11 Oct 2015:
Missing GFX causes gedit to seg fault SOLVED
I love Gentoo Linux and most of the time it just works but, today it did not.

I rebuilt the linux kernel and everything went fine, rebooted and tried to follow my "post kernel install steps", which are basically just install a matching GFX card driver. This is required for accelerated and 3D graphics.

But it will not install! Deciding that right then and there I did not need 3D and that slow screen switching was acceptable, I left it as a job to do later. Which would have been fine if it had not been for gedit. A simple graphical text editor that I favour.
It was giving an error every time I ran it "Segmentation Fault", which is as generic as you can get on Linux. Nothing useful in the logs.

I started by trying to re-install, went fine, but the problem persisted. Then I started re-installing all its dependencies.

emerge -av introspection
emerge -av glib
emerge -av gobject-introspection-common gobject-introspection
emerge -av gedit
emerge --sync && emerge --pretend --update --deep world
emerge -avDNut world
revdep-rebuild
emerge @preserved-rebuild

and including all my "update and rebuild everything" commands.

No change. At work I had come across talk of the strace command that logs system calls in Linux programs. Running this produced thousands of lines that made little or no sense and just ended with the SIGSEGV signal. But in among the cruft I did see a reference to ATIFGLEXTENSION. Odd, gedit does not do anything GFX-y. So ignored it and went and complained on the forums https://forums.gentoo.org/viewtopic-t-1030166.html

In the mean time I had been reading MANY posts from Gentoo users over the last 3 months about problems installing the latest ATI drivers with 4.0 kernel. A lot making little sense, regarding overlays and patches. What I did make out was a new driver version was available but needed work to install.

Unmask the AMD 68bit version in /etc/portage/package.accept_keywords/ by adding
=x11-drivers/ati-drivers-15.9-r1 ~amd64
then run
emerge -av ati-drivers
that gives you the location of the files to manually download
wget http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz
Then visit http://support.amd.com/en-us/download/ to download the 64bit linux driver.
These two files must be then moved to /usr/portage/distfiles/ (as they are, NOT expanded/unzipped)
then run
emerge -av ati-drivers
which finds the required files and installs everything. Finally a reboot fixes everything in place and gedit run once more, phew!
loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed

email

root

flog archives


Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!

[Pay4Foss banner long]