Skip to main content

Posts

Showing posts from 2008

MySQL 5.1 goes GA

I was quite surprised when I browsed dev.mysql.com and found that 5.1 was already on GA. There was no mention of this in the mysql.com site. It seems that they're holding off on the announcement until all the mirrors have it because some of the Asian mirrors still do not have it. Most of the US mirrors though have it. We'll be transitioning to this release to take advantage of partitioning.

iReport Default Date Parameter

If you want to set a default date for a jasperreports parameter, you can enter the following in the default value expression of the parameter. new Date() However, if you wanted the default to be relative from today, for example, 3 days ago, you will need to do go outside of the standard java date libraries (Date, Calendar) because JR parameter does not allow you to have multiple statements. You can write your own utility package or you can use Joda , a replacement library for the JDK date and time library. To use Joda in iReports, you need to extract the jar file and add it to Options -> Classpath. You may also drop the jar file in iReports' lib directory. You will also need to add this library to your application or report server. For setting a default date 5 days prior from today, use this: new org.joda.time.DateTime().minusDays(5).toDate() or this if you want the time part set to the beginning of the day: new org.joda.time.LocalDate().toDateTimeAtStartOfDay().minusDays(5).to

selective table restore from mysqldump

I recently had to restore a corrupted table that had resulted from a full disk. I had been using automysqlbackup as my backup script. Each database had a corresponding backup file. It would have been easy to use a text editor to edit out the tables that you didn't want to restore but this database had grown to 1G. STEP 1: Restore table structure If the table structure is corrupted, you need to retrieve the CREATE TABLE statements from the backup. To do this you can use grep: zcat backup.sql.gz | grep -A 20 'CREATE TABLE `tablename1`' > tablestructure.sql This command will create tablestructure.sql containing the CREATE TABLE statement and 20 lines after that. You may have to change the parameter from 20 to whatever to get the entire statement. Once tablestructure.sql had been edited to only contain the proper CREATE TABLE statement, you may now restore the table structure. mysql -u user -p dbname < tablestructure.sql STEP 2: Extract and restore the table data This co

Setting up Corporate Ubuntu Desktops

This guide has been updated for Ubuntu Hardy 8.04.1. The following is the official installation guide: https://help.ubuntu.com/8.04/installation-guide/i386/index.html The preseed method will enable a more automated install. You will want to enter the proxy a local apt-cacher server if you have one to speed up the updates and installs of new packages. Post Installation Tasks Updating and Installing Packages In Synaptic, configure proxy as needed. If you have an apt-cacher service running on the proxy server, it will make your updates much faster if the packages have already been downloaded by a prior machine. Click on Reload Click on Upgrade Install ubuntu-restricted-extras Install ttf-liberation Apply Configure Desktop to Remove Annoying Stuff In System -> Administration -> Login Window -> Accessibility, uncheck the sounds In System -> Preferences -> Sounds -> Sounds, uncheck Play System Sound to remove annoying sounds If you want to ch

Pentaho Quick Install

Pentaho has a preconfigured install package that can be used to evaluate the platform. The default install will only work if it is run on your own machine. There are two things that you'd want to do if you want others to test the platform. 1. Allow access from other machines on the LAN. You need to edit web.xml file located at %PCI%/jboss/server/default/deploy/pentaho.war/WEB-INF/web.xml where %PCI% is the folder where you uncompressed the Pentaho preconfigured install. Look for the string base-url. http://localhost:8080/pentaho/ Change the value into an IP address or the computer name that will resolve to it. 2. Change the default port 8080. Sometimes port 8080 is already being used by another application, possibly Tomcat. Pentaho has a web container using port 8080 that may conflict with the existing application. You need to edit server.xml located at: %PCI%/jboss/server/default/deploy/jboss-web.deployer/server.xml Look for the string 8080. Change the port number to your desired