Archive for the ‘Uncategorized’ Category

h1

ulimit: 181: Illegal option -u

21/10/2009

En un script se puede reproducir el siguiente problema con ulimit:

ulimit: 181: Illegal option -u

Esto ocurre cuando se utiliza una shell distinta de bash. Para evitarlo, y si no hay más consecuencias en el script, vale con cambiar de shell:

#!/bin/sh
#!/bin/bash

h1

Error VBoxLinuxAdditions bad interpreter, Permission denied

19/10/2009

En la instalación de las VirtualBox tools en una imagen de VirtualBox, Debian 5.0 por ejemplo, puede ocurrir el siguiente error:

debian-xplico-demo:/media/cdrom# ./VBoxLinuxAdditions-amd64.run
-su: ./VBoxLinuxAdditions-amd64.run: /bin/sh: bad interpreter: Permission denied

Se soluciona con:

debian-xplico-demo:/media/cdrom# sudo sh /media/cdrom/VBoxLinuxAdditions.run"

Fuente: UbuntuForums.org.

h1

Error compilando ghostpdl: /usr/bin/ld: cannot find -lXext

15/10/2009

El siguiente error compilando «ghostpdl«:

#kubuntu@kubuntu:~/xbuild/ghostpdl-8.70$ make
./obj/echogs -a ./obj/ldall.tr -s - ./obj/gsromfs1.o ./obj/plmain.o ./obj/plimpl.o  -lm -lpthread -ldl
sh <./obj/ldall.tr
/usr/bin/ld: cannot find -lXext
collect2: ld returned 1 exit status
make[2]: *** [obj/pcl6] Error 1
make[2]: Leaving directory `/home/kubuntu/xbuild/ghostpdl-8.70/main'
make[1]: *** [pdl-product] Error 2
make[1]: Leaving directory `/home/kubuntu/xbuild/ghostpdl-8.70/main'
make: *** [pcl] Error 2

se soluciona instalando la siguiente librería.

kubuntu@kubuntu:~$ sudo apt-get install libxext-dev

En algunos entornos también puede ser necesario libx11-dev:

kubuntu@kubuntu:~$ sudo apt-get install libx11-dev

h1

Como medir el tiempo que utiliza un proceso en ejecutarse

07/10/2009

Si se desean realizar por ejemplo comparativas de distintos binarios para comprobar su rendimiento, una de los parámetros a estudiar puede ser el tiempo de ejecución de los mismos sobre la misma máquina.

Para ello, en vez de utilizar un script bash con el comando «date –rfc-3339=ns», se puede utilizar el comando «time» seguido del programa, a modo de cronómetro.

carlos@WhenIGrowUp:~/tmp/capturas.tests$ time cat /etc/debian_version
lenny/sid
real 0m0.003s
user 0m0.004s
sys 0m0.004s

h1

Error The file to which the capture would be saved («capture.cap») could not be opened: Permission denied.

28/09/2009

Al ejecutar Tshark (la versión de consola de Wireshark) puede ocurrir el siguiente error:


carlos@maquina17:~$ sudo tshark -i eth0 -w captura.trafico.20090928.cap
Running as user "root" and group "root". This could be dangerous.
Capturing on eth0
tshark: The file to which the capture would be saved ("captura.trafico.20090928.cap") could not be opened: Permission denied.

Esto ocurre por una cuestión de diseño basada en la seguridad del software (Bug Debian #453292).

Se soluciona de dos formas distintas:

a) Creando previamente el fichero:
carlos@maquina17:~$ sudo touch captura.trafico.20090928.cap

a) Cambiando la ruta donde salvar el fichero a otra donde no haya problemas de UID.
carlos@maquina17:~$ sudo tshark -i eth0 -w /root/captura.trafico.20090928.cap

h1

Error Firefox: Could not find compatible GRE between version 1.9.0.1 and 1.9.0.*.

22/09/2009

Si al ejecutar Firefox se produce este error en la consola:

carlos@WhenIGrowUp:~/personal$ firefox
Could not find compatible GRE between version 1.9.0.1 and 1.9.0.*.

Es necesario realizar los siguientes pasos:

1º) Comprobar paquete «xulrunner»

$ dpkg -l xulrunner-1.9
(...)
ii xulrunner-1.9 1.9.0.3+nobinonly- XUL + XPCOM application runner

2º) Instalarlo si no se dispone de él:

$ sudo apt-get install xulrunner

3º) Ejecutar:

$ xulrunner --register-global

Y volver a ejecutar Firefox.

Fuente: Launchpad Ubuntu

h1

Web-Shell exception happened SocketServer.py

14/09/2009

Si al ejecutar la utilidad Web-Shell se producen trazas similares a éstas:

