January 30, 2010 0

Migrating from Serendipity (s9y) to WordPress

By Max in Java

I migrated this blog from from Serendipity (s9y) to WordPress.

It turned out to be pretty simple to import s9y posts to WordPress with the s9y importer, but making sure the old links to posts and feeds turned out to be a bit trickier.

I found a blog post that outlined how to use .htaccess to solve some of these problems, but it included manually having to figure out which id’s that had become skewed during the import process. Luckily the SQL schema of both s9y and WordPress is pretty similar and easy to do queries against to generate matching .htaccess lines.

The following SQL queries is what I used to create a working .htaccess file for my migration, use at your own risk ;)

SQL for posts:

SELECT CONCAT( "RewriteRule ^archives/", s9.id,
"\-.*.html$ /index.php?p=", wp.id, " [L,R=301]" )
FROM `serendipity_entries` s9, wp_posts wp
WHERE wp.id != s9.id
AND wp.post_parent=0
AND s9.title = wp.post_title
ORDER BY s9.id

SQL for category feeds:

SELECT concat("RewriteRule ^feeds/categories/", s9y.categoryid,
 "\-.*.rss$ /index.php?cat=", wp.term_id, "&feed=rss2 [L,R=301]")
FROM `wp_terms` as wp, serendipity_category as s9y
where name = category_name

SQL for category:

SELECT CONCAT( "RewriteRule ^categories/", s9y.categoryid,
 "\-.*$ /index.php?cat=", wp.term_id, "[L,R=301]" )
FROM `wp_terms` AS wp, serendipity_category AS s9y
WHERE name = category_name

Once you have the output from these insert them into the following .htaccess file:

RewriteEngine On
RewriteBase /

## skewed articles
[Insert output for Posts]

## categories
[Insert output for Categories]

## category feeds
[Insert output for Categories feeds]

## handle defaults
RewriteRule ^archives/([0-9]+)\-.*.html$ /index.php?p=$1 [L,R=301]
RewriteRule ^archives/([0-9]{4,4})/([0-9]{2,2}).*.html$ /index.php?m=$1$2 [L,R=301]
RewriteRule ^archive$ / [L,R=301]
RewriteRule ^feeds/index.rss2$ /index.php?feed=rss2 [L,R=301]
RewriteRule ^feeds/index.rss1$ /index.php?feed=rss [L,R=301]
RewriteRule ^feeds/index.rss$ /index.php?feed=rss [L,R=301]
RewriteRule ^feeds/index.atom$ /index.php?feed=atom [L,R=301]
RewriteRule ^plugin/tag/(.*)$ /index.php?tag=$1 [L,R=301]
RewriteRule ^categories/(2)\-.*$ /index.php?cat=3 [L,R=301]

With that in place in the root of your WordPress installation those using your old s9y links should now be redirected automatically to the matching WordPress posts/feeds/categories.

Another useful post I found were about how to move WordPress between domains, which I needed because I intially installed it on wordpress.xam.dk but needed it to end up on blog.xam.dk and apparently WordPress thinks it is a good idea to stored absolute url’s in its settings.

Now if I could just find a WordPress theme that were both beautiful, simply and functional…still searching..

May 24, 2008 1

Rant about international airports, especially Geneva

By Max in Work at JBoss

The last 3-4 years I’ve been travelling alot to and from Switzerland and especially Geneva Airport.

I normally always take a trolley for my suitcase and carry on luggage since I realized that it makes my long flights much smoother not having strained my back or feet with moving around bulky and semi-heavy luggage (and no, four-wheeled luggage does not help since I still have to carry my carry on bag).

But lately Geneva did the most annoying thing. They started requiring you to put 2 CHF in to get a trolley.

I understand the reasoning about it since the airport probably feel that it is cheaper to let their customers put back their trolley instead of paying personel to pick them up.

But seriously, how many international passengers arriving in the airport will have an actual swiss franc coin in their pocket ? Bill notes maybe, but not coins! And even you have a coin you can’t get it back when you reach the “No trolleys allowed signs” since Geneva airport never bothered putting up trolley stations inside the airport where you can get your 2 CHF back!

