🕹ī¸ Do Something Great! 😄

Tag: raspberrypi

  • Blocking ads on your home network

    Blocking ads on your home network

    You’re home, and you’re thinking of projects to do. What about setting up your home network to block ads?

    What is ad blocking?

    You may have used an extension in your browser to block ads, but when you block them on your network, you don’t have to configure each device. It’s not without it’s faults, some things will stop working. For example, if you try to click on any search results marked with Ad, the link won’t work. But, your browsing will be faster and I’ve noticed that ads in iPhone games are blocked.

    One other con against blocking is that you are depriving the website of revenue, revenue that they may need. It is nice to be able to enable the ads on certain sites, but that’s a real hassle when you’re blocking for the entire network. I don’t have a solution for this.

    How it works

    When you block ads on an entire network, what you’re actually doing is blocking access to the ad server in the Domain Name Service (DNS). DNS is used as a phone book for the internet, translating names such as ryancollins.org to its IP address so your browser can find the site. People smarter than I collect lists of ad servers, and with that information, the servers can be blocked with DNS. This means the ad blocking will work on any device, without configuration.

    Two options

    These aren’t the only options, but they are two very good options. The first one is the easiest and the second one is for the geeks among us.

    nextdns.io

    NextDNS is the easiest to get going. By following their directions for setting up your router, you can be ready to go in a few minutes. The site is currently free, and will remain free for up to 300K queries a month once it gets out of beta. Will 300K queries be enough normal usage? I don’t really know. My home network had over 3M queries last month, so probably not.

    They do have the option of apps for your devices, so the blocking can follow you outside of your home network. But, if you’re holed up at home like us, that might not be a big concern right now.

    Pi-Hole

    Besides having a really cool name, Pi-hole is pretty powerful. It is designed be set up and ran on a separate machine, and Raspberry Pis are pretty inexpensive. Setting up Pi-hole and running Pi-hole does require some work. If that scares you, it may be worth the $1.99/month to stick with NextDNS.

    The Pi My Life tutorial is pretty nice how how to set up a Raspberry Pi and your home network.

    Other advantages

    Regular DNS travels over the internet in plain text, allowing anyone to see the sites you are visiting. Your ISP or wireless carrier could be (probably is) collecting this information to sell to the highest bidder. If you set up pi-hole to use DNS-Over-HTTPS then your DNS queries are encrypted, and snooping eyes can’t see what you’re doing. Well, that’s not entirely true. They can’t know the names of the sites you are visiting, but they can know the IP addresses of those sites. You’d have to use a VPN to hide this information.

    Downsides

    Every once in awhile I have to turn Pi-hole off because a website won’t work correctly or a link wouldn’t work. It’s not too often though. And the lack of ads during normal browsing is well worth the little pain.

  • Set your Raspberry Pi up for Wifi roaming

    I’ve had a Raspberry Pi 2 just sitting around for several months, waiting for a purpose. Since I haven’t come up with a purpose, I decided to make it a portable headless Linux box that will travel with me, connect to Wifi automatically, and eventually, hopefully, set it up as a Piratebox. First things first, lets get it connecting.

    It was easier than I thought it was going to be to set it to automatically connect. Basically, I modified /etc/network/interfaces to add a roam configuration for wpa supplicant.

    # Include files from /etc/network/interfaces.d:
    source-directory /etc/network/interfaces.d
    
    auto lo
    iface lo inet loopback
    
    iface eth0 inet manual
    
    allow-hotplug wlan0
    iface wlan0 inet manual
        # wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
        wpa-roam /etc/wpa_supplicant/wpa_roam.conf
    
    allow-hotplug wlan1
    iface wlan1 inet manual
        #wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
        wpa-roam /etc/wpa_supplicant/wpa_roam.conf
    

    I just added the two lines that start with wpa-roam and commented out the default wpa_supplicant.conf lines. Next up was to create the /etc/wpa_supplicant/wpa_roam.conf file:

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
            ssid="home"
            key_mgmt=NONE
    }
    network={
            ssid="iPhoneHotSpot"
            key_mgmt=WPA-PSK
            psk="PASSWORD"
    }
    

    Adjust the parameters for your networks. Plugging the Pi into the network and manually running sudo ifdown wlan0;sudo ifup wlan0 is how I tested it.

    Finally, the pi needs to see if it doesn’t have a network connection, and if it doesn’t, bring wlan0 and then back up and see if it will connect. My wifi dongle (the Edimax EW-7811Un) is on wlan0, so you may need to modify. I set a crontab (sudo crontab -e) with the following line:

    * * * * * /bin/ping -q -c2 8.8.8.8 || (/sbin/ifdown --force wlan0 ;/sbin/ifup wlan0 )
    

    Every minute the Pi will send out two pings to Google’s DNS servers, and if it doesn’t get a reply, it will take the connection down and bring it back up. Now I have a Pi that will autoconnect to wifi.

  • The little computer that could

    Raspberry Pi: one million units made in Britain landmark passed

    The Raspberry Pi started life as an idea to bring computing in schools back to the era of the BBC Micro in the early 1980s, which inspired children to learn how a computer worked and allowed them to discover what was possible through learning to code.

    “What was needed was a return to an exciting, programmable machine like the old BBC Micro; and it had to be affordable, say around ÂŖ20, so every child could potentially have one,” explained Eben Upton co-founder of the Raspberry Pi at its launch. “Computing wasn’t being seen as the exciting, vibrant subject it should be at school – it had become lacklustre and even boring.”

    I’ve been studying how we could use the Raspberry Pi in out classrooms. The lack of monitors with DVI or HDMI connectors have been a stumbling block, along with the lack of Flash and mediocre performance as a desktop. Although, that’s not the role the Raspberry Pi was designed to fill, it would be a good entry into the classroom.