Unclutter Your GMail Without Missing Out On Your Newsletters

Photo by Natasa Grabovac on Unsplash

Photo by Natasa Grabovac on UnsplashI try to keep my email inbox fairly clean but I do subscribe to some daily and weekly newsletters. Usually I skim the newsletters and delete them on a daily or weekly basis. However, if I miss a day or two I am doomed with clutter.

I could unsubscribe but there are a few I like to read regularly. Or I could setup a filter and send them out of my inbox and off to a folder automatically. However, out of sight, out of mind, and I have found when I do this I never read the archived email.

Here’s a solution that I found works for me using an Android phone and Gmail (but you could do a similar thing on iPhones and any web based email):

  1. On your computer (this is easier on your computer then on mobile), open your browser and log in to your Gmail account
  2. For each newsletter, create a filter which archives and labels them with the name of the newsletter.

    For example:

    Start by creating the label/folder:

  3. After creating the label, click “Filter Messages Like These”:

    Click “Create Filter”

    Click “Skip the Inbox (Archive It)
    Click Apply the Label and select the label you created above.
    Click “Create Filter”

  4. In your browser, navigate to the Gmail folder/label you just created and click on it. The URL in your browser should reflect this. In my example, my URL is “https://mail.google.com/mail/u/0/#label/Codewars”. Bookmark the URL.
  5. Now send that URL to your mobile phone. I use Firefox both on mobile and on my desktop, so this is easily done by the “Send Tab to Device” option. I believe Chrome has a similar feature.
  6. On your mobile phone, open the link to your folder in your browser.
  7. In your browser, click on the Menu and select “Add to Home Screen” (both in Firefox and Chrome). The phone will allow you to rename the icon link and drag it to the desktop.

  8. Drag the Icon to a new folder labeled “News” or some other appropiate label. I also put other reading apps and links in this folder.

  9. Now when I am in the mood for reading and catching up on my newsletters, I just go the News folder and click on the shortcut. I can read when I want and my email inbox stays uncluttered.

Windows Reinstall: Use Secret Migration Tool to Restore All Settings Even If Option Disabled; Plus Tips to Restore Programs After a Clean Install

Photo by Clint Patterson on Unsplash

Photo by Clint Patterson on Unsplash
I was recently faced with the dreaded prospect of re-installing Windows 10. While the standard advice on many websites is to do a clean install of Windows to solve many problems, I have gone through great lengths in the past to avoid doing so. I have many programs and settings built up over many years which I dread having to redo. In addition, my computer has a complicated dual boot process with a Hackintosh install which is threatened by any Windows install.

However, after my Windows 10 updates started failing, and after exhausting all solutions I could find, I gave in and decided I would try an in-place re-install. I clicked through the Windows Install Media wizard hoping to be able to reinstall Windows and keep my current settings and programs.

Unfortunately the Windows Setup Wizard disabled the “Keep Settings” and “Keep Programs” options – the only option allowed was a full install wiping out my Windows drive. Again I searched the tech forums in vain. All the offered solutions failed. Finally I gave up and decided to do a clean wipe. Thankfully, following the below steps, I was able to reinstall my system nearly perfectly to what it was before my problems began.

Windows User Profile Migration Tool (USMT Gui)

This Windows User Profile Migration tool by Nick Rodriguez is a graphical front-end to an all but secret (at least to the average Windows user) Microsoft migration utility called USMT.

Nick’s profile wizard will backup all of your Windows user accounts containing all your settings, plus any folders that you specify. This worked nearly perfectly for me but the instructions are a little hard to understand as I think they are intended for an over network migration rather than local.

Another tool for moving your profile is Forensit’s Trans Wiz and it’s companion User Profile Wizard. But my attempt at using both failed while Nick’s wizard worked perfectly.

Tips on using Nick Rodriguez’s User Profile Migration Wizard

  • Prior to doing anything, make a full backup of your Windows drive ! Use software that will allow you to browse your backup image in case you need to restore individual files. I used the free version of Minitool Shadowmaker.
  • Of course, read and follow Nick’s github Readme
  • The first tab “Old Computer” on Nick’s tool is for backing up, the second tab “New Computer” is for restoring. Do one at a time, not both. When the options are correctly set, the “Migrate” button on the particular tab will become active.
  • Make a copy of the “.MIG” file produced from Nick’s tool when backing up. Nick mentions on one of his posts that the file will be deleted by the tool on recovery. I didn’t experience this but you may so make sure you have a backup.
  • When backing up, UNcheck the “Save on New Computer” box (Old Computer Tab) and when recovering UNcheck the “Save State Source” (“New Computer”). I believe keeping it checked is only for migrations over a network.
  • When the Windows install asks you for a User account, provide a name and password with the understanding that this initial account will be temporary and deleted once you import the old profiles.
  • After installing Windows, enable the hidden Windows Administrator account. Log out of the temporary user account you created above which was used for the initial install, log into the Administrator account, and delete the temporary user account. From the Administrator account download and run Nick’s profile wizard.
  • If recovery using Nick’s GUI doesn’t work – try this command in an admin command Console which worked for me (adopted from some obscure Microsoft documentation). Use from within the amd64 directory in elevated Powershell:

I used this only because I didn’t uncheck the “Save State Source” checkbox so the Migrate button on the “New Computer” tab in Nick’s wizard was disabled. I found out after the fact that I had to have the box unchecked in order for the Migrate button to work.

Prior to Reinstall, Export List of Installed Windows Programs Using UninstallView

Prior to installing Windows, export a list of all of your installed programs. I did this using Nirsoft’s UninstallView. Use the Options dropdown to toggle the appearance of Windows Apps. Click View -> HTML Report – All Items to see an HTML export of the list. Save to a safe place (not the Windows drive!). If you use Chocolatey or similar command line tool export a list of the currently installed programs so you can reinstall them later using the same tool.

