Friday, December 03, 2021

JAXB processing of an XSD, building with Gradle

 


// -----------------------------------------------------------------
// Generate the domain classes from the original project XSD
// -----------------------------------------------------------------
project.ext {
jaxbTargetDir = file("src/generated/java")
}

configurations {
xsd2java
}

dependencies {
xsd2java "com.sun.xml.bind:jaxb-xjc:3.0.2"
xsd2java "com.sun.xml.bind:jaxb-impl:3.0.2"
xsd2java "com.sun.xml.bind:jaxb-core:3.0.2"
xsd2java "com.sun.activation:jakarta.activation:2.0.1"
xsd2java "jakarta.xml.bind:jakarta.xml.bind-api:3.0.1"
}

task xsd2java() {

doLast {
jaxbTargetDir.mkdirs()

ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xsd2java.asPath)
ant.jaxbTargetDir = jaxbTargetDir

ant.xjc(
destdir: '${jaxbTargetDir}',
package: 'dk.project.domain.service.request',
schema: 'src/build-resources/project.xsd'
)

ant.xjc(
destdir: '${jaxbTargetDir}',
package: 'dk.project.domain.service.response',
schema: 'src/build-resources/project.xsd'
)

}
}

compileJava.dependsOn xsd2java

Friday, November 26, 2021

Python UUID and bytes encode decode

It's been a while, I've ventured into the Python world, it's a new beginning.

This piece of code should visualize the UUID generated object converted into different forms and output as a string to the console

Wednesday, May 23, 2012

Get a handle for your NAS

As my kids are growing they need to have easy access to a PC, so they got my old equipment. To be honest, it is crap and I would have dumped it, if I'd had the money. They are glad they have their own Personal Computer in their room, I'm glad I have my own to myself :)

But then you start getting a vast amount of scattered data, all over different systems, and it all gets really messy. "Hmm, where did I put that? I know I have it somewhere, Damn! now I have to look through every PC.."
No!, now I got myself a NAS(Network Attached Storage) and it will, over time, contain all the important stuff: pictures, music, videos.. etc.
And all my, different OS, machines will have access to this central unit. I mean, WinXP, Win7, Ubuntu "whatever version", Android telephones aso.

For myself I will now store the information of getting a handle on the NAS, and I leave this here on my blog, so to always get at it in an easy way :)

Mount your network storage.

CIFS(Common Internet File System):
Temporary mount
sudo mount -t cifs -o user=joke //ip.address/somefolder /media/somefolder

Mount permanently, add this line in the /etc/fstab file:

//ip.address/somefolder /mnt/somefolder cifs credentials=/folder/.creds,_netdev,uid=client_user,gid=users 0 0
And the .creds file should contain your credentials of course :)

username=server_user
password=passw 




Tuesday, August 17, 2010

Harddisk recovery and how I helped a friend

My neighbor came over with a big problem. On a vacation he managed to wipe his PC clean, and the biggest problem was the dissapearence of the tons of photos from the trip.

I knew I had used a program previously to recover one of my own hard drives, that had the accident to suffer the same fate. But I was not able to remember what the program was called.
Searching for the phrase "harddisk recovery linux", gave a lot of results, but I had no clue of what to click.
After a while I found "TestDisk" which is the best I have ever come across.
I remember the last time I used it I donated around 20USD because I was so happy.

Monday, March 17, 2008

My *Updated* Ubuntu - must have list -

It's been a while now, and I've upgraded a few times since my last list entry. Now I'm on "Hardy Heron", that means a lot of the previous must haves are included, and I need to re-visit my must haves, for a complete Ubuntu OS.

List of Software that I have installed on top of the standard Desktop Ubuntu installation :

1. Kino, video editing. <- Still on top
2. Codecs for various music and video formats, they get installed when needed.
3. css2, for playing DVD's.
4. Pan, Newsreader.
5. Picasa from Google, Yes they made a linux one.
6. GParted, Gnome Partition editor, great for your external harddisks or USB sticks.
7. GLabels, great for name labels or cd covers..
8. abcde, the CD ripper, that generates the aac files correctly.

An this list will probably extend over time...

Sunday, January 13, 2008

Try out a different linux distro using vmware.

I would like to have an extremely basic linux system, with a simple desktop and a browser, which supports all the different plugins the new web needs. This means java, flash, adobe reader, quick time and everything else web related.
I've found a few minimalistic linux distributions, but the problem is burning every single one of them to a CDRom. Then trying them out by rebooting, it was too much of a pain.
I found out that, it's not nessecary, when you 've got wmplayer installed.

Just get a clean vmx file like this one:

#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "4"
scsi0.present = "TRUE"
memsize = "256"
ide1:0.present = "TRUE"
ide1:0.fileName = "~/cdrom/yourcdrom.iso"
ide1:0.deviceType = "cdrom-image"
floppy0.present = "FALSE"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "LiveCD"
guestOS = "otherlinux"
nvram = "otherlinux.nvram"

insert your filename.iso instead of the one in this template.
Start it with vmplayer, and off you go...

Get vmplayer here:
http://www.vmware.com/download/player/open_source.html

Monday, April 30, 2007

New WIFI adapter NETGEAR wg311v3

I've setup a Ubuntu PC for my 5 year old daughter. She want's to play games aso.
But because I don't wanna have cables lying around, and don't wanna drag another cable from the cellar to the first floor, I decided to buy a wireless pci card.

Fine I bought the cheapest I could possibly find in one of those electronic retail stores here in DK.

A 'NETGEAR' 'WG311v3' it was, and what a mess I ended up having. Linux or Ubuntu is not mature when it comes to WIFI and encryption, but kubuntu seems a lot better at this point. For Ubuntu you'll have to go through a number of howtos aso., but it'll still be messy.

First I had to use ndiswrapper, which is apparently a tool to wrap the windows drivers to be used within Linux (ubuntu).

~$sudo ndiswrapper -i $SOMEDRIVER$.INF

Then I had to remove all encryption from my wireless router, to test that I got a connection.
After that I fumbled with kwlan and wpa_supplicant, which should make me able to have wep encryption on my connection, I abandoned kwlan, and rushed back to networkmanager instead.

This last step was very time consuming, because I'm no nux-wizz, and I'm not familiar with starting up 'services' from boot. But in the end I found that command that did the trick :)

~$sudo ndiswrapper -m

Makes ndiswrapper start every boot.

Hope this link is helpfull in the future, it's about security: http://ubuntuforums.org/showthread.php?t=202834