Thursday, July 16, 2015

How to view OS X hidden (unix) folders using TextWrangler

I thought there was a way to view hidden OS X Unix folders like bin, etc, home, Network, private, sbin .vol etc using Bare Bones Software's free TextWrangler but I couldn’t figure out how to do it. I wondered if this now required BBEdit, but the comparison chart didn’t mention anything.

It’s in the manual. Yeah, TextWranger, which is free, not only has Help file, it also has a (superb) manual:

Opening Hidden Files Turn on the “Show Hidden Items” option in the Open dialog to display hidden files (including both files whose invisible attribute has been set, and those whose names begin with a period) or files from a folder which is normally hidden by the system.

Screen Shot 2015 07 16 at 11 28 17 AM

When I turned it on I had to navigate the folders to force a refresh, but then they all showed.

I’d been hunting around for a preference settings, but it’s part of the Open dialog. I’ve gotten so used to utterly undocumented applications that I didn’t think to look for a manual. Google was no help … but maybe it will be after I post this.

Wednesday, July 15, 2015

Photo slide show screensaver on Mac - network share and Yosemite's reversion to default. A workaround.

I have never been happy with how OS X handles anything to do with file shares, I think Windows does a much better job.

Which, if you know anything about Windows network services, must mean I’m a raving loon. How could OS X be worse than that?

I can’t explain it. My experience is that, for no good reason, when requesting a file or folder from an OS X server, things often fail. Disabling sleep and hard drive rest helps. [4]

So it’s not surprising that using a server based photo collection with the OS X Photo Slideshow screensaver has always been problematic. I’ve really only had good success with local stores, or using local Aperture or iPhoto as the source.  I assume something hangs and OS X switches to the default photo slideshow (national geographic) screensaver, losing all memory of the screensaver you want to use.

This isn’t new, but with Yosemite it’s seems to have gotten worse [1].  Every time I opened my brand new MacBook Air on 10.10.4 I was back to National Geographic. Which is pretty, but I’ve come to hate it.

Happily, this problem is aggravating enough that there’s now a fix, which is best described in an AskDifferent post by “Flavin” (he found bug in 10.10.1, he both asks questions and answers it. I love when people return to add their answers.) The process goes like this:

  1. Set up your screensaver as desired.
  2. Run a terminal command to see the preference file values:
    defaults -currentHost read com.apple.ScreenSaverPhotoChooser
  3. Copy values into a script to write them back, where script is of the form
    defaults -currentHost write com.apple.ScreenSaverPhotoChooser … 

This is what my script looked like based on Flavi (emphases mine):

#!/bin/bash
defaults -currentHost write com.apple.ScreenSaverPhotoChooser CustomFolderDict -dict identifier \"/Volumes/ss/ss\" name ss
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath \"/Volumes/ss/ss\"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedSource -int 4
defaults -currentHost write com.apple.ScreenSaverPhotoChooser ShufflesPhotos -bool true

My images are in a network share /ss/ss [2]. Note in a Bash script like this quotes are escaped with slashes, hence \” to contain the string.

At this point I had the fix, but I got stuck with following the usual practice of storing it in OS X’s hidden unix file structure. TextWrangler wouldn’t show them to me [3]. So instead I put the script into a standard OS X Folder (Documents\Bash is my name) and used my favorite tip of the year: How to run a Unix shell script from the Mac Finder | alvinalexander.com. I changed the .sh extension to .command and now it’s double-clickable. No need to wrap it in AppleScript or death with BSD Unix PATH, etc.

THEN I discovered my script only worked when the remote network share was mounted. If it wasn’t mounted OS X wouldn’t mount it for me; the script would run as above but OS would fail to find the volume (“ss”) and would return to the dreaded Nat Geo. So I revised the script to mount as needed (I had a devil of a time getting mount_afp working because I didn’t understand I had to create a directory first in Volumes to be the mount point/node), and I added code to set Screensaver to Photo Slideshow borrowed from another reference.

#!/bin/bash

