How do I install the Matlab MCR in Ubuntu 14.04 without "killing" Unity? - matlab

Background: I have created an Ubuntu VirtualBox from LAPP stack and added the Ubuntu desktop (Unity: sudo apt-get install ubuntu-desktop). Now I am attempting to install the MCR without loosing Unity.
Download MCR zip and extract to MCR_SOURCE
Go to my folder that contains the files: cd /media/sf_shared/MCR_ SOURCE
Change installer_input.txt file:
destinationFolder=/opt/MCR
agreeToLicense=yes
outputFile=/opt/install.log
mode=silent
product.MATLAB
product.MATLAB_Builder_JA
# Note: To find out the required toolboxes >> start Matlab >> run your code and find out which toolboxes were used with: license('inuse')
Install MCR: sudo ./install -inputFile /media/sf_shared/MCR_SOURCE/installer_input.txt >> success
Restart Ubuntu >> test whether Ubuntu’s Unity still exists >> everything is fine
Attention the next step will “ kill ” your Ubuntu desktop configuration!!! (i.e. copy your hardisk, anything you must do to recover quickly) – now configure: sudo gedit /etc/environment
LD_LIBRARY_PATH="/opt/MCR/v84/runtime/glnxa64:/opt/MCR/v84/bin/glnxa64:/opt/MCR/v84/sys/os/glnxa64:${LD_LIBRARY_PATH}"
XAPPLRESDIR="/opt/MCR/v84/X11/app-defaults"
# Note: X11/app-defaults folder has not been created during installation
Restart Ubuntu >> Unity is gone, recovery attempts such as deleting the above lines do not recover Unity; reinstalling the Ubuntu desktop does not help either.
I have tried an alternative route with exporting the variables, which also "kills" Unity. By the way this affects all users.
Any ideas?

It is not necessary to register these environment variables in /etc/environment, which means that the Unity sidebar will not be affected.
Instead register the environment variables temporarily either as local user or via sudo -i:
export LD_LIBRARY_PATH="/opt/MCR/v84/runtime/glnxa64:/opt/MCR/v84/bin/glnxa64:/opt/MCR/v84/sys/os/glnxa64:${LD_LIBRARY_PATH}"
export XAPPLRESDIR="/opt/MCR/v84/X11/app-defaults"
Now it is possible to run Matlab Apps without "killing" Ubuntu's desktop. For instance to run the Java compiled makesqr.m file.
java -classpath "/opt/MCR/v84/toolbox/javabuilder/jar/javabuilder.jar:/media/sf_shared/for_testing/makesqr.jar" makesqr.Class1 5
The Java package makesqr was created using Matlab's JavaBuilder tutorial. This was done on my Windows 7 machine, which runs Matlab R2014b.
Please ensure that the owner and permissions of the /opt/MCR and /media/sf_shared/for_testing folders are set correctly (see here for details).

Related

Installing jupyter lab on RHEL 7

I install jupyterlab on RHEL 7 (RedHat) with
pip3 install jupyterlab
Now I am trying to start it. I need to run it only locally (no need to open any ports). I found where file is located, but still cannot launch it. I tried jupyterlab and got back command not found.... I am guessing I need to add it to PATH, but I still expect it to run when launched from the same directory. Whatever limited experience I have with Ubuntu, does not work on RedHat.

PhpStorm in Ubuntu can't detect pd_dump executable on PostgreSQL Export

My environment:
Ubuntu 20.04.3 LTS on Windows 10
-> https://www.microsoft.com/store/productId/9NBLGGH4MSV6
PhpStorm 2022.1 Build #PS-221.5080.224, built on April 13, 2022
My Problem:
I'm trying to export a PostgreSQL database inside the Database tab of PhpStorm.
To execute the export I right click the database in the list and click on the "Export with 'pg_dump'" option. This opens the Export window with all the options and command preview:
Inside of the window I get the error message "Path to executable is wrong" even tho the pg_dump file exists at the given path /usr/bin/pg_dump. This stops me from executing the export.
I have tried to manually install pg_dump in another directory and select it in the PhpStorm Export window, but it still won't detect the executable. The executable itself works fine.
The solution to this problem was to do a sudo apt-get install postgresql-client.
Apparently there is a general problem with the pg_dump executable of the "postgresql-client-common" package:
https://askubuntu.com/questions/501091/command-pg-dump-not-found
After installing the postgresql-client package, everything works fine in PhpStorm as well.
The code is pretty simple there: IDE checks that file exists and is executable, then run /path/to/pg_dump --version command and parse output looking for some keywords. Unfortunately there are no logs which can show exact reason, but I guess the issue that IDE can't get access to the file. Most likely due to WSL. The workaround is to install IDE and unpack PG binaries on Windows, then configure port forwarding to make PG server accessible from host OS.

powershell and conda: conda activate env returns command not found

