If you must run Windows 10... #

Heaven help you:

Barring divine intervention, Windows 10 Enterprise LTSC 2019 (formerly LTSB) may be the least bad option:

However, be aware that LTSC requires a volume license (VL) agreement, making onerous audits potentially more probable:

(despite Microsoft's own apparent need for a thorough inspection:

While five licenses are required to enter into a new VL agreement, they need not all be for LTSC. According to a rep I spoke with at a Microsoft Partner, this combination would work as an upgrade from a Windows OEM license (i.e., it would allow a user who bought a PC with Windows 10 preinstalled to run Windows 10 LTSC instead):

Here are links and prices from three well-known Microsoft Partners, though you should definitely confirm details with a rep before purchasing:

For those hapless souls stuck on Windows 10 Home or Pro, see:

Further reading:

Updates:

/windows | Nov 30, 2018

Last chance to buy a proper MacBook #

Model Base Price Ports Keyboard SSD replace-able? Battery glued? MagSafe 2 Other
MacBook Air (13-inch, 2017) $999

Two USB 3 ports

One Thunderbolt 2 port

MagSafe 2 port

SDXC card slot

3.5 mm headphone jack

In retrospect, the best MacBook keyboard ever

Yes

Standard NVMe SSDs work beautifully via Sintech ST-NGFF2013C.

No Yes

Going back to my Macbook Air

MacBook Air. Apple’s best product ever

MacBook Air (Retina, 13-inch, 2018) $1199

Two Thunderbolt 3 (USB-C) ports

3.5 mm headphone jack

Worst. Keyboard. Ever.:

The New MacBook Keyboard is Ruining My Life

Unreliable MacBook Pro Keyboards

The 2018 MacBook Keyboards Have the Same Old Problems

Apple Engineers Its Own Downfall With the Macbook Pro Keyboard

An ode to Apple’s awful MacBook keyboard

Appl Still Hasn’t Fixd Its MacBook Kyboad Problm

No No, but must remove logic board to replace No:

Apple is killing off MagSafe, one of the MacBook's best features

Please Apple, don't kill MagSafe

Why oh why did Apple kill MagSafe?

Apple removed its safest, smartest invention ever from the new MacBook Pros

Will your new MacBook crash to the ground without MagSafe? (Yes.)

The one serious MacBook Pro security flaw that nobody is talking about

5 things we wish we could change with the new MacBook Air

I've got some bad news.

MacBook (Retina, 12-inch, 2017) $1299

One USB-C port

3.5 mm headphone jack

No Yes Charge or plug in a peripheral!
MacBook Pro (13-inch, 2017, Two Thunderbolt 3 Ports) $1299

Two Thunderbolt 3 (USB-C) ports

3.5 mm headphone jack

Only with a proprietary SSD Yes

Don't buy the MacBook Pros even on sale, in my opinion

MacBook Pro? No

MacBook Pro board design flaw

MacBook Pro flexgate shows Apple might be losing its touch

MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports) $1799

Four Thunderbolt 3 (USB-C) ports

3.5 mm headphone jack

No Yes

Yet more...

UPDATE: Monterey: "A required firmware update could not be installed."

/mac | Nov 19, 2018

MacBooks without batteries severely throttled #

/mac | Nov 15, 2018

Best Linux distro for a 2009 MacBook Pro? #

See also Breathing new life into a 2006 MacBook and Apple's New Hardware With The T2 Security Chip Will Currently Block Linux From Booting

With OS X 10.11 El Capitan no longer receiving security updates1, unsupported but otherwise excellent hardware like the MacBook Pro (15-inch, Mid 2009) can be revitalized with Linux.2

After some false starts with the usual suspects (namely Linux Mint 19 (both Mate & XFCE), Elementary 5, Fedora Workstation 26, and Pop!_OS 18.04 LTS), I decided to give Manjaro XFCE 17 a try after seeing it regularly mentioned in HN comments.

After struggling with previous distros, Manjaro was a dream: boot and shutdown times were halved (at least), the boot splash screen displayed properly (rather than just displaying a black/blank screen like so many others), WiFi and video drivers working right out of the box, and there was no screen flickering or taskbar weirdness. In short, Manjaro presented the most polished experience, from start to finish, of the bunch.

However, during install, Manjaro requires creating a password for the root account, which is subsequently enabled. If you prefer to disable it after installation is complete:

$ sudo passwd --status root
root P 10/29/2018 -1 -1 -1 -1

$ sudo passwd --delete --lock root
passwd: password expiry information changed.

$ sudo passwd --status root
root L 10/29/2018 -1 -1 -1 -1

Test:

$ su
Password: 
su: Authentication failure

To reenable root:

$ sudo passwd root
New password: 
Retype new password: 
passwd: password updated successfully
$ sudo passwd --status root
root P 11/01/2018 -1 -1 -1 -1

Footnotes

  1. Why doesn't Apple just come out with an official macOS support policy? It's clearly and consistently been 3 years from release on modern versions, why not share that with consumers? Speaking of which, why not warn them when they are running an unsupported and unsafe version (something even Microsoft, hardly renowned for its stellar consumer support, did for Windows XP)? Within the last week or so, I've had two different people contact me with problems which turned out to be caused by running OS X 10.7 and OS X 10.8 respectively! See also No more security patches for OS X El Capitan, time to upgrade and Apple has released Mojave 10.14.1 update, and Security Updates for Sierra and High Sierra.

  2. There's also Collin's kind patcher collection of course (macOS Sierra Patcher Tool for Unsupported Macs, macOS High Sierra Patcher Tool for Unsupported Macs, and macOS Mojave Patcher Tool for Unsupported Macs) if you don't mind disabling SIP, limited WiFi support, and trusting third-party, closed source software with deep access.

