Fix safari or chrome scroll lagging in Yosemite

Just found some lagging when scrolling content in Chrome/Safari, especially after a few scrolls, the web page will pause about 0.5s then leap to the target position, which is quite annoying. After a few google around and testing, the Better Touch Tool v0.9995 is found to be the culprit. After disable it, all browsing returns smooth.

But as I use customized three finger swipes frequently, the magicprefs is now the alternative choice for gesture customization, which seems no conflict problem. But the system three finger swipe gesture must be disabled first in the trackpad preference pane, then the magic preference will enable the available gestures.

Update:

Just encounter a Yosemite system-wide problem of missing right click menu, but ctrl+click still works, which might be related to WindowServer process. Only reboot can get the right click back. After rebooting more than 10 times,  it seems to happen after drag & drop to secondary monitor by bluetooth mouse. Quite strange, not sure if it’s bluetooth problem or drag&drop problem. Revert to Better Touch Tool temporally. And BTT released 1.0 which seems no lagging problem now.

Fix Mac App Store An Error Has Occurred

Just encountered a frustrating problem when updating Numbers in the Mac App Store. There’s “an error has occurred” message in the Updates list as well as Purchased app list for Numbers after a seemingly success but actual fail update. Then, opening Numbers app will fail, showing an alert that the app is still updating. Go back to the MAS, the button for Numbers is now installed, so you cannot update/install the app ever again because App Store deems it alright.

Try deleting the Numbers.app in Application folder won’t help either. The “an error has occurred” is still there and the app status is always “installed” even the app is absent from my Mac. Logging out, and logging in to MAS several times, an error always occurred.

Now googling hundreds of pages. Try the interesting MAS debug mode solutions here, but the problem remains. Try the reset errors solution, still no hope. Even try the reset everything for app store cache solution and safari cache solution, both fails. And nothing going wrong for MAS in the Console even strongly suggested that it might be a MAS server problem, which would requires a bug report eventually. I supposed.

Finally, a non-sense post in somewhere in the piles of discussion threads on the web I’ve browsed gave a helpless cue and last resort action: changing the system language/location to English. The mysterious MAS problem is solved. The latest Numbers update showed and installed.

Now I advocate that a fallback App installer/updater mechanism should be there just in case that MAS goes wrong.

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!

Setup Test Analytics on GAE with Google Apps Account

Test Analytics is a quite good project from Google for testing analysis practice. It is open sourced at http://code.google.com/p/test-analytics/. However the documentation is quite limited and not straight forward for configuration and setup.

Just spend quite a few hours to make it run on GAE with Google Apps account. Here is the  steps:

  1. Create target GAE application in GAE (https://appengine.google.com) with your Google Apps account, select user authentication to Google Apps and set your apps domain (i.e. xxxx.com)
  2. In your Google Apps Administrator Homepage (https://www.google.com/a/xxxx.com/), add services with GAE application id set to the created one
  3. Download or git clone the test analytics project code
  4. In the pom.xml at project dir, add following lines into the maven-gae-plugin <plugin> element:

    <configuration>
    <serverId>appengine.google.com</serverId>
    <sdkDir>${appengine.sdk.root}</sdkDir>
    <appDir>${basedir}/target/test-analytics-1.0-SNAPSHOT</appDir>
    </configuration>

  5. also change gae.version to latest version in pom.xml

    <gae.version>1.7.1</gae.version>

  6. In ~/.m2/settings.xml add: (make sure <id>value is equal to <serverId> of maven-gae-plugin in pom.xml)

    <settings>
    <servers>
    <server>
    <id>appengine.google.com</id>
    <username>google apps account</username>
    <password>google apps password</password>
    </server>
    </servers>
    </settings>

  7. In the appengine-web.xml under src\main\resources, change:

    value of frontend.url to your GAE application url

    value of frontend.localdomain to your Google Apps Domain xxxx.com

    value of frontend.whitelisting to true

  8. in terminal, go to project folder, run “mvn gae:unpack” to install latest gae java sdk to maven repository
  9. run “mvn gae:deloy”
  10. now maven will download all required plugins, compile project and upload it to GAE
  11. check if it works successfully by login with your Google Apps Account, you can enable accessing accounts in GAE application’s  permission settings

add route and dns for VPN connection in Mac

VPN now becomes a ubiquitous way for climbing over GFW in China. However, once the Mac is connected with VPN and sends traffic thru it , VPN’s dns and route setting will take priority over the default network settings, which sometimes is quite inconvenient for fast accessing local sites and using other dedicated network like ipv6.

There’s a combination of configurations to work around the dns and route table of VPN:

1) when connected to the VPN, in Terminal, use the way described to find which VPN’s dns you want modify

2) in Terminal, sudo vi /etc/ppp/scutil_vpn.txt, add following lines, replace the GUID with your target GUID:

d.init
get State:/Network/Service/E6592FF4-8A4F-4C86-B1A2-F865D658D4FF/DNS
d.add ServerAddresses *
set State:/Network/Service/E6592FF4-8A4F-4C86-B1A2-F865D658D4FF/DNS

4) in Terminal, sudo vi /etc/ppp/ip-up,(make it executable), add following lines, and modify the TARGET_IPADDR and MASK of which network subnet you want to go thru the VPN:

#!/bin/sh
/sbin/route add TARGET_IPADDR/MASK $5
/usr/sbin/scutil < /etc/ppp/scutil_vpn.txt

5) install and use dnsmasq to direct wildcard dns resolving for target server names to the VPN dns server

6) in the VPN settings, uncheck “Send All Traffic” box

7) done.

Now when you are connected with the target VPN, you will only go through the VPN to visit target domain names and ip you’ve set, with all other network like ipv6 unchanged. Of course,  the settings could be reversed to send most traffic thru VPN, leaving a few sites accessing locally.

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.

sunpinyin compile problem in Lion 10.7

Just encounter some build problem in 10.7 with latest sunpinyin git:

1)when compiling xib there’s a warning says TableViewColumns identifier expects NSString in 10.7, it could be fixed by manually set the TableViewColumn’s identifier to a string in Interface Builder. And note: manually set the english version xib, the zh_CN version will be auto generated

2)an build error suggest cp’s usage: in the build phrase, add quotation mark with the directory part, there could be space in the path

p.s. the diff file for the changes is here

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.

fix adium spotlight log search

For Adium 1.4.2, the chat transcript log doesn’t appear in spotlight search result even though the word is exactly in the chat logs. Yeah, it’s no big deal, but a bit annoyance, especially when Adium’s own transcript search won’t return good results.

After some research, a few tryouts were taken: Using mdimport to force spotlight reindex the logs folder seems not work. Followed instruction of this ticket to move the chat logs folder to user documents folder, still not work. Then, this ticket has the culprit bug revealed. The
GetMetadataForXMLLog function doesn’t handle the chatlog bundle correctly. Just appending the xml path before parsing the xml file and rebuilding the project will exactly fix the spotlight search issue.

Therefore the reverse steps are the final solution:
1) Get my bug fixed version of AdiumSpotlightImporter (or compile the bugfix version by yourself), unzip and copy to /Applications/Adium.app/Contents/Library/Spotlight, and make sure the importer is used by spotlight in “mdimport -L”
2) Move the adium chat log folder to your documents folder as the above ticket shows, so that spotlight will not exclude it under the system library folder
3) mdimport “your new adium chat log folder” to merge into the spotlight index
4) Search words in spotlight, the adium result now will show in search results under the mail category

Good luck, Adium users!