Tuesday 23 January 2024

ASP.NET Development Certificates in Traefik

The ASP.NET Core HTTPS development certificate can be created with the dotnet dev-certs command.

It is found in Certificate Manager (User Certificates, NOT Local Computer) under the Personal Certificates and Trusted Root Certification Authorities nodes.

You can search for it by it's SHA-1 hash (known as the thumbprint in the Certificate Details tab).

To export the certificate for use in a Traefik Reverse Proxy, type:

dotnet dev-certs https --export-path aspnet.crt --trust --format Pem --no-password

and follow these instructions to add it to Traefik:

https://www.andrewdixon.co.uk/2020/03/14/using-https-certificates-with-traefik-and-docker-for-a-development-environment/

Wednesday 10 January 2024

CSS Selector syntax in Chrome

 

Chrome allows you to search for elements using CSS selectors or XPath.

Puppeteer uses 

  1. Type selector 
  2. CSS Selector
  3. Class selector 
  4. ID selector 
  5. Attribute selector 

xpath selector

Find the anchor within the tdtd a

XPath

Find element with the text//p[text()='Asset']
Find parent of the element with the text//p[text()='Asset']/..

Sunday 24 December 2023

FreeBSD commands


Find the date of modified files
https://forums.freebsd.org/threads/a-script-to-get-date-time-of-file-modification.12121/

find . -type f -exec stat -t "%Y-%m" -f "%Sm %N" {} \;

Saturday 23 December 2023

Setting the DHCP domain name on a Draytek router

To set the domain that all DHCP clients become connected to; read the article:

https://faq.draytek.com.au/2011/12/14/how-do-i-set-the-domain-name-issued-by-the-dhcp-server/


It is performed by issuing a command on the telnet interface:

sys domainname wan1 .local

Sunday 17 December 2023

Emulator Summary

Z80 Spectrum

Zesarux - a good Windows (and Linux) Z80 emulator with a wealth of command-line options. Good for testing Z80 Assembler.

Zero Emulator - a good Z80 Spectrum emulator, written in C#, that runs on Windows.

x86

Qemu -  a good emulator that runs on Linux. Good for x86 assembly.


Friday 15 December 2023

The role of launch.json and tasks.json in VSCode

Launch.json describes the activity that takes place when the debugger is launched or the program is started.

It can rely upon a task defined in tasks.json - see "preLaunchTask".

You can reference variables defined in settings.json.

You can build up a dependency tree of tasks using "dependsOn".

If you want to launch an application such as an emulator as part of the debugger - and leave it running - then you define it as a background task. But it is necessary to set a problem watcher for it to work.

You will need to manually close the task in VSCode when you are done debugging.

Sunday 12 November 2023

Docker cheatsheet

Attach to a running container:
docker exec -i -t <container> /bin/bash

Run networking tools:
docker run -d praqma/network-multitool --name netshoot
docker exec -it netshoot /bin/bash