Archive for April, 2008

Remote Desktop from Ubuntu

Monday, April 21st, 2008

I don’t want to search for the right commands everytime I want to connect to a windows machine with RDP when I’m on a Linux machine running Ubuntu or Kubuntu that is. The best tool I know, that really does the work is rdesktop.

Install this package:

sudo apt-get install rdesktop

And then just connect with this line:

rdesktop -u user -p password -k de-ch -g 1280x1024 server

This also shows how to use a Swiss German keyboard layout, as I have searched for it many times. The thing is, that it is not an underscore, as many may think.

Simple Configuration for Log4j

Friday, April 18th, 2008

Ever wanted to use Log4j, but didn’t know how to configure it? Or you don’t remember how to configure it in a jiffy?

Just add the following two lines in your application, like say in the main()-method and then your’re done:


BasicConfigurator.configure(new ConsoleAppender(new PatternLayout("%d %5p [%t] %C{1} %M - %m%n")));
Logger.getRootLogger().setLevel(Level.INFO);

The first line sets logging to go to the console and it will look something like this:

2008-04-18 11:21:33,395 INFO [main] TestApp main - exists: true

If you want a different logging level, then just take Level.DEBUG, or whatever else suits you.

MySQL new user SQL statements

Tuesday, April 1st, 2008

A quick and dirty explanation to create a new MySQL datbase with a user

Create the user:

  • CREATE USER 'hibtest'@'localhost' IDENTIFIED BY '*******';
  • Set some permissions:

  • GRANT USAGE ON * . * TO 'hibtest'@'localhost' IDENTIFIED BY '*******' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0MAX_USER_CONNECTIONS 0 ;
  • Create the database:

  • CREATE DATABASE IF NOT EXISTS `hibtest` ;
  • Grant the privileges on the database:

  • GRANT ALL PRIVILEGES ON `hibtest` . * TO 'hibtest'@'localhost';