## Mount remote volume if not already mounted
if [ ! -d /Volumes/ss ]; then
mkdir /Volumes/ss
mount_afp afp://Thunderpaws._afpovertcp._tcp.local/ss /Volumes/ss
fi

## Set Screensaver to Photo Slideshow
/usr/bin/defaults -currentHost write com.apple.screensaver 'CleanExit' -string "YES"
/usr/bin/defaults -currentHost write com.apple.screensaver 'PrefsVersion' -int "100"
/usr/bin/defaults -currentHost write com.apple.screensaver 'idleTime' -int "300"
/usr/bin/defaults -currentHost write com.apple.screensaver "moduleDict" -dict-add "path" -string "/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver"
/usr/bin/defaults -currentHost write com.apple.screensaver "moduleDict" -dict-add "type" -int "0"
/usr/bin/defaults -currentHost write com.apple.screensaver 'ShowClock' -bool "false"
/usr/bin/defaults -currentHost write com.apple.screensaver 'tokenRemovalAction' -int "0"

## Set location of photos
defaults -currentHost write com.apple.ScreenSaverPhotoChooser CustomFolderDict -dict identifier \"/Volumes/ss/ss\" name ss
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath \"/Volumes/ss/ss\"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser LastViewedPhotoPath \"\"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedSource -int 4
defaults -currentHost write com.apple.ScreenSaverPhotoChooser ShufflesPhotos -bool true

## Removes the .plist LaunchAgent from inside the User Launch Agent Folder.
## rm -f ~/Library/LaunchAgents/set-screensaver.plist
## killall cfprefsd

exit

Eventually I may take app.net@jws’s advice and use Watchman to fully automate a fix, but I kind of like firing this script off every time Yosemite zaps my slideshow of 100 years of family pictures.

- fn -

[1] Maybe related to this Mavericks change? It’s not the only thing that’s gotten worse over the past 1-2 years of course. My current explanation for the Hot Mess that is Apple software 2015 is that during the Jobs era and shortly thereafter Apple incurred massive technical debt and they are slowly and painfully trying to fix it, while shedding expertise like water off the proverbial duck’s back. An even more worrisome possibility is that Apple is now a typical corporation.

[2] Why the redundant ss? Historic reasons. The network share is a thumb drive sticking out of the back of a Time Capsule, so there’s no authentication needed.

To get the path of a folder just drag the finder icon into Terminal and the path will render.

[3] I’ve run into this before I think, but I can’t remember if there’s a setting I’ve missed or … what. Maybe it’s a BBEdit only feature, but it doesn’t show up in the TextWranger vs. Bbedit comparison page. Google was no help at all.

[4] I wonder if it’s because OS X often stores references to “mount points” (Volumes/…) but mount points have to be associated with network addresses, and those are not stored. Note my script should really check for the network access, not the existence of the Mount directory, but I don’t yet know how to do the former.

References

 

iOS 8.4: Spotlight not showing Bing results? Your email index may be corrupted.

Recently Spotlight stopped offering me Bing results (or Wikipedia). Power cycling the phone didn’t help. I tried the usual Spotlight fix in Settings:General:Spotlight of turning off all search results, exiting settings, confirming searches return nothing, then turning them back on. Didn’t work this time.

After a bit of experimentation I found Spotlight worked as long as I didn’t include mail search. Not unexpectedly, when I tried searching within Mail.app search would hang for at least 30 seconds (when I gave up). 

The fix was to remove all of my email accounts entirely - it wasn’t enough to simply turn mail off. I then restored them [1] and now search works within Mail.app and also within the Spotlight UI — including Bing results.

I assume Spotlight performs searches in sets, and when it got to the set containing Mail it got hung up, returning nothing and blocking returns from later sets in the execution pipeline.

I decided I don’t like getting Mail results back in search anyway, so I turned them off. I do like being able to search Mail, so the fix was important.

