Using Pi-hole On A Raspberry Pi: Series Index

Raspberry PiThis series is a sub-series of the Adventures with a Raspberry Pi, in which I am going to show how to use the Pi-hole.

If you’re reading this post on azurecurve, this index will automatically update, otherwise you need to check back to the original post.

Adventures With A Raspberry Pi

Adventures With A Raspberry Pi
Building The Raspberry Pi: CanaKit Raspberry Pi 3 B+ Complete Starter Kit
Building The Raspberry Pi: Raspberry Pi Build
Building The Raspberry Pi: Install Operating System
Building The Raspberry Pi: First Run
Building The Raspberry Pi: System Configuration Tool
Building The Raspberry Pi: Enable SSH For Remote Access
Building The Raspberry Pi: Securing the Raspberry Pi
Building The Raspberry Pi: Conclusion
Installing Pi-hole On A Raspberry Pi: What is Pi-hole?
Installing Pi-hole On A Raspberry Pi: Install Pi-hole
Installing Pi-hole On A Raspberry Pi: Change Pi-hole Admin Password
Installing Pi-hole On A Raspberry Pi: Configure Network to use Pi-hole
Using Pi-hole On A Raspberry Pi: Blocked Adverts
Using Pi-hole On A Raspberry Pi: Admin Interface
Using Pi-hole On A Raspberry Pi: Disabling Pi-hole
Using Pi-hole On A Raspberry Pi: Whitelisting a Site
Using Pi-hole On A Raspberry Pi: Update Blocklists
Using Pi-hole On A Raspberry Pi: Maintain Blocklists
Using Pi-hole On A Raspberry Pi: Change DNS Servers
Using Pi-hole On A Raspberry Pi: Connecting With SSH
Using Pi-hole On A Raspberry Pi: Updating the Pi-hole
Using Pi-hole On A Raspberry Pi: Conclusion
What Else Can I Use It For?
Prepare New SD Card For Raspberry Pi OS: Download SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Install SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Format SD Card
Prepare New SD Card For Raspberry Pi OS: Download NOOBS
Prepare New SD Card For Raspberry Pi OS: Copy Files To The SD Card
Prepare New SD Card For Raspberry Pi OS: Conclusion
Installing Pi-hole On A Raspberry Pi: Changing the IP Address
Raspberry PI Update Fails
Check Version of OS on Raspberry Pi
How to Update the OS on a Raspberry Pi
Using Pi-hole On A Raspberry Pi
Disabling Pi-hole
Whitelisting a Site
Update Blocklists
Maintain Blocklists
Change DNS Servers
Connecting With SSH
Updating the Pi-hole
Conclusion
Adventures With A Raspberry Pi: Raspberry PI Update Fails

This Workflow Is Locked By Another User And Cannot Be Edited

Microsoft Dynamics GPI was onsite recently with a client making a Workflow project live and encountered a lock on the workflow we needed to amend. There were no users logged into the company so we knew the lock was an orphaned one.

This workflow is locked by another user and cannot be edited. Please try again later.

"This workflow is locked by another user and cannot be edited. Please try again later."

The locks on Workflow are stored in the Workflow User Security (WF00104) table; when clearing locks, care should be taken to only remove the lock required, so as not to cause additional problems.

