Zoneminder with Logitech C310

Bus 001 Device 002: ID 046d:081b Logitech, Inc. Webcam C310 # Add following line to /usr/bin/zmdc.pl $ENV{LD_PRELOAD} = ‘/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so’; sudo service zoneminder restart Capture method: V4Lv2 Format: PAL Palette: YUYV Width/Height: 640/480

JavaScript debug with Chrome / Eclipse

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome –user-data-dir=$(mktemp -d /tmp/chrome-profile-XXXXX) –remote-debugging-port=9222 Add this update site http://chromedevtools.googlecode.com/svn/update/dev/

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 or PNG32. This conversion is trigged by both convert and mogrify, e.g. image resizing with… Continue reading ImageMagick darkening Grayscale PNGs

Published
Categorized as geek

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 enhanced with the following to use twiddle.sh – a built in JBoss JMX client to… Continue reading Waiting for EBSs/WARs in JBoss to deploy using gradle / twiddle

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 farm = (Farm)unmarshaller.unmarshal(message.getSOAPBody().extractContentAsDocument()); Anti-example seen in the wild: string chopping / regex String example =… Continue reading Unmarshalling JAXB entities from SOAP wrappers

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(); soapMessage.getSOAPBody().addDocument(document); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); soapMessage.writeTo(outputStream); String output = new String(outputStream.toByteArray()); Anti-example seen in… Continue reading Marshalling JAXB entities into SOAP wrappers

Published
Categorized as geek Tagged ,

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 # – minimal install using mini.iso from https://help.ubuntu.com/community/Installation/MinimalCD # – install. select only open SSH server apt-get… Continue reading 13.04 Mythtv with minimal ubuntu desktop upgrade

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 sudo mkdir -p /u01/app/oracle/oradata sudo mkdir -p /u01/app/oracle/diag sudo touch /var/lock/subsys/listener sudo groupadd dba sudo… Continue reading Oracle 11g XE on Ubuntu 12.10

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 –auto-detect Model Port ———————————————————- Canon PowerShot SX110 IS usb:253,003 So far so good… gphoto2 –summary… Continue reading Canon powershot SX110 remote control