LINUX skills

I started interacting with UNIX systems before Linux came out. I have never been a LINUX developer though. I’ve had at least LINUX box up and operating for a couple decades. They are handy to have around and useful for odd tasks. The GUI’s have come a long way, but as a UNIX admin told me mumble years ago, “If you aren’t using the command line, you’re doing it wrong.”

If you want to improve your LINUX skills, here is a good, and relatively cheap method. Pick up a Raspberry Pi, load Raspbian LINUX (or Ubuntu is another option), and work your way through “The LINUX Command Line by William Shotts.

I’m going with Raspbian. This way you can learn to fill in the gaps (example: no ‘cal’ command, so it’s ‘sudo apt install ncal’ for you).

Low Power FM Transmission

I decided to muck about with a low power private FM transmission. The goal was to pump my local and streaming music over an open FM frequency so I can listen on a radio, which I have several, including nice Bose Wave radios. The FM transmitter was just under $150 with shipping and taxes. This is a fairly easy to use model. I set the frequency, plugged in the input, and started listening.

I have it plugged into an old Sonos device (the Connect device, which has stereo output jacks). I had playlists with local and streaming music I could easily load and put in a looping random mix. An old smart phone or mp3 player with a mic/headphone jack and power supply would work also.

There is also a long wire antenna included in the package. The documentation clearly states that this is not for use in the United States, since it would boost your range well past the 300 feet allowed by the federal government.

Another useful tool post

As I’ve upgraded various systems over the years, I have a collection of old hard drives.

USB 3.x drive enclosures are a hand tool to have around.
Here are two I like, one 2.5″ and a 3.5″ model.

Handy for backups, file transfer, and the like.

A non tracking DNS

The nice folks at Cloudflare have put a non-tracking DNS in place for free use.  If you were not aware that most ISPs will sell your browsing history, for “marketing purposes”, you should be.

They make a nice, easy to use App for IOS devices.

Still using my Series 1 Apple Watch

It’s been three and half years and I’m still using my first edition Apple Watch (sport) on a daily basis. The screen has a few scratches, but it’s still  functional.

It’s kind of a milestone, since with the release of WatchOS 5, Apple has stopped support for us early adopting nerds.  I’m stuck on version 4.3.2 on this model.  Debating on getting an upgrade running this one till it drops.

Mini-Nuclear Plants

According to the Washington Examiner, the federal Energy Department is working with a company founded by Bill Gates (TerraPower) to develop small, less expensive/more efficient, nuclear reactors to produce electrical power.

These reactors use the molten salt cooling technology, as well as using liquefied sodium for a fuel source.

This is early stages development.  A prototype 1,100 Megawatt reactor isn’t scheduled until 2030.

Certainly a step in the the right direction for reliable, carbon free energy.

Facebook should be no surprise to anyone…

Seriously, if you hadn’t figured out long ago that you were the product Facebook was selling, you were not paying very much attention.

Remember all those pictures you uploaded to Facebook.  If you read the terms of service, you will find that Facebook reserves the right to do anything they want with them, including using them advertising.

Or collect biometric data from them.

Travel Tip

I recently saw a list of travel trips for nerds.  One was that TVs in hotels have USB ports that are typically powered ports, so you can use them to charge your various devices.

Good tip. I would still advise using a USB condom, because like most devices in the IoT world, most Internet capable TVs  lack even basic Cyber Security features.

Sorting pictures

I’ve been backing up my iPhone photos to my Windows 10 desktop using Microsoft’s OneDrive.  The photos are on my local drive as well as the cloud.  The downside is that all the photos, movies, and screen shots are dumped into a single directory, and there are a lot of them.

I prefer to have them sorted by date into directories.  A directory for each year, with sub-directories for each month.  I could do this by hand, but that’s a pain, and I have to remember to do it on a regular basis.  Plus I’ll probably want to do the same for my wife’s iPhone photos.  So I decided to write a python script to scan the camera roll directory, and copy the files to a directory in my photo archive section.  The scrip will create directories if needed and skip files that are already in place.

That part was pretty straight forward. I used os.chdir() to get to source directory and os.listdir() to get the directory contents.  Don’t want to create month directories for directories, just files, so I used os.path.isfile() to filter out non-files, and then check the file extension.  I only want jpg, mov, png, and tiff files.  I use Camera+ most of the time, which produces tiff files instead of jpg files. The png files are screenshots.

