Posts

Showing posts with the label automation

Bash and Compact Disc(CD) backups

 On the previous post, I went over how to automate copying floppy disks with only providing a Title (identifier) for the image created. This script is smiliar, but uses HandBrakeCLI to query the disc in the drive for the Chapters/Titles.  In this case, we are only querying the chapters in the Title 0 on the disc.  HandBrake has a GUI to do this manually. #!/bin/bash NAME="UNKNOWN"; function wait_for_cd_dvd_mount() { # Query the CD/DVD Drive to see if the disc is detected blkid /dev/sr0 2&>1; last_run=$?; # If blkid's exit code is not 0(Zero), then the disc detected while [[ $last_run -ne 0 ]]; do echo "Device not mounted. Waiting..."; sleep 1; blkid /dev/sr0; last_run=$?; done } function extract_videos() { # Query all CD/DVD Titles via HandBrakeCLI (-t 0 is to scan all titles) for TITLE in $(HandBrakeCLI -i /dev/sr0 --no-dvdnav -t 0 2>&1 | grep title | grep -v...

Bash and mass backup of floppy disks

 While dealing with cleaning out the family house, I have been tasked to backup all the pictures from floppy disks (3 1/2") and Compact Discs(CDs).  Thankfully I still had both a CD reader and a 3 1/2" Floppy disk drive to read them. As any sort of media goes bad over time, I first had to copy the contents onto my local drive before extracting and inspecting the contents of each.  This brings me to a problem with the 3 1/2" Floppy disks, as most of them had read errors on them.  This caused headaches when attempting to using a the standard COPY command. This is where I turned to my trusty friend ddrescue*.  This would allow me to copy the data into an IMG format, while retrying to all errors that come up while reading from the disk.   This brings me to attempting to automate the process.  A quick bash script allowed inputting of the title of the disk, along with looping indefinitely. This is a pretty simple script that requires 'sudo' access to ru...

Why Cap'n?

First of all, I am a rambler.  I type what comes to mind, when it comes to mind.  This is a part of my neuro-spiciness. On with the show. Cap'n (aka captain) has been a nickname for a long time.  Every new position I take, someone ends up calling me captain.  I normally end up taking the reigns of the project and give it structure. It first started when I worked in a well known franchise fast food fish restaurant.  Starting as a night fry cook, through dinner rushes and closing 5 days a week.  This provided me just enough free time to learn all positions in the store, and fill those positions as people needed days off.  This includes becoming an shift manager and then acting assistant manager of the store while the store general manager was replaced. If you have worked in any fast food restaurant using deep fryers, you know that oil gets everywhere.  To keep the store in a hygienic state deep cleans were required every few weeks.  The deep cl...