Connect with us

Linux

How to make Ubuntu not suspend when lowering the laptop lid

Published

on

How to make Ubuntu not suspend when lowering the laptop lid

Taking care of your laptop is something that cannot get out of hand. These teams are so important in today’s daily work that a failure is a headache.

So, for your well-being and that of your computer, it is best to learn how to handle certain tricks. That is why you should know how to do so that Ubuntu does not suspend when lowering the laptop lid.

Go ahead and walk through this interesting and nutritious read with one of the simplest and most interesting Linux tricks. You will want to share it with everyone!

The Ubuntu Linux system

Tackling the world’s most popular and used operating systems isn’t something that happens overnight. Linux is an operating system released in 1991, its main feature? What is free software?

This, however, did not attract the attention of many people at the time. However, in recent years it has experienced constant and considerable growth in the number of users. Its progress has been such that it ranks as the third most used operating system on desktop or laptop computers.

How to make Ubuntu not suspend when lowering the laptop lid

Its Ubuntu distribution was released in 2004. This is, in turn, the preferred distribution of many. This is due to its versatility and, of course, its customizability.

Energy saving

And it is precisely the customization capacity that continues to be talked about for this article. Can you imagine the scope that it can have? Here’s a hint: you can change the way your laptop saves energy.

That’s right, if you want to know how to speed up the startup or boot time of the Ubuntu system easily, this article will serve as a starting point! All this thanks to a simple and very frequent action: lower the laptop lid.

What happens when you lower the lid?

Usually, this action has an immediate consequence. Every time you lower the lid of your laptop, it goes into ‘sleep’ or ‘hibernate mode. If you still don’t know what these modes are, you may want to review what the difference is between suspend and hibernate.

The truth is that not all laptops support these functions. And although they are usually harmless, they can cause some instability in old computers. Reasons enough to know how to optimize and clean Ubuntu Linux system.

Learning how to activate the hibernate or suspend mode on my laptop when closing the lid is extremely simple … you do it and that’s it! But … haven’t you done it accidentally and you wish Ubuntu didn’t suspend when you lower the laptop lid?

It’s time to change

As you can see, this is a function that is not entirely intuitive. Sometimes lowering the lid of the computer does not mean that it should enter ‘sleep’ or ‘hibernate’ mode. Normally, it would be advisable to learn how to program an automatic power on and off in Ubuntu Linux. However, this trick will save you much more time.

  1. Use your system terminal to enter the following command: Sudo nano /etc/system/login.conf
  2. Locate the section that contains: # HandleLidSwitch = suspend .
  3. You can simply remove the comment (suspend) or modify it by hibernate (so that it goes into ‘hibernate’ mode when closing the lid).
How to make Ubuntu not suspend when lowering the laptop lid

You can also modify the behavior of your laptop by closing the lid in a different way. From your computer’s desktop, enter the system configuration and:

  1. Access the “Energy” section.
  2. Next, go to the section “When closing the cover”.
  3. In the options bar the alternatives “Suspend” and “Do nothing” are shown.

Easy, fast, and useful

That Ubuntu is not suspended when lowering the lid of the laptop is highly recommended if you are constantly on the move. Since, many times, to change the table or room, it is necessary to lower the lid without going into suspension.

Despite not saving as much energy as you normally would with the active option, you save yourself inconvenience when working. If you want to know more tricks, surely you are interested in how to activate or deactivate the touchpad while writing in Ubuntu Linux.

Linux

The new version of Linux 5.13 comes with enhanced security, support for Apple M1 and more

Published

on

The new version of Linux 5.13 comes with enhanced security, support for Apple M1 and more

Linus Torvalds released version 5.13 of the Linux kernel where it provided early support for the new Apple M1 chip with basic support, new security features for Linux 5.13 such as Landlock LSM, Clang CFI support, and the ability to randomize the kernel stack offset on every system call, as well as s Support for HDMI FreeSync and early implementations of Aldebaran, among others.

About 47% of all changes introduced in 5.13 are related to device drivers, about 14% of changes are related to updating code specific to the hardware architecture, 13% are related to the network stack, 5% are related to the file system, and 4% are related to the kernel subsystem internals.

Torvalds called the new version “pretty big”.

