Monday, January 13, 2014

Installation and Configuration: VM Player, Ubuntu, and Julia

Below are the steps I used to quickly load and configure:
- an Ubuntu VM on Windows
- emacs and mysql
- julia and ODBC

Good luck!
    1. Download free vmplayer: https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0
    2. Download the ubuntu iso: http://www.ubuntu.com/download/desktop/questions?distro=desktop&bits=64&release=lts
    3. Install the vmplayer following the prompts.
    4. Start the player and create a new vm using the downloaded ubuntu .iso.
      1. Adjust hard disk size and memory for VM as desired.
      2. Say yes to pop up on VMWare linux specific tools. They are handy.
      3. You be asked to enter some information about your vm. Name, user, password, etc.
    5. Once the install is complete, log in to your new linux box.
    6. Click on the Update Manager on the left side navigation buttons. Choose to install all the updates. You will need to enter your password for authentication.
    7. After the updates are finished, open a terminal window (Press the windows key to bring up the dash, type terminal, and then hit Enter.)
    8. Install git:
      1. Note: Use Ctrl-Shift-V to paste into the terminal
      2. sudo apt-get install git-core
    9. Install julia:
      1. sudo add-apt-repository ppa:staticfloat/julianightlies
      2. sudo add-apt-repository ppa:staticfloat/julia-deps
      3. sudo apt-get update
      4. sudo apt-get install julia
    10. Type julia and you should see the julia greeting :)

    • Optional: Install Emacs 24 and ESS with julia mode
      • sudo add-apt-repository ppa:cassou/emacs
      • sudo apt-get update
      • sudo apt-get purge emacs emacs-snapshot-common emacs-snapshot-bin-common emacs-snapshot emacs-snapshot-el emacs-snapshot-gtk emacs23 emacs23-bin-common emacs23-common emacs23-el emacs23-nox emacs23-lucid auctex apel emacs24 emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs-el
      • sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg
      • from https://github.com/emacs-ess/ESS/wiki/Julia:
        • Make a directory somewhere for ess then change into that directory. In the next step a directory called ESS will be created for you.
        • git clone git://github.com/emacs-ess/ESS.git
        • cd ESS
        • git pull
        • make all
        • For me it failed on making the documentation, but when opening a jl file within emacs gave me the desired syntax highlighting. That's good enough for me.
      • add the following line to your ~/.emacs file to allow for julia mode:
      • (load "~/your_dir_to/ESS/lisp/ess-site")
      • (setq inferior-julia-program-name "/usr/bin/julia-basic")
    • Optional: Install MySQL and ODBC connectivity
      • sudo apt-get install mysql-server
      • You will be asked to pick a password for the mysql root user
      • Optional: Add Time zones to MySQL
        • mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -p**** mysql
      • Configure odbc
        • sudo apt-get install unixodbc
        • sudo apt-get install libmyodbc
        • edit the /etc/odbcinst.ini file:  sudo gedit /etc/odbcinst.ini
        • add the following, save, and exit:
    [MySQL]
    Description = ODBC for MySQL
    Driver =  /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
    Setup =  /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
    FileUsage = 1

    • from the command line run: odbcinst -q -d
    • It should return [MySQL]
    • Next edit the /etc/odbc.ini file:    sudo gedit /etc/odbc.ini
    • replace **** with the password you used when installing MySQL
    [mysql-connector]
    Description           = MySQL connection to hist database
    Driver                = MySQL
    Database              =  mysql
    Server                = localhost
    UserName              = root
    Password              = ****
    Port                  = 3306
    Socket                = /var/run/mysqld/mysqld.sock
      • save and exit the file editor
      • check for connectivity on the command line:     isql -v mysql-connector root ****
      • If you do not receive a "Connected!" message and an SQL> prompt, then check the previous steps to ensure you didn't miss something.
      • Press ctrl-D or type quit to exit.
    • start julia by typing:  julia
    • Add the DataFrames and ODBC packages: 
      • Pkg.add("DataFrames")
      • Pkg.add("ODBC")
    • Test for a connection:
      • using ODBC
      • ODBC.connect("mysql-connector", usr="root", pwd="****")
      • query("show databases;")
    32 bit installations
    • If your computer doesn't support a 64 bit operating system there are a few changes:
      • Download the appropriate 32 bit vmplayer
      • Download the 32 bit Ubuntu iso
      • For ODBC, the odbcinst.ini file should have these lines:
      • Driver =  /usr/lib/i386-linux-gnu/odbc/libmyodbc.so
        Setup =  /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so
    For more information check out http://julialang.org and the great community at:

    No comments:

    Post a Comment