Friday, December 14, 2007

Jboss - Disable cluster

It could happen that you have two instances of Jboss running inside the same network. By its default configuration Jboss will start to search for other instances around and if it found one it will start clustering. If you want to avoid this you can simply modify the mcast_port or the mcast_port. To do this first you have to identify where this parameters are confiugred:

abba@MyHost /jboss/server/all/deploy $ grep -r mcast *.xml

Doing like that you will have something like this:

cluster-service.xml: UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}" mcast_port="5566"

cluster-service.xml: ip_ttl="${jgroups.mcast.ip_ttl:8}" ip_mcast="true"

cluster-service.xml: mcast_recv_buf_size="2000000" mcast_send_buf_size="640000"

ejb3-clustered-sfsbcache-service.xml:

ejb3-clustered-sfsbcache-service.xml: mcast_send_buf_size="150000" mcast_recv_buf_size="80000" ucast_send_buf_size="150000"

ejb3-entity-cache-service.xml:

ejb3-entity-cache-service.xml: mcast_send_buf_size="150000" mcast_recv_buf_size="80000" ucast_send_buf_size="150000"


Now you will have to modify all this file. In my case you can already see that compared to the default jboss configuration I've changed the mcast_port. You will have also to modify another file:

abba@MyHost /jboss/server/all/deploy $ vi META-INF/jboss-service.xml

Tuesday, December 11, 2007

Data extraction from oracle to csv file

First of all we have to create a script (test.sql) to extract our data:

spool test.csv
set colsep ";"
set pagesize 0
set linesize 10000

SELECT A, B, C
FROM TB_AA
INNER JOIN TB_BB
ON TB_BB.ID = TB_AA.EXT_ID
WHERE TB_AA.FOO = 4;

spool off
exit

Once this is done we can use this command to run the script we have just created:

$ sqlplus user/passwor@ @test.sql

At this point we will obtain as result a file (test.csv) in our folder.

Change locale & language inside ssh terminal

First you can have an overview of the setting of the system you are working with typing:

$ locale

You will obtain a list of all the avaiable locale setting (language, currecy, date....):

LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

At this point we can modify the language:

$ export LANG=en_UK.UTF-8

Obviously once you will have logged out you will lose all your setting.


Oracle - SQL Plus - See avaible tables in your table space

To see all the table available inside your table space you can use the views available inside sys schema:

SQL> select table_name from user_tables;

Now lets try to have additional information:

SQL>select sys.USER_TABLES.table_name, sys.USER_TAB_COLS.COLUMN_NAME, sys.USER_TAB_COLS.DATA_TYPE
from sys.USER_TABLES
join sys.USER_TAB_COLS on sys.USER_TAB_COLS.TABLE_NAME = sys.USER_TABLES.TABLE_NAME
order by sys.USER_TABLES.table_name asc;


Saturday, April 28, 2007

Installazione dei fonts Truetype di Microsoft

Molto utile, specialmente se si vogliono visualizzare le pagine web così come le aveva previste chi le ha create (solitamente si sviluppa basandosi sui fonts di Microsoft). E' sufficiente installare il pacchetto msttcorefonts:

$sudo apt-get install msttcorefonts

Per poter utilizzare i font è necessario fare log out e log in, oppure premere Ctrl+Alt+BackSpace per riavviare GDM oppure rigenerare la chace dei font:

$sudo fc-cache -fv