MacOS bluetooth headset audio issue

Recently my bluetooth headset starts to act up when listening to music from MacOS. I initially thought it has died. Turns out it is an OS problem. Basically if i use it as both input and output device, the sound quality is awful. So one solution is go to the sound setting and manually select input…

macos system launch config

MacOS Config options MacOS boot service is mainly configured via three ways: 1.  the system preferences -> Users & Groups -> Login items 2. /System/Library/StartupItems and /Library/StartupItems/ 3. launchd system initialization process configuration. The first two are relatively simple, we will focus mainly on the third more complex launchd configuration optimization. launchd is a key…

disable the macos auto update notification

The auto update notification is pretty annoying since it popup everyday, and you need several clicks to make it disappear. change from UI I tried to disable it from System Preference -> App Store -> uncheck Automatically check for update. it does not that the checkbox keep checked after i reopen the system preference panel….

clipboard in terminal(copy/paste)

Was watching a CD video with Semaphore and saw the guy in the video manipulating clipboard with pipe directly in the terminal. Pretty cool! Did some research on that. OSX(MacOS) In Mac, it is pretty straightforward with the built in pbcopy and pbpaste. (pasteboard copy / paste). Some examples: cat my.key.pub | pbcopy pbpaste > my.otherKey.pub ps…

OSX auto cleanup tmp ignore dir

Was putting some project related configs into the OS X /tmp directory, but found it was deleted. Turns out OS X has system scheduled cleanup job for the tmp dir. The config is under ‘/etc/defaults/periodic.conf‘. I was first trying to leverage the provided ‘daily_clean_tmps_ignore’ parameter to exclude my directory but found not working, have to…

Install jdk 8 in Yosemite 10.10.2

While i was trying to downgrade JDK from 1.8.0._25 to 1.8.0_05 into the yosemite 10.10.2 so that i could use the DCEVM in my OSX.   I first remove the new version by just do a sudo mv jdk1.8.0_25.jdk ~/Desktop/ Next step is to install the 1.8.0_05 which is the current latest version that DCEVM supports.However, I got the…

.profile vs .bash_profile in OSX

According to the manual page that ships with OS X: … it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The –noprofile option may be used when the shell is started to inhibit this behavior. in summary: .profile works with sh…

upgrade java version in OSX

To find the right value that JAVA_HOME should be set to. 1. first executed a `which java` in the nearest Terminal. this told me that /usr/bin/java was the executable that launched the VM. 2. A quick `ls -l /usr/bin/java` told me that it wasn’t a symbolic link to the JDK installation that I was hoping…

add indicator for UIwebview loading in iOS

To achieve this, we need to do several steps: 1. make self as the webview delegate : UIWebViewDelegate. 2. add a UIActivityIndicatorView into the view 3. implement methods like start load in the UIWebViewDelegate; Below are the details.  1. make self as the webview delegate : UIWebViewDelegate. in the .h file, add <UIWebViewDelegate> after the UIViewController.  for example…

create manual segue and config in viewController

regular segue from storyborad In StoryBoard we can easily create segue by control drag the source widget to the destination widget. Then in the viewContoller, just create a method: if the source widget is a cell in table view, use the indexPath to get the param from context. if there is some simple condition to…

determine ios connectivity states wifi 3g

Method 1 Many people use an easy and dirty way: Mehthod 2 (better): Follow following 3 easy steps – Step 1: Include “SystemConfiguration.framework” framework in your project Step 2: Included Apple’s Reachability.h and Reachability.m from Reachability example Step 3: Now add this code anywhere in your .m.

ios webview url null problem

when i was trying to load a url in the uiWebView, my NSURL object is always nil when i init it this way: NSURL *url = [[NSURL alloc] initWithString: urlString]; This is because: If the string was malformed, returns nil. This method expects URLString to contain any necessary percent escape codes, which are ‘:’, ‘/’,…