/mac | Nov 01, 2018

"Burning" an ISO image to USB flash drive with just dd #

More

/nix | Oct 28, 2018

Twitter - Disable auto links in tweets #

Having set up IFTTT to autopost blog updates on a recovered Twitter handle, I did my best to forget all about it.

However, I recently discovered that Twitter automatically inserts hyperlinks for text that matches certain patterns (e.g., "Mail.app" becomes a link to said domain), prompting me to go back and delete such tweets, namely:

I was able to delete today's earlier tweet (Mojave - Where did DVD Player.app go?) and repost it with the hyperlink disabled (why can tweets not be edited?) by inserting a zero width space after the dot as explained by Amit Agarwal.

See also:

/misc | Oct 23, 2018

Mojave - Where did DVD Player.app go? #

It's been moved from /Applications/ to /System/Library/CoreServices/Applications/. Due to SIP, "Make Alias" is not available from the Finder's context menu in that directory, nor does the new Make Alias keyboard shortcut (Ctrl+Cmd+A - really, Apple?! Cmd+L does not appear to have even been reassigned!) work.

If you'd like a Finder alias for DVD Player in the Applications folder*, one can be created via AppleScript like so:

tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/DVD Player.app") at (POSIX file "/Applications")

* To its credit, Apple still provides the "CDs & DVDs" preference pane, which offers an option to open DVD Player when a video DVD is inserted, but some may prefer another action or to launch DVD Player manually to play VIDEO_TS files, etc.

/mac | Oct 23, 2018

OS X / macOS printer drivers #

As reported by Howard Oakley, Apple has stopped maintaining its printer compatibility list and is apparently only supporting AirPrint going forward.

I scoured support.apple.com for the final printer driver versions, preferring to archive them locally rather than rely on Software Update. The inconsistent naming conventions and system requirements sections have been preserved intact:

/mac | Oct 19, 2018

Large hosts file causes networking issues in Windows 10 #

Network problems encountered include: web browsers crashing, websites not loading, yield symbol appearing over the notification area's WiFi or Ethernet icon, "No Internet, secured", etc.

Solution: disable DNS Client by changing the value data for HKLM\SYSTEM\ControlSet001\Services\Dnscache\Start from 2 (automatic) to 4 (disabled) (recent versions of Windows 10 no longer allow disabling DNS Client via services.msc).

References and more information:

/windows | Sep 30, 2018

Backing up a large Gmail / G Suite account #

is theoretically possible via Google Takeout, but there are issues:

Got Your Back (GYB) does not suffer from these issues; messages are downloaded as individual EML files, sorted into folders by year, month, and day:

$ gyb --email name@example.com --action estimate

Select the actions you wish GYB to be able to perform for name@example.com

[ ]  0)  Gmail Backup And Restore - read/write mailbox access
[ ]  1)  Gmail Backup Only - read-only mailbox access
[ ]  2)  Gmail Restore Only - write-only mailbox access and label management
[*]  3)  Gmail Full Access - read/write mailbox access and message purge
[ ]  4)  No Gmail Access

[ ]  5)  Groups Restore - write to G Suite Groups Archive
[*]  6)  Storage Quota - Drive app config scope used for --action quota

      7)  Continue
7

Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth...

If your browser is on a different machine then press CTRL+C and
create a file called nobrowser.txt in the same folder as GYB.

Authentication successful.
Got 67100 Message IDs                                                           
GYB needs to examine 67100 messages
GYB already has a backup of 0 messages
GYB needs to estimate 67100 messages
Estimated size 26.47gb 67100/67100 messages 

$ gyb --email name@example.com --action backup

Using backup folder GYB-GMail-Backup-name@example.com
Got 67100 Message IDs                                                           
GYB needs to examine 67100 messages
GYB already has a backup of 0 messages
GYB needs to backup 67100 messages
backed up 67100 of 67100 messages                                               

GYB needs to refresh 0 messages

If desired, import the collection into Thunderbird via ImportExportTools.

If you need to copy the massive collection of EML files, tar it without compression to save a LOT of time (pv is of course optional, but very handy when tarring tens of thousands of files):

$ tar -c ./GYB-GMail-Backup-user\@example.com/ | pv -s $(gdu -sb ./GYB-GMail-Backup-user\@example.com/ | awk '{print $1}') > user\@example.com.tar
4.03GiB 0:00:23 [ 177MiB/s] [====>                             ] 15% ETA 0:02:08

* Attempting to split a ~26GB MBOX file by label via mbox_split.py or WB Optimum's script on which it is based did not avail.

UPDATE: Royce Williams kindly informs us of outtake, which "sync[s] Gmail to maildir...quickly", "uses the Gmail API to efficiently sync only deltas", and "can also be limited to a specific label". Crafted in Go by Google software engineer, Daniel Margolis.

/misc | Sep 25, 2018

NVMe Sanitize #

posted to the docs section.

