Feeds:
Posts
Comments

Getting xinerama working with the closed source nVIDIA driver is easy. However, setting it up using the open source nv a bit tricker.

The solution, however, is quite easy once you know it :-) Figure out the total capacity of your screens:

$ xrandr -q

Add the horizontal and vertical max sizes of your screens and dive into your /etc/X11/xorg.conf and a Virtual directive to your Display sub section that accounts for the total virtual screen.

    SubSection     "Display"
        Depth       24
        #  1440+1600  900+1200
        Virtual     3040 2100
    EndSubSection

The final step is then to set tell xrandr setup your xinerama. I kick off my X session with the .xinitrc file, so I’ve put these two lines there (if you don’t use this approach, you can just type these lines manually after logging in):

xrandr  --output VGA1 --off
xrandr  --output VGA1 --right-of LVDS --pos 1440x900 --auto

And that’s it! Xinerama without the need of a closed source binary driver :-)

It seems to me that the JavaMail Mock library has dodgy handling of BCC fields. Sending a message with BCC fields makes it possible to read the fields again when receiving the email (!) This is against the definition of BCC, isn’t it?

    Session session = Session.getDefaultInstance(mMailProperties, null);
    MimeMessage message = new MimeMessage(session);
    String body = "body from " + getClass().getName()
      + " @" + Calendar.getInstance().getTime().toString();
    message.setContent(body, "plain/text");
    message.setRecipients(RecipientType.TO, mTo);
    message.setRecipients(RecipientType.BCC, address2 + ", " + address3);
    Transport.send(message);
  ...
  store.connect(...);
  Folder folder = store.getFolder(...);
  folder.open(Folder.READ_WRITE);
  javax.mail.Message[] allMessages = folder.getMessages();
  for (javax.mail.Message message : allMessages) {
    ...
    Address[] addresses = theMessage.getRecipients(RecipientType.BCC);

The variable ‘addresses’ now hold two entries. Note that Mailbox.get(mTo) works as you’d expect.

IIS doesn’t impress me

Okay, I admit it, this might not be completely fair as I don’t know the server setup, but still the help message at the bottom is pretty impressive stuff ;-)

The page cannot be displayed
The request cannot be processed at this time. The amount of traffic exceeds the Web site's configured capacity. 

Please try the following:
Click the Refresh button, or try again later.
If this error persists, contact the Web site administrator to inform them that this error continues to occur for this URL address.
HTTP Error 500.13 - Server error: Web server is too busy.
Internet Information Services (IIS)

Technical Information (for support personnel)
Go to Microsoft Product Support Services and perform a title search for the words HTTP and 500.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Monitoring and Tuning Web Application Performance, Performance Monitoring and Scalability Tools, and About Custom Error Messages.

The site in question was http://birkebeiner.no/Min-Side/Pamelding/ were I wanted to sign up for the Birkebeiner ski race next March.

The oracle start/stop script I’ve found on the net (written for REHL, I believe), didn’t work for me. Thus, I wrote a wee script that works for my 11g install (on Debian).

#! /usr/bin/env bash                                                                     

function stop_db()
{
    sqlplus /nolog <<EOF                                                         
connect /as sysdba                                                               
shutdown                                                                         
EOF                                                                              
    lsnrctl stop
}

function start_db()
{
    sqlplus /nolog <<EOF                                                         
connect /as sysdba                                                               
startup                                                                          
EOF                                                                              
    lsnrctl start
}

case "$1" in
    start)
        start_db
        ;;
    stop)
        stop_db
        ;;
    *)
        echo "Usage:" `basename $0` ""
        ;;
esac

exit 0

As you can see, its far simpler than the more “official” scripts, but it does exactly what I want it to, so I’m happy :-)

Solr is a great piece of software but its logging is bloody annoying. Defaultwise on my Tomcat, it will write all its log messages to the system out log, which is a pain in the but to say the least.

To make it log to its own log file, this is what I did to tomcat/conf/logging.properties

# added 6localhost.org.apache.juli.FileHandler to the list of handlers

6localhost.org.apache.juli.FileHandler.level = FINE
6localhost.org.apache.juli.FileHandler.directory = /var/log/escenic
6localhost.org.apache.juli.FileHandler.prefix = solr.

org.apache.solr.level=INFO
org.apache.solr.handlers=6localhost.org.apache.juli.FileHandler

Now, I get all solr messages in /var/log/escenic/solr-2009-07-22.log. What a relief! Of course, you may want to drop the logging level to WARNING

DBUnit and Hibernate

You wouldn’t think the difference between these two code snippets were anything to blog about, right?

String selectString = "select * from mytable";
List result = getHibernateTemplate().find(selectString);

and this one, and no, you woun’t get any points for pointing out that this is a better, non-deprectaed way of executing a query in Hibernate ;-)

String selectString = "select * from mytable";
Query query = getSession().createQuery(queryString);
List result = query.list();

And now to the funny part: the latter implementation makes DBUnit hang forever!

Doing a thread dump of the Maven Surefire process reveals that this part of code is hanging:

"main" prio=10 tid=0x09945c00 nid=0x5279 in Object.wait() [0xb7d74000..0xb7d751f8]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on  (a org.apache.commons.pool.impl.GenericObjectPool)
	at java.lang.Object.wait(Object.java:485)
	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:748)
	- locked  (a org.apache.commons.pool.impl.GenericObjectPool)
	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)

Now, who can tell me why this is?

Oracle nonsense

Was to install an Oracle DB on my Debian system the other day. Now, a big kudos to Oracle for providing Debian packages of their XE version. However, the non sense started once the thing was apt-get-ed.

It turned out that if you set the system user password to ‘admin’, you cannot log in! What kind of headless logic is that?!! And of course, there’s no way to re-set the admin password, so I had to re-install the DB to try a new password.

# apt-get --purge delete oracle-xe
# apt-get install oracle-xe

So, after setting the following in my .bashrc, I can enjoy (developer version of) Oracle 10.2.0.1.0 with less installation fuss than normal :-)

######################################################################
# Oracle
######################################################################
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_OWNER=oracle
export ORACLE_SID=XE
export SQLPLUS=$ORACLE_HOME/bin/sqlplus
export LSNR=$ORACLE_HOME/bin/lsnrctl
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
Follow

Get every new post delivered to your Inbox.