Getting around the WordPress "add image" bug

WordPress currently has an annoying bug where you cannot add images easily using the in-built editor. Instead of a pop-up being shown with the image setting details, you are sent to another page.  Once you choose the image size etc, you go to a blank page. Until that’s fixed, there is a work-around.  It’s not exactly pretty but it does work. I have assumed you have uploaded your images to the media library first.

First, type up what you want your blog entry to say. The save it as a draft which is the button in the blue circle in the screenshot. Then click the “add image” icon which will bring up the warning to go to the image selection page. This page should be a pop up on the same screen but is not (and is the bug).


On the image selection page choose “Image library” which is the blue circle and edit the meta-data such as the name caption etc. Once you are happy with your decisions, click the “Insert into Post” button (red circle) which goes to a blank screen.

The blank screen actually does have data in it. You will need to view source which will show something like:


The stuff in the win.send_to_editor is what you want. You will also need to change the backslash-quotes to plain quotes, so the code I would use is


You then enter this information back into your post (click back a few times in your browser). Also, make sure you have your editor set for HTML and not Visual for it to work. With that small bit of HTML, I have a nice set of home-grown tomatoes, or whatever else you want.

Enhanced by Zemanta

Silly C errors in gjay

I have been working on Gjay to add support for [Music Player Daemon](http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki) where I had what initially looked like a strange problem. When WITH_MPDCLIENT was defined, the program would crash in all sorts of wierd places when the main program structure had this:

#ifdef WITH_MPDCLIENT
struct mpd_connection *mpdclient_connection;
#endif /* WITH_MPDCLIENT */

But would work fine when it was:

struct mpd_connection *mpdclient_connection;
#ifdef WITH_MPDCLIENT
#endif /* WITH_MPDCLIENT */

I tried changing the structure to just void *blah to see if it made a difference and it didn’t. The program would crash every time.

The answer was pretty simple in the end. The WITH_MPDCLIENT is defined in the file config.h and not every c source file was including it. Needless to say, they should! So half the program was using one version of the structure and the other was using another; no wonder the whole program was a mess because anything beyond this entry in the structure would be a few bytes out.

With that little insanity out of the way i can get back to making gjay work with mpd.

JFFNMS at RC2, ncurses at 5.8

After some reports back about [JFFNMS](http://www.jffnms.org/) 0.9.0rc1 I have now updated it to rc2. Thanks for all who gave me information about how it worked in YOUR setup.  I cannot be sure but I’d say the second RC will be the last until the release itself.

Sven has also given me the nod and ncurses 5.8 migrated into unstable.  We’ve had one report that the new version of ncurses might not play well with stfl (see #616711 ) but generally speaking it should work ok.

Finally, congratulations to the Debian project on [winning two categories at the Linux New Media Awards](http://www.debian.org/News/2011/20110304). It was especially good to hear the presentation by Karsten Gerloff who is president of the Free Software Foundation Europe.

## ncurses bug update
It seems that the ncurses bug is more serious and is to do with newwin() function in the library. If you get crashes when a program starts and its linked to ncurses 5.8 (even if it is not a Debian system) you may have this problem.

It doesn’t happen to all ncurses programs, as the stfl example code and mutt work ok.

Y9VW3CNYRFF6

Apache and incomplete redirection messages

As part of moving my site around, I needed a bunch of redirects so that http://enc.com.au/docs/linuxload.html now becomes because its now controlled by [Wordpress][]. so I used the [RedirectPermanent][] feature of [mod_alias][2.2 mod_alias] to do it with lines like:

RedirectPermanent /docs/linuxload.html /2010/07/manually_calculating_process_times/

So you come in on /docs/linuxload.html and redirect to the blog entry, simple really! It actually works, kinda, but the log files fill with things like:

[Fri Mar 04 14:40:17 2011] [warn] [client 172.16.242.1] incomplete redirection target of '/2010/07/manually_calculating_process_times/' for URI '/docs/linuxload.html' modified to 'http://enc.com.au/2010/07/manually_calculating_process_times/

What is going on? Why won’t Apache just be quiet and be happy? The reason is in the Redirect Directive documentation on the [2.0 mod_alias][] page:

> Also, URL-path must be a fully qualified URL, not a relative path, even when used with .htaccess files or inside of sections.

But I’m running Apache 2.2 and the [2.2 mod_alias][] page says:
> The new URL should be an absolute URL beginning with a scheme and hostname, but a URL-path beginning with a slash may also be used, in which case the scheme and hostname of the current server will be added.

That’s it, you two choices:

* Use relative urls and have Apache complain
* Use absolute urls and have a happy Apache

Changing the above config snippet to use absolute paths fixed it.

RedirectPermanent /docs/linuxload.html http://enc.com.au/2010/07/manually_calculating_process_times/

[2.2 mod_alias]: http://httpd.apache.org/docs/2.2/mod/mod_alias.html
[2.0 mod_alias]: http://httpd.apache.org/docs/2.0/mod/mod_alias.html
[RedirectPermanent]: http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirectpermanent
[Wordpress]: http://www.wordpress.org/

JFFNMS 0.9.0 release candidate 1 out

The next version of [JFFNMS](http://www.jffnms.org/) is nearing completion and is now at Release Candidate 1. Version 0.9.0 has a major amount of work in cleaning up and securing the code.

The majority of the work has been in the complete re-write of the engines that do the polling, autodiscovery and consolidation. The parent/child communication has changed as has the way the processes are forked.

On the front-end, the requirement to register globals has finally been removed, with the code explicitly specifying and sanitising the variables it requires. This will make it easier to debug problems and make the application webservers more secure.

Finally there is better support for High Capacity interface counters and some support for IPv6, meaning you can see how slow ipv6.google.com is from your place.

JFFNMS 0.9.0rc1 is available from SourceForge at