/nix | Sep 13, 2018

Unexpected SCSI Command Failure: 00h - No SCSI controller error #

In an Adaptec SCSI Card 29320LPE's Adaptec SCSISelect Utility, neither "Format Disk" nor "Verify Disk Media" would work for two Fujitsu Ultra-320 SCSI 146GB (MAW3147NC) hard drives, immediately returning "Unexpected SCSI Command Failure" and "00h - No SCSI controller error". Both functions worked normally on two Seagate Ultra-320 SCSI 73.4GB (ST373405LC) drives.

When a Verify or Low Level Format is attempted on the hard drive, it responds with some error codes did not sound very promising:

If the error occurs in both Format and Verify, it usually indicates a defective drive. Contact the drive vendor for interpretation of other errors.

Happily, Unexpected SCSI command failure message when attempting low level format held the answer:

One reason for this could be the way the SCSI controller is set up to hand-shake with the device. This can be changed through the SCSISelect utility. Enter the SCSI Select utility by pressing CTRL-A on system boot or insert the SCSI Select diskette.

In the SCSI Select utility, take the option for Configure/View Host Adapter Settings. Then choose SCSI Device Configuration.

On the next screen you will see the SCSI ID's listed across the top and the options to set for each ID listed down the left side. For the SCSI ID of the hard drive that you are trying to verify or format, set Initiate Sync Negotiation to NO ( on U160/U320 controllers change Initiate Wide Negotiation = No), Enable Disconnection to NO, and Maximum Sync Transfer Rate to 5mb/sec. Exit the utility, saving the changes.

While "Verify Disk Media" failed if run first, running "Format Disk" then "Verify Disk Media" worked. Increasing the "Maximum Sync Transfer Rate" to 40MB/sec had no ill-effect and made verifying the format via hexdump much faster.

/misc | Sep 13, 2018

Contacts.app: Batch add existing contacts to group via text file and AppleScript #

tell application "Contacts"

    -- Path to file containing list of contacts (one per line) to add to group
    set groupList to "Macintosh HD:Users:foo:grouplist.txt"

    -- Read lines from groupList
    set groupMembers to paragraphs of (read file groupList as «class utf8»)

    -- Add each name to a pre-existing Contacts.app group named "Friends"
    repeat with i in groupMembers
        set aMember to (first person whose (name is i))
        add aMember to group "Friends"
    end repeat

    save

end tell

-- Any mismatch between names in grouplist.txt and Contacts.app will return an invalid index error along with the errant name, resulting in no names being added to the group.

-- Tested in macOS 10.12 and 10.13

-- Hat tip: mklement0's script: https://stackoverflow.com/a/30407353/

/mac | Sep 12, 2018

Microsoft Office 2016 for Mac Activation Woes #

Recently there have been activation errors with Microsoft Office Home & Student 2016 for Mac and Microsoft Office Home & Business 2016 for Mac product keys:

  1. Buy product key
  2. Associate product key with a Microsoft account
  3. Download Office 2016 installer from Microsoft
  4. Install Office 2016
  5. When prompted, enter Microsoft account credentials used in step 2 above
  6. Attempt to activate Office 2016
  7. Activation fails
  8. Telephone activation also fails

Solution:

  1. Download and install all Office 2016 updates
  2. Reboot Mac
  3. Launch an Office 2016 app like Word
  4. Activation errors resolved

UPDATE: Sadly, the activation notification returned 24 hours later, counting down from 14 days. So far, have had to get a tier 2 tech at Microsoft resolve on their end in the dozen or so cases I've seen, but What to try if you can't install or activate Office 2016 for Mac offers troubleshooting tips for the following activation issues:

/mac | Aug 12, 2018

On reputation #

Live never to be ashamed if anything you do or say is published around the world -- even if what is published is not true.

Illusions: The Adventures of a Reluctant Messiah by Richard Bach

A certain devotee asked Maharshi about some disagreeable statements made by a certain man well-known to Maharshi. He said, "I permit him to do so. I have permitted him already. Let him do so even more. Let others follow suit. Only let them leave me alone. If because of these reports no one comes to me, I shall consider it a great service done to me.

Talks with Sri Ramana Maharshi recorded by Munagala Venkataramiah

He who with equanimity surveys
Lustre of goodness, strife of passion, sloth
Of ignorance, not angry if they are,
Not angry when they are not: he who sits
A sojourner and stranger in their midst
Unruffled, standing off, saying--serene--
When troubles break, "These be the Qualities!"
He unto whom--self-centred--grief and joy
Sound as one word; to whose deep-seeing eyes
The clod, the marble, and the gold are one;
Whose equal heart holds the same gentleness
For lovely and unlovely things, firm-set,
Well-pleased in praise and dispraise; satisfied
With honour or dishonour; unto friends
And unto foes alike in tolerance;
Detached from undertakings,--he is named
Surmounter of the Qualities!

The Song Celestial, Or, Bhagavad-gîtâ translated by Edwin Arnold

/misc | Aug 03, 2018

Hard wrap text to window width #

Metapad has a handy feature called Commit Word Wrap which inserts carriage returns into text based on the current window width (the command to remove them is Unwrap Lines).

The same functionality was available in TextWrangler 4.0.1 (download) but removed as of 4.5. Here's how to use it:

/mac | Jul 15, 2018

