0 Comments

There are a lot of guides on how to install Pi-hole on a pi. I just used the win32DiskImager to put Rasbian on it and I did put an ssh.txt file on the SD card to enable SSH. I just had to plug it in the pi and wait for it to show up on the DHCP list of my router so that I knew the IP to ssh to.

I have an archer c7 router which has “DNS rebind protection” so I could not change the DNS to the local IP address.

In order to fix it I had to go to the Archer web interface and follow these steps:

Add in dhcp –> dhcp settings, set the primary DNS to the local ip

in the dhcp –> address reservation “add new “ paste the mac address which you can find in dhcp –> dhcp clients list.

and the local ip which the pi has. This makes sure that the next reboot, the pi/dns server will have the same lan IP.


By the way, I had an issue with the ‘ftl’ part in the installation of pi-hole

I fixed it with : `sudo nano /etc/resolv.conf`

add a line with: `nameserver 8.8.8.8`

That is the google dns and that makes sure that there is a know dns so that the installation can lookup ip’s and continue.

Save the .conf file and run `sudo bash /etc/.pihole/pihole –r`


That will repair the installation and the FTL part will succeed now that there is an dns entry to the google dns in the resolv.conf


Good luck!

ps. please let me know if you know a way to block youtube ads. No browser plugin, but a pi-hole solution please.

Post on LinkedIn
0 Comments

When you have a nice .Net core solution and want to see the code smell and technical debt, you can analyze it with SonarCube

SonarQube

I started by browsing to the docker hub and used a container:

docker pull sonarqube

docker run -d --name sonarqube -p 9000:9000 sonarqube

The default username is ‘admin’ and the default password is ‘admin’ so once it is started you can head over to http://localhost:9000 and login. Configure your project there and copy the key/hash

You can get the SonarLint extension for Visual Studio and Visual Studio Code and link it to the local SonarCube server.

You need this one time installation of a global tool:

dotnet tool install --global dotnet-sonarscanner --version 4.3.1

And then:

dotnet sonarscanner begin /k:"project-key" 
dotnet build <path to solution.sln>
dotnet sonarscanner end 

Wait a minute after it finishes so that the SonarCube server has some time to process the results. Check the dashboard again to see the smell, bugs and tech debt. This does help you verify if you are still coding SOLID.


Happy coding!

Post on LinkedIn

As you have noticed, you need Visual Studio Enterprise for live unit testing, or Jetbrains Rider, or some Visual Studio Code “hacks”. Here is a method to have coverage of .Net core with a global tool:

Daniel Palme has a global tool version of Report Generator. You should install it once with:

dotnet tool install -g dotnet-reportgenerator-globaltool

dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools

You can then run it with `reportgenerator` so after building I run:

dotnet test --filter FullyQualifiedName~UnitTests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*Test*]" /p:ExcludeByAttribute="GeneratedCodeAttribute"
reportgenerator "-reports:**\coverage.opencover.xml" "-targetdir:C:\Temp\Reports\" "-reporttypes:HTML"
Start-Process -FilePath "C:\Temp\Reports\index.htm"

Of course you can go to the project properties and add the three lines of powershell to a file in the root of your solution and add to the build events tab as post-build:

Powershell -File "$(SolutionDir)nameOfPowershellscript.ps1"

Good luck!

Post on LinkedIn

Recently the Raspberry Pi 4 was announced, But I am currently using my rpi 3test_1 and want to run Rabbit MQ on it in Docker. So I used these two commands to get it to work and I just wanted to share it:


sudo rm /etc/apt/sources.list.d/docker.list;

curl –sL get.docker.com | sed ‘s/9)/10)’ | sh

If you would like to use Docker as a non-root user you should add your user to the docker group:

sudo usermod –aG docker pi

To get Rabbit MQ (which has arm container) on the pi with a management web interface run:

sudo docker run –d –hostname my-rabbit –name some-rabbit –p 15672:15672 –p 5672:5672 rabbitmq:3-management

Then get the ip of the docker container with (but since you added the ports in the previous command, this step can be skipped):

sudo docker inspect –f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ some-rabbit

Then you can launch a browser and go to http://thatipaddress:15672 and login with 'guest/guest'. If you did not lookup the ip of the container you can use the ip of the pi because you opened container ports when running it.


8850828555_df7c7bd300_b


Good luck!

Post on LinkedIn
0 Comments

My previous blog post was about my history with mobile phones. How I have switched from Windows Mobile to Android to Windows Phone and back to Android. I have had a temporary car in the beginning of this month. It was a highline Volkswagen Polo which contained the native Volkswagen RS multimedia system. Android Auto worked perfect. Of course I had to download the .apk myself on the phone. But there are plenty of guides explaining that. I was really excited that my new car (Volkswagen Golf) photowould contain a Pioneer system. It was the Pioneer AVIC-EVO1-G72-BBF which has Apple Carplay and Android Auto. I connected my phone with a cable and…. nothing. So I called the Volkswagen dealer and they had to look into it. I got a call back that I would not have that option which seemed weird to me because it was the top most feature on the Pioneer website. After a few days my wife connected her iPhone to charge it and it launched Apple Carplay. I was blown away and took a look at the manuals that I found in the dashboard glovebox. In the installation manual it mentioned on page 8 that you had to connect a USB to a specific port on the back of the Pioneer. So that would explain that Carplay works and Android Auto did not. So I mailed and called the dealer again and they told me to bring the car in.

integration-manual

It took them over three hours to switch the cable on the back and test it. They could not get it to work. They even called Pioneer support and got an answer that it was not supported and would not work. They retrieved a brand new Pioneer system from the warehouse and it was largely displayed on the outside of the box that it would have Android Auto support. So a lot of effort and still no Android Auto. But at least the radio was connected to USB 2. I searched a while online and found this link. I thought it would not affect me because I do not have a Pixel. But I do have USB-C (Nokia 8) and when they delivered the car, there was an USB extension cable in the glovebox so I decided to give it a try. And it finally worked. So buying a short USB-C did not help me, because due to an issue on Pioneers end, I will always need an extension cable Confused smile

Next step: try to update firmware of the adapter and the system itself. Currently I just keep getting incompatible USB stick. Even when it’s formatted as FAT32 filesystem and only has the firmware file on it in the root directory.



Post on LinkedIn