Editors

Vim

sudo vi file_name.format

i - insert
esc - menu
:x - save and exit

Nano:

sudo nano file_name.format
Ctrl+X - exit
Y/N - save
Choose file name

CUDA

Install CUDA toolkit.

WSL

Installation guide

Basics

CPU info:

lscpu

Memory info:

free -t --giga

--giga (GB) and t (total = RAM + swap).

GPU: cat /proc/driver/nvidia/gpus/0000:61:00.0/information

Current directory:

pwd

Move to parent directory:

cd ..

Directories

To access windows directory enter:

cd mnt

To access linux directory enter:

cd ~

Use a symbolic link to connect Windows and Linux directories using:

ln -s  /mnt/d/projects/web-project  /var/www/web-project

To copy a file from A (path/file.format) to server (user@server:~/folder):

scp /mnt/c/Users/breno/Downloads/ILOG_COS_20.10_LINUX_X86_64.bin breno@mtt-mme.3me.tudelft.nl:~/cplex

Copying file to current folder (.):

If needed, use -r to copy folders.

sudo cp /home/breno/cplex/ILOG_COS_20.10_LINUX_X86_64.bin .

Where to place bins?

Bins accessible system-wide to multiple users should be placed by an administrator into /usr/local/bin.

Accessing the server

SSH

On Windows, install ssh in PowerShell (tutorial).

Remote desktop

Use X2Go (tutorial).

Address

Username: your first name in lower case (for me: bilge) Password your tudelft account including the @ sign (for me: B.Atasoy@)

To reach the server you need to ssh: e.g, ssh bilge@mtt-mme.3me.tudelft.nl. You can do this with putty or any other ssh client. If you have a Mac you can directly use the terminal. You need to be either on campus or connected to VPN. And if you do not have an admin account on your machine, you need to do this after changing to that admin user (localadmin for TUD computers I believe).

When you login your will be asked to change your password (So above login details for me are not valid anymore).

Use VS Code to open code hosted remotely

install the Visual Studio Code Remote - SSH extension and follow this tutorial to work on projects hosted on the server using the VS Code.

Installing .bin

To launch an installation, the file should have execute permission and should be executed from the command line:

chmod u+x <installname>.bin
sudo ./<installname>.bin

Connecting to Python API

To use the CPLEX or CP Optimizer engines through their Python APIs, you need to tell Python where to find them:

sudo python3 /opt/ibm/ILOG/CPLEX_Studio201/python/setup.py install

and:

pip install --upgrade cplex

Where are examples?

/opt/ibm/ILOG/CPLEX_Studio201/python/examples/

Starting http server in folder

python3 -m http.server --bind 131.180.122.64

Linux

Version:

hostnamectl

List files:

ls

Compiling C#

Follow tutorial here. First, add the package repository:

sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

Then, install Mono:

sudo apt install mono-devel

Verify if Mono was installed successfully:

# hello.cs
using System;

public class HelloWorld
{
	public static void Main(string[] args)
	{
		Console.WriteLine ("Hello Mono World");
	}
}

Compile using csc hello.cs and execute using mono hello.exe.

Loging to root and executing source

The problem is that source is a bash build-in command (not a program - like ls or grep). I think one approach is to login as root and then execute the source command.

sudo -s
source /etc/bash.bashrc
exit

Install Matlab

Follow tutorial.

Install Conda

Visit Anaconda website to get the latest version and download using:

wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh

Install for user (tutorial):

bash Anaconda3-2020.02-Linux-x86_64.sh
conda init

Test:

conda --version

Adding other users (tutorial multi-user):

sudo groupadd name_group
sudo chgrp -R name_group /path/anaconda3
sudo chmod 770 -R /path/anaconda3
sudo adduser username name_group

Installing apache

https://ubuntu.com/tutorials/install-and-configure-apache#1-overview

Creating website

Create a folder for your website (e.g., new-site-name) in the directory var/www.

Setting up VirtualHost

cd /etc/apache2/sites-available/
sudo cp 000-default.conf new-site-name.conf
sudo nano new-site-name.conf

Edit the configuration file:

DocumentRoot /var/www/new-site-name/
ServerAdmin yourname@example.com
ServerName mtt-mme.3me.tudelft.nl

Change server configurations at:

/etc/apache2/sites-available/new-site-name.conf

Activate virtual host file using:

sudo a2ensite new-site-name.conf

To deactivate, use a2dissite (see here):

sudo a2dissite new-site-name.conf

Check more virtual host examples here.

After updating files at /var/www/new-site-name reload Apache server using:

service apache2 reload

Jekyll

Install Jekyll to build from a webpage framework (guide) and compile the webpage (guide).

Create new page:

jekyll new webpage_name
cd webpage_name

Run the jekyll build command and copy the contents of the generated _site folder to the root folder of your hosting account (manual).

Alternatively, make jekyll create a local server by typing:

bundle exec jekyll serve

Configure using “minimal-mistakes-theme” (guide):

Add the following to Gemfile:

gem "minimal-mistakes-jekyll"

Update bundled gems:

bundle

Set the theme in _config.yml:

theme: minimal-mistakes-jekyll

Modify files to use Minimal Mistakes layouts (guide):

Edit _config.yml. Then:

  • Replace <site root>/index.md with a modified Minimal Mistakes index.html.
  • Change layout: post in _posts/0000-00-00-welcome-to-jekyll.markdown to layout: single. Remove about.md, or at the very least change layout: page to layout: single.

To execute, go to <site root> and enter:

bundle exec jekyll serve

Browse to http://localhost:4000.