A rare new addition to the aging catalog #

🌱 SNOW (Steganographic Nature Of Whitespace) [31k] {S}+ Conceal (and optionally encrypt) messages in ASCII text by appending whitespace to the end of lines. 📺 (NB: terminal/cmd.exe alternative shown in screenshot is ConEmu.)

/windows | Jul 13, 2018

Office cannot verify the license for this product #

After cloning a Windows install to a new drive, the following error appeared when launching Word, Excel, or PowerPoint:
Microsoft Office Home and Student 2010 cannot verify the license for this product. You should repair the Office program by using Control Panel.

Microsoft's own "Microsoft Office cannot verify the license for this product" error when you start an Office app suggests disabling compatibility mode - no change.

Help Desk Geek's Fix MS Office "Cannot Verify License" Error Message offers four methods:

  1. Change time & reactivate
  2. System Restore
  3. Delete or rename C:\ProgramData\Microsoft\OfficeSoftwareProtectionPlatform\tokens.dat
  4. Uninstall & reinstall Office

none of which worked initially, as the Activation Wizard unhelpfully offered:

Telephone Activation is no longer supported for your product.

Happily, Microsoft published a new number: +1-866-421-7141. Used with method 4 above to resolve.

/windows | Jul 13, 2018

Autoreply to SMS, MMS, and iMessage text messages without jailbreaking or driving #

by leveraging iOS 11's Do Not Disturb while driving feature:
  1. Settings > Do Not Disturb
  2. Enable Do Not Disturb > DO NOT DISTURB WHILE DRIVING > Activate > Manually > back > Auto-Reply > enter desired message
  3. Settings > Control Center > Customize Controls > tap plus symbol next to Do Not Disturb While Driving
  4. Swipe up to reveal Control Center > tap automobile icon to enable autoreplies

Notes:

Update:

/misc | Jul 05, 2018

NVMe Secure Erase #

posted to the docs section.

/nix | Jun 30, 2018

Add SRT subtitles to DVD / VIDEO_TS without re-encoding #

Steps

  1. Rip DVD to VIDEO_TS

  2. Run DVDStyler and select new project options (e.g., DVD-9 (8.5GB), NTSC 720x480, AC3, etc) based on values of source VOBs (check with ffmpeg or ffprobe) > OK > No template

  3. Click DVD > Add > Titles from DVD... select VIDEO_TS directory > Open

  4. Right click "Menu 1" in the Titleset Manager > Delete > Yes

  5. Right click "Title 1" in the Titleset Manager > Properties...

    1. Verify that video and audio are set to "Copy" (which will skip reencoding) and check "do not remultiplex/transcode" if possible (even if it is grayed out, only multiplexing will be performed)

    2. Delete "call last menu;" from "Post commands:" (to prevent "Cannot jump to menu" error)

    3. Click the green plus symbol > select your SRT file > Open (had to resave SRT in Notepad with UTF-8 encoding to resolve "Error 42 -- Illegal byte sequence -- decoding subtitle file at approx line...")

    4. Click the ... button next to "Subtitle: srt"

    5. Select language, charset, font face/size (the default 28pt Arial worked best, but there are many fans of PT Sans Narrow Bold), and fill color (light gray was more pleasing than the default yellow) > OK > OK

  6. File > Burn DVD... > select "just generate" to create new VIDEO_TS with subtitles > Start

Notes

Previous instructions to losslessly convert and merge desired VOBs from VIDEO_TS into a single MPG or VOB file via:

and adding it to a DVDStyler project generally allowed checking "do not remultiplex/transcode". However, the new process (using the entire VIDEO_TS directory) completes in almost exactly the same time and produces virtually identical results even if the box cannot be checked, as reencoding is not performed.

Another advantage of the new directions: obviating the need to deal with preexisting subpicture streams, which otherwise may need to be deleted before adding new subtitles:

Removing existing substream from a combined VOB or MPG:

  1. Attempting to generate DVD returns "ERR: [duplicate substream ID 0x20" due to an existing subpicture stream with ID 0

  2. Confirm in DVDSubEdit:

    Current subpic info:
    Subpic# = 0 (0 in stream)
    StreamID = 0x20
    ...

  3. Open VIDEO_TS\VTS_01_0.IFO in IfoEdit > VOB Extras > Strip Stream's [sic] > OK > uncheck SubPicture 1: English (2-bit rle ) (ID: 0x20) > click "Strip it" button (h/t rmdeboer82)

Alternate methods utilizing SubtitleCreator

/misc | Jun 28, 2018

Saving RealAudio streams and extracting audio without RealPlayer #

  1. Save audio.rm to stream.dump:
    $ mplayer -dumpstream -bandwidth 20000000 -cache 30000 -noframedrop rtsp://example.com/audio.rm

  2. Direct audio output of stream.dump to audiodump.wav:
    $ mplayer -ao pcm stream.dump

Sources:

Wikipedia entry on RealAudio file extensions:

RealAudio files were originally identified by a filename extension of .ra (for Real Audio). In 1997, RealNetworks also began offering a video format called RealVideo. The combination of the audio and video formats was called RealMedia and used the file extension .rm. However, the latest version of RealProducer, Real's flagship encoder, reverted to using .ra for audio-only files, and began using .rv for video files (with or without audio), and .rmvb for VBR video files. The .ram (Real Audio Metadata) and .smil (Synchronized Multimedia Integration Language) file formats are sometimes encountered as links from web pages (see Streaming Audio section below).

