h1

Error compilando: Type undefined reference to boost::filesystem::detail::status_api

11/11/2009

Si al compilar un proyecto c++ que utilice las librerías Boost en Eclipse se produce el siguiente error:

Type undefined reference to boost::filesystem::detail::status_api

o de forma extendida:
Description Resource Path Location Type
undefined reference to `boost::filesystem::detail::status_api(std::basic_string<char, std::char_traits, std::allocator > const&, int&)' Indect3 line 279, external location: /usr/include/boost/filesystem/operations.hpp C/C++ Problem

Se solucionan incluyendo en el linker la librería “boost_filesystem″. En el caso de Eclipse:

Para solucionarlo es necesario ir al siguiente menú:
Propiedades del proyecto > C/C++ Build > Settings > GCC C++ Linker > Libraries > "Libraries (-l)"
y añadir esta referencia:
boost_filesystem

Fuente: Ferdy Christant

h1

Errores habituales con Lintian y soluciones

27/10/2009

Lintian es una utilidad para buscar errores en paquetes .deb. Algunos de ellos son:

1º) Lintian copyright-file-contains-full-gpl-license
Borrar el fichero de copyright
# echo > debian/copyright

Incluir el siguiente texto:
# nano debian/copyright

GPL 1.0 Licence
For details, read /usr/share/common-licenses/GPL

2º) copyright-without-copyright-notice
Introducir el siguiente texto, modificando los valores correspondientes en debian/copyrigth
| This package was debianized by VICTIMS NAME on
| DATE.
|
| The current Debian maintainer is YOUR NAME
|
| It was downloaded from: http://www.download.address/foo.bar.tgz
|
| Upstream Authors: Homer Simpson, Bart Simpson, Maggie Simpson
|
| Copyright: 1971 - 2001 Homer Simpson
| 2001 - 2006 Bart Simpson
|
| This program is free software; you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation; either version 2 of the License.
|
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License with
| the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
| if not, write to the Free Software Foundation, Inc., 51 Franklin St,
| Fifth Floor, Boston, MA 02110-1301, USA.
|
| On Debian systems, the complete text of the GNU General Public
| License, version 2, can be found in /usr/share/common-licenses/GPL-2.
|
| The Files in lib/maggie are Copyright 2005, 2006 Maggie Simpson
|
| This library is free software; you can redistribute it and/or
| modify it under the terms of the GNU Lesser General Public
| License as published by the Free Software Foundation; either
| version 2.1 of the License, or (at your option) any later version.
|
| This library is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
| Lesser General Public License for more details.
|
| You should have received a copy of the GNU Lesser General Public
| License along with this library; if not, write to the Free Software
| Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| On Debian systems, the complete text of the GNU Lesser General Public
| License, can be found in /usr/share/common-licenses/LGPL.
|
| The Debian packaging is (C) 2006, YOUR NAME and
| is licensed under the GPL, see above.

3º) old-fsf-address-in-copyright-file
cambiar la dirección por:
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

4º) depends-on-python-minimal
eliminar del fichero debian/control, línea depends, «python-minimal«, ya que será instalado por otros paquetes especificados en esa misma línea.

Fuentes: http://lists.debian.org/debian-devel-announce/2006/03/msg00023.html

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