For quite some time I was trying to figure out why my installed applets like “hamster-applet” for example where not showing up in the applet list. Finally I found the solution. You have to install the gnome applet bonobo compatibility package:
sudo apt-get install gnome-panel-bonobo
Then log off and on and the applets should show up in the list.
January 17th,2012
Misc |
No Comments
Lately needed to create a project plan for a company who was doing some migrations. In this migrations a lot of different systems (about 200) and ressources (about 200 people) where involved. There were about 30 tasks which all had a different duration and different people involved depending on the system for which they were performed. First we thought about doing it the hard way: preparing a template for one system, copy&pasting it 200 times, then adjusting the values as needed. But due to frequent changes in the plan soon this turned out as unmanageable work effort.
So I was looking for some solution to automatically generate the plan.
I found this great java library, which makes it easy to read and write project plans: http://mpxj.sourceforge.net/
Download
First download the necessary files. The mpxj library is mandatory, the poi library you need to read mpp-Project-Files.
Setting up eclipse
- Create a new Java Project
- Add the mpxj and poi libraries to the buildpath as external archives
Create a basic project plan
Here is the example code to generate a basic project plan with tasks and subtasks and dependencies between the tasks
import java.util.Calendar;
import java.util.Calendar;
import net.sf.mpxj.Duration;
import net.sf.mpxj.ProjectFile;
import net.sf.mpxj.RelationType;
import net.sf.mpxj.Resource;
import net.sf.mpxj.Task;
import net.sf.mpxj.TimeUnit;
import net.sf.mpxj.mpx.MPXWriter;
public class MpxjExample {
static Task pre = null;
public static void main(String[] args) throws Exception {
// writes the project-data-structure into a mpx-XML-File
MPXWriter mpxwriter = new MPXWriter();
// base data-structure for project files
ProjectFile projectfile = new ProjectFile();
// filling the project with some dummy data
// here you can easily use your real data extracted
// from a database or a csv-file
int personcount = 1;
for (int i = 1; i <= 10; i++) {
// the same task as in ms project
Task task = projectfile.addTask();
task.setName("Example Task " + i);
Task presub = null;
// add some subtasks
for (int j = 1; j <= 10; j++) {
Task subtask = task.addTask();
subtask.setName("Sub Task " + j);
// set the subtasks duration, every subtask will take 4 hours in
// the example
subtask.setDuration(Duration.getInstance(4, TimeUnit.HOURS));
// add resources to the subtask
// in this example we will add only one resource to every task
// 1. add the resource to the general projectfile
Resource res = projectfile.addResource();
res.setName("Person " + personcount);
personcount++;
// associate the resource with the current task
subtask.addResourceAssignment(res);
// concatenate the subtasks, so that one subtask is performed after
// another on the timeline
// the first task has no predecessor
if (j == 1) {
presub = subtask;
} else {
subtask.addPredecessor(presub, RelationType.FINISH_START, Duration
.getInstance(0, TimeUnit.HOURS));
presub = subtask;
}
}
// concatenate the tasks, so that one main task is performed after
// another on the timeline
// the first task has no predecessor
if (i == 1) {
//set the startdate of the project
Calendar rightNow = Calendar.getInstance();
rightNow.set(2012, 1, 1);
task.setStart(rightNow.getTime());
pre = task;
} else {
task.addPredecessor(pre, RelationType.FINISH_START, Duration
.getInstance(0, TimeUnit.HOURS));
pre = task;
}
}
//writing the project file
mpxwriter.write(projectfile, "exampleproject.mpx");
}
}
Opening the file in MS Project
At my tries there popped up an error message, but if you click to ignore the warnings the file builds up normally and then you can save it under a normal mpp-file. With the mpp-file saved by MS Project no error messages pop up.
Sometimes MS Project crashed when opening the mpx-file, but next time it worked. I think there is some problem with MS Project parsing files which have not set all values. But trying it another time for me always worked.
Adding several resources to a task
I don’t know if this is the right way to do, but for me it worked. As long as you proceed this way. If i did it otherwise, the total project times did not fit in the end.
- you need to know (in the code) how many resources will be added to the task
- add the time the task takes and divide it through the count of resources added (the more people work on the task in parallel the faster it is finished)
- add the resources
Here is the example code
import java.util.Calendar;
import java.util.Calendar;
import net.sf.mpxj.Duration;
import net.sf.mpxj.ProjectFile;
import net.sf.mpxj.RelationType;
import net.sf.mpxj.Resource;
import net.sf.mpxj.Task;
import net.sf.mpxj.TimeUnit;
import net.sf.mpxj.mpx.MPXWriter;
public class MpxjExample2 {
static Task pre = null;
static final int respertask = 3;
public static void main(String[] args) throws Exception {
// writes the project-data-structure into a mpx-XML-File
MPXWriter mpxwriter = new MPXWriter();
// base data-structure for project files
ProjectFile projectfile = new ProjectFile();
// filling the project with some dummy data
// here you can easily use your real data extracted
// from a database or a csv-file
int personcount = 1;
for (int i = 1; i <= 10; i++) {
// the same task as in ms project
Task task = projectfile.addTask();
task.setName("Example Task " + i);
Task presub = null;
// add some subtasks
for (int j = 1; j <= 10; j++) {
Task subtask = task.addTask();
subtask.setName("Sub Task " + j);
//this time we add three resources per task
subtask.setDuration(Duration.getInstance(((float)4/(float)respertask), TimeUnit.HOURS));
for(int k = 1; k <= respertask; k++) {
// add resources to the subtask
// 1. add the resource to the general projectfile
Resource res = projectfile.addResource();
res.setName("Person " + personcount);
personcount++;
// associate the resource with the current task
subtask.addResourceAssignment(res);
}
// set the subtasks duration, every subtask will take 4 hours in
// the example
// concatenate the subtasks, so that one subtask is performed after
// another on the timeline
// the first task has no predecessor
if (j == 1) {
presub = subtask;
} else {
subtask.addPredecessor(presub, RelationType.FINISH_START, Duration
.getInstance(0, TimeUnit.HOURS));
presub = subtask;
}
}
// concatenate the tasks, so that one main task is performed after
// another on the timeline
// the first task has no predecessor
if (i == 1) {
//set the startdate of the project
Calendar rightNow = Calendar.getInstance();
rightNow.set(2012, 1, 1);
task.setStart(rightNow.getTime());
pre = task;
} else {
task.addPredecessor(pre, RelationType.FINISH_START, Duration
.getInstance(0, TimeUnit.HOURS));
pre = task;
}
}
//writing the project file
mpxwriter.write(projectfile, "exampleproject2.mpx");
}
}
Example Java Classes
MpxjExample.java
MpxjExample2.java
November 27th,2011
Misc |
No Comments
playing around with spring and hibernate I found this very good and practical tutorial which explained to me how to model many-to-many and one-to-many relationships with hibernate using annotations.
http://www.vaannila.com/hibernate/hibernate-tutorial/hibernate-tutorial.html
By the way. If you need a good starting point for exploring spring with hibernate and maven as build system check this page out. For my tests I slightly modified the example and added the maven exec plugin to actually run the project without having to worry about the dependency libraries. (i will add this part of the pom.xml some day to this post)
http://www.mkyong.com/spring/maven-spring-hibernate-annotation-mysql-example/
Sorry, this entry is only available in Deutsch.
really like what you are doing
you wan’t to make money? you think IT sounds cool, even if you don’t know what it means? You have a iPhone, so you’re 1337? Perfect requirements to become an it-specialist … NOT . Actually there exist a lot of people outside who would call themselves it specialists who fit quite well into this pattern, but obviously they are not. The problem is that all knowlegde comes from repetition and failure (and mostly repetition of the failures
) and this can be boring and disappointing. But to get real knowledge you have to go through this process. So be curious and really like exploring the system and playing around with stuff, this will bring you very far. Don’t look at others, perhaps some gain more, perhaps some work less, but in the end you have the knowledge and this satisfaction lasts. And if you have some über-guy at work and think you will never know as much as him: He puts his pants on one leg at a time, too.
- really like experimenting and exploring computer systems and software. If you don’t. No matter, but perhaps you should take another less technical emphasis (it-support, it-sales, etc.).
- be open for the new. Often you will be asked to do some new task you don’t have the necessary knowledge for. A lot of people just reject such tasks, which makes sense if you are overloaded with work. If you have some free time try to do the stuff through learning the necessary skills. Learning with a specific task or real life application for me always was way easier than just learning in theory
- if you have some time left over at work look for some interesting stuff which is used or could be used in the company. Of course you can also read general information, but personally I learn best when I can try my new earned knowlegde on a reallife project. Often you find some stuff to improve or you can finally document this or that.
Where to start?
So you are motivated and want to start yesterday with learning, but you really don’t know what you should do. There are so many topic, so many stuff. What will you need? Basically everything can be of good use, as the field is very wide in IT, so you best start just with something you like. Here is a basic skill list, you can pick some stuff.
Hardware Knowledge
- Buy the components and build your own self configured PC, know what the components do
- Setup your own network, use a switch, crimp some cables by your own
Basic System Knowledge
- Basic Linux/Unix Administration: set up your own linux server (you can do it easily with a virtual machine these days), play around with basic commands, read a good basic linux book and DO THE PRACTICAL EXERCISES
- try to build your own kernel (you can start with the config of your distribution-kernel, normally found under /boot/kernel-name.config)
- try to compile some program under linux, for example the videolan-player or something else
- learn to use SSH
- get used to the run-level autostart system
- Basic Windows Active Directory Setup: Learn how to set up a Domain-Controller with server-saved profiles, DNS, Shares
- use group policies to install a printer and mount the shared-Directory on the windows clients
Services
- Set up a apache-Webserver with PHP-Support
- Set up a DNS Server (e.g. bind)
- Set up a FTP Server (e.g. vsftpd)
- Set up a Mail Server (e.g. postfix + dovecot)
Programming
- Learn Bash-Skripting
- Aquire at least some basic Perl-Knowledge (as it is one of the most popular languages among administrators)
- Learn Perl or PHP or Python or Ruby, etc. , it should be a scripting language, because this is easier for most administrative tasks
- Solve Problems regarding your daily work, for example a simple Backup-Skript, etc.
i run into some problems installing glassfish on a centos server without X-Windows.
loli (local linux box) you need X-Windows running there of course
centsrv (remote centos server without X11)
1. you have to get a java sdk and install (i used the rpm provided by oracle)
2. get the glassfish install package for linux
3. install the xauth package (e.g. yum install xorg-x11-xauth) without it you can’t with ssh X-forwarding
4. connect with X forwarding to centsrv: ssh -X root@centsrv
5. now simply start the glassfish setup, the graphical installer will start on your local linux machine (loli) but it will run on the server centsrv. i installed glassfish under /opt/glassfish3
6. check your /etc/hosts file. There HAS TO BE a entry with your hostname pointing to eth0
(eg. if eth0=192.168.123.3, then you need a line like this
192.168.123.3 centsrv.example.com centsrv
otherwise you will get the error “There is a process already using the admin port 4848 — it probably is another instance of a GlassFish server.”
I had severe problems to get a mount of the ReadyNAS automatic usershare to my laptop. Everthing I was trying failed and serveral people had the same problem. The NAS had domain-authentication activated.
The error was error 13 = Permission denied
This is my fstab entry which worked in the end, substitute XX with your IP and mmustermann with your user.
//192.168.XX.XX/mmustermann /mnt/mmustermann-usershare cifs credentials=/etc/samba/mmustermann-creds,uid=mmustermann,gid=mmustermann,domain=mydomain,forceuid,forcegid,sec=krb5,iocharset=utf8 0 0
this is my credential file /etc/samba/mmustermann-creds:
username=mmustermann
password=mypw
EDIT: i forgot the domain part, without it it didn’t work properly. Actually i had some problems mounting the autogenerated usershare again. So for now only thing that worked for me was a “normal” manual created share.
Installing the Citrix Client on Ubuntu x86_64_sucked a bit as the citrix client is 32bit.
Get the Citrix-Client here:
http://www.citrix.com/English/SS/downloads/details.asp?downloadID=3323&productID=-1#top
First you have to install the openmotif library also in 32bit
cd /tmp
wget http://de.archive.ubuntu.com/ubuntu/pool/multiverse/o/openmotif/libmotif4_2.3.3-5ubuntu1_i386.deb
dpkg -i --force-all libmotif4_2.3.3-5_i386.deb
then you install the downloaded Package
dpkg -i --force-all icaclient_11.100_i386.patched.deb
a first test
cd /usr/lib/ICAClient
./wfcmgr
if it starts without problems everything works. Now you can associate ica-Files in your Browser with the ica-Client. Just click on one file and choose the program /usr/lib/ICAClient/wfica to “always open with” and you are ready.
EDIT: adjusted wget-url as pointed out by Egbert
For some time now a friend of mine kept nagging me about how cool Solaris were and what nice features like ZFS and everthing it had. As I was using Debian Linux for a really long time and was absolutely satisfied in all situations I didn’t give Solaris much of a thought. But recently I decided to give it a chance and try something new. So here are my first experiences and tipps.
Installation
I recommend to choose the user defined installation. For Slice-Sizes I chose 50GB for / and 50GB for /exports/home/ because the initial Size of 4GB for / seemed quite small in my opinion. And you should choose DNS.
So having the system up and running the first thing you have to learn is: Solaris is more like Windows. You get a DVD and there’s some stuff on it. If you want more, it’s your problem. Sun doesn’t have any network-mirrors or similar like Debian where you can get precompiled Opensource-Stuff.
But luckily Solaris isn’t Windows and Solaris is Opensource. So there’s a vast community which also provides “apt-get”-like tools and mirrors which make software installation really really easy.
I choose Blastwave, which got my attention because of it’s good documentation http://www.blastwave.org/. Ok honestly I didn’t try any other until now
.
Just follow the steps:
http://www.blastwave.org/howto.html
Requirements
A Debian Lenny Basic Installation
Install OTRS over apt-get
This part is easy
apt-get install otrs2
First Test
Point your browser to your IP (for example 192.168.1.123) /otrs and you should see the OTRS Login
http://192.168.1.123/otrs/index.pl
Login with the following User-Data:
Login: root@localhost
PW: root
Under “Admin”->”User”->”Add” add a new User (for example Admin) and grant all rights. Login with the new User. If the new User works, disable the root@localhost User.