Monday, September 10, 2012

How to fix Nexus One sd card corruption using linux

Every now and then a forced shutdown of my Nexus One phone leaves me with a corrupted sd card. To fix this using Linux (I use Ubuntu 12.04): Connect the card using a card reader to your linux machine. Type
df
to see the device name of your sdcard. For me it is /dev/sdc1. Then
sudo umount /dev/sdc1
dosfsck -a /dev/sdc1
Job done, remove the card and try it in your phone. Note that
fsck -a /dev/sdc1
has never fixed my problem. I had to use dosfsck.

Friday, January 27, 2012

Sonar and Maven with an overriden derby port

The Sonar server uses a derby database by default that listens on port 1527. This conflicted with another process on our server so we edited the conf/sonar.properties file and set the properties sonar.jdbc.url and sonar.derby.drda.portNumber to use say 1528 instead. Uncomment the sonar.derby.drda.host parameter to allow remote connections. Restart sonar.

To run the maven sonar plugin on a project is simple, you don't even need a reference to it in the pom.xml.

mvn sonar:sonar

However, the sonar maven plugin needs to know where the server is and also the jdbc url for the server (I guess it interacts directly with the sonar database). So add two properties to your pom.xml (we added it to our parent pom.xml so all child projects would inherit it):
<properties>
  <sonar.host.url>http://YOUR_SERVER:9000</sonar.host.url>
  <sonar.jdbc.url>jdbc:derby://localhost:1528/sonar</sonar.jdbc.url> 
</properties>