home / blog

Category Archives: geek

ImageMagick darkening Grayscale PNGs

When converting or mogrify-ing images I’ve noticed grayscale PNG files are far darker than originals – mid-grays become almost black. It turns out ImageMagick tries to set to PNG8 based on image content even if the file was previously PNG24 … Continue reading

Posted in geek | Leave a comment

Waiting for EBSs/WARs in JBoss to deploy using gradle / twiddle

Some home development for an issue at work… Often integration tests fail because the ESBs/WARs fail to deploy, we’d like early warning of this. The ESBs/WARs are deployed into a JBoss instance using gradle. The deployment gradle script can be … Continue reading

Posted in geek | Tagged , | Leave a comment

Unmarshalling JAXB entities from SOAP wrappers

Extracting JAXB entities from inside SOAP wrappers can be done without string-chopping using standard APIs. Example: using standard API. String example = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header /><soapenv:Body><ns2:farm xmlns:ns2=\"http://adamish.com/example/farm\"><horse height=\"123\" name=\"glue factory\"/></ns2:farm></soapenv:Body></soapenv:Envelope>"; SOAPMessage message = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(example.getBytes())); Unmarshaller unmarshaller = JAXBContext.newInstance(Farm.class).createUnmarshaller(); Farm … Continue reading

Posted in geek | Tagged , , | 2 Comments

Marshalling JAXB entities into SOAP wrappers

SOAP envelopes can be added to existing org.w3c.dom.Document or JAXB instances easily. Farm farm = new Farm(); farm.getHorse().add(new Horse()); farm.getHorse().get(0).setName("glue factory"); farm.getHorse().get(0).setHeight(BigInteger.valueOf(123)); Example: using standard API Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Marshaller marshaller = JAXBContext.newInstance(Farm.class).createMarshaller(); marshaller.marshal(farm, document); SOAPMessage soapMessage = MessageFactory.newInstance().createMessage(); … Continue reading

Posted in geek | Tagged , | Leave a comment

13.04 Mythtv with minimal ubuntu desktop upgrade

Yes… I know about mythbuntu, however I prefer to roll-my-own and use the a standard minimal ubuntu-desktop for consistency, and also use netflix / chrome from the media-centre PC. # pre-setup # – backup home, etc and mysqldump # – … Continue reading

Posted in geek | Tagged , , | Leave a comment

Oracle 11g XE on Ubuntu 12.10

# dependencies sudo apt-get install alien libaio1 unixodbc # install unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip -d oraclexe cd oraclexe/Disk1/ sudo alien –scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm sudo dpkg –force all –install oracle-xe_11.2.0-2_amd64.deb # requirements for setup sudo ln -s /usr/bin/awk /bin/awk¬† sudo mkdir -p /var/lock/subsys … Continue reading

Posted in geek | Tagged , | Leave a comment

Canon powershot SX110 remote control

It seems the remote control functionality for the powershot SX110 on MacOS X 10.7.5 has been broken for quite some time now. I stumbled across an open source project gphoto2 also offering remote control functionality. sudo port install gphoto2 gphoto2 … Continue reading

Posted in geek | Tagged , , , | Leave a comment

Cannot add tomcat7 server in eclipse 4.x [solved]

rm workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.server.tomcat.core.prefs rm workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs # restart eclipse

Posted in geek | Tagged , , , | Leave a comment

Touchpad not working on keysonic ACK 540 RF [solved]

The trackpad/touchpad on my keysonicACK 540 RF although the keyboard worked fine. So did lots of debugging with dmesg, udev, xev, research on forums etc… Turned out the batteries were just low, such that the keyboard worked but the mouse … Continue reading

Posted in geek | Tagged , , | 1 Comment

Installing adobe-reader on Ubuntu 12.10 – 64bit

wget http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.3/enu/AdbeRdr9.5.3-1_i386linux_enu.deb dpkg -i –force-all AdbeRdr9.5.3-1_i386linux_enu.deb sudo apt-get -f install

Posted in geek | Tagged , | Leave a comment