Tag Archive for: Linux



GoAccess es un analizador de registros mudable y de código libre que puede interpretar y analizar archivos de registro de múltiples formatos, incluyendo Apache, Nginx, Amazon S3, Elastic Load Balancing, CloudFront, Caddy, etc. Está escrito en jerga C y utiliza la biblioteca ncurses para su interfaz de panel de control, a la que se puede conseguir desde la linde de comandos.

Puede producir informes en formato HTML, JSON y CSV, que pueden compartirse con otros. Incluso puede producir informes HTML en tiempo vivo que pueden mostrarse a través de un enlace manifiesto.

En este tutorial, aprenderás a instalar GoAccess Analyzer en un servidor Rocky basado en Linux y a configurarlo para que lea los registros de Nginx y genere informes en tiempo vivo.

Requisitos previos

  1. Un servidor con Rocky Linux 8.
  2. Un adjudicatario no root con privilegios sudo.
  3. Nginx ejecutándose en el servidor para conseguir a los registros.
  4. Asegúrate de que todo está actualizado.
    $ sudo dnf update
    

Paso 1 – Instala las dependencias para GoAccess

La última interpretación de GoAccess v1.5.2 no está adecuado en el repositorio por defecto. Para instalar la última interpretación de GoAccess, vamos a compilarla desde el código fuente. El primer paso es descargar las dependencias necesarias para construir el paquete GoAccess.

$ sudo dnf install ncurses-devel libmaxminddb-devel openssl-devel 
$ sudo dnf groupinstall 'Development Tools'

Paso 2 – Descargar e instalar GoAccess

Descarga la última interpretación del archivo de GoAccess. Puedes encontrar la última interpretación de GoAccess en la página oficial de descargas.

$ wget https://tar.goaccess.io/goaccess-1.5.2.tar.gz

Extrae los ficheros del archivo.

$ tar -xzvf goaccess-1.5.2.tar.gz

Configura e instala el paquete.

$ cd goaccess-1.5.2
$ autoreconf -fi
$ sudo ./configure --enable-utf8 --enable-geoip=mmdb --with-openssl
$ sudo make
$ sudo make install

Comprueba que GoAccess se está ejecutando.

$  goaccess --version
GoAccess - 1.5.2.
For more details visit: https://goaccess.io/
Copyright (C) 2009-2020 by Gerardo Orellana

Build configure arguments:
  --enable-utf8
  --enable-geoip=mmdb
  --with-openssl

Paso 3 – Descarga la Saco de Datos GeoIP

Puedes descargar la Saco de Datos GeoIP desde DB-IP o desde Maxmind. Si vas a descargarla desde Maxmind, tendrás que crear una cuenta y producir una esencia de osadía gratuita. La descarga desde DB-IP puede hacerse directamente.

Descarga el archivo zip del país desde cualquiera de las fuentes anteriores. Una vez descargados, extráelos y sube el archivo .mmdb al servidor a una carpeta personalizada como /home/<user>/geoip.

Paso 4 – Configurar GoAccess

GoAccess almacena su archivo de configuración en /usr/nave/etc/goaccess/goaccess.conf. Puedes comprobar la ubicación del archivo en tu sistema utilizando el próximo comando.

$ goaccess --dcf
/usr/nave/etc/goaccess/goaccess.conf

Abre el archivo para editarlo.

$ sudo nano /usr/nave/etc/goaccess/goaccess.conf

La mayoría de las opciones están comentadas. Puedes utilizar estas opciones a través de la linde de comandos o establecerlas aquí en el archivo. Para activar una opción, elimina el carácter # que aparece delante de ella.

En primer superficie, vamos a activar la opción time-format. En nuestro tutorial analizaremos archivos de Nginx, así que activa la opción destinada a los registros de Apache/Nginx.

# The following time format works with any of the
# Apache/NGINX's log formats below.
#
time-format %H:%M:%S

A continuación, activa la opción date-format de Nginx.

# The following date format works with any of the
# Apache/NGINX's log formats below.
#
date-format %d/%b/%Y

A continuación, activa la opción log-format. En nuestro tutorial, utilizaremos el formato de registro combined, que es el que suele utilizar Nginx.

log-format COMBINED

Si tus archivos de registro contienen el campo Host imaginario, activa en su superficie la próximo opción.

log-format VCOMBINED

Supongamos que deseas un anciano control sobre el formato de registro. En ese caso, puedes habilitar la próximo linde en su superficie (dependiendo del registro al que accedas) y añadir o quitar parámetros según tus micción.

log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"

Para activar el módulo GeoIP, activa la próximo opción introduciendo la ruta a la saco de datos GeoIP.

# For GeoIP2 Country database:
# Download the GeoLite2-Country.mmdb.gz
# gunzip GeoLite2-Country.mmdb.gz
#
geoip-database /home/geoip/dbip-country-lite-2021-10.mmdb

Cumplimiento el archivo pulsando Ctrl + X e introduciendo Y cuando se te pida una vez hayas terminado.

Paso 5 – Ejecutar GoAccess

Normalmente, si quieres ejecutar GoAccess, tendrás que utilizar el próximo comando.

$ sudo /usr/nave/bin/goaccess /var/log/nginx/access.log

Necesitamos utilizar sudo porque los usuarios normales no pueden desobstruir los archivos de registro. Por otra parte, tendrás que utilizar la ruta completa para el ejecutable con el comando sudo porque éste no reconoce las aplicaciones del directorio /usr/nave/bin. Sin bloqueo, puedes evitar esta muro creando un enlace simbólico.

Para ello, ejecuta el próximo comando.

$ sudo ln -s /usr/nave/bin/goaccess /usr/bin/goaccess

Ahora puedes ejecutar GoAccess directamente.

$ sudo goaccess /var/log/nginx/access.log

Los archivos de registro de Nginx guardan un registro de todo el tráfico HTTP entrante. Si tu servidor lleva funcionando mucho tiempo, verás varios registros de comunicación con los registros más antiguos en formato comprimido .gz. Los archivos de registro más antiguos se generan como resultado de la rotación de registros.

Una vez que ejecutes el comando, te aparecerá el próximo panel de control.

Panel GoAccess