I have pip installed powerline-shell in my base conda env. Switching envs yields the following error:
conda activate <env_name>
-bash: powerline-shell: command not found
I also tried running conda init powershell but it took no actions.
I have miniconda3, with conda 4.7, installed on MacOS Mojave.
I don't know a simple solution to this. I'm thinking you either need to install it in every env (which I don't recommend because it's best to avoid using pip in Conda) or you create a link to the powerline-shell binary in another location that you can keep on PATH to avoid adding the entire miniconda3/bin/ directory to PATH. I've done something like this in the past, but never with a Python entry point before.
I'd try something like
mkdir -p ~/.local/bin
ln -s /your/path/to/miniconda3/bin/powerline-shell ~/.local/bin/powerline-shell
Then add .local/bin to PATH in your .bashrc, probably toward the beginning (e.g., before the Conda section). The path here (~/.local/bin) is totally arbitrary, so adjust to your preferences. Main point is to minimize what you are exposing globally in a shell session.
Note: conda init powershell is for Windows PowerShell users.

How can I ensure HGFS in CentOS via Vagrant?

I am using Vagrant (1.7.4) with the VMware Fusion provider.
I have created a new VM from the centos/7 box, and configured shared folders in my Vagrantfile.
On startup, I get the message
HGFS was never found on the running virtual machine. This must be
installed either through VMware tools or Open VM Tools. HGFS is
required for shared folders to work properly. Please install either
the VMware tools or Open VM Tools and try again.
after a while, and the system starts up, but without the mounted shared volume.
I have tried installing Open VM tools, with a
sudo yum -y install open-vm-tools
in my Vagrant provisioner inline shell script
config.vm.provision "shell", inline: <<-SHELL
sudo yum -y update
sudo yum -y install open-vm-tools
SHELL
However, I still get the message at startup, and I do not see the mounted share.
I have an almost identical Ubuntu box (precise/64) that seems to work just fine.
I looked up the box https://atlas.hashicorp.com/centos/boxes/7 and from the release notes they clearly mention that virtual box guest are not installed
The VirtualBox Guest Additions are not preinstalled; if you need them for shared folders, please install the vagrant-vbguest plugin. We recommend using NFS instead of VirtualBox shared folders if possible.
I think what they should mention is that they did not install the VMWare tools neither so default sharing folder with VMWare does not work.
How to install the VMWare tools for the VM
Make sure to mount a cd
Open VMWare Fusion and make sure the VM is down - open the VM settings, select the hard drive and add a device, select the CDRom.
boot the VM from the VM menu select Install VMWare Tools
Installing VMWare Tools
login to the VM (either from VMWare or open an ssh session with vagrant ssh)
Install pre-requisites and update kernel (at least I had to run to successfully install the VMWare tools on VMWare fusion 8.0 - see here)
sudo yum install perl gcc gcc-c++ make binutils
sudo yum update kernel
reboot and run the following again
sudo yum install kernel-headers kernel-PAE-devel
mount the VMWare tools
this is found from the VMWare doc - Make sure to run the below commands with root or add sudo
To create a mount point, run:
mkdir /mnt/cdrom
To mount the CDROM, run:
mount /dev/cdrom /mnt/cdrom
To copy the Compiler gzip tar file to a temporary local directory, run:
cp /mnt/cdrom/VMwareTools-<version>.tar.gz /tmp/
Where version is the VMware Tools package version. To determine the version of VMware tools, run:
ls /mnt/cdrom
You see output similar to:
VMwareTools-5.0.0-12124.tar.gz
To change to the tmp directory and extract the contents of the tar file into a new directory called vmware-tools-distrib, run:
cd /tmp
tar -zxvf VMwareTools-version.tar.gz
To change directory to vmware-tools-distrib and run the vmware-install.pl PERL script to install VMware Tools, run:
cd vmware-tools-distrib
./vmware-install.pl
After all this, the tools were installed and shared folder is working correctly.
as a side note I can say that its much easier building a box with packer and install the tools directly from install. There are plenty of packer templates available on github for all versions of centos.

pycharm packages not displayed in the project interpreter window

I am using pycharm 5.0.4 community edition.
I wanted to install package fuzzywuzzy.
But when i go to project interpreter window and try to install package, it shows me no available packages.
Can it be issue because I am using my work desktop.
Thanksenter image description here
Can you provide more details- Are you not able to see any packages? Try searching for some other packages like pip, matplotlib, django, numpy etc. Sometimes it takes time for the IDE to build skeletons before you can actually start installing the packages. So once the IDE wait for it to complete its setup and then try to access the installation packages available.
Also if you do you have any other python interpreter installed on your local machine? If so then try switching to that interpreter.
Below are some steps you can try, which worked for me:
Step-1 Activate your intelpython using:
source <your installation path>/bin/activate
Step-2 Clone the environment using conda clone command and make sure the pwd is ~/:
conda create -n <source_environment> --clone <destination_environment>
Step-3 Activate the cloned environment:
source ~/.conda/envs/<your_environment>/bin/activate
Step-4 Provide read-wite permissions to intelpython and cloned enviroment using:
sudo chown -R <user_name>:<group_name> /<path_to_directory i.e. /opt/intel and ~/.conda/envs>
Step-5 Open Pycharm and in System Interpreter add the path to above created enviroment and then you can use pip or Pycharm itself, it should work.
I had a similar problem. I was using the Intel python distribution, and installing packages required write permissions to the folder that intelpython was installed in, which in my case was /opt/intel/intelpython2.
Try adding write permissions to the folder using the following command:
sudo chown -R <username> </path/to/folder>
Then try adding missing packages and/or repositories as seen in this page - https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html.