Updating Jessie Debian in 2022

I had this old Virtual machine running Jessie.  Turnkey Linux/Debian root@TurnkeyLamp apt/sources.list.d$ uname -a Linux TurnkeyLamp 3.16.0-6-amd64 #1 SMP Debian 3.16.56-1+deb8u1 (2018-05-08) x86_64 GNU/Linux In order to update add check-valid-until=no to the archive Debian repository deb http://archive.turnkeylinux.org/debian jessie main deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main deb http://httpredir.debian.org/debian jessie main deb http://httpredir.debian.org/debian jessie contrib # deb http://httpredir.debian.org/debian jessie non-free Stack exchange link

Python script to find extensions in directory

Here is a way to find out what type of windows extensions.  pictures in this case. Count how many of each.   import os ext_count = dict() my_root = r”C:\Users\jonallen\Pictures” # some dir to start in for root, dirs, files in os.walk(my_root): for file in files: pathname, exten = os.path.splitext(file) if exten in ext_count.keys(): ext_count[exten] += 1 else: ext_count[exten] = […]

Bash array operations – short table.

arr=() Create an empty array arr=(1 2 3) Initialize array ${arr[2]} Retrieve third element ${arr[@]} Retrieve all elements ${!arr[@]} Retrieve array indices ${#arr[@]} Calculate array size arr[0]=3 Overwrite 1st element arr+=(4) Append value(s) str=$(ls) Save ls output as a string arr=( $(ls) ) Save ls output as an array of files ${arr[@]:s:n} Retrieve n elements starting at index s

Bash – using mailx command to parse subjects

Problem:  It appears that the default mail -H appears to truncate the subject.  Grep fails to find text pass the email address. Fix:  Use Headline to format   echo ‘f 1-$’ | mail -H -S headline=”%>%a%m %20f %16d %3l/%-5o %i%150S” | grep -i ANZ535 | wc -l Here is what the issue looks like [ec2-user@jibsheet data]$ echo ‘f 1-$’ | […]