Run-levels in Ubuntu 16.04 LTS

Switching between different run-levels (targets) in Ubuntu 16.04 LTS

Ubuntu 16.04 has moved from using init to systemd. Thus, the  concept of run-levels is replaced by the term targets.  The advantages over choosing systemd is discussed in the article The Story Behind ‘init’ and ‘systemd’: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linux . The seven run-levels of init can be mapped with the targets as:

 

Run-levels Targets
0 poweroff.target
1 rescue.target
2,3,4 multi-user.target
5 graphical.target
6 reboot.target

To change the run-level non-GUI:

To set this runlevel as default for every time the system restarts

To check the current run-level

or

Similarly, one can set to any target by,

 

Installation of cuda-sdk and driver for Ubuntu 16.04

Go to Cuda Downloads and download the required version of cuda drivers deb package.

Verify you have a GPU on the system and it is being detected properly.

Verify that you are running the supported OS.

Verify the gcc version (refer System Requirements).

Verify that the system has linux kernel headers installed.

Update ld-conf for the runtime to automatically find your libraries.

Since,  nvidia drivers are going to install, you need to blacklist the nouveau driver so it don’t pop out when you will reboot.

Reboot into text mode, before running the deb package file. This is required because the GPU should be free from any engagement at the time of installation.

Install cuda-sdk and driver.

Verify the installation

Now you can revert back the settings for the GUI mode.

 

Connect to GITLAB through a SSH tunnel

This tutorial is  for a scenario  in which we cannot directly access a GITLAB server but can be accessed through another server.

Lan setup for SSH tunnelling
Figure 1 : LAN setup for SSH tunneling

First Create an account in the GITLAB Server.  For that you have to tunnel to the GITLAB server’s HTTP port. Open an terminal an type the following command:

Type the password for the username of the Server. Now,  you should be able to access the GITLAB’s web interface by opening http://localhost:9000 in your browser. In the REGISTER tab fill up the form to create an account.

Login in to your account. To push and pull from the GITLAB server through SSH, we are required to generate a SSH key in our system, then add the SSH public key in your GITLAB’s  account. The following command will let you generate the SSH keys, press the RETURN key to accept the default settings for key generation.

Now, copy the generated public key. To copy your public key to the clipboard, use xclip for Linux Systems:

Navigate to the ‘SSH Keys’ tab in you ‘Settings’, and paste the key in the Key Field. Add a title as the name of your PC (any  name to identify your PC).

Screenshot for SSH keys tab (Click to enlarge)

Create a repository in your GitLab account. After creation of the repository you can clone to your computer through SSH. For that you need to  create an ssh tunnel in port 22(SSH)

Now you can add your sources codes in the cloned repository. To test, add an README.md file inside the repository, commit and push to the Gitlab Server.