Project

General

Profile

Linux Development

Setup SSH keys for repository access

If you have not done so, setup SSH keys.

Checking for existing SSH keys

Before you generate an SSH key, you can check to see if you have any existing SSH keys. Open Terminal and type:

$ ls -al ~/.ssh

By default, the filenames of the public keys are one of the following:

  • id_ecdsa.pub
  • id_ed25519.pub
  • id_rsa.pub

If you don't have an existing public and private key pair, or don't wish to use any that are available to connect to Redmine, then generate a new SSH key (see below).

If you see an existing public and private key pair listed (for example id_rsa.pub and id_rsa) that you would like to use to connect to Redmine, you can skip the next section.

Generating a new SSH key

Paste the text below, substituting in your e-mail address.

$ ssh-keygen -t rsa -b 4096 -C "your_email@p.lodz.pl"

This creates a new ssh key, using the provided email as a label.

Generating public/private rsa key pair.

When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]

At the prompt, type a secure passphrase.

Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]

Adding your public key to Redmine

In the terminal type:

$ cat ~/.ssh/id_rsa.pub

and copy to printed output (similar to the one below) to the clipboard.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVto31yS/LLcl2S08ULCo0lc8kcMFCgDyRsi+VZEVsOEz+Ou4/Iuyg20jALy
4ITGztkga0nulq+SF45WlgqoYlhmwI1tnxJf/HNHqTLMINfBFOkW1MBTzq2xZYkHMaLe4RL7GSyJcJahnGNUDIKJuWyYYpmjaj
/ijfbJJb63FAeV4swXo5nGyI3TvIUzGtNINvoNqTiHxLL0aJnAqQcu4XiZ9PiAQND8tCJa+MnbeaUIRQAx00OsjCY8ey+rTbK4
atE92TR4iRWF8x0l0KlOec6Ti2qopy+VXMIf8HpYFHZJRSnzUDwuuzK1UTdA+H3Gl3UEEFxJnQcH5Y3mvxm3iB your_email@p.lodz.pl

Next open https://redmine.phys.p.lodz.pl/my/public_keys. In the section Enter new public key, type any identifier you want and paste the contents of the clipboad (your public key) into the Public key window. Leave Public key type set to User key. Click Create. Your key should show up in the list at the top of the screen.

Deb-dased systems (Debian, Ubuntu, Mint, etc.)

Enter the following commands:

$ sudo apt install g++ git cmake cmake-qt-gui ninja-build libboost-all-dev \
           libeigen3-dev libexpat1-dev libopenblas-dev python3-dev \
           python3-numpy python3-scipy python3-matplotlib python3-h5py python3-lxml \
           python3-yaml python3-pyqt5 python3-sphinx python3-pip ipython3 \
           doxygen libgsl-dev libx11-dev qhelpgenerator-qt5 qttools5-dev-tools \
           python3-sphinxcontrib.qthelp

# On Ubuntu 21.10 the following command is necessary
$ sudo apt install python3-sphinxcontrib.qthelp

$ cd _your/chosen/plask/directory_

$ git clone git@phys.p.lodz.pl:plask.git .

$ git submodule update --init

$ mkdir build-release

$ cd build-release

$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_TESTING=OFF ..

$ ninja

If you want to build debug version, replace release with debug and Release with Debug in above instruction.

You may also use alternative compiler CLang, which should compile your code faster. To do so, replace the above cmake -G Ninja -D CMAKE_BUILD_TYPE=Release .. command with:

$ sudo apt install clang

$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..

Additionally, you may install your favorite IDE. E.g. one of the following:

$ sudo apt install code

$ sudo apt install qtcreator

$ sudo apt install codeblocks

$ sudo apt install kdevelop

In qtcreator of kdevelop you may open CMakeList.txt as a project.

Arch Linux and Manjaro

Enter the following commands:

$ sudo pacman -S --needed gcc cmake git boost boost-libs eigen expat \
           ninja openmp openblas lapack python-numpy python-scipy \
           python-matplotlib python-h5py python-lxml python-yaml qt5-tools \
           pyside2 python-sphinx python-pip ipython doxygen gsl libx11

$ cd _your/chosen/plask/directory_

$ git clone git@phys.p.lodz.pl:plask.git .

$ git submodule update --init

$ mkdir build-release

$ cd build-release

$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_TESTING=OFF ..

$ ninja

If you want to build debug version, replace release with debug and Release with Debug in above instruction.

You may also use alternative compiler CLang, which should compile your code faster. To do so, replace the above cmake -G Ninja -D CMAKE_BUILD_TYPE=Release .. command with:

$ sudo pacman -S clang

$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..

Additionally, you may install your favorite IDE. E.g. one of the following:

$ sudo pacman -S code

$ sudo pacman -S kdevelop

$ sudo pacman -S qtcreator

$ sudo pacman -S codeblocks

In vscode, qtcreator of kdevelop you may open CMakeList.txt as a project.

Go to top