App Translocation and Dock's peculiar bug

19 Oct 2016 15:00

Setting up my new MacBook Pro, I had a quite peculiar bug that manifested itself in these symptoms:

  1. Apps in /Applications ask to be moved to /Applications when opened
  2. Apps dragged into Dock might become question marks after restarting
  3. Apps dragged into Dock then clicked on will open the app as a duplicate or a “new icon” (see Tower in this case)

Running defaults read com.apple.Dock | grep Tower.app and inspecting the result in the different stages of this bug showed a pattern: Apps with no problem showed their entries as CFURLs to their locations, and so did the affected apps. Except, after restarting, the affected apps’ CFURLs turned into some really long path under /private, expecting the app to be under a subdirectory of “AppTranslocation”. You can see where this is going.

It turns out, this issue is related to a new feature in macOS Sierra called App Translocation. As explained in that article, apps with the extended attribute com.apple.quarantine will be moved and started from another location when opened, for security reasons. Which lead me to think that some apps have not had their quarantine correctly cleared after being downlaoded and launched the first time.

You can remove the extended attribute with the command xattr -d com.apple.quarantine <app>.app. This worked, and the affected app behaved like expected even after restarts. Obviously it’s not good to have this extended attribute.

In fact, let’s remove all quarantine attributes from all apps. Just cd /Applications and run

ruby -e '`xattr * | grep quarantine`.each_line { |l| `xattr -d com.apple.quarantine "#{l.split(":").first}"` }'

(can probably be done with sed and exec but I can’t be bothered)

Glad to have this sorted out. 💦

Alienware Aurora R5 + Samsung 950 PRO M.2 NVMe SSD

4 Oct 2016 15:00

I recently got an Alienware Aurora R5 gaming desktop, in which I wanted to install a 256GB Samsung 950 PRO M.2 NVMe SSD and ran into a few problems. Couldn’t find anything conclusive online so here’s how I made it work and boot the OS:

  1. Install the Alienware Aurora R5 System BIOS version 1.0.9 or higher.
  2. Install the SSD into the M.2 slot and start the computer.
    • The M.2 slot is under the GPU.
    • You will need to find an M.2 screw because Alienware doesn’t provide any, and neither does Samsung. I used the screw from the Wi-Fi M.2 card. (very bad idea but the Wi-Fi card is less loose without the screw than the SSD)
  3. Open Disk Management, format the SSD as GPT, create one NTFS partition.
  4. Install Samsung Magician & Samsung Data Migration from the official website.
    • Samsung Magician will report the SSD as something garbled like aSsmnu gSS, ignore that for now.
  5. Clone your OS hard drive to the SSD using Samsung Data Migration, then shut down the computer.
  6. Unplug the hard drive.
  7. Change the SATA Controller setting in the BIOS Setup to AHCI.
    • You can boot into BIOS Setup by repeatedly pressing the F2 key during startup.
  8. Restart the computer again. You will get a BSOD about not being able to find the boot drive. THIS IS EXPECTED. 🙄
  9. Restart again, the Windows UEFI will present you with boot options. Choose to start in Safe Mode.
    • Windows will magically recognize the SSD and boot.
  10. Restart into normal mode. Windows will boot from the SSD just fine now. 🙄
    • Samsung Magician will recognize the SSD with no problems.
  11. Install the Samsung NVMe drivers.
  12. Shut down, plug the hard drive back in.
    • Hope it’ll keep booting from the SSD, otherwise play around a little bit with the boot order in the BIOS Setup.

And you’re done.

I don’t know why this is this complicated, but oh well. Nothing “just works” in Windows’ world.

Japanese language support on Pebble Time

17 Jun 2015 17:27

This post is outdated. Use Kuro's language pack

The Pebble Time is finally out and it turns out, there is no official Japanese support. (or even the promised Chinese for that matter)

The original Pebble had custom language packs that could be installed by the user. In fact, I had Cryingneko’s Japanese language pack (pbJapanese_j06.pbl) installed on my old Pebble. It allowed Japanese characters support in notifications and also added a “Japanese” option in Settings > Languages so you could switch the Pebble’s menu/actions language.

@KnightBaron brought to my attention that you could still install these language packs on the new Pebble Time, BUT an Android phone was required to do that.

I did quite a bit of testing and it turns out that yes, you cannot install the language packs using iOS and the current version of the Pebble Time app. In extension, it seems that even some Android phones will just skip the install completely. (an “Installing!” message would pop up followed by… nothing.)

After a lot of tinkering and trying different devices I succeeded (see below for steps), but one problem remained:

Pebble OS v3 doesn’t have the option to change languages…

The notifications had Japanese support but there was no way to use English menus/interface. Using these tools, I managed to extract the localization from Cryingneko’s pbJapanese_j06.pbl, replace the values with the default ones and pack it again. Basically undoing the localization while keeping the Japanese characters in the pack.

You can download the resulting pack here: english_jp_support.pbl

Without further ado, here’s a how to

How to add Japanese support to the Pebble Time

  • If you’re an iOS user and your Pebble Time was already paired to iOS, Factory Reset it.
  • Pair the Pebble Time with Android’s Pebble Time app
  • From the Android phone (with a modern browser/Chrome), tap the pack you want to install and choose to open with Pebble Time:
  • You’ll be sent back to the Pebble Time app and it’ll ask you whether you want to install the language pack or not. Obviously you should answer Yes.
  • At this moment an “Installing” loading bar should show up

    • If not, try Factory Resetting the Pebble Time, re-pairing with Android (first) and trying the install again. Otherwise use another Android phone. In my experience it didn’t work on some Android devices.
  • There, done! Notice how it displays Kanji and “Just now” is in English. Feel free to unpair/pair with iOS, but don’t forget that Factory Resetting removes the installed language pack.