Ghostscript: **** Unable to open the initial device, quitting.
6th October 2008The above error message has been greeting me when creating PDF's with Ghostscript on a Solaris box and does need some translation. If you are directing output to a real printer, I suppose that it is sensible enough: nothing will happen unless you can connect to it. It gets a little less obvious when associated with PDF creation and seems to mean that the pdfwrite
virtual device is unable to create the specified output file. A first port of call would be to check that you can write to the directory where you are putting the new PDF file. In my case, there appears to be another cause, so I'll have to keep looking for a solution.
Update: I have since discovered the cause of this: a now defunct TEMP assignment in the .profile
file for my user account. Removing that piece of code resolved the problem.
A way to combine PDF files in UNIX and Linux
4th October 2008My latest adventure in the world of computing has led me into the world of automated PDF generation. When my first approach didn't prove to be completely trouble-free, I decided to look at the idea of going part of the way with it and finishing off the job with the open source utility Ghostscript. It is that which got me thinking about combining bookmarked PDF files and I can say that Ghostscript is capable of producing what I need as long it doesn't generate any errors along the way. Here's the command that does the trick:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=final.pdf source_file1.pdf source_file2.pdf
The various switches of the gs
command have very useful roles with dBATCH
ensuring that Ghostscript shuts down when all is done, dNOPAUSE
removing any prompts that would otherwise be given, q for quiet mode, sDEVICE
using Ghostscript's own PDF creation functionality and sOutputFile
creates the output file, stopping Ghostscript from sending it to its default stream. All of this applies to Windows Ghostscript too, though the name of the executable is gswin32c for 32-bit Windows instead of gs
.
When it comes to any debugging, it is useful to consider that Ghostscript is case-sensitive with its command line switches, something that I have seen to trip up others. I am getting initial device initialisation, so it strikes me that dropping some of the ones that reduce the number of messages might help me work out what's going on. It's a useful idea that I have yet to try.
There is also online documentation if you fancy learning more, and Linux.com has an article that considers other possible PDF combination tools as well. All in all, it's nice to have command line tools to do these sorts of things rather than having to use GUI applications all the time.
Interrogating Solaris hardware for installed CPU and memory resources
2nd October 2008There are times when working with a Solaris server that you need to know a little more about the hardware configuration. Knowing how much memory that you have and how many processors there are can be very useful to know if you are not to hog such resources.
The command for revealing how much memory has been installed is:
prtconf -v
Since memory is often allocated to individual CPU's, then knowing how many are on the system is a must. This command will give you the bare number:
psrinfo -p
The following variant provides the full detail that you see below it:
psrinfo -v
Output:
Status of virtual processor 0 as of: 10/06/2008 16:47:54
on-line since 09/13/2008 14:47:52.
The sparcv9 processor operates at 1503 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 1 as of: 10/06/2008 16:47:54
on-line since 09/13/2008 14:47:49.
The sparcv9 processor operates at 1503 MHz,
and has a sparcv9 floating point processor.
For a level intermediate between both extremes, try this to get what you see below it:
psrinfo -vp
Output:
The physical processor has 1 virtual processor (0)
UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x34 clock 1503 MHz)
The physical processor has 1 virtual processor (1)
UltraSPARC-IIIi (portid 1 impl 0x16 ver 0x34 clock 1503 MHz)
position: static?
12th September 2008CSS positioning seems to be becoming a nightmare when it comes to IE6 support. While I am aware that the likes of 37signals have stopped making their products work with it, there remain plenty of people who stick or are stuck with the old retainer. I am one of the latter because of the continued use of Windows 2000 at my place of work, though a Windows Vista roll-out has been mooted for a while now. If nothing else, it keeps me in the loop for any inconsistencies that afflict the display of my websites. Positioning of an element within the browser window rather than within its parent element is one of these, and it looks as if specifying a position of relative in a stylesheet is part of this. Apparently, it could be down to its non-triggering of IE's haslayout
property. Though it might be a hack, I have found that static positioning has helped. While I'll continue to keep my eye out for a better solution if it exists, the static option seems to have no detrimental effect in IE7, IE8, Firefox, Safari, Chrome or Opera.
Dean's FCKEditor for WordPress plugin, a wish list
8th September 2008Admittedly, I have a liking for FCKEditor over and above what comes as standard with WordPress. Here, the FCKEditor for WordPress plugin has been addressing my preference for a while now. However, its most recent release dates from last April and its integration with WordPress 2.6.x has been leaving a lot to be desired. In that vein, I have decided to collect a few of them here:
- Automatic saves: the idea behind this feature of WordPress is that you aren't hitting the save button that often at all. In fact, given that hitting save creates a revision and an extra record in your database, it really isn't something that you should be doing very often anyway. Unless, you don't mind a bloated database, it's probably best to avoid that habit of saving every few minutes like I do when using Word.
- Word count: this doesn't update without saving a revision, while it should update periodically in a manner akin to the automatic saves.
- Insertion of media such as images: this is just broken, and it takes away the possibility of having galleries and captions without manual work.
What I have above are the major inconsistencies, but there have always been annoyances like the adding unwanted entities allover the place, probably a habit of FCKEditor itself anyway. Nevertheless, it's the integration work that really shows the lack of attention. Maybe, it's time to move Dean Lee's labour of love over to a fully community-maintained course of development. While I know that it's difficult to see your "baby" leave you and take flight, I am inclined that it's the best way forward when you consider how rapidly WordPress has been changing over the last year. Though some moves have been made towards this, they really do need to go further.
Things that I like about VirtualBox OSE
6th September 2008Now that VirtualBox 2.0 is out with its 64-bit operating system support among other things, the version included in Ubuntu 8.04, OSE 1.56, is looking that bit older. Nevertheless, there remains a lot to like about the version that I have been using.
For one thing, its Shared Folders functionality doesn't trip up Photoshop Elements like VMware does. VMware so hobbled Photoshop's ability to save back to the Linux file system that it had me looking at the WINE route; I also got to use GIMP for a while. VirtualBox brought me back into the Photoshop fold, and I seem to like the results that I can get with Elements better than those from GIMP.
Another nicety is the way that guest OS desktops can be resized to fit in a maximised VM window. For this to work, you need VirtualBox Guest Additions in place in the virtual machine, but it works very well when all is in place; my experience is with Windows XP. Full screen is on tap too once you use the Host+F combination; the right hand control key is usually the Host key by default. If there is any criticism at all, it might be that seamless application windows are not available in OSE 1.5.6.
Linux kernel changes can upset things, but drivers don't take too long to appear, and you can always take matters into your own hands anyway. It's a far cry from the blithe indifference of VMware and the need to resort to vmware-any-any
patching to get things under way again.
All in all, VirtualBox OSE treats me very well. Guest operating systems may seem sluggish at times, but it's never enough to annoy or seriously impede usage. It'll be interesting to see if a newer version of VirtualBox makes it into Ubuntu 8.10.
Removing files for which you have no write access from the GNOME Wastebasket in Ubuntu 8.04
2nd September 2008It might be that GNOME contains a small trap awaiting the unwary: moving files for which you have no write permissions to the Wastebasket using Nautilus. This happened to me in Ubuntu 8.04 which meant that I couldn't clear the Wastebasket using the normal means. To resolve the situation, I thought of finding where the Wastebasket in the normal file system, and that isn't as easy as it might be. One place to look is ~/.Trash
, but I didn't have that at all because the location in Hardy Heron is ~/.local/share/Trash/Files
. Armed with this knowledge, I turned to the command line and performed the required erasure using sudo. It was all over soon enough once I knew where to look.
A radical new look on the way for WordPress' administration area
31st August 2008One thing that you can never say about Automattic is that it stands still for very long. That may generate adverse commentary from some, yet it's bad to leave things stagnate, too. In fact, resting on laurels also generates flak, so you can't please everyone all the time.
Earlier on this year, the WordPress administration screens went through something of an overall for version 2.5. In hindsight, it wasn't terribly dramatic, but the prospect had me checking out what was happening with the development version and contributing to the project in my own small way. Now, it appears that a bigger upheaval is in prospect with wireframes and what not being brought into play on the design side.
The first change that anyone will notice is that the navigation has moved from the top to the side, and that some things have been moved around and renamed. Another thing that you'll see soon enough is that there is a QuickPress section added to the dashboard screen for those quick and short postings. Sticking with the subject of content creation, alterations to post and page editing screens and the link creation screen are obvious too. The thing that really comes to mind here is the level of customisation on offer, so you can make yourself feel right at home: some of the screen furniture can be moved about, and you can remove what you feel is nothing but useless clutter. Content generates comments, so the addition of keyboard shortcuts for comment moderation should be a boon for those with very active readers.
Some functionality currently added by plugins is getting incorporated in the main application. An example is automatic upgrades of WordPress itself. In the development version, it installs the latest nightly build, but I am certain that it can be made to point to the latest stable release. That makes it more convenient for keeping a backseat eye on things rather than getting stuck into the hurly-burly of checking on what's in Subversion.
There are some pieces that remain incompletely functional at present, such as the Inbox and Media added to this post pieces, but I have seen nothing that used to work to be broken. So, while the development version of WordPress is more of a work in progress than I have seen for a while, it will do what you need it to do. Since you always need to be cautious, I'd advise you to keep away until it's ready for the big time, unless you have the knowledge to put things back should the undesirable befall your blog. I had an automatic WordPress update kick in maintenance mode without turning it off again. Nothing happened to the database, so a manual re-installation was all that was required to restore order. Otherwise, the development installation remains relatively stable, though there are display problems in IE6 that do not afflict either Firefox, Opera or even IE8 Beta2.
All in all, these changes will make the next major WordPress release a substantial one, and I have little doubt that the new administration interface will make for many comments. While I must admit that I wasn't too taken with it when I first glimpsed it in the crazyhorse
branch, it now seems to be growing on me. The most significant change on the aesthetic front is that there's a lot less whitespace, about which may or may not float your boat. In any event, you can always change the colours like I have to make things more amenable.
Even so, I reckon that WordPress 2.7 will be a major step forward when it comes, one that I might like. Saying that, I reckon that the release date is a good while away for now, and the fact that 2.6.2 is being readied for release is telling in itself. Leaving plenty of time to remove any roughness is never a bad thing, especially so when you see the changes that are being made. Meanwhile, I am certain that most people can wait.
Another way to look through WordPress code
10th August 2008At times in the past, I have complained about there not being sufficient documentation of the actual code used on WordPress itself. True, there is the venerable Codex, but that can be incomplete, and any extra help is always useful. Peter Westwood (a.k.a. westi) has generated documentation from the code itself and put it up on the web for all to peruse. While we are on the subject of information on the more advanced aspects of WordPress, blogs by Mark Jaquith and Andrew Ozz are also worth a look. As the cliché goes, every little helps...
A quick way to do an update
8th August 2008Here's a quick way to get the latest updates on your PC using the command line if you are using Ubuntu or Debian:
sudo apt-get update && sudo apt-get upgrade
Of course, you can split these commands up if you prefer to look before you leap. At the very least, it's so much slicker than the GUI route.