“We’ve had a pretty quiet week since rc7, and I see no reason to delay 5.13. The roundup for this week is small, with just 88 uncombined commits (and some of them just rollbacks). Of course, while last week was small and quiet, the 5.13, on the whole, was pretty big. In fact, it is one of the most important versions of 5.x, with over 16,000 commits (more than 17,000 if you count mergers), from over 2,000 developers. But this is a general phenomenon, not a specific phenomenon distinguished by its unusual character,” wrote Torvalds.

Major new features of Linux 5.13

One of the most important new features of the Linux 5.13 kernel is early support for Apple’s M1 chip, where at the moment you only have hardware support and code execution, but a lot of optimization is expected. Graphics acceleration is not yet available, but it is hoped that in the next version initial support will also be available.

Another news presented in Linux 5.13 in relation to security is Landlock, which is a new security module that can run alongside SELinux to better manage processes. It allows to limit interaction with external environment group processes and was developed with a view to isolation mechanisms such as Sandbox, XNU, FreeBSD Capsicum, and OpenBSD Pledge/Unveil.

With the help of Landlock, any processes, including those that are not rooted, can be isolated reliably and avoid going through isolation in case of vulnerabilities or malicious app changes. Landlocks allow processes to create secure sandboxes that are implemented as an additional layer on top of existing system access control mechanisms. For example, a program may deny access to files outside the working directory.

also, improvements to the RISC-V architecture are highlighted, because in this new version support for kexec, crash dumps, kprobe, and kernel launch are implemented in place (execution in place, execution from native media, without copying to RAM).

Also for modern Intel processors, a new cooling controller has been won, Initial support is also provided for this manufacturer’s new system, branded Alder Lake-S (12th generation).

Meanwhile, AMD highlights FreeSync support via HDMI, support for ASSR (Alternative Encoder Seed Reset), ioctl to request video encoding and decoding capabilities, and CONFIG_DRM_AMD_SECURE_DISPLAY mode to detect changes to the screen displaying important information. Support for the ASPM power-saving mechanism has been added.

From other notable changes of this new version of Kernel:

  • Support for the Simultaneous Translation Search Buffer Buffer (TLB) feature for some minor performance benefits In fact, Linux 5.13 x86 memory management work provides a small performance optimization which is especially useful given the CPU security mitigations of recent years affecting TLB.
  • Support for AMD Zen for Turbostat.
  • Loongson 2K1000 bracket.
  • KVM provides AMD SEV and Intel SGX upgrades for guest virtual machines.
  • Support for Intel bus key detection has been added in addition to existing support for separate key detection.
  • KCPUID is a new utility in the tree to help configure new x86 processors.
  • A generic USB display driver has been added for settings such as using the Raspberry Pi Zero as a display adapter.
  • Support for “Intel DG1 Platform Monitoring Technology” / telemetry platform.
  • The POWER9 NVLink 2.0 driver has been removed due to lack of open source user support.
  • Direct Rendering Manager driver update.

Continue Reading

Linux

How to Install and Configure Java on Ubuntu 20.04

Published

on

How to Install and Configure Java on Ubuntu 20.04

Java is one of the most popular programming languages ​​used to build various types of applications and systems. Java runs on all operating systems and devices. We can find applications developed in Java on your laptop, mobile phone, and game console.

In this guide, we will learn how to install Java on Ubuntu 20.04.

Before starting

There are several different Java implementations. OpenJDK and Oracle Java are the two main implementations of Java, with almost no difference between them except that Oracle Java has some additional commercial features. The Oracle Java license only permits non-commercial use of the software, such as personal use and development use.

The default Ubuntu 20.04 repository includes two OpenJDK packages, the Java Runtime Environment (JRE) and the Java Development Kit (JDK). The JRE consists of the Java virtual machine (JVM), classes, and binaries that make it possible to run Java programs. The JDK includes the JRE and the development/debugging tools and libraries needed to build Java applications.

If you are not sure which Java package to install, the general recommendation is to install the default version of Java, which is the OpenJDK version (JDK 11). Some Java-based applications may require a specific Java version, so as a user, it is mandatory to read the application documentation.

Install Java OpenJDK 11 on Ubuntu 20.04

At the time of writing, Java 11 is a long-term supported (LTS) version of Java. It is also the default Java development and runtime in Ubuntu 20.04.

