Ir a contenido

 Página 1 de 10  1  2  3  4  5 » sig.  Última » 

Debian Eeepc 901: Mount SD card as part of root filesystem (like /var)


Back again? Time will answer.

Beginning September I couldn’t wait any longer and I decided to buy an eeepc 901. As one of those mobility and digital-ubiquity believers I am. Of course this acquisition will worth an article.
But what I want to explain right now is that today I’ve finally fixed one of those horrible errors that gets your frustration arise because you don’t find a good (google) search pattern or any valid solution.

My main problem

Previous acquisition phase there is always a documentation phase. There I found that Solid States Disk (SSD), in their firsts versions suffer from a write limit.
As I’m skeptical and ignorant in this hardware topic I “believe and panic” about it.

Solving the problem

Solving the write limit problem had a easy solution, a SD card where most often written/modified files will live. That means putting /var on that card-disk. That’s easy, just a simple move and link.
But what you don’t expect is that SD reader gets detected after mounting file systems which brokes boot sequence. If you have this kind of bad boot sequence, you have to re-init from command line after mounting by hand.
You should be having a message that looks like “Enter root pass for maintenance or enter crtl+enter to continue”

Remount and reinit by hand

root@miniyo:~$ runlevel (to know which runlevel you are)
N 1
root@miniyo:~$ mount /dev/YOUR SD CARD some-options
root@miniyo:~$ init 2 (as a common example)

Getting things donde, but properly

We have to regenerate our init kernel, so it loads USB devices as soon as posible.
Of course SD reader is connected through USB internally in eeepc

This is how my “pre kernel loading” modules file looks like now that everything works.

user@miniyo:~$ cat /etc/initramfs-tools/modules
# List of modules that you want to include in your initramfs.
#
# Syntax: module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
usbcore
ehci-hcd
uhci-hcd
usb-storage
enrgar@miniyo:~$ update-initrafms

References and links
Etiquetas: , , , , , , , , ,
Te interesará:

Howto to intercommunicate processes in different(remote) machines through DBus


Introduction

In this post I’m going to try to connect two processes in different machines through DBus. The method is a little bit complex, so be patient if you try.
Also is to advert that this has been the result of 3 days of tests (reference1). So maybe this method may be improved with time and use reference2.

Tools (The actors)

  • dbus
  • gabriel
    • socat
    • libssh
  • SSH
  • your apps

Debian official packages are dbus libssh-2 socat
gabriel is not part of Debian yet (but I’ve build one for myself)

Knowledge (Actors curriculum)

In this section I will describe the basics about the tools we are going to use.

DBus. Extracted from DBus page:

D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a “single instance” application or daemon, and to launch applications and daemons on demand when their services are needed.

D-Bus supplies both a system daemon (for events such as “new hardware device added” or “printer queue changed”) and a per-user-login-session daemon (for general IPC needs among user applications). Also, the message bus is built on top of a general one-to-one message passing framework, which can be used by any two apps to communicate directly (without going through the message bus daemon). Currently the communicating applications are on one computer, or through unencrypted TCP/IP suitable for use behind a firewall with shared NFS home directories.

Gabriel is a simple utility to enable D-Bus clients to connect to a D-Bus daemon running on a remote machine, through SSH.
This is the main piece of this puzzle. If you are interested in understanding how it works you should take a look at socat and libssh. As I’ve had to take a look at code, and make some modifications, you should read it as a punishment.

Extracted from socat man page:

socat - Multipurpose relay (SOcket CAT)
socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be used for many different purposes. It might be one of the tools that one ‘has already needed´.

Libssh. Extracted from libssh page:

The SSH library was designed to be used by programmers needing a working SSH implementation by the mean of a library. The complete control of the client is made by the programmer. With libssh, you can remotely execute programs, transfer files, use a secure and transparent tunnel for your remote programs. With its Secure FTP implementation, you can play with remote files easily, without third-party programs others than libcrypto (from openssl).

You should know about SSH and about your application.

Architecture

Local host will run gabriel and your application.
Remove host will need a running SSH server, a running dbus server and will need socat installed and ready to use.
We need to run gabriel, that will act as a server that will connect our host to the remote host through SSH. After that gabriel will use this SSH connection to intercommunicate our local application with remote DBus applications by using socat.

Remote DBus communication

Remote DBus communication

Howto (Main action)

At the moment I’ve only achieved to connect a process using session-bus, I’m still testing until I get connection through system-bus which was my initial purpose.
After reading next information, you will be able to connect using session bus and system bus.

