Ubuntu – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Sat, 17 Dec 2022 10:52:19 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 Setup Selenium with Python and Chrome Driver on Ubuntu & Debian https://tecadmin.net/setup-selenium-with-python-on-ubuntu-debian/ https://tecadmin.net/setup-selenium-with-python-on-ubuntu-debian/#comments Sun, 19 Jun 2022 04:12:49 +0000 https://tecadmin.net/?p=30109 Selenium is a versatile tool that can be used for automating browser-based tests. It has a wide range of features that make it an ideal choice for automating tests. Selenium can be used to automate tests for web applications and web services. Selenium supports a number of programming languages, including Java, C#, Python, and Ruby. [...]

The post Setup Selenium with Python and Chrome Driver on Ubuntu & Debian appeared first on TecAdmin.

]]>
Selenium is a versatile tool that can be used for automating browser-based tests. It has a wide range of features that make it an ideal choice for automating tests. Selenium can be used to automate tests for web applications and web services. Selenium supports a number of programming languages, including Java, C#, Python, and Ruby.

This makes it possible to write tests in the language that you are most comfortable with. In addition, Selenium has a large user community that provides support and help when needed.

In this blog post, you will learn to set up a Selenium environment on an Ubuntu system. Also provides you with a few examples of Selenium scripts written in Python.

Prerequisites

You must have Sudo privileged account access to the Ubuntu system.

One of the examples also required a desktop environment to be installed.

Step 1: Installing Google Chrome

Use the below steps to install the latest Google Chrome browser on Ubuntu and Debian systems.

  1. First of all, download the latest Gooogle Chrome Debian package on your system.
    wget -nc https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 
    
  2. Now, execute the following commands to install Google Chrome from the locally downloaded file.
    sudo apt update 
    sudo apt install -f ./google-chrome-stable_current_amd64.deb 
    

    Press ‘y’ for all the confirmations asked by the installer.

This will complete the Google Chrome on your Ubuntu or Debian system. This will also create an Apt PPA file for further upgrades.

Step 2: Installing Selenium and Webdriver for Python

We will use a virtual environment for running Python scripts. Follow the below steps to create Python virtual environment and install the required python modules.

  1. Create a directory to store Python scripts. Then switch to the newly-created directory.
    mkdir tests && cd tests 
    
  2. Set up the Python virtual environment and activate it.
    python3 -m venv venv 
    source venv/bin/activate 
    

    Once the environment is activated, You will find the updated prompt as shown below screenshot:

    Create Python Environment for Selenium on Ubuntu
    Create Python Environment for Selenium on Ubuntu
  3. Now use PIP to install the selenium and webdriver-manager Python modules under the virtual environment.
    pip install selenium webdriver-manager 
    

    Installing Selenium and Webdriver Python Module on Ubuntu & Debian
    Installing Selenium and Webdriver Python Module on Ubuntu & Debian

Example 1: Selenium Python Script with Headless Chrome

Your system is ready to run Selenium scripts written in Python. Now, create a sample selenium script in Python that fetches the title of a website.

This script will run headless, So you can run it without an X desktop environment. You can simply SSH to your system and run the below example:

  1. Create a Python script and edit it in your favorite text editor:
    nano test.py 
    
  2. Copy-paste the following Selenium Python script to the file.
    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    from selenium.webdriver.chrome.service import Service
    from webdriver_manager.chrome import ChromeDriverManager
    
    options = Options()
    options.add_argument('--headless')
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-dev-shm-usage')
    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
    
    driver.get("https://python.org")
    print(driver.title)
    driver.close()

    Press CTRL + O to save content to the file and press CTRL + X to close the editor.

  3. Now, run this Python script in a shell.
    python test.py 
    

    You will see the output something like the below:

    Running Selenium Python Script in Ubuntu & Debian
    Running the Selenium Python Script

Example 2: Selenium Python Script with Chrome GUI

In order to run this example, the Ubuntu system must have installed a Desktop environment. If the desktop is not installed, use another tutorial to install the Desktop environment on Ubuntu systems.

Now, log in to the desktop interface and try to run the below example.

  1. Open a command prompt, then create a new Python script and edit it in your favorite text editor.
    nano test.py 
    
  2. Copy-paste the below snippet in the file:

    import time
    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    from selenium.webdriver.chrome.service import Service
    from selenium.webdriver.common.by import By
    from selenium.webdriver.common.keys import Keys
    from webdriver_manager.chrome import ChromeDriverManager
    
    options = Options()
    # options.add_argument('--headless')
    # options.add_argument('--no-sandbox')
    options.add_argument('--disable-dev-shm-usage')
    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
    
    driver.get('http://www.google.com')
    search = driver.find_element(by=By.NAME, value="q")
    search.send_keys("Hey, Tecadmin")
    search.send_keys(Keys.RETURN)
    
    time.sleep(5)
    driver.close()

    Write the changes to file with CTRL + O and close this with keyboard shortcut CTRL + X

  3. This is a Selenium script written in Python, that will launch the Google Chrome web browser and search for a defined string. then close the browser.
  4. Run the Python script in the terminal:
    python test2.py 
    

    You will see that a Browser window will open and perform the defined tasks in the script. See the below screencast of the run:

