Puede ser que alguna vez tengas un problema causado porqué el gestor de paquetes de tu distro no acceda a conseguir la clave pública llegando a producir un error. Con la siguiente instrucción solventarás el problema.
gpg --keyserver subkeys.pgp.net --recv-key $Llave && gpg -a --export $PUBKRY | sudo apt-key add -
El error, te facilita una clave, de esa clave, fíjate en los últimos 8 dígitos y sustituyelo en la instrucción en donde aparece $Llave. Ejecuta como sudo, si utilizas una distro tipo ubuntu, actualiza y problema resuelto. Yo lo he tenido en todas las actualizaciones de paquetería, incluso en las traducciones de open office a español. Mi problema justamente vino por querer traducir open office 3.0 a español y obtenía siempre error por el repositorío launchpad de open office. Ahroa con esa instrucción lo he resuelto. Si quieres traducir open office al español, ejecuta la siguiente instrcucción: sudo apt-get install openoffice.org-l10n-es.
Recuerda! Es recomendable actualizar las cabeceras antes de cualquier instalación!
domingo, 15 de marzo de 2009
viernes, 19 de diciembre de 2008
Problema con fichero system de Windows.
Hola, bueno ante el problema que puede ocasionar el borrado, pérdida o modificación errónea de este fichero, aquí pongo una solución que parece funcionar.
Iniciar con el cd de instalacion de Windows XP y entrar a la consola de recuperación. Ejecutar: cd C:\windows\repair y pones "copy system c:\windows\system32\config" sobreescribes el archivo y reinicias.
Puede ser que iniciando únicamente el cd de Windows XP y entrando en modo recuperación se solvente el problema.
Iniciar con el cd de instalacion de Windows XP y entrar a la consola de recuperación. Ejecutar: cd C:\windows\repair y pones "copy system c:\windows\system32\config" sobreescribes el archivo y reinicias.
Puede ser que iniciando únicamente el cd de Windows XP y entrando en modo recuperación se solvente el problema.
Eliminar WinDefender2009
Bueno, aquí dejo un enlace para eliminar Windefender2009. Espero que os sirva!!! Está masticadito, paso a paso.
http://www.411-spyware.com/es/eliminar-windefender-2009
http://www.411-spyware.com/es/eliminar-windefender-2009
martes, 2 de diciembre de 2008
Shell Scripts - Copiar linas de un fichero a otro.
He aquí un script para copiar las n primeras lineas de un fichero a otro fichero.
Echale un ojo!
#!/bin/bash
Fich1=$1
Fich2=$2
NLineas=$3
if [ $# != 3 ];then
echo "[x] El número de parámetros es incorrecto."
echo "Se esperaban tres argumentos."
exit
fi
/usr/bin/test -f $Fich1
if [ $? = 1 ];then
echo "[x] El argumento $Fich1 no es un fichero o no existe."
exit
fi
/usr/bin/test -f $Fich2
if [ $? = 1 ];then
echo "[x] El argumento $Fich2 no es un fichero o no existe."
echo "Se creará $Fich2."
fi
if expr $NLineas \<= 0 &>/dev/null;then
echo "[x] El número de lineas recibido como parámetro es incorrecto."
echo "Se esperaba un valor mayor que 0."
exit
fi
LineasReales=`/usr/bin/wc -l $Fich1 | cut -d\ -f1`
if test $LineasReales -lt $NLineas;then
echo "[x] El fichero $Fich1 tiene menos lineas de las que se desean copiar."
exit
fi
/bin/cat $Fich1 | /usr/bin/head -n$NLineas >> $Fich2
Echale un ojo!
#!/bin/bash
Fich1=$1
Fich2=$2
NLineas=$3
if [ $# != 3 ];then
echo "[x] El número de parámetros es incorrecto."
echo "Se esperaban tres argumentos."
exit
fi
/usr/bin/test -f $Fich1
if [ $? = 1 ];then
echo "[x] El argumento $Fich1 no es un fichero o no existe."
exit
fi
/usr/bin/test -f $Fich2
if [ $? = 1 ];then
echo "[x] El argumento $Fich2 no es un fichero o no existe."
echo "Se creará $Fich2."
fi
if expr $NLineas \<= 0 &>/dev/null;then
echo "[x] El número de lineas recibido como parámetro es incorrecto."
echo "Se esperaba un valor mayor que 0."
exit
fi
LineasReales=`/usr/bin/wc -l $Fich1 | cut -d\ -f1`
if test $LineasReales -lt $NLineas;then
echo "[x] El fichero $Fich1 tiene menos lineas de las que se desean copiar."
exit
fi
/bin/cat $Fich1 | /usr/bin/head -n$NLineas >> $Fich2
domingo, 30 de noviembre de 2008
Shell Scripts - Script para exportar directorios
Script para la exportación de directorios en sistemas Linux.
#!/bin/bash
DIR=vacio
READ=vacio
WRITE=vacio
MACHINE=vacio
SERVICES=vacio
NOTVALID=1
clear
while getopts d:rwm:s OPCION
do
if [ "$OPCION" = "d" ];then
DIR=$OPTARG
NOTVALID=2
fi
if [ "$OPCION" = "r" ];then
READ=si
fi
if [ "$OPCION" = "w" ];then
WRITE=si
fi
if [ "$OPCION" = "m" ];then
MACHINE=$OPTARG
NOTVALID=2
fi
if [ "$OPCION" = "s" ];then
SERVICES=si
fi
done
if [ "$NOTVALID" = 2 ];then
if [ "$DIR" = "vacio" ] || [ "$DIR" = "" ];then
echo "[X] El directorio introducido no es valido."
sleep 2
exit
else
test -d $DIR
EXISTE=$?
if [ "$EXISTE" = 1 ];then
echo "[X] El directorio introducido no existe."
sleep 2
echo "[?] ¿Desea crearlo? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
mkdir $DIR
else
NOTVALID=1
fi
else
if [ "$MACHINE" = "vacio" ];then
echo "[i] Introduzca una maquina o una red para establecer el compartimento:"
read MACHINE
echo "[?] ¿Se trata de una red? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
echo "Ajustando parametros de mascara para la red $MACHINE ..."
sleep 2
MACHINE=$MACHINE"/255.255.255.0"
fi
fi
fi
fi
fi
EXISTE=1
if [ "$NOTVALID" = 1 ];then
until [ "$EXISTE" = 0 ]
do
echo "[i] Introduzca un directorio a exportar:"
echo "Directorio (Ruta completa):"
read DIR
test -d $DIR
EXISTE=$?
if [ "$EXISTE" = 1 ];then
echo "[X] El directorio introducido no existe."
sleep 2
echo "[?] ¿Desea crearlo? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
mkdir $DIR
EXISTE=0
fi
else
echo "Asignando permisos minimos necesarios ..."
sleep 2
chmod o+r $DIR
echo "[i] Introduzca una maquina para añadir al fichero de compartimento:"
read MACHINE
echo "[?] ¿Se trata de una red? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
echo "Ajustando parametros de mascara para la red $MACHINE ..."
sleep 2
MACHINE=$MACHINE"/255.255.255.0"
fi
fi
done
fi
echo "READ=$READ,WRITE=$WRITE"
read x
if [ "$READ" = "si" ] && [ "$WRITE" = "vacio" ];then
MACHINE=$MACHINE"(ro)"
else
if [ "$READ" = "vacio" ] && [ "$WRITE" = "si" ];then
MACHINE=$MACHINE"(rw)"
else
if [ "$READ" = "si" ] && [ "$WRITE" = "si" ];then
MACHINE=$MACHINE"(rw)"
fi
if [ "$READ" = "vacio" ] && [ "$WRITE" = "vacio" ];then
echo "[?] ¿Desea dar permiso de solo lectura al recurso, o de lectura y escritura? (r-solo lectura, w-lectura y escritura)"
read ANS
if [ "$ANS" = "r" ];then
MACHINE=$MACHINE"(ro)"
fi
if [ "$ANS" = "w" ];then
MACHINE=$MACHINE"(rw)"
fi
fi
fi
fi
echo "Concediendo los permisos establecidos ..."
sleep 2
if [ "$SERVICES" = "si" ];then
/etc/init.d/nfs restart
/etc/init.d/portmap restart
fi
echo "$DIR $MACHINE" >> /etc/exports
#!/bin/bash
DIR=vacio
READ=vacio
WRITE=vacio
MACHINE=vacio
SERVICES=vacio
NOTVALID=1
clear
while getopts d:rwm:s OPCION
do
if [ "$OPCION" = "d" ];then
DIR=$OPTARG
NOTVALID=2
fi
if [ "$OPCION" = "r" ];then
READ=si
fi
if [ "$OPCION" = "w" ];then
WRITE=si
fi
if [ "$OPCION" = "m" ];then
MACHINE=$OPTARG
NOTVALID=2
fi
if [ "$OPCION" = "s" ];then
SERVICES=si
fi
done
if [ "$NOTVALID" = 2 ];then
if [ "$DIR" = "vacio" ] || [ "$DIR" = "" ];then
echo "[X] El directorio introducido no es valido."
sleep 2
exit
else
test -d $DIR
EXISTE=$?
if [ "$EXISTE" = 1 ];then
echo "[X] El directorio introducido no existe."
sleep 2
echo "[?] ¿Desea crearlo? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
mkdir $DIR
else
NOTVALID=1
fi
else
if [ "$MACHINE" = "vacio" ];then
echo "[i] Introduzca una maquina o una red para establecer el compartimento:"
read MACHINE
echo "[?] ¿Se trata de una red? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
echo "Ajustando parametros de mascara para la red $MACHINE ..."
sleep 2
MACHINE=$MACHINE"/255.255.255.0"
fi
fi
fi
fi
fi
EXISTE=1
if [ "$NOTVALID" = 1 ];then
until [ "$EXISTE" = 0 ]
do
echo "[i] Introduzca un directorio a exportar:"
echo "Directorio (Ruta completa):"
read DIR
test -d $DIR
EXISTE=$?
if [ "$EXISTE" = 1 ];then
echo "[X] El directorio introducido no existe."
sleep 2
echo "[?] ¿Desea crearlo? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
mkdir $DIR
EXISTE=0
fi
else
echo "Asignando permisos minimos necesarios ..."
sleep 2
chmod o+r $DIR
echo "[i] Introduzca una maquina para añadir al fichero de compartimento:"
read MACHINE
echo "[?] ¿Se trata de una red? (s/n)"
read ANS
if [ "$ANS" = "s" ];then
echo "Ajustando parametros de mascara para la red $MACHINE ..."
sleep 2
MACHINE=$MACHINE"/255.255.255.0"
fi
fi
done
fi
echo "READ=$READ,WRITE=$WRITE"
read x
if [ "$READ" = "si" ] && [ "$WRITE" = "vacio" ];then
MACHINE=$MACHINE"(ro)"
else
if [ "$READ" = "vacio" ] && [ "$WRITE" = "si" ];then
MACHINE=$MACHINE"(rw)"
else
if [ "$READ" = "si" ] && [ "$WRITE" = "si" ];then
MACHINE=$MACHINE"(rw)"
fi
if [ "$READ" = "vacio" ] && [ "$WRITE" = "vacio" ];then
echo "[?] ¿Desea dar permiso de solo lectura al recurso, o de lectura y escritura? (r-solo lectura, w-lectura y escritura)"
read ANS
if [ "$ANS" = "r" ];then
MACHINE=$MACHINE"(ro)"
fi
if [ "$ANS" = "w" ];then
MACHINE=$MACHINE"(rw)"
fi
fi
fi
fi
echo "Concediendo los permisos establecidos ..."
sleep 2
if [ "$SERVICES" = "si" ];then
/etc/init.d/nfs restart
/etc/init.d/portmap restart
fi
echo "$DIR $MACHINE" >> /etc/exports
Shell Scripts - Script gestión usuarios para vsftpd
A continuación un script para gestionar usuarios de este servicio. Para echarle un ojo!
#!/bin/bash
USUARIO=vacio
PASSWORD=vacio
NOTVALID=1
#EVALUACION DE PARAMETROS
#------------------------
while getopts u:p: OPCION
do
if [ "$OPCION" = "u" ];then
USUARIO=$OPTARG
NOTVALID=2
fi
if [ "$OPCION" = "p" ];then
PASSWORD=$OPTARG
NOTVALID=2
fi
done
#FILTROS
if [ "$NOTVALID" = 2 ];then
if [ "$USUARIO" = "" ] || [ "$USUARIO" = "vacio" ];then
echo "[X] El usuaio introducido no es valido."
sleep 2
NOTVALID=1
fi
if [ "$PASSWORD" = "" ] || [ "$PASSWORD" = "vacio" ];then
echo "[X] El password introducido no es valido."
sleep 2
NOTVALID=1
fi
if [ "$NOTVALID" != 1 ];then
NOTVALID=0
fi
fi
#INTRODUCCION SI NO SE LE PASAN PARAMETROS
until [ "$NOTVALID" = 0 ]
do
clear
if [ "$USUARIO" = "vacio" ] || [ "$NOTVALID" = 1 ];then
echo "[i] Introduzca un nombre para el usuario:"
read USUARIO
echo "[i] Introduzca un password para el usuario $USUARIO:"
read PASSWORD
NOTVALID=0
fi
if [ "$USUARIO" = "" ];then
echo "[X] Usuario no valido."
NOTVALID=1
fi
if [ "$PASSWORD" = "" ];then
echo "[X] Password de $USUARIO no valido."
NOTVALID=1
fi
done
#Compruebo la existencia del fichero users.txt, si no existe, lo creo
test -f /etc/vsftpd/users.txt
EXISTE=$?
if [ "$EXISTE" = 1 ];then
>/etc/vsftpd/users.txt
fi
CONT=0
while read LINEA
do
let CONT=$CONT+1
let A=$CONT%2
if [ $A = 1 ];then
if [ "$LINEA" = "$USUARIO" ];then
echo "[X] El usuario introducido ya existe."
sleep 2
exit
fi
fi
done < /etc/vsftpd/users.txt echo "$USUARIO" >> /etc/vsftpd/users.txt
echo "$PASSWORD" >> /etc/vsftpd/users.txt
echo "[i] Añadiendo a $USUARIO ..."
sleep 2
/etc/init.d/vsftpd restart
db_load -T -t hash -f /etc/vsftpd/users.txt /etc/vsftpd/users.db
echo "Compilando fichero de usuarios..."
sleep 2
echo "auth required /lib/security/pam_userdb.so db=/etc/vsftpd/users" > /etc/pam.d/vsftpd
echo "account required /lib/security/pam_userdb.so db=/etc/vsftpd/users" >> /etc/pam.d/vsftpd
test -d /etc/vsftpd/users
EXISTE2=$?
if [ "$EXISTE2" = 1 ];then
echo "Creando directorio para las configuraciones de los usuarios..."
sleep 2
mkdir /etc/vsftpd/users
fi
#Crea el fichero de configuracion del usuario
>/etc/vsftpd/users/$USUARIO
echo "Creando fichero de configuracion para $USUARIO ..."
sleep 2
mkdir /home/ftpvirtual/$USUARIO
chown ftpvirtual /home/ftpvirtual/$USUARIO
echo "Dando permisos necesarios al directorio /home/ftpvirtual/$USUARIO ..."
sleep 2
echo "local_root=/home/ftpvirtual/$USUARIO" >> /etc/vsftpd/users/$USUARIO
clear
echo "[?] ¿Desea que $USUARIO tenga permisos de escritura en el directorio? (s/n)"
echo "Respuesta:"
read ANSW
if [ "$ANSW" = "s" ];then
echo "write_enable=YES" >> /etc/vsftpd/users/$USUARIO
else
echo "write_enable=NO" >> /etc/vsftpd/users/$USUARIO
fi
ANSW=0
echo "[?] ¿Desea que $USUARIO descargue archivos del servidor ftp? (s/n)"
echo "Respuesta:"
read ANSW
if [ "$ANSW" = "s" ];then
echo "download_enable=YES" >> /etc/vsftpd/users/$USUARIO
else
echo "download_enable=NO" >> /etc/vsftpd/users/$USUARIO
fi
#!/bin/bash
USUARIO=vacio
PASSWORD=vacio
NOTVALID=1
#EVALUACION DE PARAMETROS
#------------------------
while getopts u:p: OPCION
do
if [ "$OPCION" = "u" ];then
USUARIO=$OPTARG
NOTVALID=2
fi
if [ "$OPCION" = "p" ];then
PASSWORD=$OPTARG
NOTVALID=2
fi
done
#FILTROS
if [ "$NOTVALID" = 2 ];then
if [ "$USUARIO" = "" ] || [ "$USUARIO" = "vacio" ];then
echo "[X] El usuaio introducido no es valido."
sleep 2
NOTVALID=1
fi
if [ "$PASSWORD" = "" ] || [ "$PASSWORD" = "vacio" ];then
echo "[X] El password introducido no es valido."
sleep 2
NOTVALID=1
fi
if [ "$NOTVALID" != 1 ];then
NOTVALID=0
fi
fi
#INTRODUCCION SI NO SE LE PASAN PARAMETROS
until [ "$NOTVALID" = 0 ]
do
clear
if [ "$USUARIO" = "vacio" ] || [ "$NOTVALID" = 1 ];then
echo "[i] Introduzca un nombre para el usuario:"
read USUARIO
echo "[i] Introduzca un password para el usuario $USUARIO:"
read PASSWORD
NOTVALID=0
fi
if [ "$USUARIO" = "" ];then
echo "[X] Usuario no valido."
NOTVALID=1
fi
if [ "$PASSWORD" = "" ];then
echo "[X] Password de $USUARIO no valido."
NOTVALID=1
fi
done
#Compruebo la existencia del fichero users.txt, si no existe, lo creo
test -f /etc/vsftpd/users.txt
EXISTE=$?
if [ "$EXISTE" = 1 ];then
>/etc/vsftpd/users.txt
fi
CONT=0
while read LINEA
do
let CONT=$CONT+1
let A=$CONT%2
if [ $A = 1 ];then
if [ "$LINEA" = "$USUARIO" ];then
echo "[X] El usuario introducido ya existe."
sleep 2
exit
fi
fi
done < /etc/vsftpd/users.txt echo "$USUARIO" >> /etc/vsftpd/users.txt
echo "$PASSWORD" >> /etc/vsftpd/users.txt
echo "[i] Añadiendo a $USUARIO ..."
sleep 2
/etc/init.d/vsftpd restart
db_load -T -t hash -f /etc/vsftpd/users.txt /etc/vsftpd/users.db
echo "Compilando fichero de usuarios..."
sleep 2
echo "auth required /lib/security/pam_userdb.so db=/etc/vsftpd/users" > /etc/pam.d/vsftpd
echo "account required /lib/security/pam_userdb.so db=/etc/vsftpd/users" >> /etc/pam.d/vsftpd
test -d /etc/vsftpd/users
EXISTE2=$?
if [ "$EXISTE2" = 1 ];then
echo "Creando directorio para las configuraciones de los usuarios..."
sleep 2
mkdir /etc/vsftpd/users
fi
#Crea el fichero de configuracion del usuario
>/etc/vsftpd/users/$USUARIO
echo "Creando fichero de configuracion para $USUARIO ..."
sleep 2
mkdir /home/ftpvirtual/$USUARIO
chown ftpvirtual /home/ftpvirtual/$USUARIO
echo "Dando permisos necesarios al directorio /home/ftpvirtual/$USUARIO ..."
sleep 2
echo "local_root=/home/ftpvirtual/$USUARIO" >> /etc/vsftpd/users/$USUARIO
clear
echo "[?] ¿Desea que $USUARIO tenga permisos de escritura en el directorio? (s/n)"
echo "Respuesta:"
read ANSW
if [ "$ANSW" = "s" ];then
echo "write_enable=YES" >> /etc/vsftpd/users/$USUARIO
else
echo "write_enable=NO" >> /etc/vsftpd/users/$USUARIO
fi
ANSW=0
echo "[?] ¿Desea que $USUARIO descargue archivos del servidor ftp? (s/n)"
echo "Respuesta:"
read ANSW
if [ "$ANSW" = "s" ];then
echo "download_enable=YES" >> /etc/vsftpd/users/$USUARIO
else
echo "download_enable=NO" >> /etc/vsftpd/users/$USUARIO
fi
sábado, 29 de noviembre de 2008
Eliminar Windows Genuine
Bueno, si teneis las actualizaciones de windows activadas y habéis actualizado de forma automática, es posible que Windows haya instalado su herramienta Genuine para notificaros de que vuestro Sistema Operativo (vuestro Windows) no es original. Bueno, visitar este enlace (aquí), descargar la pequeña aplicación y ejecutarla. Os pedirá reiniciar y ... Asunto arreglado!
Suscribirse a:
Entradas (Atom)