End result: Tired international passengers will have to carry their luggage since they don’t have the coins, and local swiss passengers that have the 2 CHF will still leave the trolleys left and right since there are no sane place to get the 2 CHF back again….I guess those 2 CHF is now a tip for the personel Geneva airport couldn’t let go since there is still work for them to move the left over trolleys back to their origin.

Rant over – now ill continue wait for my flight ;)

January 16, 2008 6

This category is moving to in.relation.to

By Max in JBoss Tools and devstudio

In the future i’ll put my blogs about JBoss Tools/Developer Studio and related at in.relation.to.

First entry is already there, an updated version of “Making Eclipse look good under Linux”, see it here.

November 29, 2007 0

JBoss Tools & Developer Studio at JavaPolis

By Max in JBoss Tools and devstudio

JavaPolis is getting near and this year I’ll finally have time to go to it – yay!

If you want to hear about JBoss Tools and Developer Studio (or just meet up and try out the belgium beer) then come meet me in the JBoss/Red Hat booth or catch me listening in on some of the presentations that are related to the tooling:

Seam In Action with Pete Muir et.al.

Intro to Richfaces and JBoss JSFUnit with Stan Silvert.

See you there.

November 15, 2007 1

Jing – the best tool for reporting bugs for any UI!

By Max in Java

Jing is a tool for grabbing screenshots and screencasts on Windows and Mac.

That does not sound so new and exiting until you actually try and use Jing.

They made it so easy to do the screenshot and screencasts that everybody can do it without spending any more time than it takes to actually do the act you want to record.

Furthermore they provide a one-click sharing facility so the only thing you have to do is to paste the automatic generated url into your favorite products issue tracker to be able to let everyone see what the bug is about.

Jinq does not have many editing facilities so you can’t fix any stupid mistakes you did for e.g. a demonstration (I currently use Wink for that), but for quick’n'dirty grabbing a screenshot or recording a screencast nothing gets close to the ease and use of Jing!

I’m definitly going to recommend it to anyone that want to easily show a bug (or a cool thing) in JBoss Tools or JBoss Developer Studio.

Update: I realized I had written jinq instead of jing. That is now fixed ;)

November 14, 2007 0

Red Hat Developer Studio Candidate Release

By Max in JBoss Tools and devstudio

The candidate release of Red Hat Developer Studio is now available over at Red Hat.

The major news in this release is Seam 2 support together with over 300+ fixes and enhancements.

You can read more about those in the New and noteworthy pages.

Below is a small video, demonstrating the quick and easy setup of a Seam project in Red Hat Developer Studio.

November 8, 2007 30

Making Eclipse look good on Linux

By Max in Java

I have been bothered a long time by the “clumsy” look that Eclipse has on my Fedora box compared to how it looks on Windows and Mac.

Eclipse 3.3 running on Windows XP

Windows Sample

Eclipse 3.3 running on Fedora 6 (but looks very similar on other distros)

Windows Sample

Notice that the font size is bigger ( 10 vs 8 ) and that there is alot of extra spacing between elements (The package tree and problem view is much more compact on windows).

I tried changing the GTK themes but the issue prevailed – the themes doesn’t seem to adjust the fonts only the component “look”.

But with some help from my Red Hat friends on our tech-list I got some tips and ended up getting close.

The tweaks

Install Red Hat Liberation fonts which are free/liberated Windows fonts available for any OS and readily available in Fedora’s repositories so they are very easy to install via yum.

After they are installed I ran gnome-font-properties and used the following settings:

Application/Document/Desktop font: Liberation Sans, size 8
Window title font: Liberation Sans Bold, size 10
Fixed with font: Liberation Mono, 10

Font rendering: Best contrast (the others left weird artifacts, but mostly up to taste here I think)

Under details:
Resolution: 99 dpi (to avoid the letters to get too close, need at least 1 px between them ;)
Smoothing: Grayscale

