Category Archives: Computers

pkexec not found workaround

I’m setting up an old and slow laptop (EeePC 701) as mainly a console-only machine, but I do have XFCE4 on there for my kid to play around with, which he has to start with startx.

I don’t have policy-kit installed, so when he tries to launch Synaptic, XFCE freezes up. The output on the console says pkexec was not found.

Instead of installing pkexec and policy-kit, I just symlinked gksudo to pkexec.

sudo ln -s /usr/bin/gksudo /usr/bin/pkexec

Problem solved.

Posted in Computers | Leave a comment

How to Flip All of XOrg Upsidedown

I recently hung an old iMac upsidedown from the ceiling to be used as a media center. It’s out of reach of the kids, but I needed to flip the video upside down. Since I am using Linux, I needed X11 to be inverted.

Upside Down Mac
Upside Down Mac

 

It ended up being really easy.

1) Generate an xorg.conf file:

sudo X -configure

(This is saved in ~/xorg.conf.new)

2) Copy the xorg.conf file to /etc/X11
sudo cp ~/xorg.conf.new /etc/X11

3) Restart X to make sure the conf file is good
sudo service kdm restart

(or sudo service lightdm restart, or whatever you’re using)

4) Edit /etc/X11/xorg.conf
Find the “Monitor” section and add this line:

Option "Rotate" "inverted"

5) Restart X11 again to apply the change. It should now appear upside-down

 

One shortcoming — If you have an built-in¬†video camera, this does not flip the video camera upside down too. Since this is a media center, they won’t be needing the video camera at the moment.

Posted in Computers, Projects, Something Interesting | Leave a comment

GeoServer GetLegendGraphic Fails With “Width (0) and height (0) cannot be <= 0"

I had a weird issue with WMS GetLegendGraphic requests failing with the following message:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://michael.mapfeeder.net:80/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"&gt ;<ServiceExceptionReport version="1.1.1" &gt ;<ServiceException>
java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
Width (0) and height (0) cannot be &amp;= 0
</ServiceException></ServiceExceptionReport>

This was weird because my request definitely included non-zero height and widths, like so:

/geoserver/wms?LAYER=parcel_area&REQUEST=GetLegendGraphic&FORMAT=image%2Fpng&STYLE=michael_test&WIDTH=20&HEIGHT=20

Eventually I tracked it down to an issue with the SLD xml. The XML was valid, but GeoServer didn’t like the use of CDATA tags inside of <Name>,<Title> and <ogc:Literal> tags.

So anywhere with formatting like this

<NamedLayer>
<Name>
<![CDATA[Parcel Area]]>
</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Name>
<![CDATA[ Low Density Residential ]]>
</Name>
...

had to be changed to

<NamedLayer>
<Name>Parcel Area</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Name>Low Density Residential</Name>
...

Once I got rid of the CDATA tags everything worked beautifully.

This issue was on GeoServer 2.5. YMMV, etc.

Posted in Computers, GIS Portfolio, Programming | Tagged , , , , | Leave a comment