GoAccess te proporciona varios atajos de teclado para navegar por el panel de control.

  • TAB para avanzar por los módulos disponibles y SHIFT+TAB para retroceder.
  • F5 para modernizar el panel de control.
  • g para ir a la parte superior de la pantalla del panel de control y G para ir a la parte inferior.
  • o o ENTER para expandir el módulo seleccionado.
  • j y k para desplazarte en torno a debajo y en torno a en lo alto en el interior del módulo activo.
  • s para mostrar las opciones de distribución del módulo activo.
  • / para averiguar en todos los módulos y n para acaecer a la próximo coincidencia.
  • 0-9 y SHIFT+0 para activar rápidamente el módulo numerado correspondiente.
  • ? para ver el diálogo de ayuda rápida.
  • q para salir del software.

Veamos brevemente todos los paneles.

  1. Visitantes únicospor día – Este panel se explica por sí mismo. Enumera los visitantes únicos, las visitas y el orondo de bandada acumulado para cada época. Asimismo incluye por defecto los rastreadores y arañas web.
  2. Archivos solicitados (URLs ) – Este panel proporciona las estadísticas relativas a los archivos no estáticos más solicitados en tu servidor.
  3. Peticionesestáticas – Es similar al panel precursor, indemne que gestiona archivos estáticos como imágenes, CSS, JavaScript, etc.
  4. URLs no encontradas (404s ) – Este panel registra todas las peticiones a archivos y rutas no encontradas en tu servidor.
  5. Nombres de host e IP de visitantes – Este panel ofrece más información sobre los visitantes de tu sitio. Puedes pulsar o para ampliar el panel y obtener información detallada como el país de origen, la ciudad y el DNS inverso.
  6. Sistemas operativos – Este panel muestra los distintos sistemas operativos utilizados por los visitantes.
  7. Navegadores – Este panel muestra los distintos navegadores utilizados por los visitantes.
  8. Distribución Horaria – Este panel ofrece un documentación horario del número de visitas, visitantes únicos y orondo de bandada consumido.
  9. Anfitriones virtuales – Este panel muestra los anfitriones virtuales analizados a partir del archivo de registro. Sólo se mostrará si utilizas el formato de registro VCOMBINED en el archivo de configuración precursor o si %v forma parte de la configuración del formato de registro.
  10. URL de narración – Enumera las URL que remiten a los visitantes a tu servidor. Este panel está desactivado por defecto. Para activarlo, comenta la próximo linde en el archivo de configuración añadiendo # delante de ella.
    #ignore-panel REFERRERS
    
  11. Sitios de narración – Este panel muestra las direcciones IP de los hosts de narración.
  12. Frases esencia – Este panel muestra las palabras esencia utilizadas en la Búsqueda de Google, la personalidad de Google o Google Translate que llevan a tu sitio. Este panel igualmente está desactivado por defecto. Actívalo comentando la próximo linde en el archivo de configuración.
    #ignore-panel KEYPHRASES
    
  13. Códigos de estado HTTP – Este panel muestra las estadísticas de los códigos de estado HTTP devueltos por tu servidor cuando replica a una petición.
  14. Beneficiario Remoto (Autenticación HTTP) – Este panel muestra el ID de adjudicatario de la persona que accede a un documento en tu servidor, protegido por autenticación HTTP. Este panel sólo funciona si %e forma parte de la configuración del formato de registro.
  15. Estado de la cach é – Este panel determina si una petición está siendo almacenada en personalidad y servida desde ella. Este panel sólo funciona si %c forma parte de la configuración del formato de registro.
  16. Ubicación geográfica – Este panel proporciona una directorio de ubicaciones geográficas de los visitantes que acceden a tu sitio. Sólo aparecerá si has descargado y añadido su ubicación en el archivo de configuración.

Paso 6 – Ejecutar GoAccess sin privilegios

Como buena destreza de seguridad, cuanto menos código funcione como root, mejor. Para ejecutar GoAccess sin ser root, necesita permisos para interpretar los archivos de registro.

Los archivos de registro del servidor suelen formar parte del camarilla adm. Puedes comprobarlo utilizando el próximo comando.

$ ls -l /var/log/nginx
total 68
-rw-r----- 1 nginx adm 30547 Oct 10 12:47 access.log
-rw-r----- 1 nginx adm 35063 Oct 10 12:47 error.log

Como puedes ver, no necesitas ser adjudicatario root para desobstruir los archivos de registro. Cualquier adjudicatario perteneciente al camarilla adm puede desobstruir los archivos.

La forma más sencilla de ejecutar GoAccess sin ser root es añadir al adjudicatario actualmente conectado al camarilla adm. De ese modo, podrás ejecutar GoAccess con ese adjudicatario sin sudo.

Ejecuta el próximo comando para añadir el adjudicatario presente al camarilla adm.

$ sudo usermod -aG adm $USER 

Ahora, cierra la sesión y vuelve a entrar para aplicar el cambio. O puedes ejecutar el próximo comando sin indigencia de cerrar la sesión para aplicar el cambio.

$ su $USER

Deberías poder ejecutar GoAccess directamente sin indigencia de sudo.

$ goaccess /var/log/nginx/access.log

Paso 7 – Ocasionar Informes HTML

GoAccess puede utilizarse para producir informes HTML que puedes servir en linde. Utiliza el próximo comando para producir un documentación HTML.

$ goaccess /var/log/nginx/access.log -o stats.html

Puedes descargar el archivo en tu PC nave para ti o en la carpeta de tu sitio web para servirlo públicamente.

Informe HTML de GoAccess

Incluso puedes producir un documentación HTML en tiempo vivo utilizando GoAccess. Pero primero, necesitas desobstruir el puerto 7890 para que se ejecute el Websocket de GoAccess. Abre el puerto utilizando el próximo comando.

$ sudo firewall-cmd --permanent --add-port=7890/tcp

Recarga el cortafuegos para aplicar el cambio.

$ sudo firewall-cmd --reload

Ahora, ejecuta el próximo comando para producir un documentación HTML en tiempo vivo.

$ goaccess /var/log/nginx/access.log -o /usr/share/nginx/html/livereport.html --real-time-html