I used os.stat() to get the create time, and found files I exported to the camera roll from Camera plus had a create time of when they were exported, not the time the photo was taken. (Once I started having Camera+ dump straight to the camera roll, I didn’t have this problem).

So, I dug a little deeper and found I could get an image created time stamp with a getImageDate() call.  Downside was this didn’t work for png, tiff, or mov files.   So I had to do some extra sorting, and wrote another function to use on just the jpg files. I called the open() function from the Image library, and extracted the exif data using the _getexif() function. This works most of the time, so when it fails I had it return a ‘?’ rather than the time stamp string.  Seeing that caused a fall back to the getImageDate() function.

This extra call to the Image library made the placement of the files more accurate.  I had the base time function return the month as a three character string and the year as a 4 characters string.  This required some basic string manipulation. Those two parameters were added to predetermined destination and passed to a function I had written for another project that checks if directory exits, and creates it if it does not.

Next was to have the program check to see if the file already existed in the correct destination directory.  If it did, don’t bother copying it again. This will make the incremental runs faster and save on unneeded file transfers.

Now I have a functional script that I can set up to automatically run once a week.  Once the files are archived off OneDrive, I can removed them there and on the iPhone is order to free up space.

Update: Source Code

The tricky part is getting the time stamps.  Here are the three routines that handle that.  Wordpress mucks with the spacing, but you should be able to figure it out.

def getImageDate(sPath,file):
    'Get the image created time stamp'
    img = Image.open(sPath + "\\" + file)
 
    tTime = "?"
    imgData = img._getexif()
 
    if 306 in imgData and imgData[306] < tTime: # 306 = DateTime
        tTime = imgData[306]
     if 36867 in imgData and imgData[36867] < tTime: # 36867 =                             DateTimeOriginal
         tTime = imgData[36867]
     if 36868 in imgData and imgData[36868] < tTime: # 36868 =         DateTimeDigitized
          tTime = imgData[36868]
      return tTime
def getTime2(file,sPath):
    'If the file is not a jpg, get the last modified time, which is close enough'
    os.chdir(sPath)
    (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(file)
    year = time.ctime(mtime)[-4:]
    month = time.ctime(mtime)[4:7]

return month, year

def getTime(sPath,dPath,file):
     'Most files are jpg files, so this is the default path'
      month = "Jan"
     year = "1956" #If we see this year, we know there is a problem
     months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
     ext = file[-3:].lower()
     if ext == 'jpg':
          cTime = getImageDate(sPath,file)
           if cTime != '?':
                   year = cTime[0:4]
                    monthNum = cTime[5:7]
                    month = months[(int(monthNum)) - 1]
            else:
                       month,year = getTime2(file,sPath)
    else:
            month,year = getTime2(file,sPath)
    return month,year

Apple Watch

I broke down a bought an Apple Watch several months ago. I went for the Sport model with the basic Sport band. That kept the cost down to $400. The “Watch” model was another $200 with no change in functionality. The only difference would be in the materials. A steel case and a sapphire crystal.
This was not my first wearable. I had a Fitbit Force, which was recalled. I was happy with the fitness functionality & the iPhone software package. My opinions on the band are well documented.

 So far, I’m more pleased with the Apple Watch. It is much more versatile, and has comparable fitness tracking functions.  

 As a watch, the Apple Watch is actually usable. The software does a good job of displaying when I raise my arm and rotate the watch upward. This is a vast improvement over the Fitbit, where I had to press a button (flashback to the early digital watches). My one nit is that the Apple Watch software is calibrate for wearing it on the outside of the wrist. I wore my watch on the inside of my wrist for decades, and the Apple Watch wasn’t happy with this. This limitation has me back to wearing my watch on the outside of my wrist. 

 There are ten watch faces loaded, each configurable. I’ve been switching around on an irregular basis. My preference is for traditional analog watch faces. This includes the Mickey Mouse option. The watch faces are configurable for color and options like day, date, timer, stop watch, fitness rings, and battery life.

 In all, I’m happy with it. The fitness function is what I use the most (outside of actually using the watch to tell time). I really like the message and phone preview functions. Being able to review/preview messages and calls and deal with most of them quickly is more of a feature that I thought it would be.

 Watch OS 2 is due out next week. I’ll post my impressions after I play around with it a bit.