How to disable activity logging in Ubuntu 11.10 Oneiric Ozelot
Ubuntu has mechanism to log user activity such as used documents. This is used to facilitate searching, but can also be intrusive to your privacy.
Here is a way to disable this logging without breaking Unity or any other part of the system, execute these commands in a terminal:
sudo mv /etc/xdg/autostart/zeitgeist-datahub.desktop /etc/xdg/autostart/zeitgeist-datahub.desktop-inactiverm ~/.local/share/recently-used.xbelmkdir ~/.local/share/recently-used.xbelrm -rf ~/.local/share/zeitgeist
then log out and log in again.
Backup your mobile phone in Linux
To backup data from a non-smart SonyEricsson mobile phone (such as W890i) in Linux, use the gammu utility.
-
Install gammu, it is available as a package in the standard repositories for Debian and Ubuntu, just install the
gammupackage. -
Create a
~/.gammurcfile with the following content:> > [gammu]
> port = /dev/ttyACM0
> connection = at -
Connect your mobile phone to the computer with the USB cable and select
Phone mode -
Use
> gammu backup filename.vcf -yes
PHP session timeout
The developers of PHP has, in their infinite wisdom, decided that the default session timeout should be 24 minutes (1440 seconds).
This means that if you have a MediaWiki wiki and are editing a single page for half an hour and then click the save button, you are logged out and all your changes are lost. I just learned this the hard way.
Fortunately, you can change this with the session.gc_maxlifetime parameter in php.ini. So set this to a higher – more sane – value, such as 86400 (24 hours).
Upgrade to Ubuntu 11.04 without Unity
The new Ubuntu release 11.04 Natty contains the new Unity desktop environment which is quite controversal. I have tried it for a while and I think it is neat but too buggy and immature. However, it is easy to revert to the old Gnome 2 desktop environment and have things working almost as in 10.10.
First do a normal distribution upgrade to 11.04, then go to System Settings -> Login Screen and select Ubuntu Classic as default session and reboot.
Using Sveon SNT1020 WiFi USB adapter in Ubuntu
I just brought an Sveon SNT1020 WiFi USB adapter.
It works very well with Ubuntu Linux 10.10, just connect it to an USB 2 port and you can start using it with NetworkManager right away, no drivers or setup necessary. You should possibly disable any built-in WiFi adapters first though.
It cost €35.
Web application frameworks in Java
When you know which type of web application you are to develop, it’s time to have a look at some possible choices.
I have tried to categorize some modern and popular web application frameworks in Java.
Simple server driven MVC page based
This category contains the traditional frameworks used for developing web applications with purely server driven application logic. They are based on complete HTML pages and uses the Model-View-Controller design pattern.
Web applications and web frameworks
If you are to develop a web application, there are a lot if frameworks to choose between.
I assume that the web application by its nature needs to have bi-directional communication between the web browser and the server during the execution, initial downloading of resources is not enough. I also assume that the available technologies are HTML, CSS and JavaScript/AJAX; no Flash, Java applets, ActiveX, Silverlight or other browser plug-ins are used.
Mount your home directory with SSHFS in Linux
If you have your home directory on another machine, it’s common to use NFS to access it. NFS is easy to set up and works more or less out of the box on Linux. However, NFS is not secure, and you need to have a carefully setup firewall in order to use it safely.
SSHFS is a more secure alternative, but it’s quite tricky to set up on the client side. It’s very easy to set up on the server though, you just need an SSH server with SFTP support.
Using Vaadin with Maven
Vaadin is a comprehensive framework for developing web applications in Java. The Vaadin web site presents a number of ways to use Vaadin with Maven, but I am not completely satisfied with any of those. Here is how I do it.
Use a pom.xml like this:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thecompany</groupId>
<artifactId>theapp</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>The App</name>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.3.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<type>jar</type>
<includes>
<include>VAADIN/**</include>
</includes>
</overlay>
</overlays>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.17</version>
</plugin>
</plugins>
</build>
</project>
And a src/main/webapp/WEB-INF/web.xml like this:
Implementing POX Web Services with Spring WS and JAXB
Spring Web Services together with JAXB 2.0 provides a convenient way to implement POX Web Services in Java.
POX means Plain Old XML, and a POX Web Service is a protocol based on sending XML over HTTP without using any well-known protocol framework like SOAP or XML-RPC.
First you have to define annotated JAXB classes for all XML request and response messages. If you have a schema, you can generate them with the xjc tool. Or you can create and annotate them manually. It can be a good idea to make one abstract base class for all requests, and one for all responses.