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 = + "\\" + 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'
    (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]
                       month,year = getTime2(file,sPath)
            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.

Building the better Macbook dongle

As I have said before, the single USB C port is the weak point of the new Macbook.  I’m not overly impressed with the $80 dongle solution from Apple either.

The nice folks at Nonda have slicker solution, at the same price, but only for about another 24 hours.   After the Kickstarter campaign is over, it’s going to run about double the price and still, IMHO, worth it.  The Apple dongle gives you a USB C port for power only, a USB 3.0 port, and an HDMI port.  The Hub+ gives you the following:

  • 2 USB-C ports
  • 1 SDXC card reader
  • 1 mini DisplayPort (mDP 1.2 video output, 4k displays at 60Hz refresh rate)
  • 3 USB-A 3.0 \ charging ports
  • Built-in lithium ion battery to charge ANY phone

Display Port keeps the price down (HDMI needs licensing) and mini DisplayPort to HDMI cables are easy to get.  If you sprung for a new MacBook, grab one of these as well.

The new MacBook

I’ve been reading the specs on the recently announced Macbook.

It certainly is a very slick bit of technology.  Apple poured a lot of research into creating this ultra thin notebook.  Keyboard, display, batteries, motherboard, and the port list, all redesigned nearly from scratch.  About the only thing they didn’t redesign was the headphone jack.

 All this new technology didn’t come cheap either.  The low end one runs $1299.  Compare this to a 13″ Macbook Air with a comparable configuration .  The biggest difference is the MacBook’s Retina display, but the Air wins on battery life, processor, and ports (two USB 3, one Thunderbolt 2, power, SD, and a headphone jack).  Oh, and the Air weighs about a pound more.

 Apple does have a solution for their “all in one” USB-C port, in the way of a $80 dongle that provides a trio of ports (HDMI/USB 3/USB-C).  So now you can charge your macBook (via USB-C),  and attach a USB memory device at the same time.

 Personally I love the idea of USB-C, but I also like doing things in parallel.  This also brings Apple’s commitment to the Thunderbolt port into question.  A lot of third party manufacturers have sunk a lot of capital into Thunderbolt based devices, especially for secondary storage.

 My goto laptop is my 13″ MacBook Air, which I’m not planning on replacing anytime soon.  Ya, the batteries are on the downside of the curve, but Apple can replace those for approximately $150.  That is a lot cheaper than purchasing a new laptop I don’t need (I do the heavy computing and storage tasks on my home build Windows system).

 Of course the serious Apple fan nerds are going to buy a Macbook as soon as they are out.  My plan is to wait for the next rev.  I would like to see a next gen MacBook Pro with Macbook technology.  High end CPU, and a Thunderbolt and SD slot go with the USB-C and headphone jack.

 Disclaimer: I’m talking about serious Apple fan nerds, at least bigger ones than me.  I just have an iPhone 6 Plus, an iPad Air, and two MacBooks.