Dedup script v0.2

Update 20220510

Sorting out my fileserver, i had the need for a deduplication script.
Many files i’ve been copying from backup, clouds mobile devices and workstation. Inevitable to get many copies.

Below script walks a directory, using locate it tries to find files with same name. Using a md5sum it wil check if it is the same file, when found a simular file it stops searching, removes the one from the check-directory and checks the next one.

#!/bin/bash
# Copy this script to your to clean directory, 
# when you got a copy on your fileserver from this script
# then the copy in your clean dir will be removed also.
# Dont want that? change
# find -type f | 
# into
# find -type f | grep -v <nameofthisscript> |

# dont is current directory, skip these from locations
dont=$(pwd)
# Never start in /mnt ? uncomment below
# echo "$dont" | grep "^/mnt" && ( echo "start in tank" ; exit )

find -type f | while read file ; do
        filemd5=$(md5sum "$file" | cut -f1 -d" ")
        basenamefile=$(basename "$file")
        echo "searching $basenamefile"
        locate -i "/$basenamefile" | grep -v "$dont" | while read location ; do
        if [ -f "$location" ] ; then
                locatedfilemd5sum=$(md5sum "$location" | cut -f1 -d" ")
                if [ "$filemd5" == "$locatedfilemd5sum" ] ; then
                        echo "found same md5sum at $location"
                        rm "$file"
                        break
                fi
        fi
        done
done
# Remove empty dirs?
# find . -type d -empty -delete

Locate can be slow, sometimes it is better to put the locate DB in memory of on another fast storage system.

mkdir /ramdisk
mount ramfs -t ramfs /ramdisk/
cp /var/lib/mlocate/mlocate.db /ramdisk/ 

# change above script locate command
locate -d /var/lib/mlocate/mlocate.db -i IMG20191123.jpg

And remove empty directories?
Add below at the end of the script

find . -type d -empty -delete

C64 and SD2IEC

As posted before ( https://www.henriaanstoot.nl/2022/04/09/c64-plus-drive-running-again/ ) i’ve got a little gadget which emulates a C64 diskdrive.

The SD2IEC connected

I’ve been using this for a while now, and i’m really impressed by it. It just connects to the Serial Din of your C64, draws power from the Cassette port. … And even looks like a mini drive!

I’ve been converting Disks to images as well as runnig previously converted D64 images on a real C64 again.

Also the internet provides loads of images to run again.

Converting and running:

  • For real floppy to image i used a empty image file. Made my real original drive device number 9, and used Dracopy (also below)
  • Image running on your real C64, just put a D64 disk image on your SDcard.

There is a disk selector and run program you can use. (See below)
Also you can use the buttons for disk swap/change.

FB64 tool to select a D64 image to start
Dracopy

MPF-1B – Z80 Training kit

One from my collection: A training kit for learning to write machine language.

Update: 20220514 – Save and Load a program
Update: 20220829 – Mad-1 computer runaway movie

A little example, life programming a little machine code.

ORG 1800
0E 80              ; LD C,0
21 C0 00           ; LD HL,00C0
CD E4 05           ; CALL 0X05E4
0E 01              ; LD C,0
21 00 01           ; LD HL,0100
CD E4 05           ; CALL 0X05E4
C3 00 18           ; JMP 0X1800

Found this cameo in the movie “Runaway”

Using a tape and COMX-35 cassette player, i can store and retreive programs

Old Skool saving a program
And loading a program

Above i mentioned a Runaway Cameo .. well there is a MAD-1 system cameo also. (Which also i in my collection)

GNS3 Testing with Mikrotik

All my Mikrotiks are running production, so i need a virtual environment

sudo add-apt-repository ppa:gns3/ppa
sudo apt update                                
sudo apt install gns3-gui gns3-server

git clone https://github.com/GNS3/ubridge.git
cd ubridge
sudo apt-get install libpcap-dev
make 
sudo make install

reboot

nohup gns3server &
gns3

edit > preferences 
qemu 
qemu vms
New and select chr-6.48.6.img

New project > select vm

NOTES

ping not working? use even number interfaces (8)

garbled output? .. Answer (Y/N) with N when starting telnet. Or turn off and on again. 

Surströmming

Surströmming as it should be eaten.

As the tin is pressurised, open the surströmming in a basin of water. Wash it, gut it, and wrap it in buttered tunnbröd, a type of sweetened flat bread, with sour cream, potatoes and onion. Accompany with beer.

Didn’t have tunnbröd, used another flat bread.

I liked it enough to have two portions, would eat again.

Oak island

I was about 16 when i first read about Oak Island, it was the first book posted below (it’s from 1979 and i still got it, it already was a few years old before i got it.). It was mysterious and about a place that still existed and i never forgot about it in all those years.

I even wanted to build a model to understand how it could have worked, with the drain system and the ‘boobystraps’.

In 2014 a series started on History Canada about trying to solve this mystery.
I still watch it whenever a new episode is posted.

A few years back i’ve been playing with Unity and Unreal. I’m really a beginner, but it would be nice if some community effort was made to get a Oak Island in a game engine where you can explore some of the things they found.

Another book i got some years later.

C64 Tape found

Tape i found yesterday

I found a cassette tape yesterday. I was really curious .. dont remember making this.

Connected a tape drive to my C64 and tried to get the damn thing to read the tape.

Commodore tape drive

Got stuck on READY’s with no programs. Being a little rusty into using C64 i tried:

  • L+shiftO
  • shift break
  • LOAD”$”,8
  • LOAD”$”,8,1
  • LOAD”*”,8

Maybe there was a turbo loader used?
Maybe my tape unit wasn’t aligned?

Tried multiple tape units, couldnt find a Tape Head Alignment Program like:

So i used another method to see if data was recoverable.

Using UberCassette or AudioTap

Above are two examples with uses recorded wave files and calculations to generate the original written bits!

Recorded the tape to mono wav file using a generic linux recording application.

ubercassette taperecording.wav mytape.tap 

Started to build a Drawbridge

For my amiga i started to build a floppy disk reader/writer using a arduino.
I found a superb project by rob smith.
It uses only a arduino pro and a FTDI USB to serial breakout board, to raw read and write disks.
I wanted to convert my own created amiga disks to PC image to use in a emulator like vice.

http://amiga.robsmithdev.co.uk/instructions/promini

I’m not going to copy his website, with all instructions. Only my personal experiences.

Starting with … don’t use a IDE cable, and start soldering .. it is a diskdrive cable .. connector doesn’t fit! ..

Getting components and flashing arduino … no brainer

"If something is worth doing, it's worth overdoing."