Thursday, May 19, 2016

Mac OSX (El Capitan) Software Update tool via CLI


List available software updates via CLI (but don't install them):

$ sudo softwareupdate -l
Software Update Tool
Copyright 2002-2015 Apple Inc.

Finding available software
Software Update found the following new or updated software:
   * OS X El Capitan Update-10.11.5
OS X El Capitan Update (10.11.5), 740450K [recommended] [restart]
   * RAWCameraUpdate6.19-6.19
Digital Camera RAW Compatibility Update (6.19), 7575K [recommended]
   * iTunesXPatch-12.4
iTunes (12.4), 144804K [recommended]



Install all pending software updates via CLI:

$ sudo softwareupdate -i -a
Software Update Tool
Copyright 2002-2015 Apple Inc.

Finding available software

Downloading OS X El Capitan Update
Downloading Digital Camera RAW Compatibility Update
Downloading iTunes
Downloaded Digital Camera RAW Compatibility Update
Downloaded iTunes
Downloaded OS X El Capitan Update
Installing OS X El Capitan Update, Digital Camera RAW Compatibility Update, iTunes
Done with OS X El Capitan Update
Done with Digital Camera RAW Compatibility Update
Done with iTunes
Done.

You have installed one or more updates that requires that you restart your

computer.  Please restart immediately.

Thursday, February 25, 2016

Useful settings for Mac OS X (Mavericks onward) / Adding GPX files directly to a Garmin Fenix 3

Here's a few settings that I came across [1] that helped make my daily workflow easier while working on a Mac, listed below:

defaults write com.apple.finder AppleShowAllFiles YES
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
killall Finder

Let's cover what they do:

defaults write com.apple.finder AppleShowAllFiles YES

This command above enables the ability to show all hidden files in the Finder, which can be useful for power users (or for those who have a Fenix 3 and need to access the NEWFILES folder in /Volumes/Garmin/Garmin to upload .GPX files [2]).


Do you use the Quick look feature much in OS X?  If not, it's certainly a very useful feature to quickly peek into files on the Finder.  If you do use it and would like to copy and paste frequently from these files (i.e. source files, or general text files), the command below will enable this:

defaults write com.apple.finder QLEnableTextSelection -bool TRUE


Of course, we will need to either logout of the current session or restart the finder.  You can restart the finder by running the following:

killall Finder


In case you want to revert the above settings to default, you can run the following commands respectively:

defaults write com.apple.finder AppleShowAllFiles NO
defaults write com.apple.finder QLEnableTextSelection -bool FALSE
killall Finder


References / Sourced from:

[1] Macworld UK:
How to show hidden files and folders in Mac OS X Finder:

How to select and copy text from Quick Look previews in OS X:

[2] Itamar Latnik's Youtube post: Garmin Fenix 3 - Import a GPX Course

Tuesday, January 5, 2016

Calculate total amount of Physical RAM on all Active TaskTrackers in MR1 using Unix tools

The following should accomplish this assuming the interest is in identifying how much total physical RAM is available on all Active TaskTrackers (i.e. not blacklisted) in MR1 using common Unix commands:
for i in $(curl -s http://jobtracker.company.com:50030/machines.jsp?type=active | grep 'href="http://' | cut -d '=' -f2 | cut -d '"' -f2); do curl -s $i"jmx" | grep  'TotalPhysicalMemorySize' | grep -Po [0-9]+ ; done | paste -sd+ - | bc; 
NOTE:  Replace the http://jobtracker.company.com with the appropriate hostname of the JobTracker.
The above command will retrieve the list of active TaskTrackers from the JobTracker, iterate through the list, summing the 
TotalPhysicalMemorySize
 metric from each TaskTracker's JMX and display the end result, in bytes.

Example output:
[user@node10 ~]$ for i in $(curl -s http://node1.com:50030/machines.jsp?type=active | grep 'href="http://' | cut -d '=' -f2 | cut -d '"' -f2); do curl -s $i"jmx" | grep  'TotalPhysicalMemorySize' | grep -Po [0-9]+ ; done | paste -sd+ - | bc;

23488339968
[user@node10 ~]$



As replied here: https://www.quora.com/How-can-I-check-total-RAM-in-Hadoop-cluster-running-MR1-not-YARN

Wednesday, November 25, 2015

Not able to see all your shared Google calendars?

The following link (loaded on desktop rather than smartphone) will allow you to select which specific shared calendars are visible on the devices which read from Google Calendars (ie. your Smartphone):

https://calendar.google.com/calendar/syncselect


Context:  My wife and I recently started to share our multiple calendars on each other's smartphones (iPhones), and noticed that we were only able to see the main calendar, but not the resulting sub-calendars from each main Google account.   After digging around, the above link was found deep within the forums of Google and Apple, and was able to help expose the page where I could select which specific sub-calendars I could share out!   Hope this helps you in your quest for shared information!


Sunday, July 26, 2015

Add new Java SDK to IntelliJ CE

Sourced from: https://www.jetbrains.com/idea/help/sdks-java.html

File -> Project Structure -> SDKs -> Java SDK -> [+] -> Locate JAVA_HOME of intended JDK

Thursday, May 28, 2015

Open Dropbox folder from anywhere in Mac OSX

Hi folks,  here's a method that I implemented that allowed opening the Dropbox folder from within any application (well, it gets called by a Terminal session from the Finder).

This does not however, automatically switch to the Dropbox folder while in the middle of a application dialog box;  it simply opens up the Dropbox folder in the event you need to look into or open something within the Dropbox folder.  To access the Dropbox folder from an application dialog box, you can drag the Dropbox folder into the "Favorites" section of the application save/open dialog box to access it within one click.

Ok, if you're still interested in a hot-key anyway to access the dropbox folder,
here's how to do it:

1. Open Automator: [Cmd]-[Spacebar], type in Automator.

2. Select Service, click Choose

3. Modify Service receives selected [text] in [any application] to  Service receives [no input] in [any application].

4. Select the action Run Shell Script under Utilities, drag it over to the right pane.

5. Change the cat command to open ~/Dropbox .  If your Dropbox folder is located somewhere else, please modify the pah accordingly.

6. Save as Open Dropbox Folder within Automator.

7. Open System Preferences: [Cmd]-[Spacebar], type in System Preferences .

8. Navigate to Keyboard -> Shortcuts

9. Scroll down to General

10. Ensure the checkbox for Open Dropbox Folder is checked (enabled).

11. Choose the Keystroke combination to open the Dropbox folder.
NOTE:  If you choose [Option]-[Cmd]-[D], you may need to disable Turn Dock Hiding On/Off in the Launchpad  & Dock section.


Enjoy!

Thursday, May 21, 2015

Set alias options to dynamically change JAVA_HOME to particular JDK in Mac OSX (Yosemite)

Add the following to ~/.zshrc  or ~/.bashrc:

#Set alias options to dynamically change JAVA_HOME to particular JDK
alias jdk16 = ' export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) '
alias jdk17 = ' export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) '
alias jdk18 = ' export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) '



Re-source the rc file to pickup changes on the terminal:
$source ~/.zshrc or ~/.bashrc



Sourced from:
http://apple.stackexchange.com/questions/135058/i-installed-oracle-java-jdk-8-but-java-command-line-is-still-reporting-it-is-ver