Wednesday, May 12, 2010

Java in Python : JPype on Ubuntu Lucid

sudo apt-get install python-jpype openjdk-6-jdk
sudo update-java-alternatives -s java-6-openjdk

from jpype import *

startJVM("/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server/libjvm.so", "-ea")

java.lang.System.out.println("Hello World")

shutdownJVM()

KDE okular html links -> firefox

Use firefox instead of konqueror for html links in pdfs viewed in okular:

System settings -> Advanced -> File associations

Type in html in the search field and move firefox above konqueror for all html like content.

Have a lot of fun!

Friday, May 7, 2010

MySQL server on Ubuntu or debian

To setup a mysql server on my ubuntu 9.10 box, I followed this guide:

http://library.linode.com/databases/mysql/ubuntu-9.10-karmic

But connecting from another host gave me the following error:

$ mysql -u mysqluser -p --host=myhost.com

ERROR 2003 (HY000): Can't connect to MySQL server on 'myhost.com' (111)

http://dev.mysql.com/doc/refman/5.1/en/access-denied.html

The above link indicates this is a network error.

http://www.aboutdebian.com/database.htm

Referring to the above link, I found to enable access I needed to edit /etc/mysql/my.cnf, specifically, change the bind-address from 127.0.0.1:

#bind-address = 127.0.0.1
bind-address = myhost.com

and restart mysqld:

$ /etc/init.d/mysql restart


Other useful MySQL links:

Adding users, etc.

MYSQL Docs - Access Privilege System

MySQL and SSL