Conclusion

In this tutorial, you have learned about the configuration of Selenium for Python on Ubuntu and Debian Linux systems. Also provides you with two Selenium examples. Hope this tutorial helps you to understand to run Selenium with Python.

The post Setup Selenium with Python and Chrome Driver on Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/setup-selenium-with-python-on-ubuntu-debian/feed/ 1 Ubuntu Archives – TecAdmin nonadult
How to Setup Squid Proxy Server on Ubuntu and Debian https://tecadmin.net/how-to-setup-squid-proxy-server-on-ubuntu-and-debian/ https://tecadmin.net/how-to-setup-squid-proxy-server-on-ubuntu-and-debian/#respond Fri, 17 Jun 2022 11:29:48 +0000 https://tecadmin.net/?p=30131 What is Squid? Squid is a proxy server that can be used to improve network performance and security. It can be used to cache web pages and images, allowing your users to access these files more quickly. Squid can also be used to protect your network from malicious content. If you’re an experienced system administrator, [...]

The post How to Setup Squid Proxy Server on Ubuntu and Debian appeared first on TecAdmin.

]]>
What is Squid?

Squid is a proxy server that can be used to improve network performance and security. It can be used to cache web pages and images, allowing your users to access these files more quickly. Squid can also be used to protect your network from malicious content.

If you’re an experienced system administrator, you know that a proxy server can be a valuable tool for optimizing your network.

In this blog post, we’ll show you how to install a proxy server on Ubuntu using the Squid proxy server.

How to install Squid on Ubuntu and Debian

To install Squid on Ubuntu and Debian, use the following commands:

sudo apt update  
sudo apt install squid3  
How to Install Squid Proxy on Ubuntu and Debian
Installing squid proxy server

The Squid proxy server will be installed on your Ubuntu system.

You can verify the service status by running the following command:

sudo systemctl status squid3  
Output
● squid.service - Squid Web Proxy Server Loaded: loaded (/lib/systemd/system/squid.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2022-06-17 11:13:54 IST; 45s ago Docs: man:squid(8) Process: 2267 ExecStartPre=/usr/sbin/squid --foreground -z (code=exited, status=0/SUCCESS) Main PID: 2270 (squid) Tasks: 4 (limit: 2271) Memory: 15.7M CPU: 187ms CGroup: /system.slice/squid.service ├─2270 /usr/sbin/squid --foreground -sYC ├─2272 "(squid-1)" --kid squid-1 --foreground -sYC ├─2273 "(logfile-daemon)" /var/log/squid/access.log └─2274 "(pinger)" Jun 17 11:13:54 tecadmin squid[2272]: Using Least Load store dir selection Jun 17 11:13:54 tecadmin squid[2272]: Set Current Directory to /var/spool/squid Jun 17 11:13:54 tecadmin squid[2272]: Finished loading MIME types and icons. Jun 17 11:13:54 tecadmin squid[2272]: HTCP Disabled. Jun 17 11:13:54 tecadmin squid[2272]: Pinger socket opened on FD 14 Jun 17 11:13:54 tecadmin squid[2272]: Squid plugin modules loaded: 0 Jun 17 11:13:54 tecadmin squid[2272]: Adaptation support is off. Jun 17 11:13:54 tecadmin squid[2272]: Accepting HTTP Socket connections at conn3 local=[::]:3128 remote=[::] FD 12 flags=9

After you have installed Squid, you will need to configure it to meet your needs. The default configuration should be suitable for most users, but you may need to make some changes depending on your specific needs.

How to Configure Squid Proxy Server

The main Squid configuration file is located at /etc/squid3/squid.conf. This file contains all of the settings for Squid. You can edit this file to change the configuration of Squid.

  1. Configure Port
  2. To configure the Squid port, you’ll need to edit the squid.conf file. This file is located in the /etc/squid directory on most Linux systems. Once you’ve opened the file in a text editor, you’ll need to locate the following line:

    http_port 3128
    

    If you need to change the Squid port, you can simply edit this line and enter the new port number. For example, if you want to use port 8080, you would enter:

    http_port 8080
    
    Changing Squid Server Port in Ubuntu & Debian
    Set a new port to Squid server

    Once you’ve made the change, save the file and restart Squid.

    Note: You can also configure Squid as transparrent proxy server by adding transparent keyword with the port like http_port 8080 transparent .

  3. Configuring Firewall Rules
  4. In order to use Squid, you will need to enable it in the Ubuntu firewall. You can do this by running the following command:

    • UFW Users:
      sudo ufw allow 8080 
      
    • FirewallD Users:
      sudo firewall-cmd --permanent --zone=public --add-port=3128/tcp 
      sudo firewall-cmd –reload 
      

    This command will allow traffic on port 8080, which is the port that Squid listens on.

  5. Configure Proxy Authentication in Squid
  6. You can also insist users to authenticate proxy to use. This helps you to prevent unauthorized access to the proxy server. This forces users to authenticate to use the proxy.

    • First, install apache2-utils package, that provides htpasswd command.
      sudo apt-get install apache2-utils -y  
      
    • Create a new file to contain username and password. Also change ownership to the Squid user proxy:
      sudo touch /etc/squid/secure_passwd 
      sudo chown proxy: /etc/squid/secure_passwd 
      
    • Create a new user with following commnad:
      sudo htpasswd /etc/squid/secure_passwd tecadmin 
      

      The system will prompt you to enter and confirm a password for “tecadmin” user.

    • Edit the /etc/squid/squid.conf file, and add the following configuration:
      auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/secure_passwd
      auth_param basic children 5
      auth_param basic realm Squid Basic Authentication
      auth_param basic credentialsttl 2 hours
      acl auth_users proxy_auth REQUIRED
      http_access allow auth_users
      
    • Restart Squid service.

  7. Create ACL to Block Websites
  8. You can block any website by its domain name. To do the following:

    • Create a new file /etc/squid/blocked_websites.acl and edit in a text editor. You can choose any name of your choice.
      sudo nano /etc/squid/blocked_websites.acl 
      
    • In this file, add the domain names one per line to be blocked. You can start the domain name with a dot (.) to blcok subdomains as well.
      .yahoo.com
      .facebook.com
      
    • Edit the /etc/squid/squid.conf file again.
      sudo nano /etc/squid/squid.conf 
      
    • Add the following lines just before the ACL list.
      acl blocked_websites dstdomain “/etc/squid/blocked.acl”
      http_access deny blocked_websites
      

      Save changes and restart Squid service.

Conclusion

In this article, we will go over the steps on how to install a Squid proxy server on an Ubuntu server. We will also cover some basic configurations that can be made to Squid once it is installed. By the end of this article, you should have a working installation of the Squid proxy server on your Ubuntu server.

The post How to Setup Squid Proxy Server on Ubuntu and Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-setup-squid-proxy-server-on-ubuntu-and-debian/feed/ 0
How to Install Latest Node.js on Ubuntu https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/ https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/#comments Tue, 14 Jun 2022 13:10:38 +0000 https://tecadmin.net/?p=5145 If you’ve been exploring the world of front-end and JavaScript, you might have come across Node.js. It is a server-side framework that uses Google’s V8 engine to execute JavaScript code. Developers can use Node.js as it provides them with an easy way to build fast and scalable network applications, using single-threaded asynchronous events. In this [...]

The post How to Install Latest Node.js on Ubuntu appeared first on TecAdmin.

]]>
If you’ve been exploring the world of front-end and JavaScript, you might have come across Node.js. It is a server-side framework that uses Google’s V8 engine to execute JavaScript code. Developers can use Node.js as it provides them with an easy way to build fast and scalable network applications, using single-threaded asynchronous events.

