Deleting a subdirectory in the path of a URL via sed or perl #

Delete the divers subdirs which appear between "/blog/" and the filenames in this example:

$ cat index.rss

with GNU sed:

$ sed -i -E 's ([a-z]+ \1 ' index.rss

or Perl:

$ perl -pi -e 's|([a-z]+|\1|' index.rss

/nix | Sep 13, 2020

macOS: Block (most) keyboard input for cleaning, etc. #

Keyboard Cleaner 1.2 [137k] Disables keyboard input (well, most: Command+Shift+3 worked and Command+Tab switched focus to the next app (though the black screen obscured that fact)) until Command+Q is pressed. 📺

UPDATE: Michael Leddy kindly wrote in to suggest KeyboardCleanTool, which does a more thorough job of blocking keyboard input (including the Function keys, which Keyboard Cleaner does not). He has written more about the tool here.

/mac | Sep 13, 2020

Rare addition to file and macOS pages #


/misc | Sep 08, 2020

Install Snow Leopard on a 2011 Mac Mini #

(See also Downgrading from Lion to Snow Leopard on the latest Mac hardware)

  1. Install Snow Leopard via a 10.6.7 universal installer disc (a MacBook Pro or iMac 10.6.7 "Mac OS X Install DVD" can be made universal via Joel Bruner's bash script 💾).

  2. Install all updates*

  3. From a Lion install, copy
    into the same locations on the Mac Mini.

  4. Run this script as root and reboot:
    cd /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/Resources
    chown root:wheel Macmini5*
    chmod 644 Macmini5*
    cd /System/Library/Extensions
    chown -R root:wheel AppleIntelHDGraphics.kext
    chown -R root:wheel AppleIntelSNBGraphicsFB.kext
    chmod -R 755 AppleIntelHDGraphics.kext
    chmod -R 755 AppleIntelSNBGraphicsFB.kext
    kextcache -system-prelinked-kernel
    kextcache -system-caches
    echo 'Finished'


* Deuced civil of Apple to keep the old servers humming along:



/mac | Sep 07, 2020

Fiction books featuring a stoic protagonist #

who, as Arnold relates, "with equanimity surveys
Lustre of goodness, strife of passion, sloth
Of ignorance, not angry if they are,
Not wishful when they are not ... who sits
A sojourner and stranger in their midst
Unruffled, standing off, saying—serene—
When troubles break, 'These be the Qualities!'"

Title Character Author
Foundation Salvor Hardin Asimov
A Gentleman in Moscow Alexander Rostov Towles
Knight Without Armour Ainsely Fothergill Hilton
Leave it to Psmith Ronald Psmith Wodehouse
A Man in Full Conrad Hensley Wolfe

See also Descriptive book titles that obviate the need to read the book.

/misc | Aug 26, 2020

Dell Vostro 2420: pink and grey lines on screen after Windows 10 upgrade #

Four years ago, RockNir posted Weird Lines and color changes suddenly appear on screen. What's happening? to the Dell laptops general forum. It read in part, "[My] Dell Vostro 2420 has been behaving weirdly at times ... pink and grey lines suddenly appear and cover the entire area of the screen, generally when I am not plugged in ... This problem started after I upgraded to Windows 10..." and included this image:

Dell Vostro 2420: pink and grey lines on screen after Windows 10 upgrade

Sadly, the forum has since gone read only, so I am posting the solution here in hopes that RockNir (and anyone else facing this issue) finds it:

  1. Control Panel > Intel Graphics and Media
  2. Advanced Mode > Power > Power Source: On battery
  3. Under "Power Conservation Features", uncheck "Display Refresh Rate Switching" and "Display Power Saving Technology"

Verified both the problem and the solution on a Dell Vostro 2420 running Windows 10.

See also:

/windows | Aug 20, 2020

Cloning a Bitlocker-encrypted disk #

Some options for cloning a Bitlocker-enabled system drive:


  1. TBWinPE does not include manage-bde.exe.

  2. Select "Read from Volume", which "allows things like the ability to see BitLocker volumes unencrypted" (if unselected, a sector-by-sector clone will be made, even if the Bitlocker partition was unlocked). Other options worth considering: Scale to Fit, Scale to Target, Align to Target, and Remove Gaps on Copy. Could not find an option or set of options that correctly resized a larger target; fixed with Paragon's Partition Manager Community Edition.

  3. A number of useful tools lie hidden beneath the surface: Explore > Quick Access Toolbar arrow > Save As > click the now-showing Save As button > This PC > X:

    right click desired tool > Open. You can also reveal the Menu Bar in the main menu via F10.

  4. If you missed the GUI prompt to unlock, make it reappear by clicking the SmartStart Wizard icon in the upper right hand corner (alternatively, run manage-bde -unlock inside cmd.exe).


/windows | Aug 19, 2020

Importing tens of thousands of photos and videos from an iPhone #

via USB generally fails using the native Windows (Import Pictures and Videos wizard, File Explorer) and macOS (Image Capture, Photos) tools with errors like "Error Copying File or Folder - The device is unreachable" or "The operation couldn't be completed." In a recent case, these MTP-compatible Windows apps did not avail either:

nor did iMazing under macOS ("Operation Failed - foo.JPG is locked by iOS." within the first few minutes). Happily, iExplorer did the trick, successfully importing close to 40,000 photos and videos (though the batch delete process failed, necessitating a workaround).

/misc | Aug 13, 2020

Closest thing to having superpowers #

when handling digital photos and videos: Phil Harvey's sedulously-crafted ExifTool, "a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in a wide variety of files".

That description hardly does it justice; here's a taste of what's possible from the Renaming and/or Moving Files section:

By writing a new value to the FileName and/or Directory tags, files can be renamed and/or moved to different directories. This can be a very powerful tool in combination with the -d (date format) option for organizing images by date/time. For example, the following command renames all images in directory "DIR" according to the individual file's creation date in the form "YYYYmmdd_HHMMSS.ext".

exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR

Or a new directory can be specified by setting the value of the Directory tag. For example, the following command moves all images originally in directory "DIR" into a directory hierarchy organized by year/month/day:

exiftool "-Directory<DateTimeOriginal" -d "%Y/%m/%d" DIR

Read here for more details about this powerful feature.

For Windows users who prefer a GUI, check out Kim Jensen's Advanced Renamer which includes ExifTool among a host of other renaming tools.

/misc | Aug 13, 2020

Bulk delete all photos and videos from iPhone #

To batch delete all photos and videos without a third party app or a PC or Mac:

  1. Tap Photos app > Photos > All Photos
  2. Tap Select at top right
  3. Begin sliding your index finger across the bottom row of images
  4. Tap the battery icon at top right (or anywhere else in the status bar) with your middle finger to select all photos and videos
  5. Tap the Trash icon and confirm deletion
  6. Tap Albums > Recently Deleted > Select > Delete All > confirm deletion

Video of the process. H/T MacObserver.

/misc | Aug 11, 2020

Subscribe or visit the archives.