Page 1
Standard

Permisos por defecto para /var/www

Los permisos correctos deben ser 755 para carpetas y 644 para archivos. Para realizar esta modificación de forma recursiva se deben usar los siguientes comandos:

find . -type f -print0 | xargs -0 chmod 644
find . -type d -print0 | xargs -0 chmod 755

more
more
Standard

Error al instalar Wine: The following signatures couldn’t be verified because the public key is not available

Cuando ejecutamos

sudo apt-get update

aparece el error:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.winehq.org/wine-builds/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 76F1A20FF987672F W: Failed to fetch https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 76F1A20FF987672F W: Some index files failed to download. They have been ignored, or old ones used instead.

Solución:

wget -nc https://dl.winehq.org/wine-builds/winehq.key && sudo apt-key add winehq.key && sudo apt update
sudo apt-get install --install-recommends winehq-stable
more
Standard

Habilitar query log en MySQL

Editar el archivo /etc/mysql/my.cnf y agregar al final del archivo:

[mysqld]
general_log=on
general_log_file=/var/log/mysql/query.log

Reiniciar el servicio

service mysql restart

Revisamos la salida

tail -f /var/log/mysql/query.log
more
Standard

Cambiar la contraseña root de MySQL en Issabel

A continuación muestro como cambiar la contraseña root de Mysql en Issabel

Detener el servicio mysql

systemctl stop mariadb

Iniciamos el modo seguro:

mysqld_safe --skip-grant-tables &

Hacemos un login a MySQL sin password

mysql -u root

Actualizamos la contraseña

update mysql.user set password=PASSWORD("1notfound1") where user='root';

Cargamos los privilegios / permisos y salimos de la sesión:

Iniciamos el servicio
systemctl start mariadb
 y Listo!
more
Standard

Loguearse por SSH sin ingresar contraseña

Conectarse de un Equipo A con IP 192.168.1.10 a otro Equipo B con direccion ip 192.168.2.20 sin ingresar la contraseña.

  1. Crear clave de autenticación en el Equipo A 192.168.1.10

ssh-keygen -t rsa

No ingresar contraseña

  1. Copiar la clave pública desde el Equipoo A al Equipo B
cat ~/.ssh/id_rsa.pub | ssh demo@192.168.2.20 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys"
ssh-copy-id demo@192.168.2.20
  1.  Conectar de Equipo A a Equipo B sin contraseña
ssh demo@192.168.2.20

more
Standard

No se puede instalar PHP en Debian

Cuando se ejecuta sudo apt-get install php7.0 aparece el error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php : Depends: php7.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Se debe ejecutar el siguiente comando para verificar que PPAs tenemos configurados:

LC_ALL=C apt policy

Si la salida es esta:

 500 http://ppa.launchpad.net/ondrej/php/ubuntu disco/main amd64 Packages
     release v=19.04,o=LP-PPA-ondrej-php,a=disco,n=disco,l=***** The main PPA fo                                                                             r supported PHP versions with many PECL extensions *****,c=main,b=amd64
     origin ppa.launchpad.net

Quiere decir que hemos roto el sistema agregando fuentes extranjeras, hay que eliminar las fuentes php del sourcelist:

cd /etc/apt/sources.list.d/

Eliminar las fuentes php:

rm ondrej-ubuntu-php-disco.list
rm ondrej-ubuntu-php-disco.list.save
rm php7.3.list
rm php7.3.list.save

Actualizar e instalar

apt-get update
apt-get install php

Y listo.

more
Standard

gpg: failed to start the dirmngr ‘/usr/bin/dirmngr’: No such file or directory

Al querer agregar un repositorio aparece el error:

gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory

Acompañado de:

gpg: connecting dirmngr at '/tmp/tmpyq7kwe2x/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

Para solucionarlo hay que instalar el paquete dirmgr:

sudo apt-get install dirmngr

y listo.

more
Standard

Solución: locale: Cannot set LC_ALL to default locale: No such file or directory

Cuando queremos instalar algo desde la terminal aparece el error:

apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
Reading changelogs... Done
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "en_US:en",
	LC_ALL = (unset),
	LC_TIME = "es_CO.UTF-8",
	LC_MONETARY = "es_CO.UTF-8",
	LC_ADDRESS = "es_CO.UTF-8",
	LC_TELEPHONE = "es_CO.UTF-8",
	LC_NAME = "es_CO.UTF-8",
	LC_MEASUREMENT = "es_CO.UTF-8",
	LC_IDENTIFICATION = "es_CO.UTF-8",
	LC_NUMERIC = "es_CO.UTF-8",
	LC_PAPER = "es_CO.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory

Para solucionarlo instalamos la codificación español:

sudo locale-gen en_US.UTF-8

Luego reconfiguramos:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

Y el error desaparece.

more
Standard

Solucionar error: W: GPG error: ….: The following signatures couldn’t be verified because the public key is not available:

Al querer agregar el repositorio de php me aparece el error:

W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu disco InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6

Nos muestra que la llave pública no está disponible.

Lo que debemos hacer es buscar esta clave pública en el sistema. Obtenerla del mismo mensaje de error, al final: NO_PUBKEY 4F4EA0AAE5267A6

y usarla con el siguiente comando:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6

Y Listo.

more