Run the following command as a user with Sudo or root privileges to update the packages index and install the OpenJDK 11 packages:

sudo apt update
sudo apt install openjdk-11-jdk

The JRE is included in the JDK package. If you only need the JRE, install the OpenJDK-11-JRE. For minimal Java runtime, install the OpenJDK-11-JDK-headless.

Once the installation is complete, verify by checking the Java version:

java -version

The output will look like this:

openjdk version "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)

At this point, the Java installation on the Ubuntu system has been successful.

Install Java OpenJDK 8 on Ubuntu 20.04

Java 8, the earlier LTS version of Java, is still widely used. If your application is running on Java 8, you can install it by typing the following command:

sudo apt update
sudo apt install openjdk-8-jdk

Verify the installation by checking the Java version:

java -version

The output will look like this:

openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Set Default Java Version on Ubuntu 20.04


If you have multiple versions of Java installed on the system, To check the default Java version, you can use the following command:

java- Version

To be able to change the standard version, use the tools update-alternatives as shown below:

sudo update-alternatives --config java

The output will look like the following

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection Path Priority Status
-------------------------------------------------- ----------
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
  1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
  2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode

Press <enter> to keep the current choice[*], or type selection number: 

You will be presented with a list of all installed Java versions. Enter the version number you want to use as the default and press Enter.

Set JAVA_HOME Environment Variable

Some applications written in Java use environment variables JAVA_HOMEto specifies the Java installation location.

To set the JAVA_HOME environment variable, use the command update-alternatives to find where Java is installed:

sudo update-alternatives --config java

In our case, the installation path is as follows:

  • OpenJDK 11 is located at /usr/lib/jvm/java-11-openjdk-amd64/bin/java
  • OpenJDK 8 is located at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

Copy the installation path of the installation of your choice. Next, open the file /etc/environment :

sudo nano /etc/environment

Add the following line, at the end of the file:

/etc/environment
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"

Make sure to replace the path with the path to your Java version of choice.

You can log out and then log back in, or run the following source command to apply the changes to the current session:

sources /etc/environment

To verify that the environment variables are JAVA_HOMEset correctly, run the following echo command:

echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64

/etc/environment is the system configuration file, which is used by all users. If you want to set variables JAVA_HOMEon on a per user basis, add a line to .bashrcor other configuration file that is loaded when the user logs in.

How to Uninstall Java on Ubuntu 20.04

If for some reason you want to uninstall a Java package, you can uninstall it like any other package installed with apt.

For example, if you want to remove a package default-JDK just run the command:

sudo apt remove openjdk-11-jdk

Conclusion

OpenJDK 11 and OpenJDK 8 are available in the default Ubuntu 20.04 repositories and can be installed using the apt package manager.

Continue Reading

Linux

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted?

Published

on

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted

A free software system like Ubuntu has many advantages over its closed source competitors because it allows all kinds of actions to be carried out with commands. One of them even allows you to fix faulty devices, so with that in mind today you will learn how to repair a damaged or unreadable USB memory using Ubuntu and Gparted.

If you have seen the title and thought that it is crazy to repair a USB directly from an operating system, then you have probably never used Linux because it is open-source, it gives certain facilities to its users so that they can edit things that allow them to create new tools from scratch.

Repair a corrupted or unreadable USB stick using Ubuntu and Gparted

To get straight to the point and start the process that will help you repair a damaged or unreadable USB memory using Ubuntu and Gparted, you obviously have to install Gparted on your PC if you haven’t downloaded it yet.

You will achieve this by opening your command window in the menu and entering the following: Sudo apt-get install GParted, this action will immediately install the program, once the process finishes you will be able to use it without any limitation.

Now to begin the USB repair process, you must put this USB into one of the ports that you have available (make sure it is working perfectly since you cannot disconnect the memory until the process is finished).

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted

Once it is connected, the Gparted will recognize it immediately, so the next step will be to open the program, then you will have to stand over the button that has the same name as the application (it is in the menu above), and click on ” Refresh devices ”, so that the USB appears that way.

Format or resize

When your memory has been loaded into the program, you will notice that the amount of GB it has appeared, and also a small section where there are a few MB (that is the firmware information), in case that information does not come out. , then you will not be able to repair the USB (usually happens with 8 or 128 GB memory).