/nix | Jun 17, 2018

NoFan CS-80 drive brackets are NOT screwless #

Purchased a NoFan CS-80 PC case after reading that it "offers 9 EZ-SWAP drive bays and screwless installation" and is "conveniently designed so that a drive can be easily attached or detached from a bay without any extra tool":

NoFan CS-80 drive bay trays are NOT screwless

Should have glanced at the manual first, which shows 2.5" and 3.5" drives being screwed into the caddy:

Is this what you would call screwless?

Was expecting something actually tool-less, like this Corsair hard drive tray, which is at least screwless for 3.5" drives (2.5" drives mount to the bottom with screws):

Corsair CC-8930040 hard drive tray

Even better would be something completely tray-less, like the Corsair Carbide 200R's drive cage (though its plastic tabs should really be metal):

Corsair Carbide 200R tool free drive cage

/misc | Jun 17, 2018

ATA Sanitize and hdparm #

posted to the docs section.

/nix | Jun 10, 2018

Can Data from a Zero-Filled Hard Drive be Recovered? #

posted to the docs section.

/misc | Jun 04, 2018

Guide to handling read errors while verifying a hard disk wipe #

posted to the docs section.

/nix | Jun 02, 2018

Convert MP4 to GIF #

1. Simplest method:

$ ffmpeg -i in.mp4 out.gif

out.gif did not display in Finder, Safari, or Preview, but worked in Firefox and Chrome.

2. Oft-cited method using ffmpeg and convert:

$ ffmpeg -i in.mp4 -r 10 frames/frame%03d.png
$ convert -delay 5 -loop 0 frames/frame*.png out.gif

out.gif was over 14 times larger than in.mp4.

3. Best results obtained via this advice:

$ ffmpeg -y -i in.mp4 -vf palettegen palette.png
$ ffmpeg -y -i in.mp4 -i palette.png -filter_complex paletteuse -r 10 out.gif

out.gif was smaller than in.mp4, playable everywhere, and very high quality.

/nix | May 24, 2018

Animated GIF editor for Windows #

ScreenToGIF is billed as a "screen, webcam and sketchboard recorder with an integrated editor". Uniquely, it allows easy editing of existing animated GIFs:

A subtle but deeply gratifying feature is how ScreenToGIF displays the current frame when highlighting a range of frames in the timeline (rather than statically displaying the first selected frame).

Additionally, it's:

/windows | May 21, 2018

Connect to a Windows 10 (version 1803) shared folder from Windows XP via mapped drive #

These steps dumb down security advances made in later Windows versions in order to accommodate XP. Do not use them unless absolutely necessary; even then, do so at your own risk (and joy).

On Windows 10 PC:

  1. Control Panel\All Control Panel Items\Network and Sharing Center → Change advanced sharing settings:
    1. Private (current profile) → check "Turn on network discovery" and "Turn on file and printer sharing"
    2. All Networks → check "Turn off Public folder sharing", "Enable file sharing for devices that use 40- or 56-bit encryption" and "Turn off password protected sharing"
  2. If necessary, create a new local user account (e.g., "xpuser") and folder share (e.g., "shared")
  3. In HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters, create a new DWORD value name of AllowInsecureGuestAuth and set its value data to 1.
  4. C:\Windows\System32\OptionalFeatures.exe → check "SMB 1.0/CIFS File Sharing Support" → OK → reboot when prompted

On Windows XP PC:

You should now be able to map a network drive normally.

If you have trouble with "Reconnect at login" or "Connect using a different user name", consider a batch script in the Startup folder, e.g.,

    ping 127.0.0.1 -n 11 >NUL & REM delay execution for 10 seconds
    net use * /delete /yes & REM clear any existing mapped drives
    net use x: \\WIN10PC\shared

If the Windows 10 and XP usernames and passwords match, you're done!

If they differ, you can simply store the Windows 10 username and password in Windows XP's Stored User Names and Passwords (aka Credential Manager); access via rundll32.exe keymgr.dll, KRShowKeyMgr.

Otherwise, you could specify the username in the script, prompting the user for the password each time (e.g., net use x: \\WIN10PC\shared /user:xpuser *), or you could store both the username and the password in the script (security-wise, not a great idea, but hey, you're still running Windows XP, so... net use x: \\WIN10PC\shared /user:xpuser password).

Sources and more information:

/windows | May 17, 2018

Windows Update failed: Advanced Micro Devices, Inc - System - Error 0x80070002 #

Following a clean install of Windows 10 version 1803 on an HP Notebook (15-ba113cl), Windows Update reported the following error:

Updates failed - Advanced Micro Devices, Inc - System - Error 0x80070002
Updates failed - Advanced Micro Devices, Inc - System - Error 0x80070002

Attempting to automatically update the driver in Device Manager returned:

AmdAS4 Device: The system cannot find the file specified.
AmdAS4 Device: The system cannot find the file specified.

HP's Software and Driver Downloads page for this laptop inexplicably does not include chipset drivers. However, thanks to Paul_Tikkanen's answer in Missing unknown driver ACPI\ASD0001\2&DABA3FF&2 (which took longer than a few seconds to find, hence this post), the error was resolved by downloading and installing the AMD Chipset Drivers (revision 18.10.0418, released 4/18/2018) directly from AMD.

/windows | May 13, 2018

Playback Windows events and activities via timeline tools #

(Note: This post is not about Windows 10's new Timeline feature (but don't miss Windows 10 Timeline Forensic Artefacts and WxTCmd, a parser for the Windows 10 Timeline database.))

