Fix 10.11.4 mysterious trackpad reset problem after reboot

Just encountered a mysterious problem after upgraded to 10.11.4 that every time MBP reboots and logins, my trackpad settings like tap-to-click are lost. It’s mysterious because during the very beginning time after login it worked as normal, but a few minutes later trackpad settings were reset automatically. It also affected the Mac AirPlay to AppleTV which would not work except for the first few minutes after reboot.

Googling the airplay problem leads to login items. But removing all of my existing login items doesn’t fix the problem. (Of course, the trackpad plist is the first try which also doesn’t work.)

And the console log during possible resetting trackpad has messages like “kernel[0]: Sandbox: CommCenter(3359) deny(1) file-read-metadata /Library/Developer” and “otherbsd[4246]: Could not submit LoginItem job com.XXX.XXXYYY: 119: Service is disabled”;

More googling doesn’t find much useful info. Similar keyboard reset problem exists but has no fix yet. When analyzing the details of the console logs, one interesting thing is that there’re two login window app started msg around that time, when the failed login items are all at the second login window session and possibly kill my trackpad settings and airplay.

Then why on earth exists another login window session? The culprit is _xcsbuildd. As 10.11.4 upgraded Mac Server, with XCode server service included, which will run as user _xcsbuildd at background. The upgraded service’s second login session breaks some login items which seems indeed killing airplay and resetting the trackpad settings.

Simply disable xcode service in Server.app will not remove _xcsbuildd related stuffs. Use this methods to totally get rid of it.

Finally reboot and enjoy the hassle-free trackpad and airplay again.

Fix iTunes Restore iPad2 Error 9 Problem

One of my relative’s iPad2 got stuck in the iTunes logo interface and unusable for a while. Just tried to get it restored when connected to iTunes via USB. However, it always auto rebooted after progress bar appeared under the Apple logo.

Tried DFU mode and restore still fails with “Unknown Error 9”. This thread googled suggests the unbelievable culprit: the latest iOS 9.2.1 is incompatible to restore iPad2.

Since older iOS version cannot be signed and updated by Apple now, latest iOS 9.3 beta 4 works fine to restore iPad2 successfully.

Unbelievable.

Annoying iCloud Photo Library Upload Stuck Problem

My iPhone6+ got stuck when uploading some photos automatically to iCloud Photo Library. It’s quite possible if the phone’s available free space is lower than 400MB when using optimizing size option, which might be required by the mysterious blackbox photo upload process. But after cleaning up disk space, it still paused at the “uploading xx photos” phase.

Tried everything googled: reboot phone / disable-enable iCloud Photo Library / delete videos / logoff iCloud account, nothing worked.

Finally, forget about the iCloud synchronization. Disable Photo Library, transmit these photos to Mac and manually upload photos to iCloud.com, then delete all existing photos from the phone. And at last re-enable the iCloud Photo Library to download all photos again to the iPhone.

Hope it will sync next time.

Fix 10.11 key chain prompt with deny only

Just encounter a strange problem of key chain access. When prompting for access to credentials, the dialog can only be dismissed by Deny. In the console, “Ignoring user action since the dialog has received events from an untrusted source” was logged.

According to this post, 10.11.1 contains a security patch to prevent synthetic clicks on keychain dialogs. Try disabling all apps in the privacy settings of accessibility-mac-control, but not works.

Therefore manually quitting such apps one by one will be the trick to check for the culprit. It founds that BetterTouchTool is the problem.

Update: 10.11.5 will correctly prompt for administrator password and shows the blocking app.

MX Master bluetooth pair problem with Yosemite

Just bought the latest Logitech MX Master mouse, which is quite powerful for Yosemite to natively support Mission Control and Spaces with its mouse gesture button, together with the interesting Smart Shift scrolling feature.

But also encountered the problem of pairing it with my MBP Retina on Yosemite 10.10.3. One discussion thread in the logitech forum suggested to delete all existing bluetooth devices to fix the connection. However, some hidden devices remain in the bluetooth paired list for Alt-Click menu. In this case, a complete bluetooth plist delete will finally help to pair the mouse with MBP.


Update:

Yosemite Bluetooth sometime freezes after wakeup, which then cannot be turned on/off and receive connections until reboot. If you want to manually restart it, do it by command line:

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

Or you can use my Bluetooth Restart Alfred Workflow or similar AppleScript.


El Capitan UPDATE:   Above bluetooth kext restart method will make the bluetooth driver unusable in 10.11, so restart your mac seems the only way to fix bluetooth freeze.

fix himedia player to add nas files into media library