My spotlight enabled searches are, in order:

  • Applications
  • Contacts
  • Events (I use Calendars 5.app primarily, but I enabled Google Calendars in Calendar.app to support Event search. Sadly iOS still needs Google’s ugly SyncSelect hack. OS X doesn’t need it, so I blame this one on Apple and their (assumed) monstrous technical debt problem.)
  • Spotlight Suggestions
  • Bing Web Results (also Wikipedia)

I only use iOS Reminders for short term things (use ToDo.app) so I omitted that. Similarly I only use iOS Notes for transient items, so I omit that too (use Simplenote.app, despite it’s #$@$@ tag limitations). Messages, Voice Memos, Music, Podcasts, Videos and Audiobooks never made sense to me as items to include in Spotlight search.

[1] I had to redo my settings of course, including digging into preferences to make Google Delete when it damned well should Delete. I set it only save the last two weeks of email to reduce burden on the evidently unreliable indexing engine.

Sunday, July 12, 2015

Facebook event sharing - July 2015

Facebook Events (calendar items) exist in some sort of Facebook twilight zone. Neither completely abandoned, nor entirely useful. You can, for example, subscribe to an Event stream in Google Calendar. That’s a useful move.

Even public events are rather hard to share however. Facebook’s limited (usually obsolete) official documentation suggests copy and paste the URL. As of today this also works...

  1. View Event and choose Join.
  2. Look for the (mislabeled) Invite drop down - select it.
  3. Choose Share Event.

Monday, July 06, 2015

iOS - apps showing multiple times in search?

This is an easy one.

Do an iOS Spotlight search, see an app multiple times… means Spotlight needs to be rebuilt.

Go to Settings for Spotlight, uncheck all. Exit. Try search - nothing happens. Now add back applications, etc.

Wednesday, June 24, 2015

Porting an H2O Wireless (AT&T MVNO) to AT&T

(Original 6/24/2015, updated 64/28/2019 when ported last number to AT&T)

When I last wrote about H2O Wireless, our kids dirt cheap mobile carrier, I mentioned that our daughter’s texting costs were bringing the monthly H2O fee close to the $25/month device fee on Emily and my AT&T account. 

The move has come sooner than I’d expected, because in the process of debugging her iPhone [1] with some SIM swaps we lost all data access. I tried contacting H2O wireless to see if they had a fix, but I couldn’t get through. I didn’t try too hard — the H2O web site is increasingly clear that prepaid plans aren’t supposed to have data access. I figured we were living on borrowed time.

Our first attempt at porting failed though. I did it at an AT&T retail store; they had the impression we couldn’t port an AT&T MVNO number to AT&T because the porting software wasn’t designed for that use case.

i was going to let things lie for a bit, but then my daughter started getting 2-3 AT&T texts a day demanding she finish her porting. When I called up to stop the bloody things I was transferred to the “porting department’, where I ran into one of those miraculous people who actually know how things work.

Turns out the problem was not the MVNO to AT&T port. The problem is that nobody knows what the account number is for an H2O Wireless prepaid account. H2O’s correspondence and web site imply it’s either the phone number for the H2O phone or my phone number associated with the master account and credit cards.

Wrong. The account number is the SIM Card number, known to iOS settings or iTunes as the ICCID number. In addition you need to know a “passcode”, which is typically the last 4 digits of the ICCID number (supposedly customers can change this, perhaps from an H2O SIMd phone).

An AT&T porting center expert told me when the port was authorized, then I went back to an  the AT&T store to complete the process (create a database relationship between IEMI (phone ID) and ICCID (SIM card ID)) and pick up a new SIM. Our daughter’s phone service continued until the AT&T rep complete the process. There are a few things you need to do before completion:

  • Delete the H2O profile if you have one. This is hard to find in iOS 8; it’s in Settings:General then “Profiles”. You need the H2O profile to get data on an H2O SIMd phone, but if you don’t remove it you won’t have data posts transfer to AT&T. (You can remove it after transfer and you’ll get data.)
  • Log out of Message and FaceTime — these have their own authentication mechanism and they may get confused by the SIM swap.
  • If you’re using Google Voice for voicemail remove it. (Restore post switch or just use iPhone Visual voicemail — if Google’s directions don’t work see this page.)

On our no-contract mobile share account we were charged $15 $30 for adding the phone [Update: cost doubled between 2015 and 2019]

After you confirm voice and data services on the newly activated time enable Message, FaceTime and setup visual voicemail.

[1] An old 32GB iPhone 4S we fondly call the “DemonPhone”. It has been my primary tech support pain for years — possibly due to occult hardware issues, but also due to Apple’s bugs, DRM flaws, and hacked together online services. H2O hasn’t necessarily helped; adding a low quality and low service mobile carrier to a buggy phone puts the D in Demon.

Update 8/3/2015

Ting.com has a priceless resource on phone number porting, including H2O wireless.

  • account number is the ICCID of the SIM card
  • To find account number you need to call H2O wireless. Try 800-643-4296. They will provide you with the secret account number, it’s not available otherwise. You’ll need to provide the last 3 numbers dialed.
  • PIN is the last 4 digits of the SIM card ID/ ICCID

Because AT&T usual porting tool doesn’t work with MVNOs, or perhaps because I’m on a corporate discount account, I needed to do this at an AT&T store. It took at least 30 minutes of rep time.

Incidentally, I’m separately looking at porting a CenturyLink number to a burner phone then to Google Voice — hoping that will also kill my CenturyLink service (really, Comcast may be better, if only because more people hate them). That information is harder to find. I’ve read two theories on the CenturyLink number porting (number security) PIN both from a single source (the lack of information is a rather strong hint that CenturyLink is quite dead).

  • last four digits of account holder’s SSN
  • the 3 digits that follow the CenturyLink phone number on a billing statement (not including a letter that may follow those digits).

My guess is the SSN, but I’ll write a post about what happens.

Update 9/4/2015: What happens when you screw up a port and the number gets stuck.

Months after I wrote this I had to port another number. Unfortunately I relied on memory rather than reading my old notes; I tried the port at the store and messed it up. I should have done it through my AT&T account and just gone to the store to get a new SIM. This resulted in a stranded phone number — H2O’s account system couldn’t work with it but AT&T’s port eligibility page said it could’t be ported.

I knew H2O couldn’t fix the problem (their support staff is hapless), so I called AT&T’s porting service directly (888-898-7685) and “Darlene” fixed it. She spent about 30 minutes on hold with H2O then called me back.

I took the phone to the AT&T store, but ran into a confused rep. He didn’t understand how to finish the process. The clue was to say something like “check port status”, from that he found the right screen and quickly completed the port.

Saturday, June 20, 2015

iOS 8 Compass.app will let you copy coordinates if you do a long press

During a recent bike adventure I was frustrated that I couldn’t copy coordinates from either Google Map or Apple Map. I think I used to be able to do that - but no more. Compass.app would show coordinates, but I couldn’t copy/paste ‘em. Best I could do was a screenshot of what Compass displays.

There’s a convoluted way to do it …

Messages, Details, Send My Current Location -> gives a tappable link, then get info on location gives apple map URLs with coordinates

The map URL is interesting, but I wanted something better. Once I was home I paid $1 for Nav Clock.app, a primeval iOS app that, among other things, shows coordinates in portrait mode and local sun related events in landscape mode. If you tap your finger carefully (it’s picky) on the start of the coordinates you get a copy option.

Nav Clock is pretty cool and well worth $1, but I still wondered if there wasn’t a secret way to get map coordinates out of Compass.app. Seems something an engineer would sneak in. 

Jeremy W. Sherman figured it out:

Compass does let you copy out the coordinates: Long-press on the coordinates and hit Copy from the floating menu. Don’t tap - that bounces you to Maps.

It’s a non-standard UI — long but not too long press pops up a new string ‘Copy’. Tap ‘Copy’ and you can paste degrees, minutes, seconds N and W.

As best I can tell this has never been documented. It’s a secret…