Convert UninstallView Html Export to Chocolatey Import File

I opened the UninstallView html list in Notepad++. I selected Find->Replace using

in the Find box and

in the Replace box. I then checked “Regular expression” and

.

Here’s what my find/replace dialog looked like:

I clicked “Replace All” – the uninstall list converted to a list of files in more or less Chocolatey format. I then hand edited to delete irrelevant html, and added the Chocolatey tags to the top:

and bottom:

I then replaced spaces with hyphens and deleted version numbers of programs so the file now looked something like this:

I could have automated some of that but didn’t bother. I then saved this as “program_list.config”.

Reinstalling Windows Programs Using Chocolatey

After installing and updating Windows, and recovering the Windows profiles using Nick’s tool above, I logged in with my old account, fed the program_list.config to chocolatey and let it go to town installing my programs:

Surprisingly, Choco showed very few errors. Most of those I did experience were because the Choco packages were named differently in Choco’s repository or they were not available (e.g., commercial software). I reran Choco with the correct names for those programs erring out and/or installed the applicable commercial packages.

Restoring Custom Tasks in Task Scheduler

I had several scripts running in Windows Task Scheduler. On my old install they existed in “C:\Windows\System32\Tasks”. So on recovery, I mounted my MiniTool Shadowmaker image to a mapped drive, and imported the scripts into Task Scheduler. I did this by going to Action->Import Task and then browsed to the “C:\Windows\System32\Tasks” folder on the mounted Shadowmaker image and imported the scripts.

Problems Encountered

Most of the problems I encountered had to do with the Windows Start menu. I’ve gotten into the habit of pressing the Windows key, and the first few letters of a program to launch. Unfortunately Chocolatey doesn’t always produce a shortcut in the Start Menu. So I had to manually add a shortcut to the start menu.

I also encountered problems with Windows Powershell complaining it couldn’t find cmdlets. Confusingly, there are 2 powershell versions, Powershell 5.1 which MS is apparently trying to deprecate, but still installs with windows, and Powershell Core (Version 7) which apparently is the only version which is getting updates. I had to install Powershell Core version 7 (rather than the default 5.1) in order for my scripts to work properly as 5.1 was giving command not found errors.

Drivers – two drivers for my Western digital drives did not install properly. Open up Device Manager and make sure all your drivers installed properly and there are no warnings or exclamation points. Install drivers from manufacturer websites. I also had to go to the Nvidia website and update my driver for my ancient GT710. Choco seemed to have installed it but I didn’t trust the choco install as I was experiencing some slowness.

Pi-hole & Unlimited Whitelist for OpenDNS, Cleanbrowsing, Etc.

Photo by Firmbee.com on unsplash

Photo by Firmbee.com on unsplash

Pi-Hole and Upstream DNS Providers

Pi-hole is an excellent whole-home, self-hosted ad blocker and DNS filtering tool. For an easy way to install Pi-Hole see my post on installing Pi-hole using Docker.

Pi-hole intercepts every request for a website from your home network (including any devices on WIFI) and checks whether the website is on a “bad list” (ad engine, malware, adult site, etc.). If it is, then the site is blocked. If it isn’t, the request is forwarded to a filtered or unfiltered name server which you specify (such as Google’s, OpenDNS or Cleanbrowsing.org’s). Your upstream DNS provider can be unfiltered (like Google’s 8.8.8.8) or filtered (like Cleanbrowsing’s Family Filter 185.228.168.168). The result is a very ad-free (and if you choose, filtered) browsing experience both on mobile and desktop without having to install any software on any devices.

DNS settings page on the Pi-hole admin page (Settings->DNS)

Whitelisting Filtered Upstream DNS Servers Like OpenDNS and Cleanbrowsing

There are free “upstream” DNS providers that provide free filtering for malware and other harmful sites but don’t provide (at least on free accounts) very many options to white list sites that you may want to allow on your network. For example, Cleanbrowsing blocks reddit on its Family Filter (for good reason, IMO, as reddit contains a lot of objectionable material). Still, if you want to block adult sites, but permit reddit in order to access the tech forums, you won’t be able to do that through the Pi-hole admin interface or the free Cleanbrowsing Family Filter.

In addition, Pi-hole’s admin interface only allows you to specify upstream DNS providers for every request, so at least as of the current version there is no way to send different domains to different upstream DNS providers.

What to do? If you whitelist the domain using Pi-hole’s white-list settings, the domain will still be blocked as it is only whitelisted on the local Pi-hole name server, not on the upstream provider. Pi-hole will see the domain, not check it against it’s block lists (i.e., gravity lists) and send it on to the upstream provider only for the upstream provider to block the domain.

SOLUTION: Tell Pi-Hole to Send Whitelisted Domains to an Unfiltered Upstream DNS

By manually editing a configuration file on your Pi-hole server, you can send certain domains to any upstream DNS provider you want, rather than the default upstream provider in your DNS settings. That way you can effectively whitelist as many domains as you wish.

Example: Whitelisting Domain for Upstream Name Server

Here’s an example. On your Pi-hole server, open a new configuration file named “bypass_upstream_dns.conf” (or any other name you wish provided you use .conf as an extension), in the /etc/dnsmasq.d/ directory. If you installed Pi-hole using my Docker instructions, the etc directory is located in the directory where your docker-compose.yml file is located.

Now simply specify the domain you wish to white list and the IP address of an unfiltered name server (in this example, Google’s) using the following format:

Exit and restart your Pi-Hole server. Using docker-compose this would be:

Credit for this trick goes to this thread in the pi-hole forums.