The highlighted section should be changed to the Workflow Type for which the lock should be removed:

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (https://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
*/
DELETE FROM
	WF00104
WHERE
	Workflow_Type_Name = 'Purchase Requisition Approval'
GO

Installing Pi-hole On A Raspberry Pi: Configure Network to use Pi-hole

Raspberry PiThis post is part of the series on building my new Raspberry Pi; this series is a sub-series of the Adventures with a Raspberry Pi.

With Pi-hole installed and configured, the final step is to change the DNS settings on the router to point to the Pi-hole rather than the old DNS servers. In my case, they were pointing to OpenDNS on the router, so it as a case of changing them to look to the IP address configured on the Pi-hole which is set to use OpenDNS.

Every router is different in how DNS servers are configured; if your router doesn’t allow the DNS servers to be changed, you could change the DNS settings on your computers instead; bear in mind this approach takes far more effort.

Adventures With A Raspberry Pi

Adventures With A Raspberry Pi
Building The Raspberry Pi: CanaKit Raspberry Pi 3 B+ Complete Starter Kit
Building The Raspberry Pi: Raspberry Pi Build
Building The Raspberry Pi: Install Operating System
Building The Raspberry Pi: First Run
Building The Raspberry Pi: System Configuration Tool
Building The Raspberry Pi: Enable SSH For Remote Access
Building The Raspberry Pi: Securing the Raspberry Pi
Building The Raspberry Pi: Conclusion
Installing Pi-hole On A Raspberry Pi: What is Pi-hole?
Installing Pi-hole On A Raspberry Pi: Install Pi-hole
Installing Pi-hole On A Raspberry Pi: Change Pi-hole Admin Password
Installing Pi-hole On A Raspberry Pi: Configure Network to use Pi-hole
Using Pi-hole On A Raspberry Pi: Blocked Adverts
Using Pi-hole On A Raspberry Pi: Admin Interface
Using Pi-hole On A Raspberry Pi: Disabling Pi-hole
Using Pi-hole On A Raspberry Pi: Whitelisting a Site
Using Pi-hole On A Raspberry Pi: Update Blocklists
Using Pi-hole On A Raspberry Pi: Maintain Blocklists
Using Pi-hole On A Raspberry Pi: Change DNS Servers
Using Pi-hole On A Raspberry Pi: Connecting With SSH
Using Pi-hole On A Raspberry Pi: Updating the Pi-hole
Using Pi-hole On A Raspberry Pi: Conclusion
What Else Can I Use It For?
Prepare New SD Card For Raspberry Pi OS: Download SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Install SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Format SD Card
Prepare New SD Card For Raspberry Pi OS: Download NOOBS
Prepare New SD Card For Raspberry Pi OS: Copy Files To The SD Card
Prepare New SD Card For Raspberry Pi OS: Conclusion
Installing Pi-hole On A Raspberry Pi: Changing the IP Address
Raspberry PI Update Fails
Check Version of OS on Raspberry Pi
How to Update the OS on a Raspberry Pi

SQL Script to Delete Unused Segments

Microsoft Dynamics GPWhile the General Ledger Year-End Close routine can delete unused segments, during implementation, or creation of new companies , we sometimes end up with segments created which are not needed. The below script can be used to remove all segments not assigned to an account (segments which have been used will not be removed).

The script allows the user to define which segment should be removed by changing the highlighted parameter:

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (https://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
*/
DECLARE @SGMTNUMB AS VARCHAR(2) = 3

DELETE FROM
	GL40200
WHERE
	SGMTNUMB = @SGMTNUMB
AND
	SGMNTID NOT IN (
			SELECT
				CASE @SGMTNUMB 
				WHEN 1 THEN GL100.ACTNUMBR_1
				WHEN 2 THEN GL100.ACTNUMBR_2
				WHEN 3 THEN GL100.ACTNUMBR_3
				WHEN 4 THEN GL100.ACTNUMBR_4
				WHEN 5 THEN GL100.ACTNUMBR_5
				WHEN 6 THEN GL100.ACTNUMBR_6
				WHEN 7 THEN GL100.ACTNUMBR_7
				WHEN 8 THEN GL100.ACTNUMBR_8
				WHEN 9 THEN GL100.ACTNUMBR_9
				WHEN 10 THEN GL100.ACTNUMBR_10
				END
			FROM
				GL00105 AS GL105
			INNER JOIN
				GL00100 AS GL100
					ON
						GL100.ACTINDX = GL105.ACTINDX
			)
GO

Installing Pi-hole On A Raspberry Pi: Change Pi-hole Admin Password

Raspberry PiThis post is part of the series on building my new Raspberry Pi; this series is a sub-series of the Adventures with a Raspberry Pi.

In the last post, I stepped through the installation of the Pi-hole software on a Raspberry Pi. It will install with a admin password provided which you can change (and I would recommend you do so).

You can change the password by logging into your Raspberry Pi and typing the following command (where the highlighted section is replaced with your password of choice):

sudo pihole -a -p password

There are two issues with this.

The first is, as you’re typing this command, anyone looking over your shoulder will see the new password.

The other issue, is if you use special characters in your password, you will need to escape them. For example, a password of P!hole would need to be entered as P\!hole.

Adventures With A Raspberry Pi

Adventures With A Raspberry Pi
Building The Raspberry Pi: CanaKit Raspberry Pi 3 B+ Complete Starter Kit
Building The Raspberry Pi: Raspberry Pi Build
Building The Raspberry Pi: Install Operating System
Building The Raspberry Pi: First Run
Building The Raspberry Pi: System Configuration Tool
Building The Raspberry Pi: Enable SSH For Remote Access
Building The Raspberry Pi: Securing the Raspberry Pi
Building The Raspberry Pi: Conclusion
Installing Pi-hole On A Raspberry Pi: What is Pi-hole?
Installing Pi-hole On A Raspberry Pi: Install Pi-hole
Installing Pi-hole On A Raspberry Pi: Change Pi-hole Admin Password
Installing Pi-hole On A Raspberry Pi: Configure Network to use Pi-hole
Using Pi-hole On A Raspberry Pi: Blocked Adverts
Using Pi-hole On A Raspberry Pi: Admin Interface
Using Pi-hole On A Raspberry Pi: Disabling Pi-hole
Using Pi-hole On A Raspberry Pi: Whitelisting a Site
Using Pi-hole On A Raspberry Pi: Update Blocklists
Using Pi-hole On A Raspberry Pi: Maintain Blocklists
Using Pi-hole On A Raspberry Pi: Change DNS Servers
Using Pi-hole On A Raspberry Pi: Connecting With SSH
Using Pi-hole On A Raspberry Pi: Updating the Pi-hole
Using Pi-hole On A Raspberry Pi: Conclusion
What Else Can I Use It For?
Prepare New SD Card For Raspberry Pi OS: Download SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Install SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Format SD Card
Prepare New SD Card For Raspberry Pi OS: Download NOOBS
Prepare New SD Card For Raspberry Pi OS: Copy Files To The SD Card
Prepare New SD Card For Raspberry Pi OS: Conclusion
Installing Pi-hole On A Raspberry Pi: Changing the IP Address
Raspberry PI Update Fails
Check Version of OS on Raspberry Pi
How to Update the OS on a Raspberry Pi

Installing Pi-hole On A Raspberry Pi: Install Pi-hole

Raspberry PiThis post is part of the series on building my new Raspberry Pi; this series is a sub-series of the Adventures with a Raspberry Pi.

Installing the Pi-hole was something which I was quite concerned about doing. A week or so before I boguth my Pi-hole I mentioned Pi-hole on Twitter and a friend had a go at installing it on an unsed Raspberry Pi he had. He actually had quite a few problems which put me off for a short time.

However, when he resolved his problems he realised that the problems were his and not Pi-hole in general. So, I decided I was back on for building a Pi-hole.

Once the Raspberry Pi had arrived and been built, I set about installing Pi-hole. It is actually quite straightforward. As with Linux in general, you do not need to download the software as you would on Windows. Instead it is all, usually, handled from the command line.

To download and start the install Pi-hole type this command at the Linux command line prompt:

curl -sSL https://install.pi-hole.net | bash

The Pi-hole installer does require some user interaction, but guides you though the process. On the welcome screen, click OK to proceed:

Pi-hole automated installer

Continue reading “Installing Pi-hole On A Raspberry Pi: Install Pi-hole”

Edge Canary: Series Index

Edge CanaryMicrosoft have recently announced they are ditching the current version of their Edge browser in favour of a Chromium based browser. In this series, I am going to take a look at the Canary version of this new browser.

If you’re reading this post on azurecurve, the index below will automatically update, otherwise you need to check back on the original post.

Edge Canary
What Is Edge Canary?
Why Is Edge Being Remade In Chromium?
Download
Installation
Add Extension From Microsoft Store
Add Extension From Chrome Play Store
Dark Mode
Conclusion

Installing Pi-hole On A Raspberry Pi: What is Pi-hole?

Raspberry PiThis post is part of the series on installing Pi-hole on a Raspberry Pi; this series is a sub-series of the Adventures with a Raspberry Pi.

Before launching into the installation of Pi-hole, I thought it might be useful to explain what a Pi-hole is and why you might want to use one.

From Wikipedia

Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole (and optionally a DHCP server), intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux and cloud implementations.

Pi-hole has the ability to block traditional website adverts as well as adverts in unconventional places, such as smart TVs and mobile operating system adverts.

I run quote a few PCs, laptops, tablets and so on in the house, as well as mobile phones or tablets when people visit; I have uBlock Origin installed in Vivaldi, but I wanted something a bit broader in terms of ad blocking. The actual impetus to sorting out a Pi-hole was when Google announced they’d be making changes to Extensions ion Chrome which would have crippled ad blockers.

Internet adverts have become far too intrusive and I just want them gone (I have a small set of whitelisted sites where they have ads which are not intrusive (no video, sound, flashing or otherwise moving images).

Pi-hole admin

Continue reading “Installing Pi-hole On A Raspberry Pi: What is Pi-hole?”

Find Table in All Microsoft Dynamics GP Databases

Microsoft Dynamics GPI was doing some work with a client recently with a custom extension being tested in some Microsoft Dynamics GP companies. Due to how it is deployed (very manually) we had only deployed it to some databases and not all.

Due to other project commitments, no testing was done for a while and when we returned, we weren’t sure if the deployment notes listed all databases correctly or if some of those databases had been overwritten for other testing.

So, a small script was needed to check for the presence of a custom table in all databases; the below is what I came up with to check for a table in all Microsoft Dynamics GP databases:

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (https://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
*/
DECLARE @command nvarchar(max)

DECLARE @SystemDatabase VARCHAR(15) = 'DYNAMICS'
DECLARE @Table VARCHAR(50) = 'SY00800'
CREATE TABLE #ReturnedData(
	DBNAME VARCHAR(15)
	,TABLENAME VARCHAR(100)
)

SELECT @command = 'IF EXISTS (SELECT 1 FROM sys.databases AS dbs LEFT JOIN ' + @SystemDatabase + '..SY01500 SY ON SY.INTERID = dbs.name WHERE dbs.name = ''?'' AND (dbs.name = ''' + @SystemDatabase + ''' OR SY.INTERID IS NOT NULL))
						BEGIN
							USE [?];
							INSERT INTO #ReturnedData (dbname, tablename) (SELECT DB_NAME() AS ''DB_NAME'', o.name FROM sys.objects AS o WHERE o.name LIKE ''' + @Table + '%'')
						END'

EXEC sp_MSforeachdb @command

SELECT * FROM #ReturnedData

DROP TABLE #ReturnedData

Installing Pi-hole On A Raspberry Pi: Series Index

Raspberry PiThis series is a sub-series of the Adventures with a Raspberry Pi, in which I am going to step through installing Pi-hole on a Raspberry Pi.

If you’re reading this post on azurecurve, this index will automatically update, otherwise you need to check back to the original post.

Adventures With A Raspberry Pi

Adventures With A Raspberry Pi
Building The Raspberry Pi: CanaKit Raspberry Pi 3 B+ Complete Starter Kit
Building The Raspberry Pi: Raspberry Pi Build
Building The Raspberry Pi: Install Operating System
Building The Raspberry Pi: First Run
Building The Raspberry Pi: System Configuration Tool
Building The Raspberry Pi: Enable SSH For Remote Access
Building The Raspberry Pi: Securing the Raspberry Pi
Building The Raspberry Pi: Conclusion
Installing Pi-hole On A Raspberry Pi: What is Pi-hole?
Installing Pi-hole On A Raspberry Pi: Install Pi-hole
Installing Pi-hole On A Raspberry Pi: Change Pi-hole Admin Password
Installing Pi-hole On A Raspberry Pi: Configure Network to use Pi-hole
Using Pi-hole On A Raspberry Pi: Blocked Adverts
Using Pi-hole On A Raspberry Pi: Admin Interface
Using Pi-hole On A Raspberry Pi: Disabling Pi-hole
Using Pi-hole On A Raspberry Pi: Whitelisting a Site
Using Pi-hole On A Raspberry Pi: Update Blocklists
Using Pi-hole On A Raspberry Pi: Maintain Blocklists
Using Pi-hole On A Raspberry Pi: Change DNS Servers
Using Pi-hole On A Raspberry Pi: Connecting With SSH
Using Pi-hole On A Raspberry Pi: Updating the Pi-hole
Using Pi-hole On A Raspberry Pi: Conclusion
What Else Can I Use It For?
Prepare New SD Card For Raspberry Pi OS: Download SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Install SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Format SD Card
Prepare New SD Card For Raspberry Pi OS: Download NOOBS
Prepare New SD Card For Raspberry Pi OS: Copy Files To The SD Card
Prepare New SD Card For Raspberry Pi OS: Conclusion
Installing Pi-hole On A Raspberry Pi: Changing the IP Address
Raspberry PI Update Fails
Check Version of OS on Raspberry Pi
How to Update the OS on a Raspberry Pi
Installing Pi-hole On A Raspberry Pi
What is Pi-hole?
Install Pi-hole
Change Pi-hole Admin Password
Configure Network to use Pi-hole
Using Pi-hole On A Raspberry Pi: Blocked Adverts
Using Pi-hole On A Raspberry Pi: Admin Interface
Changing the IP Address