As I commented somewhere else, I’ve made some modifications on gabriel code. I needed some common parameters as SSH port (my virtualbox testing environment ), better help explanations or add a verbose output.
Gabriel establish a connection with the remote SSH and by socat commands it communicates with the remote DBus “environment”. You should administrate SSH parameters and Dbus parameters to gabriel.

user@machine:~/svn/gabriel/gabriel$ src/gabriel –help
Usage:
gabriel [OPTION...] - Gabriel
Help Options:
-?, –help Show help options
Application Options:
-h, –host=HOSTNAME Hostname or IP of the remote host
-p, –port-ssh=PORT-SSH SSH port on the remote host
-u, –username=USERNAME SSH username on the remote host
-w, –password=PASSWORD SSH password on the remote host
-m, –method=DBUS_TRANSPORT_METHOD The D-Bus transport method to use (TCP, UNIX, abstract-UNIX)
-b, –bind=HOSTNAME The bind-address to listen for D-Bus client connections on
-d, –bus-address=BUS_ADDRESS The DBus session bus address of the remote D-Bus daemon
-t, –port-tcp=PORT-TCP The TCP port to listen for DBus client connections on
-v, –verbose=VERBOSE Set verbosity level (3, 2, 1, 0, -1)=(packet,protocol,functions,important,none)

We have to put special attention to -d, –bus-address=BUS_ADDRESS because this info must be gotten from the REMOTE machine.
That address is the one used by processes to communicate through DBUS. It’s something “internal” and automatically done when you use DBus API/library. I’m going to show you where to get it.

DBUS_SESSION_BUS_ADDRESS, DBUS_SYSTEM_BUS_ADDRESS, DBUS_SYSTEM_BUS_DEFAULT_ADDRESS

Again, this info should be gotten from REMOTE machine.
At the moment I don’t know any nice command where to get this info.
We have two main options of DBus buses. System and Session (more info in DBus page).
If you need SESSION bus address, you can choose what it better fits you:

  • You can can get it from process environment
  • You can stole it from any other process suspicious from being involved in DBus activities…
  • You can create your own dbus-daemon (which, actually, I don’t know if it uses it’s own BUS_ADDRESS)

If you need SYSTEM bus address, you can choose what it better fits you:

  • You can can get it from process environment. If it’s not defined, take a look at /etc/dbus-1/system.conf where you should locate a string like <listen>unix:path=/var/run/dbus/system_bus_socket</listen>
  • You can stole it from any other process suspicious from being involved in DBus activities…

Examples:

// C++ code
#include <stdio.h>
#include <stdlib.h>
char * env;
// env = getenv (”DBUS_SESSION_BUS_ADDRESS”);
env = getenv (”DBUS_SYSTEM_BUS_ADDRESS”);
if (env!=NULL){
cout << env << endl;
}

user@REMOTE-machine:~ $ grep -z BUS_ADDRESS /proc/2047/environ
HALD_RUNNER_DBUS_ADDRESS=unix:abstract=/var/run/hald/dbus-bonbZtoykd,guid=8b5aff565de0dc7c467fef414832dd98

This command gives you a dbus-daemon in your session with the one you can contact.

user@REMOTE-machine:~ $ dbus-daemon –session –print-address
unix:abstract=/tmp/dbus-j2npbTXDwD,guid=d69f66d43e354de5733e4a1a48335bd6

user@REMOTE-machine:~ $ grep unix /etc/dbus-1/system.conf
<listen>unix:path=/var/run/dbus/system_bus_socket</listen>

Howto (Main action): Back to local host

Those ugly unix:stri:ngs/asdkaj/numbers we have seen is what we need for -d, –bus-address=BUS_ADDRESS.
See a session example:

user@machine:~/svn/gabriel/gabriel$ src/gabriel -h localhost -p 2222 -d unix:abstract=/tmp/dbus-j2npbTXDwD,guid=d69f66d43e354de5733e4a1a48335bd6
Listening to D-Bus clients on: “unix:abstract=/tmp/gabriel”
bla ble blu bla

See a system example:

user@machine:~/svn/gabriel/gabriel$ src/gabriel -h localhost -p 2222 -d unix:path=/var/run/dbus/system_bus_socket
Listening to D-Bus clients on: “unix:abstract=/tmp/gabriel”
bla ble blu bla

