Saturday 22 June 2024

Mounting an external FAT32 USB drive with FreeNAS

Mount the FAT32 disk

dmesg | grep da1
mkdir /mnt/usbhdd
mount_msdosfs -o large /dev/da1s1/ /mnt/usbhdd

rsync -recursive --ignore-existing --human-readable --progress "/mnt/usbhdd/Matthew Potts iPhone 12 Photo Backup/" "/mnt/Data/My Media/Matthew/Photo Backup/"

To copy a file pattern:

rsync --include='**/*.MOV' -recursive --ignore-existing --human-readable --progress "/mnt/usbhdd/Matthew Potts iPhone 12 Photo Backup/" "/mnt/Data/My Media/Matthew/Photo Backup/"

To count files:

find . -maxdepth 1 -type f -print | wc -l

Tuesday 11 June 2024

Syntax Highlighter

 https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Brushes-and-Themes#official-brushes

Monday 10 June 2024

Syncing Files from Mac iOS to Freenas

Pre-requisites

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install sshpass

brew install sshpass

Synchronisation

rsync -av -e 'sshpass -p <password> ssh -oHostKeyAlgorithms=+ssh-dss root@freenas' ./* <destFolder>

FreeBSD utility commands

list the number of files in the directory

ls -1 | wc -l

Display the subfolder usage

du -h

Recursively find files with the name

find . -name IMG_0003.JPG

Thursday 28 March 2024

Audio mutes when you switch devices in Windows 11

 -Go to Control Panel

-In Control Panel, select Large icons from the View by drop down menu.
-Select Sound.
-Select the Playback tab
-Right click the Speakers and click Enable.
-Right-click it again and select Set as Default Device.
-Right click Speakers and click Properties.
-Click on Advance Tab
-Uncheck the box to "Allow Application to take exclusive controls on this device"
-Click OK.

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" {} \;