In this article, we will see how to install Node.js on Ubuntu and its derivatives via a new official PPA repository. If you are new to Ubuntu or any other Linux operating system, then be sure to check out our beginner’s guide first.

You can also use the popular Node Version Manager (NVM) for installing specific Node.js version on your system.

Step 1 – Configuring Node.Js PPA

Node.js releases are available in two types, one is the LTS release, and the other is the current release. Choose any one version of your choice or as per the project requirements. Let’s add the PPA to your system to install Nodejs on Ubuntu.

  • Use Current Release – During the last update of this tutorial, Node.js 19 is the current Node.js version available.
    sudo apt install -y curl 
    curl -sL https://deb.nodesource.com/setup_19.x | sudo -E bash - 
    
  • Use LTS Release – Instead of the current release, it’s a good idea to use a stable version. During the last update of this tutorial, Node.js 18 is the latest LTS release available.
    sudo apt install -y curl 
    curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - 
    

For this tutorial, I am using the latest current release and added their PPA to my system.

Step 2 – Install Node.js on Ubuntu

You have successfully configured Node.js PPA in your Ubuntu system. Now execute the below command to install Node on Ubuntu using apt-get. This will also install NPM with node.js. This command also installs many other dependent packages on your system.

sudo apt install -y nodejs 

That’s it. This will install Node.js on your Ubuntu system.

Step 3 – Check Node.js and NPM Version

After installing node.js verify and check the installed version. You can find more details about the current version on node.js official website.

node -v

v19.2.0

Also, check the npm version

npm -v 

8.19.3

Step 4 – Create Demo Web Server (Optional)

This is an optional step. Suppose you want to test your node.js install. Let’s create a web server with “Hello World!” text. Create a file server.js

sudo nano server.js 

and add the following content

server.js
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(3000, "127.0.0.1"); console.log('Server running at http://127.0.0.1:3000/');

Save the file and close. Then start the Node application using the following command.

node server.js 

debugger listening on port 5858
Server running at http://127.0.0.1:3000/

You can also start the application with debugging enabled with the following commands.

node --inspect server.js

Debugger listening on ws://127.0.0.1:9229/938cf97a-a9e6-4672-922d-a22479ce4e29
For help, see: https://nodejs.org/en/docs/inspector
Server running at http://127.0.0.1:3000/

The web server has been started on port 3000. Now access http://127.0.0.1:3000/ URL in browser. Now you will need to configure a front-end server for your app.

Conclusion