Replay / rewind Windows events and actions to:

Unlike the lengthy forensic and incident response tools listed below, Nir Sofer's LastActivityView runs on a live system within seconds, reporting:

In 2014, Thomas Weller combined LastActivityView with a host of additional Nirsoft utilities to create Live System Timeline Builder, which builds a super timeline of a running Windows machine in seconds. The unified view includes results from:

While Live System Timeline Builder comes packaged as an installer, the resulting folder (%PROGRAMFILES(X86)%\WelliSolutions\LiveSystemTimeLineBuilder\) is completely portable; you just need LiveSystemTimelineBuilder.exe, EPPlus.dll, and the Providers subdirectory.

You can even update the Nirsoft apps in Providers as well (the latest RegDllView, 1.60, does not appear compatible, so stick with the included 1.58).

If you have more time to dig, there are a number of exhaustive (and time-consuming) timeline tools focused on forensics and incident response:

* Unlikely that they erased all (if any) traces.

/windows | May 11, 2018

What keeps me on macOS #

despite Apple's waning attention and nominal concern:

Footnotes:

  1. The Windows version is much clunkier. Reportedly, 2016 is the final desktop version for Mac. (UPDATE: Just learned from an Intuit customer service rep that a 2019 version for Mac is planned.) Still available at a discount from Intuit via this curiously-obscure page.
  2. Yes, it's available for other platforms as well, but without Sublime Text I'd be sorely tempted to jump ship.
  3. Other platforms also enjoy plenty of virtualization options, none of which run OS X / macOS guests easily and/or legally.

/mac | May 09, 2018

Resizing videos in OS X / macOS #

For years, I used Stomp for resizing videos under OS X. However, in addition to recently being retired, it has had trouble processing a number of formats of late, either hanging altogether or displaying lengthy time estimates (e.g., ~6 hours to scale a 6 minute video by half).

Happily, ffmpeg makes quick work of scaling video while preserving the aspect ratio, e.g.,

$ ffmpeg -i in.mp4 -vf scale=640:-2 out.mp4

UPDATE: To optimize for web streaming, add -movflags faststart. To optimize existing videos for streaming without have to reencode, use ffmpeg -i in.mp4 -movflags faststart -acodec copy -vcodec copy out.mp4

/mac | Apr 28, 2018

Excerpts from Michel Peissel's "Zanskar: The Hidden Kingdom" #

Shangri-La?

I stepped outside and again I was struck by the magnificent view: a full circle of peaks surrounded the flat sea of the central plain dotted with its villages, refuges in a world unfit for man. If ever there lay a valley cut off from the world, a hidden, secret land, it was Zanskar. I could hardly believe that only recently I had left a world which is polluted and over-populated. Everything in Zanskar I found near to perfection: nothing, so it seemed, was out of place or unnatural. ... There was nothing here to tarnish the harmony of nature in which man has his natural place blending with the earth...

Fleas in Heaven

Finally I retired to a nocturnal safari against the terrible fleas. Someone, alas, had forgotten to explain to them the deadly effects of DDT, for they completely ignored the floods of insecticide with which I had covered my body. Leeches in the lower, damp southern Himalayas and fleas in the north are responsible for the real hardships of Himalayan travel. My parasites and I awoke early the next day.

At last I lay down to what I thought was well-earned sleep only to appreciate I had overlooked the fleas for which Kargil is famous. As I sat scratching myself I thought of all those travellers who had passed sleepless nights at this ancient crossroads of caravans heading for Tibet, Afghanistan, China and Sinkiang.

I must admit I needed self-control not to kill the fleas I caught in the chapel. Instead, with traditional respect for life, I placed the offenders on the ground without squashing them, thus leaving them free to start a new career on someone else.

For the night I was offered a small room in a large house that seemed neat and reasonably clean. Little could I then foresee that this was to result in severe wounds, much frustration and eight full days of furious scratching. 'To bite a flea is hardly food for the stomach but how nourishing for the soul,' goes a Tibetan proverb. I had to agree as, forgetting all taboos about respecting life, and in spite of the difference in size and the Geneva convention, I killed all prisoners!

Belief

