OSX

Adding Sublime Text Command in OSX Terminal

Create a symbolic link from sublime text installation.

$ ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

Then you can use this command to open text file or folder.

$ subl .  # Open current directory
$ subl path/to/file.txt

Reference: https://stackoverflow.com/a/31771252/1936697

 

Advertisements

Fix Java Won’t Update in OSX Sierra

I have an issue using Oracle JDK in my laptop that the auto updater successfully update the JDK but the update is not applied on my system. I check my java version using.

$ java -version

But still showing the old version rather than the latest one.
I fix my issue by putting this following line on my bash configuration.

export PATH="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin:$PATH"

Show OSX Battery Cycle Count in Terminal

In case you are too lazy to find info about your battery cycle count in your OSX. Here is how to check battery cycle count through terminal.

$ system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'

Here is table information for maximum cycle count for your laptop.
mac battery count

Reference: http://apple.stackexchange.com/a/116435/199418

Show Homebrew Dependencies

Just found simple script to visualize homebrew and its dependencies.

brew list | while read cask; do echo -n $fg[blue] $cask $fg[white]; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done

Reference: http://zanshin.net/2014/02/03/how-to-list-brew-dependencies/