Thursday, February 22, 2018

Homebrew and Homebrew-Cask

Homebrew: The missing package manager for macOS
https://brew.sh/

Homebrew-Cask extends Homebrew and brings its elegance, simplicity, and speed to macOS applications and large binaries alike.
https://caskroom.github.io/

Monday, February 19, 2018

Early 2015 MacBook and late 2015 iMac 27'' 5K, target display mode alternative solution

Late 2015 iMac 27 5K doesn't support target display mode anymore, so early 2015 Macbook could not use it as display with target display mode.Plus This model MacBook doesn't come with thunderbolt port, one USB-c type only.

Obvious workaround will be old fashion remote desktop then. Apple's remote screen works, but it could not scale and the screen response depends network condition if it is via WiFi.

Then I got a Apple Thunderbolt 3 to Thunderbolt 2 adapter from BestBuy, however MacBook won't recognize it at all. Called Apple support couple times, and eventually they told me the usb type C port on this early 2015 MacBook is not really Thunderbolt 3, it is just USB 3.1 Gen one,  and 5Gbps is its maximum bandwidth, so the adapter won't work for it, and I could not use it for thunderbolt 2.0 conversion at all. (This is from Ajay Divakaran post on http://www.ajaydivakaran.com/imac-retina-and-target-display-mode/)

This leaves me to another try with USB 3.0 IP networking. after a good amount of google searching, I found one USB 3.0 cable with build-in switch: JUC500 from J5 Create. It is used for file transfer between two computer with USB 3.0 via smart Data Link protocol. (I did think about USB 3.0 cross over, but none of them available could be used for data transfer) I found the driver for IP over USB on OSX via HoRNDIS, which was build to share internet connection via USB cable for OS X, since Apple never provides its own driver for it. This driver was written some years ago, so it is for USB 2.0, and it is halfplex for some reason, so iPerf shows around 240Mbps throughput. I could not blame them at any rate. They was build to do they was meant to do, but not my case here. :-(

Eventually I went for ancient old cross over Ethernet cable with 1Gbps bandwidth, and of course I need a USB C to ethernet adapter for MacBook as well from eBay. This good old fashion connection was recognized by iMac ethernet port and Macbook USB type c port right away. With their own private subnet, 1Gbps connection via VNC connection (scaleable) could be an acceptable alternative for the missing target display mode finally.


VNC headless mode on Raspberry Pi low remote desktop resolution

Connecting to Raspberry Pi without keyboard and monitor connected via VNC viewer, but default display resolution is 640x480, which is too small and could not be scaled up.

After google for a while, link below provide the solution to change VNC screen solution:

https://www.realvnc.com/en/connect/docs/raspberry-pi.html

The term is headless and  To change the resolution, run the command sudo raspi-config, navigate to Advanced Options > Resolution, and choose an option. HDMI mode: Force

Thanks realvnc, and I learned something new.

Raspberry Pi 3B no video output

New Raspberry Pi 3B from MicroCenter, connected to TV via HDMI connection but there is no video signal on the screen.

Got a replaced Pi from MicroCenter again, and there is still no video signal, then I realized there is something else wrong, other than just bad video output.

Looking back to instruction guide, it mentions that using keyboard to type 1 or 0 depend on video cable connection, then I realized that initial NOOB boot needs keyboard!

Once I got keyboard connected, boot screen show up on TV right away.

After Raspbian OS is installed successfully, you can boot it without keyboard and monitor.

Sorry, MicroCenter.

App Store: macOS needs to repair your Library to run applications. Type your password to allow this.

Mac OS Sierra Version 10.12.6

New company Macbook Pro (15-inch, 2017) with VMware AirWatch and Enterprise Connect pre-installed after initial power on.

App Store crashed with error prompt: "macOS needs to repair your Library to run applications. Type your password to allow this. "

Quick google result to clean up files in ./Library and /Library about com.apple.appstore did not help, so I just look into error log: "You don’t have permission to save the file “Preferences” in the folder “Library”."

OK, it is about permission then,  so search it again and result from apple works:
 https://support.apple.com/en-us/HT203538

The procedure is to reset home folder permission, which could affect multiple applications, such as Preview, TextEdit, and even iTunes, not only App Store, but also Safari memory usage!

Wednesday, October 11, 2017

Malware MacDefender Removal experience

At least the following steps:
  1. Remove the malware browser plug-in (eg: OptiBuy), which will always try to get malware MacDefender/MacSecurity/MacProtector back.
  2. Stop MacDefender process via Activity Monitor, and then remove related programs from applications folder if any.
  3. System Preference ->Accounts->Login Items->remove MacDefender
  4. Remove OptiBuy from /Applications/;/Library/LaunchDaemons;/Library/Application Support; I also checked /System/Library/LaunchDaemons. When a user logs in, a per-user launchd is started, it loads list found in //System/Library/LaunchAgents, /Library/LaunchAgents, and the user's individual Library/LaunchAgents directory.
Based on timestamp, I also removed a suspected .ini file, though I am not sure it is related, however I don't believe Mac OS uses ini file anyway.

Sunday, October 30, 2016

iMac migration from Windows

I decided to use Migration Assistant from Mac OS X El Captain to transfer files from Windows machine to new iMac 27.

It is a decent tool, and it provides option to migrate email, but I did not try that. I just used it to transfer my files, music, and video, etc. Of course, client tools need to be installed on Windows machine. Copy process took few hours over Wi-Fi.

Then I noticed that OS X actually created  a new user account and copied all files I requested under that user! which is not exactly I wanted. I also observed by then, OS X createsits own Download, Pictures, Music, and movie folder outside Document folder, which is different from Windows by default. This is not quite convenient at all, and  later I realized that it is for iTunes and Photos, and iBooks default file path.

OS X denies to move my previous windows files to my current folder, since they belongs to the migrated user, so I used cp -r to make a copy of the files, and then chown -R. One thing I ignore during this process is to keep to original timestamp. I am not exactly sure they are already lost during Migration Assistant process, and my cp -r process, since I deleted the migration assistant user account later before I realize this.

Migration Assistant doesn't provide option for web browser bookmarks, so I export my IE bookmarks and Firefox book marks, and import them back to Safari/Firefox.

OS X uses unicode for text file encoding (UTF 8/16), which is different from Windows text file by default. In order to open previous windows file via TextEdit, you need change it preference. To change it permanently for other application, command-line iconv or duplicate an open file in TextEdit , and the select unicode encoding for saving file.

iTunes could not play APE/FLAC files, so alternate application is VOX. VOX might not recognize cue file properly, so you need a UTF  encoding version cue file via iconv or TextEdit.

iTunes can play MP3 files from my previous Windows machine, but I quickly noticed that MP3 tags are not displayed in iTunes Library. Again, it was due to encoding, as iTunes also use UTF, so a tag editor is required. eyeD3 is a command-line tool to do so, while Unicode Rewriter is a nicer application to do so too.

Before I changed MP3 file tag, I would like to know existing tag, Kid3 is the ideal application to do this.

I believe that Unicode Rewriter creates a new V2.3 MP3 tag with Unicode, after it reads original MP3 tag. Kid3 can be used to remove all unnecessary V1 tags and APE tags if any on MP3 files.

iTunes then can import unicode tagged MP3 file into iTune Library with proper display.

Audacity can modify sound file in various format

XLD can split APE files.

QuickPlayer might not be able to play certain video codec formats, so MPlayerX is the alternative to do so.


OS X creates default computer name during the first boot process, you can change afterward via command line scutil  or from System Preference->Sharing. OS X has three related names, one of them is used for file sharing over the network.

Samba file sharing for ubuntu client doesn't work well, but afp does.
Samba file sharing for Windows client need profiled credential.
Shared folder on OS X is defined in Sharing section of System Preference.

Unarchiver can extract RAR file format

Didbit 1: screen capture: CMD+SHIFT+3 or CMD+SHIFT+4  partial screen (from Apple support)
Tidbit 2: CMD + <- beginning of line; CMD + -> end of line; CMD+ up beginning of page; CMD + down, end of page
Tidbit 3: Option + <-, forward one word;Option+->, backward one word; up and down for paragraph movement.
Tidbit 4: to delete after cursor: Fn + delete
Tidbit 5: to zoom screen: enable it from System Preference -> Accessibility -> Zoom