Looking for a way to automate pi-hole updates with custom addlist entries, on Windows using Docker? Here’s what I did:

Pre-reqs:

  • Download Docker for Windows and install
  • Create a new batch file, e.g. “update_pihole.bat” with the content below
    • Change the docker run parameters, e.g. change the server IP/password/TimeZone/DNS2 and DNS3 (leave DNS1 to the default 127.17.0.1)
    • Create a scheduled task on the Windows host that runs the script periodically, e.g. every month. Test the task to see if it’s working.
  • Make sure the host can resolve DNS to download the latest pi-hole container after the script stops the running pi-hole docker container. I’ve configured a secondary DNS on my Windows host to point at my ISP’s DNS server directly.
  • Change your router’s DHCP to hand out IP’s with the DNS pointing to your Windows host/pi-hole’s IP.

@echo off
REM Update a pi-hole container on Windows using Docker and adding a bunch of custom addlists 
REM Latest script can be found on http://pieter.wigleven.com/it/archives/187

REM Stop and delete existing pi-hole container
docker stop pihole
docker rm pihole

REM Clear out the Docker cache and all unused images (i.e. the out of date version of pi-hole).
docker image prune -a --force

REM Pull latest pihole container, make sure your host can resolve DNS at this point!
docker pull pihole/pihole

REM Run pihole with customized parameters (change this to match your environment)
docker run -d --name pihole -e ServerIP=192.168.1.5 -e WEBPASSWORD=abcdefgh -e TZ=Europe/Amsterdam -e DNS1=127.17.0.1 -e DNS2=8.8.8.8 -e DNS3=1.1.1.1 -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 --restart=unless-stopped pihole/pihole:latest

REM Add custom addlist by modifying the database (ugly but only method AFAIK...)
docker exec pihole sqlite3 /etc/pihole/gravity.db "INSERT INTO adlist (address, enabled, comment) VALUES ('https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt', 1, 'comment');"
docker exec pihole sqlite3 /etc/pihole/gravity.db  "INSERT INTO adlist (address, enabled, comment) VALUES ('https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt', 1, 'comment');"
docker exec pihole sqlite3 /etc/pihole/gravity.db  "INSERT INTO adlist (address, enabled, comment) VALUES ('https://dbl.oisd.nl/', 1, 'comment');"
docker exec pihole sqlite3 /etc/pihole/gravity.db  "INSERT INTO adlist (address, enabled, comment) VALUES ('https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt', 1, 'comment');"

REM Update Gravity to download contents of custom addlists
docker exec pihole pihole updateGravity

Consider leaving a reply if you found this to be helpful

Comments (0) Posted by pieter on Tuesday, December 21st, 2021


Since several weeks I noticed that when downloading files from the internet, after clicking a file to download – it took up to a minute before the “Open/Save/Cancel” golden bar appeared.
Very frustrating if you quickly want to download something.

The first troubleshooting step was to launch Internet Explorer 9 without any add-ons using “iexplore –extoff”. Internet Explorer reported it was running without add-ons:

After testing, the problem still occurred, it took exactly 54 seconds between the moment you clicked a file to download and the moment the dialog would appear:

54 seconds before the golden bar to appear

Now it was time to start Procmon, I downloaded the latest version from http://live.sysinternals.com and started a new process monitor session and limited the process to “iexplore.exe”

Shortly after capturing the events I initiated a download in Internet Explorer 9, just after the download dialog to appear I stopped capturing events.

I could see some delays in the trace but at first it wasn’t obvious what was causing them. After browsing through the events I noticed several references to UNC locations:

Notice the UNC locations

 

As you can see in the picture above, Internet Explorer was trying to reach my Mediacenter PC.
My mediacenter wasn’t powered on and therefore a “BAD NETWORK PATH” was logged. However – my main question was “Why is Internet Explorer looking for these locations at all?”

The default download folder for IE9 is a folder on my local drive, therefore I was wondering why IE9 was looking in places I – probably – previously downloaded files to.

A quick search through the Windows Registry didn’t reveal this information to be stored anywhere. That’s when I had a look in the “Download History” in IE9, you can access this by hitting CTRL-J. In my case it took another 54 seconds before the download history dialog to appear. This is where I could see the references to my Mediacenter PC.

After clearing the list I tested the download functionality and this time it the golden bar would appear immediately.
Thanks to Procmon we now know that IE9 tries to reach to previous download locations, including UNC locations to unreachable machines.

Another case closed thanks to Procmon.

Comments (5) Posted by pieter on Tuesday, January 17th, 2012