The moment we have or gabriel server running we (may have nothing) need to set DBUS_XXX_BUS_ADDRESS. Many apps would use, or have, this environment variable to connect to a DBus instance and intercommunicate with other process.
This is is easy, DBUS_XXX_BUS_ADDRESS should be the address gabriel shows few instants after being launched.
When we have defined this environment variable (in command line) we can execute our app, and it will happily communicate with the remote DBus world.
Example:

user@machine:~/svn/dbusmm/trunk/examples/glib$ export DBUS_SESSION_BUS_ADDRESS=”unix:abstract=/tmp/gabriel”
user@machine:~/svn/dbusmm/trunk/examples/glib$ ./dbus-browser

dbus-browser is a program that uses a session bus.

Curiosity: DBus protocol messages interchanged

Modifying a couple of lines in gabriel can let you see DBus raw protocol messages. It’s a didactic info.
If you enable verbose code at least at level 2, you will get raw DBus protocol messages.

My modifications and hacks

Code will be publish under GLKM project page.

Links and references
Etiquetas: , , , , , , , , , , , , ,
Te interesará:

WHYFLOSS Madrid Conference 08


¿Cuándo?

En los días 8 y 9 del mes de Mayo se celebrará la cuarta edición de la WhyFLOSS Conference, con entrada libre y gratuita.

Con un importante apoyo de la Escuela de Informática de la Universidad Politécnica de Madrid, Campus Sur se presentarán conferencias variadas entorno a las tecnologías abiertas de IT.

Estarán colaborando en la IV edición del evento compañí­as como SUN, Red Hat, OpenBravo, Andago, SIE, Liferay, Opentia, Monolabs, Accenture, Avanzada7 y universidades como la UPM y la URJC, así­ como comunidades de proyectos como LibreSoft, OpenSolaris y FFII.

¿Dónde?

El evento se realizará en la Escuela de Informática de la Universidad Politécnica de Madrid. Se encuentra ubicada en el Campus Sur de la UPM en la carretera de Valencia Km. 7 en la Ciudad de Madrid (España).
Información de localización de la Whyfloss Madrid 2008

Calendario

DIA 1

9:30
Inauguración WHYFLOSS Conference 08.
Alejandro Sánchez Acosta, Neurowork

10:00
Open-Cities: el reto de la administración electrónica
Guillermo Pastor, Ándago Ingeniería S.L.

11:00
VII Programa Marco en la UE: FLOSS Include y FLOSS Metrics
Jesús Gonzalez Barahona, LibreSoft

12:00
Modelos de negocio basados en Asterisk (la plataforma de VoIP basada en Software Libre)
Juan Ignacio Cabrera, Avanzada 7

13:00
Clustering Computacional en CSIC
Raul Diaz Medina, Sistemas Informáticos Europeos S.L.

14:00
Descanso para comer

16:00
La implicación de la FFII en los estándares abiertos en Europa
Alberto Barrionuevo, Presidente de Foundation for a Free Information Infrastructure (FFII) / OPENTIA, S.L.

17:00
Caso de exito OpenSolaris en Accenture
David Galan Ortiz, Accenture Outsourcing

18:00
¿Es viable el software Open Source en la Industria? El caso de Red Hat LINUX y JBoss
Jesús González de Buitrago, Red-Hat

DIA 2

10:00
Evolución e influencia del Software Libre en los 10 últimos años
Juantomás García, Monolabs

11:00
Liferay Enterprise Portal: The project, the product, the community and how to extend it
Alvaro del Castillo San Félix, Liferay Inc.

12:00
Openbravo: las claves del éxito del desarrollo en las aplicaciones en software libre
Representative, OpenBravo Inc

13:00
Rocks: Distribucion para clusters computacionales
Jesús Espino García, Sistemas Informáticos Europeos

14:00
Descanso para comer

16:00
Seguridad en OpenSolaris
Victor M. Fernandez, SIA / OpenSolaris Hispano

17:00
Django: Framework MVC en Python
Jesús Espino García, Sistemas Informáticos Europeos

Notas personales (idem a la pasada edición):

  • He de decir que conozco al organizador principal.
  • Yo voy
Referencias y enlaces
Etiquetas: , , , , , , , , ,
Te interesará:

Fixing wordpress mod_rewrite/permalinks 404 errors


As I wrote some time ago for spanish readers, I was having HTML 404 errors in my logs (see awstats statistics before January 2008) which I wanted to solve.

