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

Monday, May 18, 2015

Fix for when iMessage on Mac OSX no longer displays SMS/iMessage photos

Thanks to Ralph Johns for the info on the fix!  Here's a quick and dirty script that can help fix iMessage if it stops displaying jpeg files in Mac OSX (Yosemite*):


$cat fix_imessage.sh
#!/bin/bash

# Set file/paths to check
file_attach='~/Library/Messages/Attachments'
file_symlnk='~/Library/Containers/com.apple.iChat/Data/Library/Messages/Attachments'
target_symlnk='../../../../../Messages/Attachments'

#Start checking
echo Checking $file_attach...
if [ -d $file_attach ]
then
        echo $file_attach is already a folder.
fi

if [ -f $file_attach ]
    then
        echo $file_attach is an unexpected file. Fixing...
        echo Renaming Attachments to Attachments.old...
        mv $file_attach $file_attach".old"
        echo "Creating new Attachments folder..."
        mkdir -m770 $file_attach
fi

echo Checking symlink dependencies...
if [ -h $file_symlnk ]
    then
        echo $file_symlnk symlink ok.
    else
        echo $file_symlnk symlink broken.  Fixing...
        mv $file_symlnk $file_symlnk".old"
        ln -sf $target_symlnk  $file_symlnk
fi

echo Done.
echo Exiting.
exit



*NOTE:  Only tested on OSX Yosemite.  May or may not work on other versions of OSX.

Thursday, March 19, 2015

Setting up Numpad keys on Zsh

Sourced from: http://superuser.com/questions/742171/zsh-z-shell-numpad-numlock-doesnt-work

bindkey -s in-string out-string binds in-string to out-string. If in-string is typed out-string is pushed back and treated as input.
The actual codes (for example ^[Oq) may be different on your system. You can press Ctrl+vfollowed by the key in question to get the code for your terminal.

 Snippet of ~/.zshrc from my machine (Macbook Pro 15" Retina):
# Setting Keypad info:
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
bindkey -s "^[Ot" "4"
bindkey -s "^[Ou" "5"
bindkey -s "^[Ov" "6"
bindkey -s "^[Ow" "7"
bindkey -s "^[Ox" "8"
bindkey -s "^[Oy" "9"
bindkey -s "^[Op" "0"
bindkey -s "^[OX" "="
bindkey -s "^[Oo" "/"
bindkey -s "^[Oj" "*"
bindkey -s "^[Om" "-"
bindkey -s "^[Ok" "+"
bindkey -s "^[OM" "^M"
bindkey -s "^[On" "."

Saturday, November 29, 2014

How-to flash Nexus devices back to a particular Android version

Link and how-to to flash Nexus devices back to factory specs;  Includes direct links to download factory images for various versions:

https://developers.google.com/android/nexus/images


Saturday, November 8, 2014

Extract sets of compressed tarballs within each respective folder

$ for i in *.gz;  do mkdir `echo $i | cut -d '.' -f1`;  tar xvfz $i -C ./`echo $i | cut -d '.' -f1`; done

The above will:
1) Build a list of all .gz files within the current folder (assuming .tar.gz files)
2) If the tarball filename is tarballfile.tar.gz, create a folder called tarballfile/
3) Extract the contents of tarballfile.tar.gz into folder ./tarballfile/
4) Continue iterating through the other tarball files until the loop has completed.


Wednesday, October 1, 2014

How to set JAVA_HOME when installing Oracle JDK on a Mac running OSX Mavericks:

How to set JAVA_HOME when installing Oracle JDK on a Mac running OSX Mavericks

Sourced from: https://www.blogger.com/home?pli=1


The right place to download the JDK for Java 7 is Java SE Downloads.
All the other links provided above, as far as I can tell, either provide the JRE or Java 6 downloads (incidentally, if you want to run Eclipse or other IDEs, like IntelliJ IDEA, you will need the JDK, not the JRE).
Regarding IntelliJ IDEA - that will still ask you to install Java 6 as it apparently needs an older class loader or something: just follow the instructions when the dialog pop-up appears and it will install the JDK 6 in the right place.
Afterwards, you will need to do the sudo ln -snf mentioned in the answer above:
sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents \
    /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
(copied here as it was mentioned that "above" may eventually not make sense as answers are re-sorted).
I also set my JAVA_HOME to point to where jdk_1.7.0_xx.jdk was installed:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home"
Then add that to your PATH:
export PATH=$JAVA_HOME/bin:$PATH
The alternative is to fuzz around with Apple's insane maze of hyperlinks, but honestly life is too short to bother.
Thanks to Marco at:
Marco
853513



Link to main response: