Freedom from Ads with Pi-Hole and Macvlan

Raspberry Pi Pi-Hole Ad Blocker

Block Ads to Your Entire Network Using Pi-Hole

Pi-Hole is a fantastic ad-blocking software that can run on a Raspberry Pi or pretty much any other Linux or Windows machine. Most websites that can detect ad-blocking cannot detect Pi_hole and Pi-Hole protects your entire home network. It acts as a personal DNS server which can block advertising or other objectionable sites from your network using blacklists (similar to OpenDNS but completely configurable by you with unlimited whitelists and blacklists). Once it blocks the sites that are on its blacklist, it hands the DNS search off to a secondary DNS (either your ISP’s or one you designate such as Google’s or OpenDNS), thus providing you a second opportunity to filter.

Easiest Install Ever Without Hogging Your Server

There are may how-tos out there on how to install Pi-Hole, but this method provides the following advantages:

  • uses Docker to compartmentalize the installation from the rest of the files on your computer,
  • stores configuration files on your physical computer rather than in the container,
  • grants the Pi-Hole server a separate IP address from the physical computer you are running the container on (this allows you to install other services that would otherwise conflict with Pi-Hole as Pi-Hole tends to listen to all relevant ports).

This post and configuration is based on Tony Lawrence’s setup for synology. It uses the Macvlan network driver to provide the Pi-hole server an IP address separate from the physical computer on which the container is running.

Note
  1. MacVlan only works with ethernet so your server should be connected to a hard wired connection, and
  2. As of April, 2020, there is currently a bug with the latest 4.19v7 kernel of Raspbian which will prevent macvlan from working but there is a fix. See the note at the end of this post for more details. As far as I am aware this only has occurred on Raspbian and does not apply to other distros.

Installing Pi-Hole – Easy as Pie

  1. Install Docker on a Linux computer (I use a Raspberry Pi).
  2. Install Docker-Compose.
  3. At the console enter the the following commands to download the docker-compose yaml file:
  4. Open the docker-compose.yaml file in your favorite text editor and edit as indicated by the #comments to add the IP address you want to assign to the Pi-hole container, as well as other network configurations:

  5. When done editing, save your changes and exit your editor.
  6. Copy files over from the image (this step should be done automatically by the volume attachment when the image is created by docker-compose but it did not work for me so I’m doing it manually here):
  7. Now start up the container:

    You can omit the second line if you don’t want to see the logs. If you keep it, when you see “Pi-hold blocking is enabled”, “Starting lighttpd” and “[services.d] done.]” the container is up and running:

    Pi-Hole Container Starting Up

    You can now can cancel out of the logs by hitting “Ctrl-C”.

  8. After a few minutes you will have Pi-Hole up and running. Type the IP4 address you revised on line #23 of the docker-compose.yaml file (e.g., 192.168.0.210), and you should see the following in your browser:

    Pi Hole Logo - Did you mean to go to the admin panel

  9. If you click on the admin link you will see the following:

    Pi-Hole Dashboard

  10. Now login to your router, and edit your router settings so that the configured DNS matches the ip address on line #23.
    For example, on my router the configuration is as follows:

    DDWRT DHCP Router Settings

  11. It’s now up and running – blocking all ads to all of the computers, phones, tablets, and other devices in your home that are on your internal LAN or Wifi networks (obviously it won’t block cellular data).
  12. Read the documentation on the Pi-Hole website to configure the various options. The most common configuration changes will be to add certain sites to the whitelist (Pi-Hole has been known to block good web sites or server URL’s that are necessary for some functions like comments). You may also want to add blacklists other than the defaults.

    Shutting Down Pi-Hole Using Docker

  13. Best to disable Pi-Hole in the web admin interface but if you really want to shut down the service type the following at the console:
    Keep in mind that wants this shuts down your network will no longer have a DNS service so your internet won’t work. Make sure you edit your router configuration to replace the Pi-Hole ip with the IP address of another DNS service (your ISP’s, Google’s, or OpenDnS for example).

    Updating Pi-Hole Using Docker

  14. Updating Pi-Hole is easy when it is in a container. At the command line of your Linux server simply issue the following within the ~/docker/pihole directory:

  15. Raspbian Kernel 4.19 Bug Affecting Macvlan

    RASPBERRY PI BUG ALERT FOR MACVlAN: As I write this, there is currently an outstanding bug with the latest Raspbian 4.19.7 kernel published on February 13, 2020 which prevents macvlan from working properly within a container on Raspbian PI (it does not expose its services to those outside its container). To fix, you can do a “sudo rpi-update” and reboot which will provide the bleeding edge update to the firmware and the kernel (currently updates kernel to 4.19.113-v7+). Do this only at your own risk! I did and the update to 4.19.113-v7+ went without a hitch and fixed the problem, but this update may cause other problems on your server as it’s an experimental update. The bug does not occur on earlier or later versions of the kernel.