My HiMedia 910a player doesn’t support adding nas files (samba/nfs) into its media library. Browsing thru folders is quite tedious for media enjoy time. And 900 series players seem auto overwrite some system files when booting. Therefore customize your own firmware is the choice. Following is the solution after two days of search and configuration:

  1. Make sure you have squashfs-tools installed, if you are on Mac, then build yourself with this code from vasi.
  2. Download your device’s latest firmware, which is named as install.img but actually a tar file. Use tar to extract img’s contents files, in the “packageN” (N=5 or other number) folder, find squashfs1.img
  3. use unsquashfs to extract squashfs files, in the output folder rtk_rootfs/etc/init.d, modify file rcS to uncomment this line:

    /usr/local/etc/rcS>/dev/console&

  4. in rtk_rootfs/user/local/etc.org/, modify file rcS to add a line at the end:

    /usr/local/etc/myinit.sh&

  5. make sure it is executable: chmod +x rcS
  6. use mksquashfs to create back squashfs1.img file, and use tar to create back install.img
  7. upgrade this new created firmware, then myinit.sh will be auto called when booting
  8. Insert a sdcard or usbdisk to player, so that himedia system will allow add to media library button from these “local files”. I use a sdcard, so following location will be /tmp/usbmounts/mmcblkop1
  9. telnet into himedia, go to /tmp/usbmounts/mmcblkop1, mkdir a folder like “nasfiles”
  10. go to /usr/local/etc, vi myinit.sh to mount nfs share after sdcard is ready:

    #!/bin/sh

    sleep 35

    if [ -d /tmp/usbmounts/mmcblk0p1/nasfiles/ ]; then

    mount -t nfs -o ro,nolock 192.168.xx.xx:/folder/ /tmp/usbmounts/mmcblk0p1/nasfiles

    fi

  11. make sure myinit.sh is executable
  12. Now when himedia player is starting, it will auto mount remote nfs files into sdcard folder, then go to storage card’s nasfiles folder, the system will allow you to add nas folders or files to media library!
  13. However, sometime the system media library handling will not work properly. You can also manually fix the media library database when some folder or file is grayed out. Take the sdcard out and insert into your PC.
  14. Go to the sdcard root folder, go into “.Theatter” hidden folder, there’s stx.db file, which is in sqlite format. use sqlite3 to open it. Backup if you don’t want risk library corrupt.
  15. Mostly the ExtHddFolder table is your target, check full_folder_name to be correct; change folder_type to 3 will show the folder in “My Movies”; if you just want folders shown, delete all files item.
  16. Insert back, reboot and wait some time for network up and mount up, browse into My Movies, you have a neat and direct display of Nas folders and movie files!

Fix TimeMachine on Buffalo LS-CHLv1

Since Lion, the TimeMachine support on the Buffalo LinkStation LS-CHL v1.0 was broken because the new Netatalk protocol is now used in Lion TimeMachine backup process which is not compatible with the old NAS firmware’s atalk version. With such a long time passing, Buffalo only updates a few products’ firmware (including LS-CHL v2.0) to support Lion’s TimeMachine, and leaves a lot of old NAS model unsupported. And according to this thread, there WILL NOT be any official firmware updates for my LS-CHL v1.0 in the future.

However, as user boing in the previous forum thread suggested, it could be done by self installing new netatalk protocol to your old NAS device. After two days of configuring, now my old LS-CHL v1.0 could successfully backup my MBP now. Here’s the detail steps:

1) use acp_command to allow telnetd on the LinkStation device, logon to it under root user

2) ipkg update, ipkg upgrade, and then ipkg install netatalk protocol, which should be version 2.2.0-2

3) stop old default atalk service by: /etc/init.d/atalk.sh stop, and killall cnid_dbd and cnid_metad service