In conclusion, we have seen how to install Node.js on Ubuntu and its derivatives via a new official PPA repository. This makes it easy for us to get started with Node.js development on our Linux systems. We can also use this repository to keep our installations up-to-date with the latest stable versions of Node.js. Be sure to check out other tutorials on our website for more tips and tricks about using Node.js!

The post How to Install Latest Node.js on Ubuntu appeared first on TecAdmin.

]]>
https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/feed/ 55
Setting Up Environment Variables on Ubuntu https://tecadmin.net/setting-up-environment-variables-on-ubuntu/ https://tecadmin.net/setting-up-environment-variables-on-ubuntu/#respond Sat, 28 May 2022 17:42:09 +0000 https://tecadmin.net/?p=29645 An environment variable contains a value, that is used to change the behaviors of the processes at run time. Similar to the other operating systems, we can also set the environment variables on a Ubuntu system. You can set the environment variables in 3 ways: Using the export command Using /etc/environment file Adding shell script [...]

The post Setting Up Environment Variables on Ubuntu appeared first on TecAdmin.

]]>
An environment variable contains a value, that is used to change the behaviors of the processes at run time. Similar to the other operating systems, we can also set the environment variables on a Ubuntu system.

You can set the environment variables in 3 ways:

  1. Using the export command
  2. Using /etc/environment file
  3. Adding shell script under /etc/profile.d/ directory

Now we will discuss the above methods to set environment variables on Ubuntu systems one by one.

1. Using the export command

You can use the export command on the terminal to set the environment variables temporarily. That variable will be accessible on the same terminal only. Once you close the terminal the variable will be destroyed.

To set the environment variable, run:

export MY_ENV=value 

To print the MY_ENV environment variable, type:

echo $MY_ENV

2. Using /etc/enviroment file

The /etc/environment is a system-wide configuration file used for setting the environment variables. It is not a shell script, it consists of the assignment expressions, that set the environment variables one per line.

sudo vim /etc/environment
/etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 MY_HOME="/home/tecadmin"

You can set multiple environment variables in this file. Each environment variable must be in a separate line.

During the system reboot, the environment variable written in this file will automatically be assigned and accessible system-wide.