Make Covid-19 Masks Designed by Biomedical Engineers

Covid-19 Mask N95 Alternative

Texas A&M University Team Designs N95 Mask Alternative

A team consisting of Texas A&M University faculty and graduate students in the Biomedical Engineering department have researched various DIY masks and have developed one they believe is highly effective and takes 10 minutes to assemble using 4 layers of a MERV 13 home air-conditioning filter, staples, wire, and 2 layers of polyester sheer fabric. All materials can be purchased for a total of about $5 per mask (when making 10) at a nearby home improvement or and/or discount store.

For those who are aren’t familiar with Texas A&M it is the sixth largest university in the United States, the largest university in Texas, and a tier 1 research institution.

The team’s goal was to design a mask with “N95-like performance” in both filtering and ability to fit. The video posted on youtube spends some time explaining the deficiencies of other DIY masks, then provides detailed hands-on instructions:

Mask Instruction Video

Instructions for Covid-19 Mask Construction

The team provides written PDF instructions also.

The following materials are used to make the masks at about $5 a piece when making 10:

Mask Bill of Materials

As per the team’s writeup:

The prototype mask was put through in-house qualitative fit testing, which was incorporated into the iterative mask development process. Over thirty prototype designs were created and vetted.. A quantitative fit test was performed with the same parameters as commercial N95 masks for use in a Biosafety-Level-3 laboratory environment. The prototype DIY mask outperformed other commonly available DIY mask designs made using the available information, including several 3D printed varieties, but it did not meet OSHA fit-testing standards required for approved N95 masks.

In summary, a low-cost, easily assembled N95-like mask was produced using materials easily found in most home-supply or hardware stores. The total estimated cost of the prototype mask is less than $5/mask, and it could be assembled in approximately 10 minutes /mask. Its materials are rated to achieve 95% filtering efficiency for 0.3 micron particles which commonly carry viral pathogens. In its current state, it is believed that this prototype may present a viable stopgap measure when rated N95 masks are unavailable, and it is strongly believed to outperform most other DIY masks currently available in light of PE shortages in the healthcare space.”

Packaging and Decontaminating

At the end of its report, the team also provides a method to package and sterilize the masks prior to distributing them by warming them in a 200 F degree.

See the project page, which contains the full instructions in the PDF or the video.

Disclaimer – Not Certified!

The team provides various disclaimers that the masks are NOT rated and NOT sterile and are of course used one’s own risk.

Add Random Post with Shortcodes Ultimate

Wordpress Plugins

Generating a Random Post in WordPress

There are many plugins out there that an generate a random post to be inserted into your website. An example of such a random post is shown to the right of this entry in the box-set off. Some of the plugins come with their own shortcodes. But there’s no need to install another plugin if you have Shortcodes Ultimate installed.

Shortcodes Ultimate by Vladimir Anokhin is a popular plugin for WordPress supplying numerous helpful shortcodes to add various features to your posts.

Using Shortcodes Ultimate to Generate a Random Post

This method permits you to customize the random listing so that it can include only the title, the title and the featured image, or even the entire content.

  1. Install the Shortcodes Ultimate plugin if you haven’t already.
  2. Customize Your Shortcodes Ultimate Template

  3. On your server, in the “wp-content/plugins/shortcodes-ultimate/” folder, create a new file called “random-post.php”. You can do this through the file manager on CPanel or other frontend on your host (or through SSH if you have command line access).
  4. Grab This Code for Your Shortcodes Ultimate Template

  5. Edit the “random-post.php” to add code for your random post – use (and modify if you wish) from one of the following:
     

    Template Code to Show Random WordPress Post Showing Just the Title and Featured Image:

    Template Code for Random Post To Show Full Content

    Random Template Code To Show The First Few Paragraphs of WordPress Post

    NOTE: This option is not recommended as it will arbitrarily truncate your post content including HTML tags which may mess up the formatting on the rest of the page where this code is inserted) .

  6. After pasting in one of the three above, save the file.

Try Out The Random Post Short Code

  1. Click on the Shortcodes Ultimate button in your editor:

    Shortcodes Ultimate Insert Shortcode Button

  2. A dialog will open. Click on the “Posts” code:

    Shortcodes Ultimate Posts Button

  3. Edit the Template name to read “templates/random-post.php” to match the name of the template you just created.
  4. Screenshot Template Name

  5. Complete the rest of the dialog options. When finished, click “Insert” to insert the Posts short code.
  6. Preview the post to verify that a random post was inserted.