If you get it, then proceed to click on the option with more memory, which will show several elements in a list, select “Delete” to format it, and if it doesn’t let you do that, then click on “Resize/Move”.

That will let you partition the device so that you can shrink the USB to the space that is considered real. If your memory is 64 then create a partition of 8, if it is 32 make it 4 (if it is some other then you can search the web for what the value would be).

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted

In order to create this partition, you only have to lower the amount of memory in the “New size” field with the bar that appears in the “Resize” section. When finished, just press “Resize/Move” to confirm and that’s it. If you want, you can try to repair the memory card without formatting, it may be a process, but maybe you will succeed.

Where to direct memory

With the above, you are just a few steps away from finishing the process that will help you answer the question How to repair a damaged or unreadable USB memory using Ubuntu and Gparted? , the next thing you should do is direct the memory where you want.

For that, click again on the section of your USB, but this time press the option “Format to”, there you will get a list of places that you can select, the recommended thing is to press “FAT32” if the destination of the USB is mobile and “NFTS” if you use it on a computer.

Having chosen one, the process will be complete and it is most likely that the USB can already be used, so the question How to repair a damaged or unreadable USB memory using Ubuntu and Gparted? , has finally been answered.

But before finishing, I tell you that if you want to force format the USB, you could also try it. And, if you finally can’t fix it, you can try to recover RAW formatted USB files.

Continue Reading
Advertisement

Latest

How To Use Dummy Text Lorem Ipsum in Microsoft Word How To Use Dummy Text Lorem Ipsum in Microsoft Word
MS Word14 hours ago

How To Use Dummy Text Lorem Ipsum in Microsoft Word

SHARE How To Use Dummy Text Lorem Ipsum in Microsoft Word How to quickly make Dummy Text Lorem Ipsum in...

How to Quickly Enlarge and Reduce Fonts in Word How to Quickly Enlarge and Reduce Fonts in Word
MS Word14 hours ago

How to Quickly Enlarge and Reduce Fonts in Word

SHARE You can increase and decrease fonts in Microsoft Word very quickly, you don’t even need to change your font...

How to Create Automatic Serial Numbers in Excel How to Create Automatic Serial Numbers in Excel
MS Excel14 hours ago

How to Create Automatic Serial Numbers in Excel

SHARE There are several ways to create automatic serial numbers in Microsoft Excel that you can use to help with...

How To Find & Replace Feature in Microsoft-Excel How To Find & Replace Feature in Microsoft-Excel
MS Excel15 hours ago

How To Find & Replace Feature in Microsoft Excel

SHARE Excel has a feature called Find & Replace, this feature will help you when searching for data according to...

How to Set Column and Row Size in Microsoft Excel How to Set Column and Row Size in Microsoft Excel
MS Excel15 hours ago

How to Set Column and Row Size in Microsoft Excel

SHARE The easiest way to adjust the size of columns and rows in Microsoft Excel is this way. Guys, curious,...

How to Delete Columns and Rows in Microsoft Excel How to Delete Columns and Rows in Microsoft Excel
MS Excel15 hours ago

How to Delete Columns and Rows in Microsoft Excel

SHARE You can delete Excel columns and rows to tidy up the data or worksheets that you are managing. By...

How to Copy Writing Format in Microsoft Word How to Copy Writing Format in Microsoft Word
MS Word2 days ago

How to Copy Writing Format in Microsoft Word

SHARE This time, how to copy the writing format in Microsoft Word into tutorial material that you will enjoy on...

How to Show Calculator Features in Microsoft Word How to Show Calculator Features in Microsoft Word
MS Word2 days ago

How to Show Calculator Features in Microsoft Word

SHARE How to display the calculator feature in Microsoft Word is really easy for you to try! For those of...

How to Add Columns and Rows in Excel How to Add Columns and Rows in Excel
MS Excel2 days ago

How to Add Columns and Rows in Excel

SHARE How to add columns and rows in Excel is an important and mandatory thing for you to know, especially...

How to Create a Table in Microsoft Excel How to Create a Table in Microsoft Excel
MS Excel2 days ago

How to Create a Table in Microsoft Excel

SHARE How to create a table in Excel is very easy because basically, Microsoft Excel consists of a table and...

Advertisement

Categories

Trending

Copy link
Powered by Social Snap