My awstats collects web statistics from eldemonionegro.{com,org,es}/wordpress and eldemonionegro.{com,org,es}/gallery2. The problem should be solved in two different ways, as wordpress and gallery2 has two different approaches when rewriting URL request.
Problems in URL coming from wordpress were due to changes I did in the way that categories and some other URL staff were generated, so everything was rightly delimited.
In the other hand, problems with gallery2 arise from who knows where. With gallery2, HTLM 404 errors come from bad formed URLs, they are errors properly generated, but, those errors, wherever they come, needed to be transformed in proper URLs and as I don’t want to lose visitors, I wanted to move those, let’s say, “false URL” to good ones, so visitors are not loosed because of an external stupid engine. The point is that I solved those errors, but now others has appeared. “Stupids” are bringing me loads of fun ;).

How wordpress works is that it uses an internal rewriting system, with an external simple .htaccess in the root wordpress directory (at least in Debian with Apache2). If you want, you can see those internal rules using a plugin called internal rewrite viewer, it’s interesting.
Over this period you could also need some web server debug output activated (Apache2 in my case). Needed rules will be showed next, but use them carefully. As you should know, debuging is a terribly-horrible-madness performance killer.

# My own custom rules
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_URI} /wordpress/archivos/tag/(.+?)/?$
RewriteRule . /wordpress/etiquetas/%1 [R=301,L]
RewriteCond %{REQUEST_URI} /wordpress/archivos/category/(.+?)/?$
RewriteRule . /wordpress/tema/%1 [R=301,L]
</ifmodule>
# End Custom Rules
# Rules automatically generated by wordpress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress

Be careful of %{REQUEST_URI} instead of %{THE_REQUEST}

# In Debian my wordpress conf is saved into
# /etc/apache2/sites-enabled/wordpress.conf
<IfModule mod_rewrite.c>
RewriteLog “/var/log/apache2/rewrite.log”
# RewriteLogLevel 5
</IfModule>

If anyone’s interested in gallery2, I could show my suboptimal rules

Etiquetas: , , , , , , , , , ,
Te interesará:

A lo que diga el marca, lo mismo que lo que digan en misa


Ni puto caso.

Bueno, acabo de llegar a casa (mejor dicho a casa de mis padres) y lo primero, queridos lectores, ha sido reiniciar el servidor que se me ha quedado tarumba. No se si habrá sido por el disco duro o qué, no respondía ni al teclado, ni a las sysrequest ni na. Un fallo grave, porque como bien sabéis todos, a GNU/Linux estas cosas no le hace falta, y a una Debian menos.

A la cuestión que vamos, después de estos menesteres culinarios, es a un comunicado que acabo de leer en el boletín electrónico del Club Baloncesto Estudiantes. Mi club baloncestístico por excelencia, para los nuevos. No se puede resumir mucho pero os resalto lo fundamental:

