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