Usually it takes me a week to get rid of the habits of my rational Western self, to stop querying every fact and figure and searching for an explanation to every phenomenon. This period over, I began to believe in witches and ghosts, gods and demons, good and evil spirits and endless other characters that in the West I liked to consider imaginary—in the same manner that Lobsang would consider unreal and laugh at all the dreary statistics in which we believe, such as the height in feet of our tallest buildings, or the exact distance in miles between the earth and the moon, the facts and figures which mould our lives and command respect in our figure-mad world. But what do figures mean, or spirits, if one does not believe in them? The answer is nothing, for it is Faith that counts. Often we would be at a loss to check many of the facts we believe in; we accept them with that same blind faith with which I now accepted the presence of demons and the miracle of the [imprint in rock of a] footprint [said to be Padma Sambhava's].

/misc | Apr 19, 2018

Only old calendars appearing in iTunes #

This post is for the scattered few who still sync calendars between their Mac and iOS device via USB, and find deleted calendars appearing in iTunes, despite those calendars not appearing in iCal / Calendar. Backup before proceeding. The iOS calendar(s) will be overwritten.

  1. Disregarding the absence of desired calendars or presence of undesired calendars within iTunes, select Sync Calendars > All calendars, check "Replace information on this iPhone" next to Calendars, sync, then quit iTunes.
  2. Open iCal/Calendar on the Mac and delete any unwanted calendars that appeared after syncing (yes, despite having selected to overwrite the iOS device, old, deleted calendars may reappear).
  3. Even if you've never used it, open Reminders.app on the Mac and delete any old, unwanted calendars.
  4. Open iTunes and head back to Info > Sync Calendars - only current calendars should appear.

Similar reports

Related

Update

In January of 2023, bidirectional calendar sync over USB stopped working between an iPhone SE (3rd generation) running iOS 16.2 and a MacBook Air (M2, 2022) running macOS 13.1; only unidirectional overwriting of the iPhone by the MacBook via Finder → iPhone → Info → "Replace Calendars" would work.

None of the above approaches nor a number of others (resetting network settings on the iPhone, erasing and restoring the iPhone, deleting the contents of ~/Library/Calendars/Pending\ Events/ (or, indeed, the entire contents of ~/Library/Calendars as suggested by Apple support), etc.) availed.

Despite the iPhone syncing normally with another Mac running the same version of macOS (and slightly better under a new user account on the affected MacBook Air - only new events would sync bidirectionally), the fix was ultimately to wait for then install iOS 16.3 and macOS 13.2 (thanks Dmitry!).

The updates also brought an end to the SyncServer (/System/Library/Frameworks/SyncServices.framework/Versions/A/Resources/SyncServer.app/Contents/MacOS/SyncServer) and Mingler (/System/Library/Frameworks/SyncServices.framework/Versions/A/Resources/SyncServer.app/Contents/Resources/Mingler) crash reports in Console ("EXC_BAD_ACCESS (SIGBUS)" and "EXC_GUARD (SIGKILL)", respectively).

/mac | Apr 08, 2018

Archiving Calendar.app events as plain text #

After 14 years of calendar events (>17,000, but still well within the recommended limit of 50,000), Calendar.app finally started acting up; a month-long period refused to sync via iTunes from an iPhone to a Mac, despite desultory remedial efforts1.

Time to archive and cleanup:

  1. Backup calendar(s) to both ICS and ICBU formats; print to PDF for good measure

  2. Recover recalcitrant events from iPhone using iExplorer

  3. Install icalBuddy2 version 1.8.10 via Homebrew3:
    brew install ical-buddy

  4. Export all events from 2003 through 2017 using a for loop4:
    for i in {2003..2017}; do icalBuddy --separateByDate --noCalendarNames eventsFrom:$i-01-01 to:$i-12-31 > $i.txt; done

  5. Combine all 2003–2017 txt files into one:
    awk 'FNR==1{print ""}1' *.txt > events.txt

  6. Check for duplicates:
    uniq -d events.txt
    and remove:
    uniq events.txt > events_deduped.txt

  7. Remove auto-generated URLs for events created via iMessage or Mail:
    sed '/^\ \ \ \ url:/d' events_deduped.txt > events_urls_removed.txt

  8. Delete 2003–2017 events from Calendar via Automator5: Find Calendar Events > Date ending > is before > 1/1/2018 > Delete Calendar Events6 (UPDATE: See macOS: Batch delete calendar events via Shortcuts.app)

Footnotes

  1. Namely (and mainly from How To Reset Calendar, iTunes USB Sync):

  2. Export iCal events to TXT or RTF

  3. To avoid a bug in the officially-hosted version (1.8.8) under OS X 10.10+.

  4. Exporting all events from 2003 through 2017 like so: $ icalBuddy --separateByDate --noCalendarNames eventsFrom:'jan 1, 2003' to:'december 31, 2017' completed without error, but stopped in 2006, hence the for loop.

  5. Calendar, Automator, and AppleScript were so recalcitrant under macOS Sierra that an OS X Mountain Lion virtual machine had to be employed for the cleanup process. More on deleting old events:

  6. Under macOS 10.14 Mojave, had to grant Full Disk Access to Automator (to prevent "The calendar is read only" error) and change the workflow slightly: Get Specified Calendar Items > Add > select calendar > Filter Calendar Items > Filter > events > Date ending > is before > 1/1/2019 > Delete Calendar Events > "If events are recurring, delete" > these events only.

Failed attempts

Related

Update

/mac | Apr 01, 2018

Rename Windows user account and profile folder #

This post has been moved to the docs section for posterity.

/windows | Mar 22, 2018

Very slow copying LibreOffice.app from dmg to /Applications #

Copying LibreOffice.app's 771.4MB (13,307 files) from LibreOffice_6.0.2_MacOS_x86-64.dmg (235.9MB) into /Applications took over three minutes* on a MacBook Pro with a SSD and 16GB of RAM via Finder (rsync and cp were similarly sluggish).

By way of comparison, Android Studio.app's 846.9MB (10,720 files) copied from android-studio-ide-162.3871768-mac.dmg (445.8MB) via Finder in just fifteen seconds.

However, after zipping LibreOffice.app via OS X's built-in Compress command, it could be unzipped in less than twenty seconds via the default handler (Archive Utility). Why is copying from the dmg file so much slower? Perhaps The Document Foundation could offer a zip file rather than (or in addition to) the sluggardly dmg.

* (On first launch, there was another thirty second delay while "Verifying 'LibreOffice.app'..."; clear the quarantine attribute beforehand to avoid: xattr -d com.apple.quarantine /Applications/LibreOffice.app)

Related:

Update:

/mac | Mar 05, 2018

Archiving JavaScript-laden webpages #

Saving webpage assets wrapped in heavy JavaScript (e.g., lightboxes and slideshows) for offline access can be irksome.

Recently, a particularly recalcitrant website refused to fall to the usual suspects (Wget, SiteSucker, Offline Pages Pro, Chrome, Firefox, Safari, various extensions and add-ons, etc.), but incredibly came to heel under the venerable iCab's web archiving feature - thank you Alexander Clauss!

/mac | Feb 18, 2018

Quickly verify file checksums in OS X & macOS #

with Joss Brown's Checksums. Supports a wide array of algorithms, from built-ins like MD5 and SHA-256 to Tiger and Bencode via optional installs. Requires OS X 10.8 or higher.
  1. Download and mount latest DMG
  2. Copy Checksums.workflow to ~/Library/Services/
  3. If desired, automatic update checks can be disabled by opening Checksums.workflow in Automator and removing the updater function and function call from the bash script.
  4. Rather than using the Context menu to launch Checksums (Control-click > Services > Checksums), set a keyboard shortcut: System Preferences > Keyboard > Shortcuts > Services > File & Folders > Checksums > none > add shortcut > Control-Command-C (or any other desired and available key combination)
  5. To compare a checksum with a file, copy the checksum to the clipboard, select the file, and press your keyboard shortcut:
    Checksums

UPDATE: As of Mojave, Automator needs to be granted Full Disk Access in System Preferences > Security & Privacy > Privacy in order for Checksums to work correctly.

/mac | Feb 18, 2018

Add a macOS recovery partition without reinstalling macOS #

If you search the web for how to restore a missing recovery partition, chances are you'll come across advice like:
"Generally the best and simplest method is to reinstall OS X entirely. This is a neat way of triggering for a second time the process whereby the recovery partition is created. It's quite a drastic and time-consuming approach, however."
-- How to create a Mac recovery partition in OS X El Capitan and Yosemite
and:
"The only way to solve this problem is to download the latest installer from App Store and re-install OS X"
-- How to re-create a missing recovery partition in OS X Yosemite (updated to OS X El Capitan)

However, thanks to davidjb's recovery.sh (detailed in his blog post Creating a macOS Recovery Partition without reinstalling OSX or re-running your installer), it is possible to add a recovery partition without reinstalling macOS.

Boot the Mac from an external drive or into Target Disk Mode*, then run:

TARGET="/Volumes/Macintosh HD"                                # Specify where to configure Recovery partition
MACOS_INSTALLER="/Applications/Install macOS Sierra.app"      # Path to your macOS installer

# Remaining paths ahead are dependent on OS version
# This *should* support 10.9 and above but is only tested on 10.12

curl http://support.apple.com/downloads/DL1464/en_US/RecoveryHDUpdate.dmg -L -o ~/Downloads/RecoveryHDUpdate.dmg

hdiutil mount -nobrowse ~/Downloads/RecoveryHDUpdate.dmg

pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /tmp/recoveryupdate

hdiutil mount -nobrowse "$MACOS_INSTALLER/Contents/SharedSupport/InstallESD.dmg"

/tmp/recoveryupdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition "$TARGET" "/Volumes/OS X Install ESD/BaseSystem.dmg" 0 0 "/Volumes/OS X Install ESD/BaseSystem.chunklist"

hdiutil eject "/Volumes/Mac OS X Lion Recovery HD Update"

hdiutil eject "/Volumes/OS X Install ESD"

Notes:

/mac | Feb 14, 2018

Remove all color but black from an image #

Background removal apps and web-based services don't do well with noisy images like this one of sheet music on thin parchment paper which has text from the next page bleeding through:

Image of sheet music before removing background

However, ImageMagick works, well... magic: $ convert in.png -fill white -fuzz 80% +opaque "#000000" out.png

Image of sheet music after removing background

If the results aren't satisfactory, try tweaking the fuzz value (e.g., 20%). For multiple images, use a for loop: $ for i in *.png; do convert "$i" -fill white -fuzz 20% +opaque "#000000" "$i-out.png"; done

Updates

  1. Converted a multi-page PDF to individual PNG images for processing via this Automator workflow (before discovering that the first convert command above works equally well on multipage PDFs):

    1. Files & Folders > Ask for Finder Items
    2. PDFs > Render PDF Pages as Images
    3. Files & Folders > Rename Finder Items > select Make Sequential from dropdown
    4. Files & Folders > Move Finder Items > select Destination directory
  2. Convert color PDF to black and white

  3. For despeckling PDFs, see 4lex4's ScanTailor Advanced (which "merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes") or this newer fork. macOS instructions and cross-platform guide | 4lex4's 2017 announcement on DIY Book Scanner

/nix | Feb 02, 2018


Subscribe or visit the archives.