El Club Estudiantes quiere mostrar su malestar con el diario deportivo Marca por sus informaciones publicadas hoy [...] referentes al encuentro correspondiente a la 16ª Jornada [...]. El artículo firmado por el periodista Jesús Sánchez (titulado `Atraco´ al León en el Madrid Arena) ataca duramente a la Liga ACB, a su estamento arbitral y fundamentalmente al Club Estudiantes, [...].

Como viene siendo habitual en los últimos meses, la parcialidad y la falta de rigor con la que el diario Marca trata la información del Club Estudiantes es impropia de un medio de comunicación de su prestigio. Este hecho se vio reflejado ayer en la comparecencia de prensa post partido del técnico visitante, ante la continua insistencia del periodista en que el arbitraje había sido vergonzoso.
[...]

Para poneros en situación, el Estudiantes en los instantes de redacción de esta entrada, se encuentra en penúltima posición de la liga ACB. Y con un juego lamentable hasta hace nada, añado.

Tras leer la noticia lo primero es ir a ver lo que tal periodista (aunque dudo que en esa redacción haya alguno y que además ejerza su profesión) ha dicho en el papelucho de ese llamado diario. Uno de esos que antiguamente usaban los obreros para envolverse el bocata y que ahora no vale ni para eso porque te puede dejar un olor fétido y repetitivo en la comida que para qué contaros.
Vaya por Buda, una lástima, en la edición publicada en Internet sobre el partido no se han dignado ni a publicarlo. Han tirado de agencia EFE y han colocado un artículo con este titular: “Los colegiales sumaron su tercera victoria consecutiva en casa“.

Si es que la prensa deportiva, perdón, siento el gravísimo error, la prensa-futbolera, de este país dejó de existir hace muchos años. Probablemente sean los mismos años que cuando empezó la guerra de televisiones. Aquella que trajo consigo tal cantidad de dineros que el resto de deportes dejó de importar en decenas de redacciones.

Podría decir más barbaridades, pero el texto que he resaltado del párrafo anterior creo que aclara suficientemente mi postura. Si no fuese por Internet y por portales como ACB.com o encancha.com, qué sería de la información baloncestística.

Aupa Estu. Ahora es la hora.

Referencias y enlaces:


Etiquetas: , , , , , , , , , , ,
Te interesará:

Howto set a proper framebuffer console resolution


Just a quick note.

If you what to change framebuffer resolution in you GRUB config file you are gonna like this table:

#VGA option
# vga=xxx sets the framebuffer console to a specific resolution.
Here is a table you can use so it can help you decide what resolution you want to use:
# 640×480 800×600 1024×768 1280×1024 1600×1200
# 256 colors (8b) 769 771 773 775 796
# 32K colors (15b) 784 787 790 793 797
# 64K colors (16b) 785 788 791 794 798
# 16M colors (24b) 786 789 792 795 799

Use example:


# defoptions=vga=791 resume=/dev/hda7

title Debian GNU/Linux, kernel 2.6.22-2-686
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-2-686 root=/dev/hda2 ro vga=791
initrd /boot/initrd.img-2.6.22-2-686

I’ve got it pasted into my /boot/grub/menu.lst file.

Hey, anyone has tested grub2?

Etiquetas: , , , , , , , ,
Te interesará:

Como montar archivos ISO, BIN, CUE, MDF, NRG e IMG en debian-linux


Una rica receta de verano…

ISO

Para montar una imagen ISO desde la línea de comandos quizás requieras permisos especiales (como ser superusuario).

usuario@maquina:~$ mount -t iso9660 -o loop archivo.iso /directorio/de/montaje

BIN y CUE

usuario@maquina:~$ aptitude install bchunk
usuario@maquina:~$ bchunk archivo.bin archivo.cue nuevonombre.iso

NRG (Nero Burning Rom)

usuario@maquina:~$ aptitude install nrg2iso
usuario@maquina:~$ nrg2iso archivo.nrg nuevoarchivo.iso

MDF y MDS

usuario@maquina:~$ aptitude install mdf2iso
usuario@maquina:~$ mdf2iso archivo.mdf nuevaimagen.iso

IMG

usuario@maquina:~$ aptitude install ccd2iso
usuario@maquina:~$ ccd2iso imagen.img imagen.iso

Descargas y enlaces
Etiquetas: , , , , , , ,
Te interesará:

WHYFLOSS Conference


WHYFLOSS Conference - Madrid - 6 de Julio

El día 6 de Julio se realizará en la Escuela de Informática de la UNED en Ciudad UniversitariaEscuelas Pías, uno de los centros asociados de la UNED, una jornada de conferencias de difusión de tecnologías abiertas de IT centradas en GNU/Linux y el Software Libre.

Se entregarán CERTIFICADOS de asistencia y también se harán SORTEOS a lo largo de las distintas charlas entre los pre-inscriptos y presentes el día de las conferencias.

El evento ya cuenta con más de 100 personas inscriptas de varias provincias España y es el evento de este tipo más importante de la región.

Para asistir se debe realizar la pre-inscripción on-line o bien en el mismo lugar los días del evento.

Para más información del evento e inscripción gratuita on-line y horarios, dirigirse a:

http://www.whyfloss.com/conference-madrid/

O enviar un correo electrónico a conference @ whyfloss.com aclarando NOMBRE y APELLIDO.

ACTUALIZACIÓN

Conferencias confirmadas:

  • Deployment de IPv6 en redes GNU/Linux
  • Virtualización en GNU/Linux
  • Soluciones criptográficas usando software libre
  • Investigación biológica con Software Libre
  • Alta disponibilidad con GNU/Linux
  • Casos de Éxito: Software Libre en la ESA
  • Desarrollo con GNU/Emacs
  • Software Libre en la Universidad

Notas personales:

  • He de decir que conozco al organizador principal y seguramente se amplíen los horarios de las charlas. Ya le he dicho que 30 o 45 minutos es poco o muy poco, más sabiendo como se suelen alargar estas cosas.
  • Puede que se amplíen los patrocinadores.
  • Yo voy
Etiquetas: , , , , , , , , ,
Te interesará:

 Página 1 de 10  1  2  3  4  5 » sig.  Última »