Exception happened during processing of request from ('172.26.0.4', 35859)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 312, in handle_one_request
self.raw_requestline = self.rfile.readline()
File "/usr/lib/python2.6/socket.py", line 404, in readline
data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('172.26.0.4', 35860)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 312, in handle_one_request
self.raw_requestline = self.rfile.readline()
File "/usr/lib/python2.6/socket.py", line 404, in readline
data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('172.26.0.4', 35861)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 312, in handle_one_request
self.raw_requestline = self.rfile.readline()
File "/usr/lib/python2.6/socket.py", line 404, in readline
data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]
----------------------------------------

Se debe sencillamente a un uso incorrecto de la aplicación. La web se ha accedido por http cuando debe ser por https.
http://172.26.0.5:8022/
https://172.26.0.5:8022/

Además, si se desea monitorizar con Monit, es necesario añadir las siguientes líneas al fichero de configuración

#sudo nano /etc/monit/monitrc
(...)
check host WebShell_8022 with address 127.0.0.1
start program = "/usr/bin/python /etc/WebShell/webshell.py &"
stop program = "/usr/bin/killall -9 python /etc/WebShell/webshell.py"
if failed port 8022 then restart
(...)

adaptando las rutas, y reiniciar Monit

#sudo /etc/init.d/monit restart

h1

Error installing Xplico 0.5.2 deb package: chown: cannot access `/opt/xplico/xi’: No such file or directory

14/09/2009

[ Update]:Newer versions of Xplico have solved this problem.

During the installation of Xplico, network traffic analyzer and sniffer (pcap compatible), may happen this error:

#dpkg -i xplico_0.5.2_i386.deb
After this operation, 0B of additional disk space will be used.
Setting up xplico (0.5.2) ...
chown: cannot access `/opt/xplico/xi': No such file or directory
dpkg: error processing xplico (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
xplico
E: Sub-process /usr/bin/dpkg returned an error code (1)

If you create that missing directory by yourself and try to reinstall, another error will be prompted:

root@ubuntu:/home/adminuser/Desktop# apt-get install xplico
chmod: cannot access `/opt/xplico/xplico.db': No such file or directory

Till next package version, the current solution is uninstall and reinstall using this method:

1º) Uninstall:
# sudo dpkg -r xplico


2º) Manually delete the lines which mention port 9876
# nano etc/apache2/ports.conf


3º) Install the package with gdebi:
adminuser@ubuntu:~/Desktop$ sudo apt-get install gdebi

adminuser@ubuntu:~/Desktop$ sudo gdebi xplico_0.5.2_i386.deb
Reading package lists: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
Xplico is a Network Forensic Analysis Tool (NFAT)
The goal of Xplico is extract from an internet traffic capture the applications data contained.
For example, from a pcap file Xplico extracts each email (POP, IMAP, and SMTP protocols), all HTTP contents, each VoIP call (SIP), FTP, TFTP, and so on. Xplico is not a network protocol analyzer.
Do you want to install the software package? [y/N]:Y
Selecting previously deselected package xplico.
(Reading database ... 136557 files and directories currently installed.)
Unpacking xplico (from xplico_0.5.2_i386.deb) ...
Setting up xplico (0.5.2) ...
Module php5 already enabled
Module rewrite already enabled

Thanks to Gianluca Costa

h1

Como descomprimir una backup de Plesk en Linux

08/09/2009

El formato de backups de Plesk es distinto al habitual tar.gz, por lo que hay que utilizar una herramienta específica para, posteriormente si, conseguir un tar.gz

1º) Bajar, descomprimir e instalar ripmime

2º) Procesar el fichero con ripmine:
# ripmime -i backup-20090908-mi-dominio.com -d directorioBackupRestaurada

3º) Descomprimir el contenido:
# tar -ztvf directorioBackupRestaurada/*

Fuente: http://forums.deftechgroup.com/showthread.php?t=1087

h1

/usr/bin/msgmerge not found

08/09/2009

Si a la hora de realizar una compilación se produce un error similar al siguiente:

/usr/bin/msgmerge --update ar.po amule.pot
/bin/sh: /usr/bin/msgmerge: not found

Es facilmente solucionable instalando el paquete gettext:

carlos@WhenIGrowUp:~/amule/amule$ sudo apt-get install gettext
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
Paquetes sugeridos:
cvs gettext-doc
Se instalarán los siguientes paquetes NUEVOS:
gettext
0 actualizados, 1 se instalarán, 0 para eliminar y 81 no actualizados.
Necesito descargar 2067kB de archivos.
Se utilizarán 8221kB de espacio de disco adicional después de desempaquetar.
Des:1 http://archive.ubuntu.com hardy/main gettext 0.17-2ubuntu1 [2067kB]
Descargados 2067kB en 1s (1182kB/s)
Seleccionando el paquete gettext previamente no seleccionado.
(Leyendo la base de datos ...
152201 ficheros y directorios instalados actualmente.)
Desempaquetando gettext (de .../gettext_0.17-2ubuntu1_amd64.deb) ...
Configurando gettext (0.17-2ubuntu1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place