Categories
Raspberry Pi

CamJam EduKit 1 – A Raspberry Pi Electronics/ GPIO Starter Kit

No soldering required! A young children friendly introduction to IT/ Computing.

Getting young kids into IT/ Computing can be a challenge, especially when it comes to doing something “constructive” i.e. not playing video games. I’ve been looking at accessible and interesting ways I can get my kids working with computers/ technology. Unsurprisingly, the Raspberry Pi came out top of the list.

I really liked the idea of doing something on-screen that would provide feedback in the real world, making the experience more interesting.

What was clear, was that as a beginner in this space, beyond selecting the SBC (single board computer), the number of add-ons/ (p)HATs is simply mind-boggling. I then came across the “CamJam EduKit” packs that were for sale at PiHut, specifically the “EduKit 1” pack, available here. So whats in the £5.00 kit?

> A 400-point breadboard
> 3 LEDs (Red, Yellow and Green)
> A button
> A buzzer
> Resistors and jumper cables
> (Online) Sample code and learning material

Comprised of eight well-written, clear and understandable modules (see here for more details), EduKit 1 provides a great introduction to building simple circuits via a breadboard and interacting with them using Python/ GPIO Zero. Within a few minutes my son had created his first circuit and, using the supplied code samples, was able to light-up the LEDs as outlined under Module 2, he then modified the supplied code for this module to change which LEDs lit-up, the order way in which the LEDs lit-up and how long they stayed on. All-in-all we’d covered basic programming/ coding in Python, circuits design, electronics and components in what was a fun and interesting 30 mins.

I was so impressed with the kit and learning material I’ve got EduKit 2 and EduKit 3 on my workbench, ready to go. The promise of building a Pi-powered robot seems to have piqued my sons interest!

I’ll state, for the record, that I am in no-way affiliated with PiHut or CamJam, the kits I have were purchased by me to try new ways to make IT interesting and exciting for my kids.

Categories
Linux

Creating a new Raspberry Pi/ Raspbian User with GPIO Access

Creating a new user in Raspbian, or any Linux distribution, is simple, just use the commands below:

sudo adduser <username>
sudo adduser <username> gpio

If you fail to add the user to the “gpio” group you will get the following Python error when trying to perform GPIO-related tasks:

No access to /dev/mem. Try running as root!

If you want the user to be a “Super User” i.e. have access to run commands with root privileges via sudo (see here for more info), add the user to the “sudo” group as well:

sudo adduser <username> sudo
Categories
General Tech

Removing Rakuten TV/ SyncPlus Channels from 2017/ 2018 Samsung Smart TVs

I recently purchased a Samsung Smart TV and every time, every time my kids watched anything on it via Plex they would hit the “Exit” button on the remote and end-up with Rakuten TV / SyncPlus channels blaring out occasionally inappropriate content.

Thanks to this post I was able to remove these annoying channels/ adverts by performing the following steps:

  1. Press CH-LIST on the remote
  2. Press up on the remote and select “Edit Channels” then press OK on the remote
  3. Select “4001” and “4002”
  4. Press right on the remote and select “Delete” then press OK on the remote

Browse to an alternative source, that’s Rakuten TV gone, for good.

Why Samsung are including this annoying service with their new TVs is beyond me. As consumers we are already paying a premium for the brand, it would appear the cash extraction opportunities now just begin at time of purchase.

Categories
Linux

Content Filtering for Kid-safe Internet at Home via Pi-Hole and OpenDNS

Its worth noting that Pi-Hole can be deployed on an x86 or ARMHF (Raspberry Pi) Linux platform (i.e. no Windows deployments). That said, any device/ client type can *use* the service once deployed/ configured as outlined below.

If like me, you have young kids you’ll want to try and protect them from inappropriate content online. This is no easy feat, and there is no ‘silver bullet.’

I was already using OpenDNS Family Shield to provide DNS-based filtering via my Internet router (functionality integrated into modern ASUS routers, but you can manually set your DNS servers as outlined here) but this wasn’t sufficient when reviewing search engine results, especially image search results.

I started looking at web content filters such as Privoxy, SquidGaurd, E2Guardian etc. but when it came to HTTPS/ SSL filtering these all suffer from very limited capabilities or were complex to setup/ configure (requirement for custom CA certificates on devices for starters). As more and more of the Internet goes SSL-only this meant that using one of these options was, potentially, a “depreciating” solution.