4) copy old /etc/atalk/*.* to /opt/etc/netatalk/, but don’t overwrite new installed uams folder (before copy, backup the new installed ones for reference if you wish)

5) remove .AppleDB .AppleDesktop .AppleDouble in the root folder under your time machine backup volume, the new cnid_dbd service will recreate these database upon the first access

6) modify file AppleVolumes.default, find the time machine backup volume line, append “options:tm” to it

7) modify AppleVolumes.default, afpd.conf, netatalk.conf to change MAC_CHINESE_SIMP to MAC_ROMAN if these ones contain such localization encoding before

7.5) because I use guest account to access NAS time machine volume, new uams_dhx2.so in afpd.conf is added but not used and tested actually, try use old firmware’s uams if logon to your network volume fails

8) start /opt/sbin/cnid_metad , /opt/sbin/atalkd and /opt/sbin/afpd service, now TimeMachine on your mac should work to connect your old friend NAS backup volume. Try do a backup first, as the Lion will update the old backup sparsebundle a bit, and you could enter into the new Time Machine with all your old data out there!

9) if you want linkstation to have boot time new afp service, modify /etc/init.d/atalk.sh, copy or create symbolic link to use new installed atalk ones

10) if TimeMachine won’t connect but prompts you “must create new backups” dialog, try this method , it takes several hours but works.

It’s a bit tedious to figure out all the configure steps after trying with several different time machine failures, but it’s not so complicated after all, requiring no recompilation or coding. It’s a REAL SHAME for Buffalo to abandon its longtime users without giving any efforts and notice.

Fix QSB Freeze with Lion

Google Quick Search Box will freeze in OS X Lion and alloc huge memory if you input long words in search box. Only forcing to kill the QSB process could free up the memory, which makes QSB almost unusable in Lion.

After a few trials and thoughts, I found that the issue seems related to spotlight integration, which is apparently upgraded in Lion. Try to deselect spotlight results and disable spotlight plugin in QSB preference to work around it.

Works for my QSB 2.0.0.3789 and freezes no more.

Lion Upgrade Issues

  1. Missing ~/Library folder in Finder: Use “chflags nohidden ~/Library” in terminal to show it back
  2. QSB huge memory alloc bug for more than 4 words input: NO FIX yet, disable spotlight plugin to work around
  3. XCode 4.1 launch crash: install standalone iTunes 10.4 after install XCode 4.1
  4. 3 finger swipe crash chrome/terminal/…: remove AirKeysInputManager.bundle from simbl, upgrade betterTouchTool to support customizable Lion multi-touches
  5. No Trim support for 3rd party ssd: Use Trim Enabler 1.2 to re-enable Trim support for SSD in Lion
  6. Alt+up/down doesn’t work any more to switch Spaces, now Mission Control only have left/right horizontal Desktops, which is ridiculous and lousy for switch more than 2 desktops; Workaround: arrange common applications to Desktop 2 so that only one left/right switch is needed for most used 3 desktops, alt+number to direct jump
  7. Time Machine backup with link station is BROKEN because Lion use new netatalk 2.2 and new security protocol. No quick fix seems to come from Buffalo 🙁 A firmware 1.53beta upgrade is provided by Buffalo to fix TimeMachine backup issue, but it’s only for LS-CHL-V2, the CHL revision 1 seems no quick fix before September! Wait Again!
  8. Preview constantly crashes upon launching if some folder in home folder is a symbolic link to external hard disk folder; remove the symbolic link, relaunch preview(won’t crash now), and relink the symbolic link, preview will work since then.
  9. Autojump broken in Terminal: Fix by replacing line 47 in autojump.bash with

    export PROMPT_COMMAND=”$AUTOJUMP ; ${PROMPT_COMMAND:-:}”

  10. TextEdit also keeps crash upon launching: Same issue with Preview, remake downloads symlink will fix it.
  11. Full screen apps doesn’t support second display. Only the primary display could show the apps in full screen mode leaving other displaying only blank linen. And because the system menu bar is also on primary display, some functions are also hard to use for app maximized window on second display. Workaround: use this hack for opening another app in full screen as well as REMEMBER the keyboard shortcuts!
  12. VMWare Fusion 4 introduce its bluetooth and broke previously self-customized bluetooth broadcom driver, now only usable in client windows system booted when bluetooth is turned on OR check share bluetooth device with windows, otherwise,  even though device manager has one bluetooth device listed, the broadcom bluetooth software won’t recognize it either.

Rar archive in mac finder with automator

用Mac的一个重要麻烦就是zip archive经常在windows下乱码,由于mac采用unicode编码,中文文件名zip压缩文件之后,在采用ansi编码格式的windows上就是乱码,往往无法解压还原。用stuffit,finder自带的压缩,都避免不了这个问题。

但rar文件就没有乱码问题,用betterzip之类的就可以归档rar文件,但大多需要打开betterzip程序,再选择文件等,多了好几个步骤,如何能在finder里选择目标文件直接生成rar文件?当然可以,用mac著名的automator!

在automator里,选择Service服务类型,选择接受文件和目录,然后拖进执行shell脚本,选择输入自变量,然后在脚本内容里输入:

#!/bin/bash
for f in “[email protected]
do
pp=`dirname “$f”`
ff=`basename “$f”`
cd “$pp”
/usr/local/bin/rar a -m5 -ep1 -o+ Archive.rar “$ff”
done

保存为建立rar的工作流服务,这样在finder选择多个文件或目录后,右键选择服务里直接可以把目标文件生成rar归档文件了。