Getting Windows 2008 server uptime via the command line

A simple one liner to get hold of Windows 2008 server uptime:

systeminfo | find "System Boot Time"
Posted in Software, Windows | Tagged , | Leave a comment

The effects of old NIC drivers on Data Protector

During the Data Protector migration we noticed that the performance on the new Data Protector Cell Manager was a lot lower than the performance on the old solution. Speeds of around 100Mbit was the best we ever could get from it, although the machine is running on a gigabit network.

To make the case even more strange, performance on other network tasks was quite normal where the gigabit  connection was maxed ASAP.

After some digging, the problem turned out to be that the server was running the old default drivers for the NIC (Broadcom BCM5708S netXtreme II GigE). Windows update has in the latest Windows versions become better on delivering driver updates but that was not the case this time.

After installing the newest drivers from Broadcom`s website the performance jumped straight to gigabit even on Data Protector.

Posted in Hardware, Software | Tagged , , , | Leave a comment

Dataprotector: System error: HOST_NOT_FOUND

I have been working a bit with migrating a Data Protector cell manager, when moving a client i recieved the following error:

[Critical] From: BDA-NET@ " [/boot]"  Time: 02.09.2011 09:08:03
Cannot connect to Media Agent on system , port 49708 (IPC Invalid Hostname or IP Address
System error: HOST_NOT_FOUND) =>
aborting.

The cause for this was that the client could not look up the cell manager. I solved this by simply adding the cell manager in the hosts file of the client. You can verify this problem by simply doing a ping or nslookup against the cell manager, from the client itself.

Posted in Software | Tagged | Leave a comment

GWT: “For security purposes, this type will not be serialized.”

The full error message you can get is: “Foo was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.”

This is normally caused by using a non-serializable class, which can happen if your class does not implement serializable or if you have forgotten to add a empty constructor.

Posted in Development, Java | Tagged , , | 1 Comment

Cant download large apps from Android Market

If you are running a rooted Android phone and have problems with downloading large apps from the Android market, one fix can be to move the market download folder over to the SD-card, install a terminal emulator and perform the following (on your own risk of course):

mkdir /mnt/sdcard/market-download-cache
su
cd /cache
mv download download.bak
ln -s /mnt/sdcard/market-download-cache download
ls -ahl

Then try again and see if it wont work better to download large apps, like Google Maps :)

Posted in Mobile & Gadgets | Tagged , | 3 Comments

Java: Converting long to double

While Integers has to be parsed from a String, doubles can simply be casted:

String bar = "9.99";
Double foo = (double)bar;
Posted in Development, Java | Tagged , | Leave a comment

EXT GWT: Adding onClick to Labels

I had a issue where i needed to add a click handler for labels in EXT GWT, the solution i came up with was as follows

theLabel.addListener(Events.OnClick, new Listener() {
@Override
public void handleEvent(BaseEvent be) {
    // TODO Auto-generated method stub
}});

 

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

Guice: java.lang.IllegalStateException: No SessionHandler or SessionManager

One reason for this error would be that you should inject the session object directly, not via constructor:

So instead of:

@Singleton
public class Foo {
 
@Inject public Foo(HttpServletSession s) {
this.session = s  }
}

do this:

@Singleton
public class Foo{
 
@Inject Provider<HttpServletSession> session;
 
}

And it should work much better :)

Posted in Java | Tagged , | 1 Comment

Expanding a kVM disk image

Had to expand a KVM virtual machine today. Luckily, that`s pretty straight forward. You simply create a new disk image with the extra size needed, merge it into the original disk and voila. Then you just need to partition in the extra space and you are good to go.

How-to:

1: Halt your virtual machine.

You need to stop your virtual machine before going wild with the drive. Virsh stop <vm name>, or virsh destroy <vm name> if it somehow wont stop.

2: Create a disk with the extra space needed:

qemu-img create -f raw 5gig.img 5G

3: Merge it into the disk you are working with

cat 5gig.img >> yourdisk.img

4: Boot up and and partition your drive.

Then start up your virtual machine again with virsh start <vm name>. If you use Windows server, all you need to do is to visit disk managent, right click your drive with little free space and choose “extend partition”. The job takes seconds and does not require any reboot.

Posted in Hardware, Linux, Software | Tagged , , , | Leave a comment

Cannot open exchanger control device ([2] The system cannot find the file specified)

You will receive this error from (among others) Data Protector if the D2D/Tape unit has gone offline, or is not reachable from the machine controlling it. Normally the Data Protector cell manager. In Windows 2008 server you can make sure that Windows is connected correctly via the iSCSI Initiator which you can find in the Control Panel.

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