Esto generaría un documentación en tiempo vivo en la ubicación especificada. El comando precursor mantendrá GoAccess ejecutándose en primer plano como un WebSocket a la audición de conexiones.

Hay una pequeña advertencia al ejecutar el comando precursor. El comando precursor funcionará cuando GoAccess tenga permisos de adjudicatario en el directorio /usr/share/nginx/html. Como estamos ejecutando GoAccess con el adjudicatario que ha iniciado la sesión, tienes que darle permisos sobre el directorio /usr/share/html. Si por alguna razón no puedes esperar, tendrás que ejecutar GoAccess utilizando sudo.

$ sudo goaccess /var/log/nginx/access.log -o /usr/share/nginx/html/livereport.html --real-time-html

Si quieres ejecutar GoAccess en segundo plano, puedes hacerlo como demonio utilizando el próximo comando.

$ goaccess /var/log/nginx/access.log -o /usr/share/nginx/html/livereport.html --real-time-html --daemonize
Daemonized GoAccess: 78315

Para detener el demonio GoAccess, mata el proceso con el próximo comando.

$ sudo kill -9 78315

Aquí estamos utilizando el ID del proceso que obtuvimos en nuestro comando precursor. Si no recuerdas el ID del proceso, igualmente puedes utilizar el próximo comando para matarlo.

$ sudo kill -9 `pidof goaccess`