Solve this by either:

– Assign the destination drive/partition a driveletter

– Change the destination drive/partition driverletter to something else (this solved it for me)

E.g.

Comments (2) Posted by pieter on Tuesday, November 22nd, 2011


Follow these steps in order to enable Facebook chat on your WP7 device with mango:

  • Go to http://profile.live.com
  • Log in using your PRIMAIRY Live account. This is the account you entered when initially setting up your phone. Find this on your phone by going to Settings / Email+accounts, it’s the account listed as “Windows Live“.
  • On the left side, hit manage and connect facebook.
  • Grab your phone and go to Settings / Email+accounts, press and hold your Facebook and primiary Live ID and choose Synchronise.
  • On your computer, go to facebook.com, log in and scroll all the way down. On the bottom you can change the display language used for facebook, change this to ENGLISH US.
  • Grab you phone, go to messaging and enjoy facebook chat!

Please leave a reply whether it worked or not.

Comments (18) Posted by pieter on Monday, August 1st, 2011


When closing a Windows Explorer window, the next time you open it the size of the preview pane isn’t remembered. Frustrating?

The solution is simple.

  1. Resize the window and preview pane just like you want to have it
  2. Hold CTRL-SHIFT on your keyboard while closing the explorer window (e.g. clicking the little X on the upper right corner)

Next time when you launch explorer you’ll see that the settings are remembered!

Comments (3) Posted by pieter on Tuesday, May 24th, 2011


When you are in bing maps and you hit the search button, does the phone brings you to Bing Maps in internet explorer?

Change these settings on your Windows Phone 7 in order to use Bing Maps navigation:
Go to Settings/Region and Language, change the last option “Browser & Search language” to “English United States”.

From now on you can use the search button in maps and enter a street address or postcode (for postcodes make sure you don’t use spaces)

en Settings/Region and Language, verander onderaan je “Browser & Search language” naar “English United States”.

Comments (0) Posted by pieter on Thursday, January 27th, 2011


Did you get “Attention required. Press here” followed by a “ connect to a wifi network or your PC to complete the download”? 

Recently I’ve purchased a game from the Windows Phone 7 marketplace. After it was succesfully downloaded, I couldn’t find the game in my “Xbox Live Games” section of the phone.

When going back into the marketplace using my phone and searching for the game, selecting it and pressing “Check install”, I noticed the game was stuck at “100% downloaded”.

The solution:

1) Make sure you are connected to WiFi or via USB to your computer with Zune software
2) Press and hold the download indicator for the game or app (which is stuck at 100%) and a menu will appear which gives you a “Retry” option. Select retry and if you’re lucky – it will go OK this time.

Please leave a reply if this helped you!
Good luck!

Comments (1) Posted by pieter on Tuesday, December 7th, 2010


During a Windows 7 installation I noticed every step, including “Setup is starting”, would take minutes to complete.

After I while I found that in the BIOS a setting was present that showed my machine to have a Floppy A: drive – which is not the case.

I disabled the A drive in the BIOS and afterwards Windows 7 Setup was fast again.
Hope it helps – let me know if it does in your case!

Comments (0) Posted by pieter on Thursday, October 7th, 2010


I’ve been asked to fix a computer that seemed to have a lot virusses. One rootkit preventing internet access to the Windows Update server. I fixed this using TDSSKILLER

After this I could at least visit http://update.microsoft.com but received a 0x8024D007 error.
To fix this:

1) Open the registry (start/run/regedit) and browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\wuauserv

2) Right click wuauserv in the left pane and select “Permissions” make sure you have:

– System at FULL CONTROL
– Administrators at FULL CONTROL

(if you mis these entries you can add them using the add button).

3) Now using the same registy editor browse to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Svchost

4) Right click Svchost in the left pane and select “Permissions” make sure you have:

– System at FULL CONTROL
– Administrators at FULL CONTROL

Close the registry editor

5) Download the latest Windows Update Client using this link
Leave me a quick reply if it helped you, good luck!

Comments (30) Posted by pieter on Thursday, September 16th, 2010


The Win7 RTM SDK is out, and with it the latest public version of Windows Performance Toolkit (which contains XPERF).

 

The SDK is huge but the lightest way to get WPT is to:

 

1)      Launch the installer from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en

a.       Note this is the “web” installer which only downloads the components that you choose to install

2)      Choose to install the Development Win32 Tools

3)      Find the wpt installer MSI’s (wpt_xxx) under C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin

Comments (0) Posted by pieter on Friday, September 4th, 2009