Ajitabh Pandey's Soul & Syntax

Exploring systems, souls, and stories – one post at a time

Tag: OSX

  • OSX Screenshots tips

    Changing location to store screenshot

    The default place where screenshots are saved in OSX is the Desktop. For people (like me), who would like to keep their desktops nice and clean and a little organised, we can change the location where the screenshot are stored. This needs command line. Launch “Terminal” and type the following commands which should do the trick. I am moving my screenshot location to somewhere in Google Drive. Please note that the location which you are setting as the target for storing screenshots, must exist, and as you can see, I am creating it first.

    $ mkdir -p ~/Google\ Drive/Pictures/Screenshots
    $ defaults write com.apple.screencapture location ~/Google\ Drive/Pictures/Screenshots/ && killall SystemUIServer

    The “killall” command is used to restart the SystemUIServer so that the changes can be picked up by the system.

    Changing the Screenshot file type

    The default screenshot file type is PNG. However, you can change this to – jpg, tiff, pdf, gif by using the following command on the terminal.

    $ defaults write com.apple.screencapture type gif && killall SystemUIServer
  • Installing Oracle Instant Client for Mac OSX

    I came across few links for installing Oracle Instant Client on Mac OS X namely – this and this. But I don’t like to tinker with the System paths while installing any s/w manually. I did the same with perl CPAN modules, I install them locally in home directory and same with Python pip packages, but that’s another post for future. So I had to work out the following method for installing the Oracle Instant Client as I needed sqlplus client for connecting to my RDS Oracle instance.

    Download the following two files from http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html

    instantclient-basic-macos.x64-11.2.0.4.0.zip
    instantclient-sqlplus-macos.x64-11.2.0.4.0.zip

    These will be downloaded in the Downloads directory

    Unzip these two files in a single directory

    $ cd Downloads
    $ unzip instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
    $ unzip instantclient-basic-macos.x64-11.2.0.4.0.zip
    $ cd ~

    Create the required structure in the home directory and copy the files in place

    $ mkdir -p oracle/product/instantclient_64/11.2.0.4.0/{bin,lib,jdbc/lib,rdbms/jlib,sqlplus/admin,network/admin}
    $ mv Downloads/instantclient_11_2/ojdbc* product/instantclient_64/11.2.0.4.0/jdbc/lib/
    $ mv Downloads/instantclient_11_2/x*.jar product/instantclient_64/11.2.0.4.0/rdbms/jlib/
    $ mv Downloads/instantclient_11_2/glogin.sql product/instantclient_64/11.2.0.4.0/sqlplus/admin/
    $ mv Downloads/instantclient_11_2/*dylib* product/instantclient_64/11.2.0.4.0/lib/
    $ mv Downloads/instantclient_11_2/*README product/instantclient_64/11.2.0.4.0/
    $ mv Downloads/instantclient_11_2/adrci instantclient_11_2/genezi instantclient_11_2/sqlplus instantclient_11_2/uidrvci product/instantclient_64/11.2.0.4.0/bin/

    Make the following additions to your ~/.bashrc file –

    ORACLE_HOME="~/oracle/product/instantclient_64/11.2.0.4.0"
    PATH=$ORACLE_HOME/bin:$PATH
    alias sqlplus="DYLD_LIBRARY_PATH=$ORACLE_HOME/lib sqlplus"

    Now I can connect to the Oracle RDS instance using –

    $ sqlplus 'root@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ajitabh-oracle-test.bkl9a9lqwsoxcd.us-west-1.rds.amazonaws.com)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))'
    
    SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 26 21:59:46 2015
    
    Copyright (c) 1982, 2013, Oracle. All rights reserved.
    
    Enter password:
    
    Connected to:
    Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
    
    SQL>

    That’s it. More on exploring Oracle RDS later.