Fíjate en que estamos utilizando el entrecomillado (`) en nuestro comando. Si utilizas comillas normales, el comando fallará.

Conclusión

Con esto concluye nuestro tutorial sobre la instalación y ejecución de GoAccess Log Analyzer en el servidor Rocky Linux 8. Si tienes alguna pregunta, publícala en los comentarios a continuación.



The “tr” command in Linux can be used to translate or remove a character from the standard input, with the results shown in the standard output. We can complete several operations with the “tr” command. It gives us access to several flags including “-c”, “-d”, “-s”, and others. This command allows us to delete the characters, remove the digits from lines, and change the lowercase to uppercase letters, among many other operations. We will use the tr command and a few of its flags as examples in this article.

Using the Linux “Tr” Command

The tr function can be used to carry out tasks including getting rid of redundant characters, changing the haber letters to lower letters, and replacing and getting rid of simple character. It is frequently combined with other commands via piping.

In this section, we utilize the Linux “tr” command to replace the characters. Let’s begin putting the command into action on Linux. First, we open the terminal. Then, we use the “echo” command to accomplish this. To display the lines of text or characters that are passed as command-line parameters, use the echo function. The most frequently used function in the shell scripts on Linux is this one. We start with the “echo” keyword then type the statement that we want to use inside the inverted comma which is “you are the best” followed by the bar “|”, the “tr” keyword, the letter that we want to replace, “e,” and the letter “s” which is the character that appears in that location where “e” is used in the echo sentence.

omar@omar-VirtualBox :~$ echo “you are the best” | tr e s

When we run this command, the terminal window displays the output which is the echo statement where the character “e” is replaced with the character “s”. The result is “you ars the bsst”.

Converting the Lowercase Characters to Uppercase Characters

In this section, we’ll show you how to change the lowercase letters into uppercase letters using one of two methods: either we may provide the character range or we can specify the interpreted sequences to change the characters. The lowercase characters go in the [:lower] sequence, while the uppercase characters go in the [:upper:] sequence. Now that the command is created, it is put into action using the “echo” statement first and then changing the lower characters to upper characters. The fruit names that are included in the echo statement are “Apple”, “Mango”, “Plátano”, and “Grapes”.

As you can see, the first character in each of these elements is uppercase, while the remaining characters are lowercase. To change the remaining characters to uppercase, we use the “tr” command in which we specify the character range as “[a-z]” and “[A-Z]” where the first specifies the range of the alphabet using the lower characters, and the second specifies it using the upper characters. This essentially indicates that all lowercase characters from “a” to “z” in the echo statement are changed to uppercase.

omar@omar-VirtualBox:~$ echo “Apple” “Mango” “Plátano” “Grapes” | tr [a-z] [A-Z]

Now that the command is executed, you can see that the lowercase characters are changed to uppercase characters in the following output:

APPLE MANGO BANANA GRAPES

Now, in the following section, we’ll utilize a different technique to change the lower case to upper case using the “tr” command with the “[:lower]” and “[:upper:]” terms. To accomplish this, we use the same echo statement and then type “tr” followed by the “[:lower:]” and “[:upper:]” keywords. Using “lower” first and then “upper” means that all of the lowercase letters in the echo statement are changed to uppercase.

omar@omar-VirtualBox:~$ echo “Apple” “Mango” “Plátano” “Grapes” | tr [:lower:] [:upper:]

When we execute this command, it produces the same results as the previous one:

APPLE MANGO BANANA GRAPES

Removing Specific Characters

In this section, we’ll use the “-d” option of the “tr” command to remove a specific character from the echo statement. Using a specific character in the “tr” command with the “-d” parameter, we can delete that character from the line or the file.

Let’s remove the character using the command on the terminal. First, we use the “My name is Alex” echo statement followed by the bar “|”. After which, we write “tr” followed by the “-d” flag to delete the character. Finally, we provide the character that we want to remove from the statement which is “e” in the inverted comma.

omar@omar-VirtualBox:~$ echo “My name is Alex” | tr -d ‘e’

When we run this command, the “e” character is removed from the line and the text is changed to “My name is Alx”.

Deleting Digits

Using the “tr” command, “-d” option, and the “[:digit:]” expression, we may additionally delete all the digits in a line or file. The word “digit” must be enclosed in square brackets and a colon. Let’s begin using the “Alex got 98% marks” echo statement followed by the “|” bar, “tr”, the “-d” option, and the “[:digit:]” keyword. This deletes all the digits that are present in the echo statement since there are two digits in the “98” echo statement which means that both of these digits are removed from the line when we run this command:

omar@omar-VirtualBox:~$ echo “Alex got 98% marks” | tr -d [:digit:]

Following the execution of this command, the “Alex got% marks” echo statement is displayed in the output. As you can see, both digits are deleted from the line, keeping only the characters and the “%” symbol that we used in the line.

Eliminating Newline Characters

In this section, we remove the file’s newline character. On the desktop, there is a file called “file.txt” that holds some information. First, we use the cat command to open the file on the terminal. To use this command, type “cat” followed by the file’s name, “file.txt.” The file opens on the terminal when we execute this command:

omar@omar-VirtualBox:~/Desktop$ cat file.txt

When the command is executed, a file which contains several names is opened. Each name is written on a separate line. Now, we display the entire name on a single line by deleting the newline character.

We type the following command on the terminal. First, we type “cat”. Then, we use the “file.txt” file name. Then, we use bar “|”. After that, we type the “tr” command. Then, we use the “-s” option which is used to convert the newline characters into spaces. Lastly, the “n” inside of the inverted commas is used. This converts the newline characters into spaces and displays all of the lines in a single line.

omar@omar-VirtualBox:~/Desktop$ cat file.txt | tr –s ‘n’ ‘ ‘

The output of the command is “Alex”, “Jhon”, “Watson”, and “David”. When the command is performed, it prints the file’s lines on a single line which is separated by spaces. The newline characters are deleted and changed into spaces.

Conclusion

This article looked at the “tr” command in Linux which can be used for a variety of tasks. The “tr” command can be used with a variety of flags such as “-s”, “-d”, and others. In the aforementioned article, we utilized the numerous instances of the “tr” command in which we substituted the characters, deleted the characters, removed the digits, and also removed the newline characters from the files and changed them to spaces before displaying the entire text of the lines in a single line.



Source link



NoMachine es un software de escritorio remoto de balde y de código despejado que se utiliza para el comunicación remoto, la compartición de escritorio, el escritorio potencial y la transferencia de archivos entre ordenadores. Utiliza el protocolo NX que proporciona una velocidad almacén con bajo satisfecho de manada. Se puede instalar en muchos sistemas operativos, como Linux, Windows, Mac OS X y Android. Si buscas una decisión de escritorio remoto, NoMachine es la mejor opción para ti.

En este tutorial, te mostraremos cómo instalar y utilizar NoMachine en CentOS 8.

Requisitos previos

  • Un sistema de escritorio que ejecute CentOS 8.
  • Una contraseña de root configurada el servidor.

Instalar NoMachine

Por defecto, NoMachine no está incluido en el repositorio por defecto de CentOS. Así que tendrás que descargarlo desde su sitio web oficial.

Puedes descargarlo con el próximo comando:

wget https://download.nomachine.com/download/7.1/Linux/nomachine_7.1.3_1_x86_64.rpm

Una vez completada la descarga, instala el archivo descargado con el próximo comando:

dnf install nomachine_7.1.3_1_x86_64.rpm

Una vez completada la instalación, deberías obtener la próximo salida:

  PulseAudio Backend

  The NoMachine  setup procedure  could not  detect  your  PulseAudio
  installation:  either  PulseAudio is not  installed  on your system
  or it was  installed  in a non-standard path.  If PulseAudio is not
  available, NoMachine audio support will try to rely on ALSA device.
  Please note  that you can enable  PulseAudio  support  at any time;
  to do this  make sure that you have PulseAudio installed, then run:

    /usr/NX/scripts/setup/nxnode --audiosetup 

  to specify the location of the PulseAudio configuration files.
NX> 700 Installing: nxserver version: 7.1.3.
NX> 700 Using installation profile: Red Hat.
NX> 700 Install log is: /usr/NX/var/log/nxinstall.log.
NX> 700 Creating configuration in: /usr/NX/etc/server.cfg.
NX> 700 Server install completed with warnings.
NX> 700 Please review the install log for details.
NX> 700 Install completed at: Tue Feb 16 05:43:49 2021.
NX> 700 NoMachine was configured to run the following services:
NX> 700 NX service on port: 4000

  Verifying        : nomachine-7.1.3-1.x86_64                                                                                              1/1 

Installed:
  nomachine-7.1.3-1.x86_64                                                                                                                     

Complete!

Configurar el cortafuegos

A continuación, tendrás que permitir el puerto TCP 4000 y el puerto UDP 4011-4999 a través de firewalld. Puedes permitirlos con el próximo comando:

firewall-cmd --add-port=4000/tcp --permanent
firewall-cmd --add-port=4011-4999/udp --permanent

A continuación, recarga el firewalld para aplicar los cambios.

firewall-cmd --reload

Trabajar con NoMachine

Posteriormente de instalar NoMachine, puedes lanzarlo desde la mostrador de búsqueda como se muestra a continuación:

Escritorio remoto NoMachine

Haz clic en NoMachine para editar la aplicación como se muestra a continuación:

Cliente NoMachine

Haz clic en el llamador Aceptar. Deberías ver la próximo pantalla:

Crear conexión

Ahora, haz clic en el llamador Añadir para crear una nueva conexión. Deberías ver la próximo pantalla:

Dirección remota

Proporciona el nombre de host de tu NoMachine remoto, la dirección IP, el puerto, el protocolo y haz clic en el llamador Conectar. Se te pedirá que proporciones el nombre de becario y la contraseña del ordenador remoto, como se muestra a continuación:

Introduce el nombre de usuario y la contraseña

Proporciona el nombre de becario, la contraseña y haz clic en el llamador Conectar. Una vez conectado, deberías ver la próximo pantalla:

Teclas de acceso rápido

Cambia la configuración de tu pantalla y haz clic en el llamador Aceptar. Deberías ver la próximo pantalla:

Escala el escritorio remoto

Selecciona la resolución de tu pantalla y haz clic en el llamador Aceptar. Una vez conectado, deberías ver la próximo pantalla:

Se ha establecido una conexión de escritorio remoto

Conclusión

En la tutela antecedente, has aprendido a instalar y utilizar el software de escritorio remoto NoMachine en CentOS 8. Ahora puedes resolver fácilmente varios sistemas remotos. No dudes en preguntarme si tienes alguna duda.



“Today, we will learn how to install KVM on Linux Mint 21 using the command line. KVM is a complete virtualization solution for Linux on x86 hardware. Using this, we can easily create Aparente Machines just like we do in VMware or VirtualBox. The best part about KVM is that it is open source and more efficient than its rival virtualization solutions.”

We have used basic Linux commands implemented on Linux Mint’s Terminal to install KVM. Let’s see how it is done!

Guide

Following are the steps involved in installing KVM on Linux Mint 21:

Step 1: Update and Upgrade Linux Mint

Before installing KVM, it is recommended to update your system and upgrade it. The following commands will help us in updating and upgrading our Linux Mint machine:

Step 2: Check System Compatibility With KVM

Next, we need to check whether KVM is compatible with our system or not. If it is not compatible, then we’ll keep running into errors.

egrep -c ‘(vmx|svm)’ /proc/cpuinfo

Output:

If you get an output above 0, that means KVM is compatible with your system and can be easily installed. In our case, we got an 8. This means we can install KVM on our system.

Step 3: Install KVM

Now that we have made sure that KVM can be installed, let’s install it by executing this command:

sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager

Step 4: Add Your User to the KVM and Libvirt Group

It is now time to add your user to KVM and libvirt group to set up KVM so that you don’t run into any permissions-related errors. Add the user to the KVM group like this::

sudo usermod -aG kvm $USER

Add the user to the libvirt group with this command:

sudo usermod -aG libvirt $USER

How to Create a Aparente Machine(VM) in KVM?

Now that we have installed KVM let’s see how we can create a VM on it. First, download the iso you want to create a VM of. We have downloaded an iso for Ubuntu 20.04.

Now open Aparente Machine Manager on your machine. This is how the interface will appear:

Click on File; you will see a list of options to choose from. Now click on New Aparente Machine:

This window will open with a list of options to choose from for your VM:

Please select the first option, as it allows you to create a VM using an ISO image. Merienda selected, click Forward.

Now select the iso that you downloaded, as shown below:

After that, allot memory and CPU utilization for the VM like this:

Next, allot storage to the VM:

Now, give the VM a name. For example, if the VM is Ubuntu, you can name it Ubuntu, followed by its version.

These are all the settings that were required. Click on Finish to finish the VM setup. The VM creation process will begin after that.

Merienda the VM is created, a new window will open for OS installation. You can then install the OS easily.

Conclusion

In today’s guide, we saw in detail how to install KVM on Linux Mint 21. We began by updating and upgrading the system. Then we verified KVM compatibility. Afterward, we installed KVM on our machine. In the end, we also saw how to create a Aparente Machine on KVM.



Source link


“It’s crucial to manage storage capacity on a Linux system. Programs that act as package managers, for instance, alert you to the amount of disc space needed for setup. You need to be aware of the amount of free space on your machine for that knowledge to be useful. There are several utilities available in the Linux systems to discover what is using the disk space of our system. Discover how to examine the disc space in Ubuntu using the df utility as well as how to view the file system’s disc space consumption using the “du” tool throughout this lesson.”

Update System

Before checking the disk space usage, we need to update our system to make it fully updated so that the memory space can be displayed correctly. For this, try opening the console application of your Linux system with the use of the “Ctrl+Alt+T” shortcut. It will be launching the console quickly in a few seconds. We have tried the apt instruction with the sudo rights followed by the keyword “update”. The execution asks for the “password” of the currently active user at the moment. We have added the password, and the process continues.

Check Disk Space Usage With Df Utility

The main system part that uses the memory more than anything is the disk, usually in all operating systems. To find the amount of space used by the disk in the Ubuntu 20.04 system, we will be utilizing the “df” utility of our system. The df tool, which refers to disk free, displays how much space each drive is using. Values are shown by df by a standard in 1-kilobyte units. Within the “df” command output below, we have been shown the space used by the file system and the system’s related parts. It also displayed the percentage usage of space in the output.

Check Disk Space Usage in Mega & Gega Bytes

Within the above output, the disk space usage has been displayed in the 1-kilobyte format, while in the “used” and “available” column, we can only see disk space value in numbers, i.e., merely understandable. So, to display the disk space output in a more human-readable presentable format so that any computer user can understand it quickly and get any type of information required. For this, we need to use the “df” instruction with its “-h” option in the query area, as we have used this instruction in the attached photo. The output for the Size, Used, and Avail column has now displayed the result in Kilobytes, megabytes, and gigabytes after the conversion. While the “Use%”, and “Mounted on” columns have got no change in them.

You can also make use of the “df” instruction according to your needs. Let’s say you only want to look for the size of disk space, its available space, and its used space on your shell screen. For this, you need to use the “df” instruction with the “-H” option and the column names from the particular space table, i.e., Size, used, avail, as presented in the image below. The output below has displayed the data for these three columns and didn’t identify the program or disk.

Check Disk Space Usage for File System

The very same “df” instruction can be utilized in the console with its “-h” option to display the disk space used by the file system used in your Linux system. So, we have tried this instruction to check the space used by the “dev/sda2” device file system. The output shows that the disk “dev/sda” has a size of 2.4GB while 0 bytes are used, and the rest is available to be used.

The use of the “df” instruction with the “-h” option and the “/” character shows the amount of space used on the primary disk storage device. So, we have tried it and found that the primary disk “dev/sda5” has a size of 30GB while 14GB has been used and 15GB has been left unused and can be utilized shortly.

Check Disk Space Usage for File System by Type

You can try to find out the disk space usage for the file system according to the type of file system. For this, you need to use the “-ht” option within the “df” instruction along with the file system type, i.e., ext4 in our case. The output on our screens is showing quiebro similar output as above while the “mounted on” column has only a “/”.

Check Disk Space Usage With Du Utility

Disk use is seen via the du utility. You may see your disc performance in further detail with this utility by using Ubuntu 20.04 Console application to show the disk usage for certain folders. Use it to show how much storage your present directory is using, as we did in the below presentation. The left side numerical value shows the data size, and the right side shows all files and folders of our system.

The “du” instruction, along with the “-h” option, has been showing the space used by the folders in kilobytes at the console application screen of our system, as presented in the attached image.

If you want to find out the space used by your current working directory, you must utilize the “du” instruction with the combined option “-hs”. The result displays that it contains a total of 106MB of data within the system.

Conclusion

We have elaborated on the popular use of the disk space concept along with the different utilities of our Linux operating system. Firstly, we have tried to update our system to avoid any issues. After that, we discussed the use of “df” and “du” instructions separately to see how much space has been utilized by a particular disk drive. We have tried the “df” and “du” instructions with the “-H” or “-h” instructions for the view of disk space usage in the Kilobytes, Megabytes, and Giga bytes. Hence, we have tried to cover every minor detail in this article.



Source link


“Linux Secure Shell, or SSH, is a protocol used by Linux computers to access remote computers and execute commands securely. It is a replacement for rlogin and rsh. Thus, SSH provides encrypted and secure communications between untrusted hosts over an insecure or untrusted network.
Also known as Secure Socket Shell, this protocol is a security application for Linux users connecting to remote servers. The framework allows users to transfer files, run command lines and graphical programs, and create secure supuesto networks over the internet.
The framework has an SSH command to secure remote connections and data transfers between clients and hosts. The utility ensures encryption of all communications.t
The command works by transferring client inputs to the host. Merienda done, the command returns the output from the host to the client and often executes through IP/TCP port 22. This encrypted connection is also used in port forwarding, Linux server, tunneling, and many more.”

Components of the SSH Command

Like every other computing command, the ssh command has syntax. The syntax for this command is as shown in the below image;

And as shown in the command, the following make the components of the ssh comma;

  • ssh command-The command provides instructions to machines to create secure encrypted connections with the host network or system.
  • User Name– This is the name of the Linux client or user accessed by your host machine or system.
  • Host– This is the machine that the user accesses or establishes a connection with and domain names or IP addresses. Ideally, hosts can either be routers or computers.

The ssh Command Synopsis and Flags

The image below illustrates the ssh command synopsis;

The ssh command tags are as follows;

Tag Description
-1 Compels ssh to try only the version 1 protocol
-2 Forces ssh to test only the version 2 protocol
-4 Makes ssh to use only IPV4 addresses
-6 Forces ssh to only use IPv6 addresses only
-A It initiates authentication agent connection forwarding. Usually, you can specify this flag on a per-host basis.
Notably, you should enable agent authentication forwarding with a lot of caution. Those with the authority to bypass file permissions on remote hosts can often access the nave agent through a forwarded connection. While attackers may not access key material from the agents, they can use the keys to perform operations and authenticate using identities within the agent.
-a Disables the authentication agent connection forwarding
-b bind_address You can use bind_address on nave machines as the source address of the connection. This flag only comes in handy for systems with multiple devices.
-C It is used for requesting compression of all data. It uses the same algorithm used by gzip to compress data, including stdout, stdin, and stderr.
-c cipher_spec It chooses the cipher specification to use during the encrypting session.
Protocol version 1 only allows the specification of one cipher. But for protocol version 2, a comma separates the list of ciphers beginning with the most preferred.
-D –Xo It controls the Sm off and Sm on components. It specifies the nave dynamic for port forwarding at the application level. Notably, it allocates a socket that listens to the port on your nave system. Every connection through this port is forwarded over the system’s secure channel.
-e escape_char This tag helps to set escape characters for sessions with pty.
-F configfile It specifies the configuration file for each user.
-f The flag initiates a request for ssh to return to the background before executing a command. This is handy when the user wants the password or passphrase requests to happen in the background.
-g Establishes connections between remote hosts and nave forwarded ports
-i identity_file Selects the system file from which your machine will read the identity for DSA or RSA authentication.
-k Disables delegation or forwarding of GSSAPI credentials and identities to the server
-L -Xo Controls the Sm off and Sm on components by specifying that the port provided on the client/nave host should be forwarded to your port and host on the remote machine.
-l login_name It directs the user to log in on the remote side.
-M It puts the client into a master mode to enable connection sharing. There can be multiple –M options to place an ssh client on master mode and require confirmation before the system accepts slave connections.
-m mac_spec This is an additional flag for protocol version 2. It provides a comma-separated list of message authentication code (MAC) algorithms.
-N Instructs users not to commit remote commands.
-n It redirects the stdin data from /dev/null and prevents its reading. It is only useable when ssh runs in the background.
-O ctl_cmd It controls an active connection from multiplexing the master process.
-o option This flag is often used to provide options in the exact format used in your configuration file.

Conclusion

This article is an elaborate introduction to the Secure Socket Shell or SSH. It has described the ssh command alongside its syntax and the relevant flags. Hopefully, you can use the above information to initiate your interaction with the SSH protocol.

Sources



Source link


JamesDSP for Linux

JamesDSP for Linux is an open source Qt audio effect processor for PipeWire and PulseAudio. Use it to enhance the music you listen to by adding reverberation, bass boost and other filters using a parametric or fixed band equalizer. It also allows you to write your own audio effects using the EEL2 scripting language.

The application is designed for use with PipeWire, which the developer recommends for its lower latency when injecting audio effects, but PulseAudio is also supported (for backwards compatibility).

It was initially released as an audio effects processor for Android, and it then ported to Linux.

JamesDSP for Linux features include:

  • Automatic bass boost (frequency-detecting bass-boost): automatically sets its own parameters, such as gain, bandwidth, and cut-off frequency, by analyzing the incoming audio stream
  • Automatic dynamic range compressor: a highly automated multiband dynamic range adjusting effect
  • Complex reverberation IIR network (Progenitor 2)
  • Interpolated FIR equalizer with flexible bands
  • Arbitrary response equalizer (also known as GraphicEQ from EqualizerAPO). AutoEQ database integration (requires network connection)
  • Partitioned convolver (Automóvil segmenting convolution). Supports mico, stereo, full/true stereo (LL, LR, RL, RR) impulse response
  • Crossfeed: realistic surround effects
  • Soundstage wideness: a multiband stereo wideness controller
  • ViPER-DDC: perform parametric equalization on audio & create VDC input files using thepbone/DDCToolbox
  • Analog modeling: an aliasing-free even harmonic generator
  • Output limiter

The application also comes with a scripting engine that allows you to write your own audio effects using the EEL2 scripting language. JamesDSP even automatically generates a basic user interface for  your scripts which allows modifying parameters.

To edit the scripts, JamesDSP comes with a minimal scripting IDE with console output support, detailed error messages, syntax highlighting, and more.

Besides this, JamesDSP for Linux also comes with universal presets that you load and save, a tray icon, and more.

The application had a major release (2.0) over the weekend, which adds PipeWire support, UI updates, and more. There’s no official change log so there might be something I missed, check out the commit log for details.

You might also like: NoiseTorch Is A Real-Time Microphone Noise Suppression Application For Linux

Getting started with JamesDSP

When you first run JamesDSP, its setup wizard is displayed, allowing you to choose the output device, set if the app should shutdown when closed or stay minimized, etc.:

JamesDSP onboarding Linux

In case you later want to change some settings presented in this setup wizard, you can do so from the application settings (cog icon in the bottom left-hand side of the JamesDSP for Linux window).

Merienda that’s done, you can start applying some effects to your computer’s audio output. For example, go to the Equalizer tab, click Enable EQ, and select an equalizer preset:

JamesDSP Linux equalizer

If you can’t hear a difference with and without a preset, make sure your audio output device is set to JamesDSP Sink in System Settings (sometimes it’s not set automatically), e.g. in GNOME:

JamesDSP system sound settings

You  might also find useful: Fix No Sound (Dummy Output) Issue In Ubuntu With SND HDA Intel

Vs EasyEffects

You might be wondering how JamesDSP compares to EasyEffects (previously PulseEffects), another audio effect processor application for Linux. The most obvious difference is that JamesDSP works with both PulseAudio and PipeWire, while EasyEffects only supports PipeWire (you must install an older version of EasyEffects from the time it was called PulseEffects if you want to use it with PulseAudio).

Besides that, EasyEffects comes with more effects, although there are some effects available in JamesDSP that aren’t available with EasyEffects, such as soundstage wideness, a multiband stereo wideness controller, or ViPER-DDC which allows you to perform parametric equalization on audio. And EasyEffects allows applying audio effects to both sound input and output, while JamesDSP is for output only. On the other hand, JamesDSP has a simpler user interface, and it comes with a scripting engine that’s not available in EasyEffects.

So while these 2 applications have many things in common, there are also some differences, so use the one that best fits your needs.

Download JamesDSP for Linux

Before installing JamesDSP for Linux, check if you’re using PipeWire or PulseAudio as described here. Then you can install JamesDSP for Linux (for either PipeWire or PulseAudio) from a repository (Debian / Ubuntu), AUR (Arch Linux / Manjaro), or build it from source.

You might like: Hushboard Mutes Your Microphone While Typing


Ventoy Linux GUI

Ventoy, a tool for easy bootable USB drive creation (simply copy the ISO to the USB), has been updated recently with a native GUI for Linux.

Ventoy is available for Microsoft Windows and Linux, and it can create bootable USB drives containing Linux and Windows ISO files. 

You need to install Ventoy to a USB drive, then every time you want to create a bootable USB drive, all you have to do is copy the ISO to the USB. There’s no need to format the USB drive. You can copy as many ISO files as you wish (even combined Windows and Linux ISOs), and when booting from the USB, Ventoy shows a list of available ISO files, allowing you to boot from the one you select. I don’t think I’m exaggerating when I’m saying that Ventoy is probably the best bootable USB creator for both Linux and Windows.

What’s more, since you don’t need to format the USB drive, you can continue to use it for other purposes. So you can copy other files to the USB, and it won’t interfere with Ventoy.

Ventoy also features support for legacy and UEFI Secure Boot, it supports persistence for some Linux distributions, it supports ISO files larger than 4GB, and it can be upgraded without reformatting the USB.

Initially, Ventoy was released for Linux as a command line tool. Back in March 2021, it added a web UI, but that was a bit clunky to use, especially since its aim was to simplify things, which it didn’t fully do.

With the latest 1.0.52 though, Ventoy has added a native GUI for Linux, which you can use to install Ventoy onto USB devices, which is similar to the one that’s been available on Windows since the early Ventoy releases. Merienda you install Ventoy on a USB stick, all you have to do is copy some ISO files to the USB, and you’ll get a bootable USB drive.

The release notes mention that the new GUI uses either GTK or Qt, depending on what you prefer (I’m not sure which one is used in the precompiled binaries).

You might like: How To Login With A USB Flash Drive Instead Of A Password On Linux Using pam_usb (Fork)

The new Ventoy Linux GUI lets you choose the USB device, shows the current Ventoy version and the Ventoy version installed on the USB drive, and it has various options that allow you to:

  • Enable Secure Boot support
  • Choose the partition type (MBR or GPT)
  • Set the partition configuration (align partitions with 4KB and preserve some space at the end of the disk)
  • Remove Ventoy from a USB device
  • Choose the user interface language

When you download the latest Ventoy binary, you’ll notice some Ventoy GUI executables: VentoyGUI.x86_64VentoyGUI.aarch64VentoyGUI.i386, and VentoyGUI.mips64el. To run it, all you have to do is double-click the VentoyGUI executable corresponding to your OS architecture (if you’re a desktop user, chances are you’re using an x86_64 architecture, so double click VentoyGUI.x86_64).

In case double-clicking the executable doesn’t work, open a terminal, navigate to the folder where you’ve extracted Ventoy and run it using, e.g. for the x86_64 architecture:

./VentoyGUI.x86_64

Other changes in Ventoy 1.0.52 include:

  • Add support for Emergency Boot Kit
  • Continue to boot when the ISO file size is invalid.
  • Fix a bug when booting puppy-4.3.1
  • languages.json update

Download Ventoy

On the downloads page you’ll find Linux and Windows binaries. If you prefer to download the source code, visit the Ventoy GitHub repository.


Oracle Java 17 LTS has been released recently, and is now available to install from the Linux Uprising Oracle Java PPA on Ubuntu, Debian, and Linux distributions based on these, such as Pop!_OS, Linux Mint, Zorin OS, etc.

Java 17 is the latest long-term support (LTS) release, and with it, the license has changed, the binaries being free (no cost) to use in production and free (no cost) to redistribute until a full year after the next LTS release. Previously (from Oracle Java 11 until now), Oracle Java used a commercial license that allowed downloading and using it at no cost for development and testing only, but it required paying a fee to use in production.

If you prefer to use open source JDK builds, check out those offered by AdoptOpenJDK or Zulu OpenJDK.

I’d like to note that even though Oracle Java 17 can be redistributed, the Launchpad PPA terms don’t seem to allow packing it into a PPA due to its license. So the Linux Uprising Oracle Java PPA continues to use a script that automatically downloads Oracle Java (the binaries are not hosted in the Launchpad PPA).

This Oracle Java 17 installer is based on the Web Upd8 Java package (so the credits go to its innovador creators), with minor modifications. This package automatically downloads, installs (with some tweaks such as better font rendering, add applications menu entries, etc.) and optionally sets Oracle Java 17 as the default Java (runs update-alternatives, exports the JAVA_HOME environment variable, etc.) on your system. 

Oracle does offer DEB packages for Oracle Java, however, these packages simply copy the Java binaries to /usr/lib/jvm, without doing anything else, so it’s exactly the same as copying the Java directory to that location yourself.

Using this PPA you can install Oracle Java 17 for x64 and aarch64 architectures.

You might also like: How To Install / Switch Between Multiple Java Versions Using SDKMAN

How to install Oracle JDK 17 On Ubuntu, Debian, Linux Mint, Pop!_OS or Zorin Os using an APT PPA repository

Add the Linux Uprising Oracle Java PPA repository and update the software sources on Ubuntu, Linux Mint, Pop!_OS or Zorin Os using the following commands:

sudo add-apt-repository ppa:linuxuprising/java

sudo apt update

Add the Linux Uprising Oracle Java PPA repository (and its key) and update the software sources on Debian and other Linux distributions based on Debian (but not Ubuntu and Ubuntu-based) using:

su -

echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A

apt-get update

exit

Now you can install Oracle JDK 17 on Debian / Ubuntu and Linux distributions based on these:

  • Install and make Oracle JDK 17 the default JDK version:

sudo apt install oracle-java17-installer --install-recommends

  • Install but don’t make Oracle JDK 17 the default JDK version:
sudo apt install oracle-java17-installer --no-install-recommends

You can control if Oracle JDK 17 is the default JDK version (runs update-alternatives, exports the JAVA_HOME environment variable, etc.) or note with the help of the oracle-java17-set-default package. If this is installed, Oracle JDK 17 is set as default; remove this package, so Oracle Java 17 is not set as default (unless it’s the only Java version on the system).

This package is set as a recommended package for the Oracle Java 17 installer, that’s why installing oracle-java17-installer with --install-recommends also installs oracle-java17-set-default.

To check which Java version is set as default on your system, you could run java -version and / or javac -version. Example with output that shows Oracle Java 17 set as default:

$ java -version
java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)

Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)

$ javac -version
javac 17

In some cases, the installer may fail to download the Oracle Java 17 .tar.gz archive from Oracle. There are multiple possible issues for this: you’re behind a router / firewall that prevents this, your Internet connection went down during the download process, etc. 

To work around this, you can download this file yourself from Oracle by other means, e.g. by going to a friend’s house, using a web browser with a proxy, etc., and then placing the downloaded Oracle Java 17 .tar.gz file in /var/cache/oracle-jdk17-installer (create this folder as root if it doesn’t exist), then install the oracle-java17-installer package from the Linux Uprising PPA as explained above.

This way, the Oracle Java 17 installer uses the nave archive instead of trying to download it itself. Make sure the downloaded Oracle Java 17 .tar.gz and the Oracle Java Installer package from the PPA are both the same version, or else this won’t work.

How to accept the Oracle Java 17 license automatically

Downloading and installing Oracle Java 17 requires the user to accept a license. In some cases, like when using this in an automated script, you may want to automatically accept the license using a command. You can do that by using:

echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | sudo /usr/bin/debconf-set-selections

If that doesn’t work, also try this command:

echo oracle-java17-installer shared/accepted-oracle-licence-v1-3 boolean true | sudo /usr/bin/debconf-set-selections


Eversticky sticky notes for Linux

EverSticky is a simple new Qt sticky notes tool for Linux that synchronizes with Evernote and displays rich text formatting.

The application lets users quickly take notes using post-it note-like windows displayed on their desktop. The notes are automatically saved, and synchronized to Evernote (including free Evernote accounts) at a given interval or on demand.

Eversticky sticky notes

The sticky notes are accompanied by a tray icon from where users can create a new note (new notes can also be created by using the + button from an existing sticky note), force sync to Evernote, bring the notes to the foreground, log out of Evernote, and access the application settings. In the settings you’ll find options like setting the sync interval, check for application updates, and set the tray icon style to light or dark.

The stick notes are quiebro basic, supporting only a few keyboard shortcuts like Ctrl + b to make the selected text bold or Ctrl + i to make the text italic.

However, you can paste rich text and EverSticky will display it. E.g. you can copy a checkbox and paste it into a sticky note, and the checkbox will behave as expected, allowing you to check/uncheck it. Or you can paste an image, but note that you must copy the image itself (for example by selecting the image or a region of an image in GIMP, then copy it), and not the image path. You may also edit the notes in Evernote and EverSticky will display them with all the included formatting.

While not explicitly supporting Wayland, EverSticky does run on Wayland, and it behaves in the same way as on X11. For example, using the Dash to Panel, when clicking the Show Desktop button, all windows are hidden, but the sticky notes remain visible on the desktop (this doesn’t happen when using Ctrl + Shift + D though).

You might also like: Joplin: Encrypted Open Source Note Taking And To-Do Application

EverSticky doesn’t come with a built-in option to start automatically on login, but you can add it manually. If your desktop environment / Linux distribution comes with a tool to add startup applications (for example Startup Application in some Ubuntu flavors including GNOME, in KDE Plasma it’s in System Settings -> Startup and Shutdown -> Autostart, etc.), add it from there, using eversticky as the command. Or, on most Linux distributions, you can also add it manually to startup by creating a file called eversticky.desktop in ~/.config/autostart with the following contents:

[Desktop Entry]
Type=Application
Exec=eversticky
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Eversticky

Download EverSticky

The application is available as a DEB package on GitHub (so it can be installed on Debian, Ubuntu, Pop!_OS, Linux Mint, etc., though note that Ubuntu 20.04 / Linux Mint 20 and newer are required), as well as on AUR for Arch Linux / Manjaro users. For other Linux distributions, you’ll need to build it from source (this requires a production Evernote API key).