Catégorie: GNU/Linux
07.07.08
How to search for text files under linux
Here's a nice command which leverages find and file to search for text/* mime type files amongst binary files:
Code:
| find . -type f | xargs file -Ni | grep "text/" | cut -d":" -f 1 |
28.11.07
Easing the configuration of a development JBoss cluster environment
Configuring a JBoss cluster is tedious because you need multiple machines, you need to configure multiple files on different machines, multicast, ips, shares, network interfaces and etc ... In order to make it easier to test things when working with JBoss clusters, here are a few tips.
First of all, use a virtual environment ! I use VMware Workstation on my development laptop (with virtual ip 192.168.208.2) and configure two debian virtual machines v1 and v2 on a NAT virtual network (192.168.208.x) with DHCP activated. I use a NAT virtual network so that the debian virtual machines can apt-get update from the internet through the dev machine.
I only configure one virtual machine (J1) with java and samba then copy and paste it in order to obtain the second virtual machine J2.
To avoid having multiple configuration files around, I find it convenient to centralize the whole JBoss directory in a shared folder on my windows development machine. I use c:\jboss shared on \\192.168.208.2\jboss in read only mode, I explain why the read only mode a bit later.
I then mount it using smbfs on each virtual JBoss node. It can be automated by adding the following line to your /etc/fstab:
//192.168.208.2/jboss /mnt/jboss smbfs ro,username=yourname,password=yourpasswd 0 0
The shared JBoss configuration must absolutely be mounted read only because it will be used by multiple JBoss instances which must not concurrently modify the same files.
JBoss needs additional configuration here because by default, JBoss creates 4 working directories under the server configuration directory server/all/:
- log: used by log4j and configrued in conf/log4j.xml
- data: used by hsqldb (i think)
- work: used by tomcat
- tmp: used by the jboss micro kernel
Those directories will actually be used in read write mode so we must tell JBoss to use some other directory, specific to each virtual node for its write needs. I use /var/local/jboss.
JBoss allows to do just that with the following property:
jboss.server.home.dir=/var/local/jboss
On the command line, you would pass the property that way:
./bin/run.sh -Djboss.server.home.dir=/var/local/jboss
But to avoid having to remember that and to take advantage of the configuration being centralized on the shared directory on the dev machine, edit the c:\jboss\bin\run.conf file and add the following line at the end:
JAVA_OPTS="$JAVA_OPTS -Djboss.server.home.dir=/var/local/jboss"
Now, you're setup, on each virtual node, you can start the jboss instance directly from the shared mount:
/mnt/jboss/bin/run.sh -c all
The shared /mnt/jboss directory structure will not be modified, all working files will be put in node specific /var/local/jboss sub directories !
Finally, just as you did for the conf/run.conf file, to modify the configuration of cluster nodes, just edit the files directly using the windows editor of your choice under the c:\jboss directory ... All cluster nodes will use those files. Dependencing on whether they are hot deployed or not, you may need to restart all instances of course.
Btw, if someone knows how to restart all nodes in the cluster partition, the tip would be helpfull ![]()
Enjoy !
23.07.07
Hardware4Linux.info
Hardware4Linux.info est un nouveau site web communautaire pour reporter et chercher les compatibilités ou incompatibilités matériel avec Linux.
01.05.07
02.07.06
Installation d'une Ubuntu "Dapper Drake" avec XGL/Compiz sur un HP NX8220
Et oui, j'ai craqué, j'ai pas pu m'empécher d'installer le nouveau serveur X OpenGL sur ma distrib linux
Il est vraiment magnifique, il y a quelques instabilités (notemment avec le switcher) mais ça vaut le coup ! Voici comment installer avec une facilité déconcertante le couple Ubuntu "Dapper Drake" / XGL Compiz sur un portable HP NX8220. Contrairement à ce que l'on pourrait craindre, c'est vraiment très fluide, aucun ralentissement, vraiment !
Commencez par installer l'Ubuntu Dapper Drake, c'est vraiment très simple, l'essentiel est reconnu du premier coup, y compris l'écran en 1680x1050 ![]()
Ensuite, suivez ce tutorial qui explique comment installer les drivers pour la carte 3D ATI Mobility X600. Il faut lire la section Sur une distribution Ubuntu Dapper Drake
Enfin, suivez ce tutorial qui explique comment installer XGL sur l'Ubuntu Dapper Drake. Dans la section Lancer sa session XGL + Compiz, préférez le choix de la méthode 2 qui vous permettera de choisir lors du démarrage d'une session X si vous souhaitez utiliser XGL/Compiz ou non, c'est plus prudent.
Enfin, il y a de fortes chances que vous ayez le message d'erreur suivant lors de votre première session XGL:
compiz.real: GLX_EXT_texture_from_pixmap is missing
compiz.real: Failed to manage screen: 0
compiz.real: No managable screens found on display :1.0
Cette erreur se traduira par le fait que les fenêtres n'auront pas de décorateur.
Si c'est le cas, suivez les consignes en commentaire dans le fichier /usr/bin/startcompiz et rééxécutez le. Le décorateur de fenêtre compiz devrait s'activer.
Play time !
28.12.05
HP va proposer des PC équipés de l'OS Linux Ubuntu
Très bonne nouvelle. Un très bon OS pour de très bons PC ![]()
29.10.05
HP Compaq nc8230 et Linux
Le nc8230 semble être une machine très performante, et en plus semble être plutôt bien supportée sous Linux pour une machine récente.
25.10.05
06.03.05
Samba et le support ACL sur Debian
Cet article explique comment remplacer complètement un serveur de fichier windows par un serveur linux en utilisant conjointement Samba et les ACL du système de fichier XFS.
23.01.05
Jailkit
Jailkit is a set of utilities to limit user accounts to specific files using chroot() and or specific commands. Setting up a chroot shell, a shell limited to some specific command, or a daemon inside a chroot jail is a lot easier using these utilities.
Jailkit has been in use for a while on CVS servers (in a chroot and limited to cvs), sftp/scp servers (both in a chroot and limited to sftp/scp as well as not in a chroot but only limited to sftp/scp), and also on general servers with accounts where the shell accounts are in a chroot.