This is the steps we have followed so that we can get our school Raspberry Pi computers to run behind our school proxy without too many issues:
- Configure an apt-cacher NG server to handle your apt-get updates – See this post for more details
- Whitelist the Python PIP domains and use the –proxy:server:port configuration when installing with PIP – See this post for more details
- Open UDP port 123 and TCP port 9418 for the IP range of your devices on the school firewall so that they can use GIT and NTP without issue
- Create a new desktop launcher for Chromium so that it auto-detects your school network proxy (this is assuming you are pushing your proxy servers .pac file out via DHCP and/or DNS!) – The guide for this part is detailed below…
Continue reading Using a Proxy with your Raspberry Pi
Whilst creating some lesson slides in Google recently I wanted to add some moving images to the slides. You can see an example of one the slides I am talking about embedded below. It is a session that I delivered with Dan Aldred at the ExaBytes17 conference about using the Raspberry Pi Sense Hat.
By using the Sense Hat Online Emulator over on Trinket, I could model what the program was going to do and then use a screen recording program to capture this back to an mp4 file. On my Windows PC at work I used the Snagit software to record my screen, but at home on my Ubuntu PC I used SimpleScreenRecorder.
Continue reading Creating Animated GIFs with GIMP
This question keeps coming up on various forums and on Twitter so I thought I would share how we install Python and the extra libraries we use across our school network. A recent discussion on Twitter between Chris Sharples and Laura caught my attention.
Chris was asking Laura for an MSI package version of her fantastic GUI Zero Python library.
So I offered to write up a blog post about how we install extra Python packages across our school network.
Now all school networks differ and, as they say, YMMV! But for what it’s worth here’s how we do it…
Continue reading Installing Python Libraries on a School Network
At our last Hull Raspberry Jam, one of our budding Python coders asked me how she could detect keyboard input in a Python script and perform different actions dependent upon which key was pressed.
We both did a bit of searching around and found a few sample pieces of code, but none of them quite did what we wanted. As we were leaving I said that I would research it a bit more, and if she had not found out how to do it before the next Hull Raspberry Jam, I would have some working code for her to use.
I don’t want to ruin the surprise about what her plan is, but needless to say, it will be a very cool project if she completes what she wants to do, more on that later!
Continue reading Detecting keyboard input in Python
Our Head of Physics today asked me if there was any code we could use that would demonstrate to his A-Level Physics students the way that digital images are represented by red, green and blue pixels with a value between 0 and 255. The reason is because of the introduction of a digital imaging unit within the new A-Level specification, and whilst this could be taught as pure theory he felt a working example to illustrate the point might help.
This got me thinking and after a bit of searching I found a Stack Overflow post which gave an example of retrieving a single pixel’s RGB value and printing it out.
This example makes use of the PIL python library, which unfortunately has not been updated for Python 3. However we can make use of the Pillow library in Python 3 to achieve the same thing!
The image I have used in the code is this one:
Continue reading Extract RGB Values from an Image
In a recent #NT2tEU Twitter chat someone posed the question about how you link Twitter and Moodle together. There were suggestions about using your Twitter account to post messages about upcoming events and assignments in Moodle, linking back to them with the URL.
The way I tend to use Twitter and Moodle together is the other way round. I let Moodle take care of sending out the emails it needs for notifications, and I use Twitter as a way of pulling interesting feeds of information back into my Moodle courses.
To do this we are going to set up a Twitter Widget and then embed this code into a HTML block on our Moodle course page
Continue reading Embed a Twitter Feed into Moodle
If you want to do it here is the code:
Continue reading Countdown Timer in Moodle
We are just about to begin teaching our Python and Minecraft unit at school so I began testing everything out on our latest Raspberry Pi image to make sure we were ready for the lessons and adjust any of the lesson plans if necessary.
Our latest Raspberry Pi image runs Jessie. Now one of the improvements Jessie brings us is that the Print Screen button on your keyboard has been set up to run Scrot in the background to save a png screen shot into your home directory. You can read more about it here.
Now that is great as for quite some time taking a screen shot on your Raspberry Pi involved installing Scrot and then running it from the terminal; not the most user-friendly way to get students to take screen shots!
Continue reading Minecraft screen shots with your Raspberry Pi
I have seen many posts on both Twitter and CAS about teachers having issues getting their class Raspberry Pis to update and install software through their school firewalls, so I thought I would share the simple solution that I have implemented at my school.
It actually leverages something that I put in place for our Ubuntu Linux servers, but works just as well for Raspberry Pi devices too.
Continue reading Getting your Raspberry Pi to update through your school firewall
We have just purchased a set of Raspberry Pi 2 boards to upgrade our Raspberry Pi B+ / HDMIPI set-up which we have been using for Computer Science this year. I will not go into the reasons why or the specifications of the Raspberry Pi 2; but needless to say the performance increase seen will make teaching with these devices much easier!
So we received our new Pi 2 boards and got straight into removing the old B+ boards from our HDMIPI set-up and installing the new Pi 2 boards. Pretty soon I ran into an issue though; having replaced the Pi board and using one of our SD Cards with our current image installed on it, the system would not boot; it just sat there at the rainbow boot screen. It turns out that the Pi 2 has an updated ARM processor and therefore needs the latest updates installing for the Pi to boot. Now I could have just downloaded the latest Rasbian image and been up and running, but we have quite a few customisations to our image which I wanted to keep
Continue reading Updating our Raspberry Pi Image