2018/03/02

is your Mac waking on its own, draining battery and then just plain powering down?

I've twiddled every setting I can find, and this still happens:

  • I close the lid of my MacBook,
  • Carefully listen for the fan to stop...
  • (Wish they'd kept the pulsing LED; that was an excellent design.)
  • And only _then_ do I put it in my bag.
  • Some time later, I pull it out - to find it hot and/or powered off. Yuck. :(
(Kudos to Apple for constructing macOS so solidly, that even when it powers down unexpectedly (still sub-optimal), it actually does come back quickly - even with unsaved work, ready to pick up where you left off. Nice.)

Recently, I've been watching this strange sleep behavior even more closely, and several times have witnessed this sequence:
  • Close lid & listen for fan to stop...
  • Keep listening; after a few more moments, the fan starts again!
  • This sequence repeats
This seems to be new-ish behavior; as of the last few releases of macOS.

I've done everything I can find (details below), to get it to _stay_ asleep, but to no avail.

However I just found something new; from the man page of the pmset command:
ttyskeepawake - prevent idle system sleep when any tty (e.g. remote login session) is 'active'. A tty is 'inactive' only when its idle time exceeds the system sleep timer.

Yes; if I've got an ssh connection open to a remote host, for a command-line, I do indeed not want it to sleep - _except_ here's the new (to me) part:

ttyskeepawake is apparently for _any_ TTY - _not_ just those open via Terminal, as one might think; see the output, as a result of turning ttyskeepawake off:

Warning: This option disables TCP Keep Alive mechanism when sytem is sleeping. This will result in some critical features like 'Find My Mac' not to function properly.
Example command to turn it off (for all power sources):
pmset -a tcpkeepalive 0

I'll try this over some time, to see if my MacBook finally does stay asleep, safely...

Feedback / suggestions welcome!

3/12 update: Apparently the "sudo pmset -a standbydelay 259200" setting must be performed _while on battery_; if done while on AC / wall power, the on-battery setting is not affected. :/

 - - - 

Other settings I use (each on a single line), to try to make it sleep quickly, _and_ stay asleep:

sudo pmset -a hibernatemode 0 # do NOT use Safe Sleep; saving time to sleep (and save disk space), by not writing /var/vm/sleepimage
sudo pmset -a standbydelay 259200 # 3 days of sleep, before moving from sleep to hibernate - MUST BE DONE WHILE ON BATTERY
sudo nvram boot-args="darkwake=0" # disable "Dark Wake" (requires reboot)
sudo pmset -a womp 0 # disable "Wake On Magic Packet" (AKA "Wake-on-LAN", AKA "Wake for Wi-Fi Network Access" on recent MacBooks; also seen in the Energy Saver pane in System Preferences)
Also: A command line that I use, to see what the pmset log has, since the most recent sleep event:
telltale='Entering Sleep state'; lastSleep=$(pmset -g log | fgrep -i -e "$telltale" | tail -1 | sed "s/${telltale}.*/$telltale/"); if [ "$lastSleep" ] ; then pmset -g log | sed -n "/$lastSleep/,\$p"; else echo '[WARN: Did not find a Sleep event]'; fi

2017/11/13

Why did Skype hijack my phone?

I installed "Skype for Business" recently (required by my org) and everything seemed fine.

Some time later, I clicked on a phone number and selected "Call 888-555-1212 using iPhone" from the contextual popup as usual - and Skype came up. Yuck.

After a _great_ deal of searching, I found that reverting to the default behavior (of actually calling with my iPhone...) is as simple as:
  • Open the FaceTime app.
  • Open its Preferences.
  • Look for the "Default for calls" popup, at the bottom.
  • Select "FaceTime".

2017/06/23

Stale NFS mounts

Think you've got a stale NFS mount, gumming up the works?
Maybe several mounts, you're not sure which is the problem, and your usual tools are not working (ex: they just hang)?

Try this one-liner (sudo / root is required for "lsof"):


Which should ID the culprit, and give you some info to help determine how to handle.

Notes:
  • This unfortunately cannot simply be single-quoted, and executed via ansible. There's probably a way to add another level of quoting to address that, however I simply dropped the code in a file in my homedir, then ansible'd that.
  • The "-b" option to "lsof" is essential, since it avoids blocking, which is almost certain in this circumstance.
  • The "lsof" gives a simple count; if there are any, you may wish to repeat the "lsof" to actually show the open files.
  • The mount's line from /etc/mtab should show some useful info, such as the IP address where the mount at least was, when it was made.

2016/10/12

Mac windows moved mostly off-screen when switching displays

Strange new behavior (to me anyway) since upgrading to macOS Sierra (10.12):

When I move between using my MacBook with a Thunderbolt display (only), and using it on with only the built-in display, it frequently leaves windows almost entirely off the side of the display. :/

(If it matters, this is with a sleep, between mode switches - like when moving between home and office.)

At no time was I using an extended desktop (multiple displays at once) - though it looks as if it somehow thinks it's in that mode. Though a trip to the Displays preference pane, shows that it is indeed using only only display.

(More than once, I've also seen this: Upon wake, I see the Desktop - but no menubar. Perhaps another indication that it's confused and thinks there's another display - which has the menubar.)

I found some interesting suggestions on this SuperUser thread though none of those worked for me, and I just created a new account there (coulda sworn I had one, but whatever), so couldn't post there yet :/ - hopefully this link helps.

What _did_ work for me: Simply "Hide" (in the app menu, just to the right of the Apple menu) any app with windows off-screen; when the app was shown again, the windows were moved back onto the current (only) screen.

In the process I also discovered the missing "Detect Displays" button, which was removed from the Displays preference pane at some point - press (and hold) the Option key. It had no effect on this issue, though maybe handy to know.

(I have heard of folks seeing this issue on other releases like "El Capitan" (10.11) - hope this helps!)

2015/04/08

SEO (search engine optimization) musings

i just did a web search for a topic where i don't have very much context to judge how relevant / reliable the results are

of course i reflexively ignored the paid results

for the "organic" results, if it's a topic i am familiar with, i may glance briefly at the top results - mostly for entertainment value, at the ridiculous junk that manipulated its way to the top

however, with something unfamiliar, i hovered briefly over the top "organic" result, wondering if it was worth the effort to click through to see how useful it might be

given the rampant manipulation behind high ranking, i wonder how many of us also reflexively ignore the top N organic results

2015/04/02

recover outlook smart folders

got some really cool "smart folders" in outlook?

but outlook is crashing and even a rebuild didn't fix it?

so you just created an entirely fresh identity, which fixed the crashing (finally) - but you really don't want to have to try to remember how all those smart folders were built?

try this:

  • outlook stuff is stored here: ~/Documents/Microsoft User Data/Office 2011 Identities/
  • within that, there's: Main Identity/Data Records/Saved Searches/
  • yep; smart folders are in there
  • move the "Office 2011 Identities" dir/folder somewhere for safe-keeping
  • fire up outlook again, enter your account info & let it start downloading stuff
  • it may help to quit here; the rebuild below may take less time
  • it may help to run "Microsoft Database Utility" & let it kill the daemon (then cancel the rebuild)
  • copy the "Saved Searches" dir from your saved copy, over the fresh copy
  • run "Microsoft Database Utility", do a rebuild, and let it complete (this appears required)


after i did this, the next time i opened outlook, my smart folders were there; hope this works for you

(now i just have to wait for spotlight to finish indexing the rebuild :/ to confirm that they actually work - though at least the definitions are visible now)

notes:

  • geez; a whole lot of mail showed up in different places; lots of cleanup needed :/
  • i copied my own smart folders; might also work for copying to other identities
  • i'm on outlook 2011, on os x 10.10 (yosemite); may or may not apply to others
  • i've got the common config of a single "identity"; this procedure resets _all_ idenities

2014/09/15

iOS fast-forwards through all tracks & doesn't play any

Strange to hear / watch this happen:

Hit "Play" and nothing comes through the headphones (or speakers) at all; check the display and it's just zooming through all the tracks, spending less than a second before going to the next, over and over.

Mucked about for awhile and then came up with a theory:

It's due to the "Sound Check" feature, which I had just turned back on - and it now has to scan every single track to know what to do before it plays any.

Great background here: http://productionadvice.co.uk/sound-check-album-mode/

Sure enough, as soon as I let it go through all of them, it was able to play.

And then I turned "Sound Check" back off. :)

2014/01/07

Has anyone seen some connection instability with the GlobalProtect VPN client (v1.2.2-14), on OS X 10.9 (Mavericks)?

Strangely, I see frequents drops of my entire WiFi connection (to an AirPort base station that's been solid before now) including to local (non-VPN'd) nodes as soon as I initiate the VPN connection (which also has been very solid before now).

Any clues?

2012/11/02

FileVault2 (FDE) trvia

Interesting...

I configured my Mac to require me to enter the boot volume's FileVault2 passphrase before login; no automatic retrieval using an account's (less secure) login password.

This worked great, then at some point later, I added a second "Standard" account (for my Grandmother's iPad :) and the next time I booted (it's not that often; thanks for making a really stable OS, Apple) I noticed that this account was able to log in directly.

Hmm; somehow when the account was created, it glommed on to the FileVault2 passphrase - not nice.

System Preferences gave me no way to turn this off; interesting-er. Neither "Users & Groups" nor "Security" was any help; "Security" didn't even have this account listed via the "Enable Users..." button (toward the bottom).

To the Intertubes!

Here's an interesting article from IACR (International Association for Cryptologic Research) with lots of background: Infiltrate the Vault: Security Analysis and Decryption of Lion Full Disk Encryption. It didn't help solve this problem, though it was a useful read; thanks, IACR.

And the jackpot, at Krypted.comEncrypting Volumes in OS X Mountain Lion is how I found out about the "fdesetup" command. (That's "fde" as in "full disk encryption".)

(BTW: After disabling this new account (with "fdesetup remove"), I opened the "Security" preference pane and it is now listed (as disabled) where it previously wasn't shown at all.)

[2015/03/20 update: If the output of "fdesetup list" is empty, no users have the capability, and it's required (as desired) to enter the disk password before login.]

2012/05/23

DuckDuckGo Action for QuickSilver

A quick & dirty Applescript for a QuickSilver Action, to quickly do a web search with DuckDuckGo (AKA DDG), in the default browser:

using terms from application "Quicksilver"
 on process text ThisClipping
  tell application "Finder" to open location "http://duckduckgo.com/?q=" & ThisClipping
 end process text
end using terms from

Save the above as something like DDG.scpt, into "~/Library/Application Support/Quicksilver/Actions"; to make it your default, drag it above other Actions - such as "Search with Google".

Now:

  • Fire up QuickSilver as you normally would (ex: command-space).
  • Type a dot (if required) for free-form text entry.
  • Enter your query & press Return; done.
Any suggestions for improvement are most welcome!

(I miss Searchling, however this is pretty close!)