3. Using /etc/profile.d/*.sh files

You can also create a shell script under the /etc/profile.d directory. During the user login /etc/profile script is executed. Tha also executed all the shell scripts (files with .sh extension) under /etc/profile.d directory.

Let’s create a shell script /etc/profile.d/custom-env.sh and set the environment variables using export command.

sudo vim /etc/profile.d/custom-env.sh 

Set the environment variables like:

/etc/profile.d/custom-env.sh
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 export JRE_HOME=/usr/lib/jvm/java-17-openjdk-amd64 export MY_ENV="value1"

The next time the user logged in will automatically set the environment variables. You can print the value of the environment variable using the echo command.

echo $MY_ENV 

value1
Setting up environment variable in Ubuntu
Print environment variable value

Conclusion

This tutorial provides you with the details of setting up the environment variables on the Ubuntu system. These environment variables are very helpful to change the run time behaviors of processes.

I hope this tutorial helped you with the basic understanding of creating environment variables on Ubuntu and Debian systems. Please provide your valuable suggestions in the comments and do share this article with the social platform.

The post Setting Up Environment Variables on Ubuntu appeared first on TecAdmin.

]]>
https://tecadmin.net/setting-up-environment-variables-on-ubuntu/feed/ 0
How to Install Apache Maven on Ubuntu 22.04 https://tecadmin.net/how-to-install-apache-maven-on-ubuntu-22-04/ https://tecadmin.net/how-to-install-apache-maven-on-ubuntu-22-04/#comments Fri, 27 May 2022 02:33:56 +0000 https://tecadmin.net/?p=29586 Apache Maven is a powerful build and project management tool for Java projects. It is an open-source tool developed by the Apache Software Foundation and is used for managing projects written in Java and other languages. It is a popular tool for managing software builds, as it allows for quick and easy deployment of projects. [...]

The post How to Install Apache Maven on Ubuntu 22.04 appeared first on TecAdmin.

]]>
Apache Maven is a powerful build and project management tool for Java projects. It is an open-source tool developed by the Apache Software Foundation and is used for managing projects written in Java and other languages. It is a popular tool for managing software builds, as it allows for quick and easy deployment of projects. It also provides a wide range of features including dependency management, project structure, and configuration.

One of the key advantages of using Apache Maven is that it allows for the easy integration of external libraries into a project. This makes it easier to create complex projects that require multiple external libraries. Another advantage of using Apache Maven is that it allows for the creation of custom-built scripts that can be used to automate the building process. It also makes it easier to maintain the integrity of a project as it allows developers to easily add new dependencies and update existing ones.

This guide will take you through the step-by-step process of installing Apache Maven on Ubuntu 22.04. Let’s get started!

Installing Java

Apache Maven can be configured on any system that has Java installed. The latest Maven version required JDK 1.7 or newer versions. On Ubuntu, you can run the following command to install JDK 11:

sudo apt update 
sudo apt install default-jdk 

Once the Java is installed, check the current default set Java version:

java -version 
Output:
openjdk 11.0.7 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

Method 1: Installing Maven Using Apt

We can quickly install the Apache Maven using the Apt package manager. Open a terminal and execute the following command:

sudo apt install maven 
Installing Maven on Ubuntu
Installing Maven on Ubuntu

You will notice that the old version of Apache Maven was installed from the Apt repository. The second method will help you to install the latest Maven version on the Ubuntu system.

Method 2: Installing Latest Maven From Source Code

Follow the below instructions to install the latest Maven version on Ubuntu systems:

  1. You can download Apache maven from its official website or use following command to download Apache Maven 3.8.6 on your system.
    wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz 
    
  2. Now extract the downloaded Maven archive file using the following command.
    sudo tar xzf apache-maven-3.8.6-bin.tar.gz -C /opt 
    sudo ln -s /opt/apache-maven-3.8.6 /opt/maven 
    

    The above commands will extract Maven under the /opt directory and create a symbolic link /opt/maven to that directory.

  3. As you have downloaded pre-compiled Apache Maven files on your system. Now set the environment variables by creating a new file /etc/profile.d/maven.sh.
    sudo vi /etc/profile.d/maven.sh 
    

    Add the below content to the file:

    export JAVA_HOME=/usr/lib/jvm/default-java
    export M2_HOME=/opt/maven
    export MAVEN_HOME=/opt/maven
    export PATH=${M2_HOME}/bin:${PATH}

    Save your file and close it.

  4. Next load the environment variables in the current shell using the following command.
    source /etc/profile.d/maven.sh 
    

    During the next system reboot, the environment will automatically load.

  5. You have successfully installed and configured Apache Maven on your Ubuntu system. You can check the installed Maven version with the following command:
    mvn -version 
    
    Installing Maven on Ubuntu
    Check Maven Version
  6. Finally, clean up the disk by removing the downloaded archive file.
    rm -f apache-maven-3.8.6-bin.tar.gz 
    

Uninstall (Remove) Apache Maven

If the Apache Maven is no longer required, you can uninstall it from your system.

Use the following command to uninstall maven using Apt package manager.

sudo apt remove --purge maven 

If you have installed maven from the source code, use the following commands to remove it.

sudo unlink /opt/maven 
sudo rm -rf /opt/apache-maven-3.8.6 

Conclusion

In this article, we discussed how to install Apache Maven on Ubuntu 22.04. We discussed the advantages of using Apache Maven and the steps involved in installing and configuring it. We also discussed how to set up a Maven project. With these steps, you can now start using Apache Maven on your system.

Apache Maven is a powerful tool for managing Java projects. It is a popular choice for managing software builds, as it allows for quick and easy deployment of projects. It also provides a wide range of features including dependency management, project structure, and configuration. If you are looking for an easy way to manage your Java projects, then Apache Maven is a perfect choice.

The post How to Install Apache Maven on Ubuntu 22.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-apache-maven-on-ubuntu-22-04/feed/ 2
Change Screen Resolution of An Ubuntu VM in Hyper-V https://tecadmin.net/change-screen-resolution-of-an-ubuntu-vm-in-hyper-v/ https://tecadmin.net/change-screen-resolution-of-an-ubuntu-vm-in-hyper-v/#comments Sun, 01 May 2022 08:44:14 +0000 https://tecadmin.net/?p=29191 Recently I created a Ubuntu desktop virtual machine in the Hyper-V platform. After login to the desktop realises that the screen resolution is not correct. I tried to change VM to full-screen mode but it opens in partial screen. When I checked the resolution under the settings found below: This how-to guide will help you [...]

The post Change Screen Resolution of An Ubuntu VM in Hyper-V appeared first on TecAdmin.

]]>
Recently I created a Ubuntu desktop virtual machine in the Hyper-V platform. After login to the desktop realises that the screen resolution is not correct. I tried to change VM to full-screen mode but it opens in partial screen. When I checked the resolution under the settings found below:

Checking the Ubuntu Screen Resolution under Hyper-V
Current Screen Resolution of Ubuntu on Hyper-V

This how-to guide will help you to change the screen resolution of an Ubuntu VM in Hiper-V. This also allows you to run Ubuntu VM in full-screen mode in Hiper-V.

Changing Screen Resolution in Hyper-V Ubuntu VM

Follow the instructions to change the screen resolution of an Ubuntu VM in Hyper-V:

  1. Login to your system as a sudo or root account.
  2. Open a shell and edit /etc/default/grub configuration file in a text editor
    sudo vim /etc/default/grub 
    

    Update the value of GRUB_CMDLINE_LINUX_DEFAULT variable as below:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1366x768"
    

    Here 1366×768 is the screen resolution of the host machine. You need to change this value as per your host machine resolution

  3. Now run the following command to update the grub configuration.
    sudo update-grub 
    
  4. Also install the linux-image-extra-virtual package that provides the extra drivers which is not included in base kernel.
    sudo apt install linux-image-extra-virtual 
    
  5. Reboot your system and test

Once the system is rebooted, log in to the Ubuntu desktop and change to full screen. You will see the Ubuntu desktop open in full screen.

Now, check the updated screen resolution of Ubuntu running on the Hyper-V platform.

Change Screen Resolution  in Ubuntu Running on Hyper-V
Updated Screen Resolution in Ubuntu Running on Hyper-V

Wrap Up

This tutorial helped you to change the screen resolution of an Ubuntu VM running on the Hyper-V platform.

The post Change Screen Resolution of An Ubuntu VM in Hyper-V appeared first on TecAdmin.

]]>
https://tecadmin.net/change-screen-resolution-of-an-ubuntu-vm-in-hyper-v/feed/ 6
Download Ubuntu 22.04 – DVD ISO Images https://tecadmin.net/download-ubuntu-22-04/ https://tecadmin.net/download-ubuntu-22-04/#respond Wed, 27 Apr 2022 03:58:25 +0000 https://tecadmin.net/?p=14470 Ubuntu 22.04 LTS Jammy Jellyfish is released and available for download. This tutorial will provide you the download links to DVD ISO Images of Ubuntu 22.04 LTS with different desktop flavors. You can find the Ubuntu 22.04 release notes on its official website. Download Ubuntu 22.04 Ubuntu desktop is available in multiple flavors, where you [...]

The post Download Ubuntu 22.04 – DVD ISO Images appeared first on TecAdmin.

]]>
Ubuntu 22.04 LTS Jammy Jellyfish is released and available for download. This tutorial will provide you the download links to DVD ISO Images of Ubuntu 22.04 LTS with different desktop flavors. You can find the Ubuntu 22.04 release notes on its official website.

Download Ubuntu 22.04

Ubuntu desktop is available in multiple flavors, where you can choose what desktop manager you want as default. Some of the flavors are built for specific purposes. Select your favorite Desktop edition and download it with the following links:

Use below link to download Ubuntu server edition, which doesn’t have any preinstalled Desktop environment.

Download Ubuntu ISO with Curl

Wget and curl are the frequently used commands for downloading files over FTP, and HTTP protocols. This tutorial will use the curl command to download files, You can use wget instead. Make sure you have curl utility installed on your system.

sudo apt install curl -y 

Then download the Focal Desktop or server edition image:

### Ubuntu 22.04 Desktop Edition 
curl -O http://cdimage.ubuntu.com/daily-live/current/jammy-desktop-amd64.iso 

### Ubuntu 22.04 Server Edition 
curl -O http://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso 

Conclusion

This tutorial helped you to download different flavors of Ubuntu 22.04 LTS Jammy Jellyfish Desktop and Server editions ISO images.

The post Download Ubuntu 22.04 – DVD ISO Images appeared first on TecAdmin.

]]>
https://tecadmin.net/download-ubuntu-22-04/feed/ 0
Ubuntu 22.04 – Release Schedule & Features https://tecadmin.net/ubuntu-22-04-release-schedule-features/ https://tecadmin.net/ubuntu-22-04-release-schedule-features/#comments Sat, 30 Oct 2021 17:38:18 +0000 https://tecadmin.net/?p=28284 Ubuntu 22.04 codename is Jammy Jellyfish. Which is the next LTS (Long Term Support) release of the Ubuntu versions. The development has been started for and the release date for Ubuntu 22.04 is set to April 21, 2022. Anyone can download the Ubuntu 22.04 daily build ISO image from its official download page. Ubuntu 22.04 [...]

The post Ubuntu 22.04 – Release Schedule & Features appeared first on TecAdmin.

]]>
Ubuntu 22.04 codename is Jammy Jellyfish. Which is the next LTS (Long Term Support) release of the Ubuntu versions. The development has been started for and the release date for Ubuntu 22.04 is set to April 21, 2022.

Anyone can download the Ubuntu 22.04 daily build ISO image from its official download page.

Ubuntu 22.04 Lifecycle

Here is the few dates set for the Ubuntu 22.04 LTS Jammy Jellyfish lifecycle.

  1. Oct 2021: Development Started
  2. February 24, 2022: Feature freeze
  3. March 31, 2022: Expected beta release
  4. April 14, 2022: Final freeze and release candidate version will be out.
  5. April 21, 2022: Final release of Ubuntu 2022
  6. April 2027: End of Life

Expected Changes

Here is the few major packages upgrades announced by the development team, that will be included with upcoming Ubuntu release.

  1. PHP 8.1: The Ubuntu 22.04 will comes with default PHP 8.1.
  2. OpenSSL3: The OpenSSL 3.0 was recently released in Sep 2021. It will be default included in upcoming releases
  3. Ruby 3.0: The Ruby 3.0 was officially released in 2020. This will be included as default Ruby version
  4. OpenLDAP 2.6: This version is announced but not released yet. So inclusion of OpenLDAP 2.6 depends on upstream release schedule
  5. Golang 1.18: will be the default version
  6. GNOME 42.0: The desktop version will comes with default Gnome 42.0.

Conclusion

Ubuntu lovers are always curious about the LTS releases. Here the next upcoming Ubuntu 22.04 Jammy Jellyfish is the long-term support release on April 21, 2022.

The post Ubuntu 22.04 – Release Schedule & Features appeared first on TecAdmin.

]]>
https://tecadmin.net/ubuntu-22-04-release-schedule-features/feed/ 6
Top 5 Most Stable Linux Distributions in 2022 https://tecadmin.net/best-stable-linux-distributions/ https://tecadmin.net/best-stable-linux-distributions/#comments Tue, 12 Oct 2021 04:18:57 +0000 https://tecadmin.net/?p=28125 Stable Linux Distributions in 2022 – Linux is one of the utmost famous and free open-source platforms. Linux has recently gained a lot of attention and is widely used due to its security, scalability, and flexibility. The distribution named Linux does all the hard work for you by taking codes from open-source till compiling and [...]

The post Top 5 Most Stable Linux Distributions in 2022 appeared first on TecAdmin.

]]>
Stable Linux Distributions in 2022 – Linux is one of the utmost famous and free open-source platforms. Linux has recently gained a lot of attention and is widely used due to its security, scalability, and flexibility. The distribution named Linux does all the hard work for you by taking codes from open-source till compiling and then combining them into a single operating system so that you’re easily able to boot up and install. Furthermore, they also provide you with different options such as the default desktop environment, browser, and other software. Users can get an operating system by installing one of the most stable Linux distros.

Linux has numerous distinct features for different users. There are lots of Linux distributions for a variety of uses, including education, gaming, and developing software. Somehow I can find so many different Linux distributions that I can’t even remember the exact numbers. There are some unique tendencies, revealed in some clones of each other. So it’s kind of confusing. But that’s the beauty of Linux. Few features of Linux distributions are quite identical to one another, but some distributions have their own user interface and unique features.

Although there are numerous Linux distributions, this article conveys the topmost stable Linux distributions of 2022 currently available.

List of Most Stable Linux Distributions

It is quite common for the term “stable” to be used with Linux operating systems or with a distro, this is because of the accessibility of the modification like updating repositories according to user requirements. Out of these modifications, some of them are vital like Debian, roughly like a fork of a base distribution; Arch, Ubuntu, and many others like Mint.

However, they are unable to fulfill numerous features like support and documentation. In this article, we will list down the top 5 most stable Linux Distros carrying good support, repositories, updating regularly, quite easy to use, and durable.

1. Debian Linux

On top of the list, Debian Linux is the most stable Linux distribution. The great thing about it is that it is user-friendly, lightweight, and compatible with other environments. The Debian team has a longer work period, which allows them to fix most of the bugs before releasing a new version.

The current stable distribution of Debian is version 11, codenamed bullseye. Can be downloaded free from the official download page.

Debian Linux
Debian Linux

Main Features

  • Effectively repair bugs
  • It does not require maintenance and the software can be updated itself.
  • The official archive upholds cutting-edge and modern packages of programming.
  • Package manager i.e. Apt the ability to control dependency issues and proficiently orphaned packages

2. Linux Mint

There is always tough competition to be at the top place and the Linux Mint is not far behind. It is the most widely used distribution and is dependent on Debian and Ubuntu. Linux Mint is one of the most well-known Linux distributions that are both free, community-centric open-source Linux distributions with a huge number of packages.

Linux mint was titled as the best distribution in October 2012. “Vanessa” is the latest version, released in July 2022 whereas the older version of this environment was “Ulyssa”. Linux mint also maintains and supports operating systems in Python and helps to modify its software.

Linux Mint
Linux Mint

Main Features:

  • Easy to use
  • Completely supports interactive multimedia
  • Comes with basic software such as “LibreOffice, Thunderbird, HexChat, Pidgin”
  • Linux Mint offers you to download numerous software like “transmission and VLC media player” by using the package manager.
  • Easy to install for newbies
  • Linux Mint also accompanies numerous flavors like “Cinnamon, GNOME, KDE”, etc.

3. Ubuntu

Ubuntu is considered the most established Linux distribution for Debian beginners. It is pre-installed on many laptops these days. The good thing is, Ubuntu has its own repositories and functionalities which are frequently synced with the repositories of Debian.

Ubuntu is a well-known, open-source desktop that contains various applications like an office suite, email and media applications, and so forth. For example, you can easily make presentations, assignments, and formal documents on Ubuntu with LibreOffice.

Ubuntu Linux
Ubuntu Linux

Main Features:

  • The graphical user interface is easy to use as you can easily customize the look according to your needs.
  • Ubuntu has a secure platform.
  • It supports numerous desktop environments i.e. “Unity, XFCE, MATE”, etc.
  • Most customizable distribution for super users.

4. Slackware

Slackware Linux is one of the oldest continuously-developed distributions, having been created by Patrick Volkerding in 1993. that is designed for advanced users who are looking for a secure, stable, and reliable distribution. It has a proven record of reliability and stability, making it a popular choice among advanced users. It is also known for its customizability and comes with a large number of preinstalled packages. It can be used on a wide range of hardware, from low-end PCs to supercomputers.

Slackware Linux
Slackware Linux

Main Features:

  • The oldest Linux operating system with continuous development
  • Flexible and stable distribution
  • Can be easily installed on older hardware.

5. OpenSUSE

OpenSUSE is another incredibly stable Linux distro developed by various companies and SUSE Linux. The purpose of OpenSUSE is to make easily accessible open-source tools by giving developers a user-friendly environment.
OpenSUSE combines and collaborates in order to stop conveying the ordinary release and focus to deliver the most stable distros. The code of OpenSUSE usually takes each one of the extraordinary characteristics from the Enterprise of SUSE Linux and gives the other way around.

Opensuse Linux
Opensuse Linux

Main Features:

  • User friendly
  • It also supports graphic cards.
  • It has various characteristics of “GNOME, KDE, Cinnamon, LXDE, Xfce, Openbox”, etc.

Conclusion

As you can see, each Linux distribution has its own unique features and is optimized to perform specific tasks. This article conveys the top 5 most stable Linux Distributions for 2022.

The term stable is very relative when it comes to operating systems. It depends on the type of hardware you are running on your system or the software you are going to run. An operating system that is stable for one user might not be stable for another. When looking for a new stable OS for your system you should go for the one which has the LTS or stable version tag.

The post Top 5 Most Stable Linux Distributions in 2022 appeared first on TecAdmin.

]]>
https://tecadmin.net/best-stable-linux-distributions/feed/ 7
How To Install and Secure MongoDB on Ubuntu 20.04 https://tecadmin.net/how-to-install-mongodb-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-mongodb-on-ubuntu-20-04/#respond Tue, 07 Sep 2021 09:00:04 +0000 https://tecadmin.net/?p=22000 MongoDB is a database and in comparison to other databases, it is easy to handle because there is no need to work in a table-based conventional relational database structure. We can save a large amount of data because of its feature of horizontal partitioning. A lot of companies are using MongoDB like CISCO, Facebook, Nokia, [...]

The post How To Install and Secure MongoDB on Ubuntu 20.04 appeared first on TecAdmin.

]]>
MongoDB is a database and in comparison to other databases, it is easy to handle because there is no need to work in a table-based conventional relational database structure. We can save a large amount of data because of its feature of horizontal partitioning. A lot of companies are using MongoDB like CISCO, Facebook, Nokia, etc.

MongoDB offers data aggregation as it allows us to store data according to our preferences. Otherwise, we have to manage data according to the data management of a conventional database.

This article will help us to understand how to install MongoDB in Ubuntu 20.04.

Prerequisites

You must have shell access to the Ubuntu system with sudo privileged account.

Installing MongoDB on Ubuntu

01. Open the terminal and add the repository key of MongoDB to the apt keyring. We can do this by following commands. It will ask for a password:

wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - 

02. Now, we will add the MangoDB repository to our repository list by editing in the system’s list of sources. To access the editor of the system’s list we open the source list:

sudo nano /etc/apt/sources.list.d/mongodb.list 

Add the following line in the file as shown in the image:

deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse
MongoDB 5.0 PPA for Ubuntu 20.04
MongoDB 5.0 PPA for Ubuntu 20.04

Press CTRL + O to save changes and CTRL + X to exit from the editor.

03. Update the apt repository and then install the Mongodb server packages.

sudo apt update 
sudo apt install mongodb-org 

This will install the MongoDB server on your system along with the required dependencies.

04. Now, start the MongoDB daemon using the systemctl utility. Also, enable the service to auto-start on system reboot.

sudo systemctl enable mongod 
sudo systemctl start mongod 

05. Once the service started successfully, check the service status by typing the following command.

sudo systemctl status mongod 

06. Type “mongo” command on terminal and run to connect to the mongo shell:

mongo 

That’s it, the MongoDB server is up and running on your system.

Enable Authorization in MongoDB

By default, anyone can access MongoDB and can make changes to it. To secure it we will enable user authentication on the MongoDB server. This will prevent anonymous access to the database server.

Login to the Mongo shell:

mongo 

We will type “use admin” in the mongo shell so now we are in its administration section.

use admin

Next, create a user account with admin privileges in MongoDB.

db.createUser(
  {
    user: "tecadmin",
    pwd: "Pa$$w0rd",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
)
Create Admin Account in MongoDB
Create Admin Account in MongoDB

Now exit the editor by pressing CTRL + C.

Next we need to enable security in MongoDB configuration file. Edit the mongo configuration file by using:

sudo nano /etc/mongod.conf 

The setting will be open and go to the “#security” section. Remove the “ # ” and type “authorization: enabled”.

MongoDB Enable Authorization
MongoDB Enable Authorization

Now exit by pressing CTRL + x, type “ y ” and press ENTER to exit by saving the file. Now restart the MongoDb and then check its status:

sudo systemctl restart mongod 

Now the database is secured, only admin users can access it by entering the set password. Use the following command to connect to the MongoDB server.

mongo -u tecadmin -p 
Output:
MongoDB shell version v5.0.2 Enter password: connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("0876c195-18dc-4e6c-a0c8-368364f10d03") } MongoDB server version: 5.0.2 ================ Warning: the "mongo" shell has been superseded by "mongosh", which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in an upcoming release. We recommend you begin using "mongosh". For installation instructions, see https://docs.mongodb.com/mongodb-shell/install/ ================ >

Conclusion

If we are doing a startup project and you know you have to make a lot of changes then MongoDB is the best database to work with as compared to conventional databases. In this article, we learned about MongoDB and how we can install and secure MongoDB on Ubuntu 20.04.

The post How To Install and Secure MongoDB on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-mongodb-on-ubuntu-20-04/feed/ 0