Jan 30, 2009

activated my Terratec NOXON iRadio

Today I activated my NOXON iRadio with WLAN access.

The first trouble was, that the WLAN network was recognized, but the device could not
get a DHCP adress. The router was configured to only allow registered devices - I had not
thought on this.

After registering the device everything went smooth.

The volume could be a little better, but I'm really pleased.
The remote control is working and you can also configure the list on the internet, which is
downloaded by the device.

delegate administration rights on ZFS filesystems to users

The last days I found a link to the Sun Tech Days 2008-2009.
There I got to the labs and especially the LAB 9500.

The PDF document guiding through the lab had an interesting point.

It is possible to delegate the administration rights of a ZFS filesystem and the
descendants to an ordinary user ( who must know the command for zfs ).

First you can set for the user the actions he can do:

bash-3.2$ pfexec zfs allow ewer create,destry,snapshot,rollback,send,receive,mount rpool/export/home/ewer

View the allowed actions:
bash-3.2$ zfs allow rpool/export/home/ewer
Local+Descendent permissions on (rpool/export/home/ewer)
user ewer create,destroy,mount,receive,rollback,send,snapshot
Also the other parts about mirroring, raidz are interesting.

Jan 29, 2009

Updated Netbeans 6.5 with Patch 2 on Solaris 10 SPARC

Today I updated NetBeans 6.5 with Patch 2 on Solaris 10 SPARC.
Just started the update and one restart of the IDE was necessary.

IDE was back without any trouble for me.

Jan 27, 2009

Installing FindBugs/PMD on NetBeans 6.5

The Project SQE ( software quality environment ) contains the FindBug, PMD and CheckStyle as plugins for NetBeans to analyze the java source for possible bugs.

The update center for Netbeans is https://sqe.dev.java.net/updatecenters/sqe/updates.xml

Jan 24, 2009

How to avoid loosing removed files with dtrace

Today I red in the blog of c0t0d0s0.org from Joerg Moellenkamp about a DTrace-Hack.

He references another blog http://blogs.sun.com/bnitz/entry/anti_destruction_destructive_dtrace_script which uses the destructive mode of dtrace.
Everythime when a "rm" command is used, the dtrace-script takes a ZFS snapshot of the
filesystem to preserve the file which should be deleted.

Jan 23, 2009

Since Build 103 it is possible to snoop on loopback interfaces

With the Build 103 and the project clearview it is now possible to trace on
the loopback interface and also in zones as shown in the following blog:


Here is an example of a snoop on the loopback interface lo0:

# snoop -I lo0
Using device ipnet/lo0 (promiscuous mode)
localhost -> localhost ICMP Echo request (ID: 4577 Sequence number: 0)
localhost -> localhost ICMP Echo reply (ID: 4577 Sequence number: 0)

creating a virtual network with OpenSolaris Build 105 and PÖroject crossbow

The project crossbow allows to create a virtual network. Network Interface cards and also switches can be virtualized.

The key command is dladm:

The first step is to create a virtual switch:

# dladm create-etherstub sw1
# dladm show-etherstub sw1

The next step is to create virtual network cards two for zones and one for the global zone which are connected to the virtual switch:

# dladm create-vnic -l sw1 vnic1
# dladm create-vnic -l sw1 vnic2
# dladm create-vnic -l sw1 vnic3
# dladm show-vnic
vnic1 sw1 0 2:8:20:8b:5d:49 random 0
vnic2 sw1 0 2:8:20:aa:fc:60 random 0
vnic3 sw1 0 2:8:20:57:87:c1 random 0

All network interfaces are connected to the virtual switch sw1.

The two zones are configure to use the interface in exclusive IP mode:

bash-3.2$ zonecfg -z virt1 info
zonename: virt1
zonepath: /zones/virt1
brand: ipkg
autoboot: false
ip-type: exclusive
[cpu-shares: 10]
address nicht angegeben
physical: vnic1
defrouter nicht angegeben
physical: 300M
[swap: 500M]
name: zone.max-swap
value: (priv=privileged,limit=524288000,action=deny)
name: zone.cpu-shares
value: (priv=privileged,limit=10,action=none)
bash-3.2$ zonecfg -z virt2 info
zonename: virt2
zonepath: /zones/virt2
brand: ipkg
autoboot: false
ip-type: exclusive
[cpu-shares: 10]
address nicht angegeben
physical: vnic2
defrouter nicht angegeben
physical: 300M
[swap: 500M]
name: zone.max-swap
value: (priv=privileged,limit=524288000,action=deny)
name: zone.cpu-shares
value: (priv=privileged,limit=10,action=none)

Now we boot the zones:

# zoneadm -z virt1 boot
# zoneadm -z virt2 boot

After logging in the zone:

# zlogin -C virt1
[Verbunden mit Konsole für Zone 'virt1']

Hostname: virt1
Reading ZFS config: done.
Mounting ZFS filesystems: (5/5)

virt1 console login:

root@virt1:~# ifconfig vnic1
vnic1: flags=201000843 mtu 9000 index 2
inet netmask ffffff00 broadcast
ether 2:8:20:8b:5d:49

and now the second zone:

root@solewer:~# zlogin -C virt2
[Verbunden mit Konsole für Zone 'virt2']

virt2 console login: root
Jan 23 18:44:10 virt2 login: ROOT LOGIN /dev/console
Last login: Fri Jan 23 18:33:44 on console
Sun Microsystems Inc. SunOS 5.11 snv_105 November 2008
root@virt2:~# ifconfig vnic2
vnic2: flags=201000843 mtu 9000 index 2
inet netmask ffffff00 broadcast
ether 2:8:20:aa:fc:60
we see the configured interfaces