I needed to find an effective way to filter content presented by search engines whilst maintaining the excellent block-list functionality that OpenDNS Family Shield provides.  Further reading led me to discover that popular search engines/ YouTub provide Safe Search/ Restricted Search-only URLs that have to be set/ configured using DNS CNAMEs – some links that will explain this in more detail (you can skip these if you are looking to configure this capability within PiHole):

Sadly, despite being requested multiple times, OpenDNS Family shield does not provide this functionality – interestingly this seems like a fairly simple capability to offer considering that DNS itself is the mechanism to force Safe Search. Enter Pi-Hole and dnsmasq.

PiHole is not a web content filter, it is an Ad blocker.

However, you can use the built-in dnsmasq service to force Safe Search URLs against popular search engines/ YouTube and continue to leverage DNS-based filtering such as OpenDNS Family shield. The two combined seem to provide a comfortable level of protection for my home network.

This guide assumes you have Docker installed/ running on Linux, this guide was tested on Ubuntu 17.10.

Docker Containers are immutable – i.e. if you delete the container its contents (including your configuration/ customisation) will be lost. We can use Docker volumes/ mount functionality to persist some data.

sudo mkdir /var/kvm/images/docker/pihole
sudo mkdir /var/kvm/images/docker/pihole/dnsmasq.d

Now create required dnsmasq configuration to force Safe Search (note most guides I found on this neglect to mention requirement to add regional Google URL, in the UK when browsing to www.google.com you redirect to www.google.co.uk):

sudo vi /var/kvm/images/docker/pihole/dnsmasq.d/05-restrict.conf

# YouTube Restricted
cname=www.youtube.com,restrict.youtube.com
cname=m.youtube.com,restrict.youtube.com
cname=youtubei.googleapis.com,restrict.youtube.com
cname=youtube.googleapis.com,restrict.youtube.com
cname=www.youtube-nocookie.com,restrict.youtube.com

# Google SafeSearch
cname=www.google.com,forcesafesearch.google.com
cname=www.google.co.uk,forcesafesearch.google.com

# Bing Family Filter
cname=www.bing.com,strict.bing.com

# DuckDuckGo
cname=www.duckduckgo.com,safe.duckduckgo.com
cname=duckduckgo.com,safe.duckduckgo.com

Now create the Docker Container, be sure to change your upstream DNS servers set using the DNS1/ DNS2 arguments and change WEBPASSWORD value. Also, note the host-file entries that are passed through to the Docker Container using the “–add-host” Docker run argument.

You can also set DNS1/ DNS2 to be the OpenDNS servers, as outlined here.

Finally, on Ubuntu I had to specify the LAN IP address of the Docker host for tcp/ udp port 53 port exposure. This is because Docker has a built-in DNS resolver. Be sure to change the script/ replace 192.168.0.7 with your Docker host IP address.

IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" # May not work for VPN / tun0
IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{ print $10; exit }')" # May not work for VPN / tun0
IP="${IP:-$IP_LOOKUP}" # use $IP, if set, otherwise IP_LOOKUP
IPv6="${IPv6:-$IPv6_LOOKUP}" # use $IPv6, if set, otherwise IP_LOOKUP

sudo docker run -d \
--name pihole \
-p 192.168.0.7:53:53/tcp -p 192.168.0.7:53:53/udp -p 8081:80 \
-v /var/kvm/images/docker/pihole/:/etc/pihole/ \
-v /var/kvm/images/docker/pihole/dnsmasq.d/:/etc/dnsmasq.d/ \
-e ServerIP="${IP}" \
-e ServerIPv6="${IPv6}" \
-e WEBPASSWORD={your password} \
-e DNS1=192.168.0.254 \
-e DNS2=192.168.0.254 \
--add-host=restrict.youtube.com:216.239.38.120 \
--add-host=restrictmoderate.youtube.com:216.239.38.119 \
--add-host=forcesafesearch.google.com:216.239.38.120 \
--add-host=strict.bing.com:204.79.197.220 \
--add-host=safe.duckduckgo.com:34.243.144.154 \
--restart=unless-stopped \
diginc/pi-hole:latest

You can now browse to http://<Docker Host IP>:8081, this should bring up the Pi-Hole Web Interface.

Finally, you’ll need to modify the DHCP configuration for your network to ensure that clients are provided with the IP address of the Docker host running Pi-Hole as their DNS server. I’ll state that you don’t *need* to use Pi-Hole to force Safe Search, any local DNS service that you can configure CNAME/ A-Records to override default IPs returned for Search Engines outlined in this post will do. You can then set the upstream DNS server(s) to be Open DNS Family Shield, or anything else. Pi-Hole provides the added benefit of Ad blocking, and my kids love clicking on Ads…