Hinting: Full

Depending on your Eclipse font settings the above will be enough, but if you already have tweaked some settings remember to check your Font settings under Eclipse preferences and verify that you are actually using the System default or the Liberated fonts to get the smoother more compact look.

Eclipse 3.3 with Liberation font + tweaks

Windows Sample

Much better, but unfortunately GTK still thinks it needs to have 1-2 extra pixels between components. If anyone knows any tips on how to reduce that wasted space then please leave a comment ;)

(Now I just need to figure out how to get this more compact look into the distro…;)

October 25, 2007 3

Eclipse The Memory Hog – resolved!

By Max in Java

A couple of months back I made a blog entry about Eclipse and its memory settings. I wrote it because so many people complained that even when they put memory flags in their eclipse.ini Eclipse was still a memory hog and it crashed all the time. The entry blog explains how fragile eclipse.ini is and how to write it correctly and verify that it is picked up correctly.

That helped many, but suddenly I was starting to see more and more blogs, jira issues, forum postings, phone calls, personal assaults etc. about Eclipse memory usage sucking and our users started having memory issues with the latest builds and releases of JBoss Tools.

Why were so many seeing memory issues on a release that actually should use less memory than the previous one ?

As it turns out, on top of the issues with eclipse.ini from my previous entry, Eclipse 3.3.1 introduced a major bug in parsing the settings in eclipse.ini that resulted in PermGen memory settings not being set correctly on Sun Java VM’s!

Result: Eclipse 3.3.1 runs “fine” at first, but as soon as you start having larger projects and/or using additonal plugins you are bound to get OutOfMemoryExceptions!

Thankfully eclipse.org is now in the process of doing a respin of Eclipse 3.3.1 and the first build is now available for testing.

So what do you do if you like your Eclipse 3.3.1 and don’t want to try the build from above ?

You have a couple of options:

  • Use the *exact* settings described in my previous blog – they are not affected by the Eclipse 3.3.1 bug
  • Use Red Hat Developer Studio which automatically uses the settings described in my blog
  • Use another VM, only Sun’s and Apple’s VM requires the PermGen setting; IBM’s and JRockIt JVM allocates PermGen space dynamically
October 17, 2007 3

Visual Page Editor updated – now with MacOSX support

By Max in JBoss Tools and devstudio

We now got nightly builds for JBoss Tools that uses the Eclipse 3.3 compatible XULRunner from Eclipse ATF/Mozilla.org instead of our older version of Mozilla in the Visual Page Editor (VPE).

So, what does this mean for our users ?

  1. VPE will use less resources on windows since we don’t have to load Mozilla twice
  2. VPE won’t crash your Eclipse on Linux because you tried to use the internal browser in Eclipse or did code completion with Java doc context help enabled
  3. VPE will now work on Mac OSX!

So in short everybody wins !

Note that this is very new and fresh (especially the Mac OSX support is experimental) so any feedback you can provide on things that breaks or is erroring will be very much welcome in our jira or forum! (we would also like to hear if it just worked ;)

Thanks goes out to Sergey Vasilyev (Exadel) and his team on doing the development for this, Phillipe Ombredanne (NexB) and the ATF team for making the XULRunner available in a standalone version and to Marshall Culpepper (JBoss) for getting our build adjusted! Thanks again!

October 8, 2007 0

Red Hat Developer Studio Beta2 released

By Max in JBoss Tools and devstudio

We made Red Hat Developer Studio 1.0.0.beta2 available at
http://www.redhat.com/developers/rhds/index.html

Red Hat Developer Studio is a set of eclipse-based development tools that are pre-configured for JBoss Enterprise Middleware Platforms.

It currently bundles JBoss EAP 4.2, Eclipse 3.3, latest JBossTools plugins plus other plugins relevant for JBoss development.

Whats new and noteworthy for Red Hat Developer Studio (and JBoss Tools) can be found at
http://docs.jboss.org/tools/whatsnew/