And now in the global zone the vnic3 is configured and brought up:

bash-3.2$ su
# ifconfig vnic3 plumb
# ifconfig vnic3 router
# ifconfig vnic3
# ifconfig vnic3 up
# ping is alive
# ping is alive
# ping

Now in the global zone we map the data from the zone network to the external interface in the global zone:

# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet netmask ff000000
ipw0: flags=201104843 mtu 1500 index 2
inet netmask ffffff00 broadcast
ether 0:c:f1:2d:e:1b
vnic3: flags=201100843 mtu 9000 index 4
inet netmask ffffff00 broadcast
ether 2:8:20:57:87:c1
lo0: flags=2002000849 mtu 8252 index 1
inet6 ::1/128
# cat ipnat.conf
# ipf.conf
# IP Filter rules to be loaded during startup
# See ipf(4) manpage for more information on
# IP Filter rules syntax.
map ipw0 from to any ->
# ipnat -f /etc/ipf/ipnat.conf
# ipnat -l
List of active MAP/Redirect filters:
map ipw0 from to any ->

List of active sessions:

Now we add the default router in each zone by command or in the
/etc/defaulrouter file:

root@virt1:~# route add default
add net default: gateway

After this we can ping the WLAN-Router from the zone.
root@virt1:~# ping is alive

This has now created two virtual hosts connect via a virtual switch and the
vnic3 ist the connected to the virtual switch and controlled in the global zone.
The IPnat allows packages to travel out of the internal network and is mapped, as they would appear from the global zone.

Jan 14, 2009

Nautilus allows search now

I haven't used the search functionality in nautilus since a longer time, because
it didn't allow to search in a folder outside the home directory.

Since I've installed Build 105 I rediscovered the Search-Functionality.
The keyboard Shortcut is Ctrl-F or in the toolbar.
  • Select the folder you like to work in.
  • Press Ctrl-F
  • In the field enter the partly string which should be contained in the filename

dbx does not allow to debug on OpenSolaris Build 105

Today I got an e-mail about the new Webcast containing the runtime checking
functions accessible via dbx, dbxtool and in SunStudio.

I tried this featuer on my OpenSolaris 2008.11 dev-Build 105 and failed in
every combination:

bash-3.2$ dbx strcpytest
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.7' in your .dbxrc
Reading strcpytest
Reading ld.so.1
dbx: internal error: could not iterate over load objects -- unknown rtld_db.so error code
dbx: internal error: liobject_get_liolist failed

After searching around I found the following Bug-Entry

There is a problem with 32-Bit dbx. Workaround is to use 64bit.
The bug is already fixed in Build 106.
So I have to wait and see.

Jan 13, 2009

Comparig 2 files in Netbeans - moving change changes depends on selection

In NetBeans 6.5, when you select one file in the project window and select a second with the Ctrl-key pressed, selecting the local menu with the right mouse button or Shfit-F10 lets you select the Diff Command in the Tools-Menu entry.

The two files are shown side by side and the differences can be moved from
the left file to the right.

The first selected file is shown on the left side, the second on the right side.
If you now recognize, that you have selected the files in the wrong order, you can
click the Swap in the Window-toolbar to exchange the position of the two files
shown in the diff window.

Before Swap:
After Swap:

Jan 10, 2009

Upgraded OpenSolaris 2008.11 on my Laptop to Build 105

I've selected the development branch on http://pkg.opensolaris.org/dev as the
so I get the updates for development release:

bash-3.2$ pkg authority
blastwave http://blastwave.network.com:10000/
opensoalris.org.release http://pkg.opensolaris.org/release/
opensolaris.org (preferred) http://pkg.opensolaris.org/dev/
sunfreeware http://pkg.sunfreeware.com:9000/
opensolaris.org.pending http://pkg.opensolaris.org/pending/
lifewithsolaris http://pkg.lifewithsolaris.jp:10000/

Today, the updatemanager in my OpenSolaris installation showed the update to
build 105.

After launching the update, it took 115 minutes to update.

bash-3.2$ uname -a
SunOS solewer 5.11 snv_105 i86pc i386 i86pc Solaris
bash-3.2$ cat /etc/release
OpenSolaris 2009.04 snv_105 X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 22 December 2008

dladm showed also the already integrated Crossbow Network project.
Now it is possible to create virtual network interfaces and "Software"-switches.

Jan 8, 2009

Opening a file in netbeans with a different type

As it seems, since NetBeans 6.5 it is possible to open files with a different type.

In one of our C/C++-Projects we use a lot of different makefile, depending on the
target to be created
In NetBeans 6.1 there was no syntax highlighting.

Since NetBeans 6.5 on the Files Panel in the menu is a "Open As"-entry, which
lets you select the type of the file and than you get the syntax highlighting!!.

Now there is also syntax highlighting for my other makefiles.

Many thanks to the NetBeans-Team

duplicating Java Class integer options to a string names

For testing a java library, I used different options of the class, which
are integers, to see the different results.

Therefore I used an array of the available options in a loop.
But for printing the result, I saw just the integer values and not the corresponding names.

int optionArray[] =

So I used an array of strings representing the options.

The long lasting solution would be to copy the array and to manually the
replacement with strings.
The faster option within netbeans is to use regular expressions to change.
Copy the optionArray put the cursor before the array and use the "Edit" - "Replace" ( Short-Cut "Ctrl-H" )

In the dialog use:

Search for BarcodeDatamatrix.(.*),
Replace for "$1",

And the result is:

int optionStringArray[] =

When you have a lot of options this is much shorter than doing it the manual way.

Jan 4, 2009