Mint: install and configure MATLAB

installation:

  1. installation
    1. download matlab iso files
    2. mount first cd
    3. run the installer (install.sh or similar) from within $HOME: $ cd $HOME; /path/to/cd1/install.sh
    4. choose the install path: /opt/MATLAB
    5. when asked for second cd one has to unmount cd1 and mount cd2 to the same path
  2. put matlab in your $PATH:
    1. usually this is done in the installation process, but just in case
    2. $ sudo ln -s /opt/MATLAB/R2017a/bin/matlab /usr/local/bin/matlab
  3. get the desktop file for matlab (somewhere in the opt/matlab folder?)
    1. $ cat /usr/share/app-install/desktop/matlab-support:matlab.desktop
      [Desktop Entry]
      X-AppInstall-Package=matlab-support
      X-AppInstall-Popcon=4
      X-AppInstall-Section=multiverse
      
      Version=1.0
      Type=Application
      Terminal=false
      Exec=matlab -desktop
      Name=MATLAB
      Icon=/usr/share/icons/matlab.png
      Categories=Development;Math;Science
      Comment=Scientific computing environment
      StartupNotify=true
      StartupWMClass=com-mathworks-util-PostVMInit
      
      X-Ubuntu-Gettext-Domain=app-install-data
      
      
  4. for updating matlab
    1. install as in step 1
    2. change the link path from step 2
    3. done
  5. change the default start of matlab by creating a custom startup.m:
    1. print the path inside of the matlab gui: >> path
    2. choose a good path for your file (usually: /opt/MATLAB/R2017a/toolbox/local/startup.m )
    3. insert some matlab code. example:
      fname='/some/path';
      addpath(genpath(fname));
      cd(fname);
      clear fname;
      
Advertisements

arch: pacman automatic download

This little post explains how to enable download for packages of pacman. It uses a systemd service.

Create the download service (note the option -w for just downloading the packages):

$ sudo vim /etc/systemd/system/pacman-downloader.service
[Unit]
 Description=Automatic Update
 After=network-online.target 

[Service]
 Type=simple
 ExecStart=/usr/bin/pacman -Syuwq --noconfirm
 TimeoutStopSec=180
 KillMode=process
 KillSignal=SIGINT

[Install]
 WantedBy=multi-user.target

Create a timer service to launch the downloader:

$ sudo vim /etc/systemd/system/pacman-downloader.timer
[Unit]
 Description=Automatic Update when booted up after 5 minutes then check the system for updates every 60 minutes

[Timer]
 OnBootSec=5min
 OnUnitActiveSec=60min
 Unit=pacman-downloader.service

[Install]
 WantedBy=multi-user.target

Enable and start the service using systemctl.


Source-link: www.techrapid.co.uk

to enable automatic updates install:

$ apt install unattended-upgrades

check and uncomment in the config file as needed, well documented inside the same config file /etc/apt/apt.conf.d/50unattended-upgrades:

$ cat /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
"o=Raspbian,n=jessie,l=Raspbian-Security";
};
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::InstallOnShutdown "true";
Acquire::http::Dl-Limit "300";
$ cat /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
	"o=Ubuntu,a=xenial-security";
	"o=Ubuntu,a=xenial-updates";
	"o=Ubuntu,a=xenial";
	"o=Canonical,a=xenial";
	"o=linuxmint,n=serena";
};
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::InstallOnShutdown "true";
Acquire::http::Dl-Limit "300";

edit the config file:

$ vim /etc/apt/apt.conf.d/10periodic
# update the package list
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";

# once a day
APT::Periodic::Unattended-Upgrade "1";

check if its working:

$ sudo unattended-upgrades --dry-run
$ tail /var/log/unattended-upgrades/unattended-upgrades.log

sources:

https://community.linuxmint.com/tutorial/view/1217

http://www.faqforge.com/linux/how-to-enable-auto-updates-in-ubuntu/