If you are running an Ubuntu 12.04.1 server and you see "Waiting for network configuration" message during boot and then another one "Waiting for 60 moreseconds for network configuration" then you have udev configured wrongly.
I got this error while cloning a VirtualBox VM and reinitializer MAC address for the network card. But if you have physical server, you probably changed network cards, ...
The solution is to check the file /etc/udev/rules.d/70-persistent-net.rules and see if you have more entries that you should have or the name of the subsystem is not the same as the network interface configured in /etc/network/interfaces or the MAC address is not right.
četrtek, 13. september 2012
sreda, 5. september 2012
sreda, 29. avgust 2012
JellyBean with multiple users
If you have a rooted Android phone running Jelly Bean, then you can have multiple users, just like on a regular Linux machine. :)
If you want to add a user then open terminal emulator and type:
If you want to add a user then open terminal emulator and type:
- su
- pm create-user foo
Press and hold the power button and you'll be able to select your newly created user.
If you want to list all users on the system then open terminal emulator and tpe:
- su
- pm list-users
If you want to remove a user then open terminal emulator and type:
- su
- pm list-users and remember the number before user foo
- pm remove-user 1
pm list-users gives something like:
Users:
UserInfo{0:Primary:3}
UserInfo{1:foo:3}
petek, 24. avgust 2012
Prevent user from running su
If you want to prevent user foo from running command su then do this:
- sudo grouadd nosu
- sudo usermod -a -G nosu foo
- sudo vi /etc/pam.d/su and uncomment
auth required pam_wheel.so deny group=nosu
sobota, 18. avgust 2012
Required property "db.example.com" is unknown host. ERRORCODE=-4222, SQLSTATE=08001
If DB2 JCC driver throws mentioned error this means that it cannot resolve db.example.com. You should check your DNS settings.
sreda, 25. julij 2012
NetBeans 7.2
ponedeljek, 23. julij 2012
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException
If you get
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][4.13.80] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill() - insufficient data (-1). Message: Insufficient data.. ERRORCODE=-4499, SQLSTATE=08001
then this usually means you are using a connection pool to get connections to database and that connections in the connection pool are "stale".
What does stale mean?
You have connection pool started, connections created, but then database restarts. The connection you now get out of the connection pool are now stale and you have to restart the connection pool (close all connections and create new ones).
nedelja, 27. maj 2012
Sourcing .bashrc in non-interactive shell
This is a new post in a long, long time. A lot has happened since New Year. I'll post about that at a later date. :)
Now to using bash under Linux.
When you are running a bash session in a terminal you are inside of an interactive environment and you can edit .basrc and source it at any given time.
You source .bashrc like this:
source ~/.bashrc or . ~/.bashrc
Now, let's say you have a bash script that you want to run. You can run in in a terminal, but that is not the subject of this post. You can run it via a file manager, like Dolphin, thunar, ... or you can put a shortcut to it on your desktop.
If you want to source .bashrc in that script, it won't work, because running via file manager or desktop is running a bash script in an non-interactive environment. .bashrc notices that and does not do anything. In fact if you look at .bashrc you will find something like this:
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
at the beginning of you .bashrc.
But there is a solution for this. Put PS1='$ ' in your script before sourcing .bashrc.
Examples:
- run a terminal
- edit .bashrc and put
export TEST_TEXT='My test text' in your .bashrc
- make a new script test.sh:
#!/bin/bash
. ~/.bashrc
echo "TEST_TEXT = $TEST_TEXT"
read
- make it executable
chmod +x test.sh
- run it and you should get something like this:
TEST_TEXT =
- now source .bashrc and run the test.sh script
. ~/.bashrc
./test.sh
- and you get
TEST_TEXT = My test text
If you run this script via file manager you will always get TEST_TEXT =
Change the script to
#!/bin/bash
PS1='$ '
. ~/.bashrc
echo "TEST_TEXT = $TEST_TEXT"
read
and .bashrc will get source everytime you run it.
Now to using bash under Linux.
When you are running a bash session in a terminal you are inside of an interactive environment and you can edit .basrc and source it at any given time.
You source .bashrc like this:
source ~/.bashrc or . ~/.bashrc
Now, let's say you have a bash script that you want to run. You can run in in a terminal, but that is not the subject of this post. You can run it via a file manager, like Dolphin, thunar, ... or you can put a shortcut to it on your desktop.
If you want to source .bashrc in that script, it won't work, because running via file manager or desktop is running a bash script in an non-interactive environment. .bashrc notices that and does not do anything. In fact if you look at .bashrc you will find something like this:
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
at the beginning of you .bashrc.
But there is a solution for this. Put PS1='$ ' in your script before sourcing .bashrc.
Examples:
- run a terminal
- edit .bashrc and put
export TEST_TEXT='My test text' in your .bashrc
- make a new script test.sh:
#!/bin/bash
. ~/.bashrc
echo "TEST_TEXT = $TEST_TEXT"
read
- make it executable
chmod +x test.sh
- run it and you should get something like this:
TEST_TEXT =
- now source .bashrc and run the test.sh script
. ~/.bashrc
./test.sh
- and you get
TEST_TEXT = My test text
If you run this script via file manager you will always get TEST_TEXT =
Change the script to
#!/bin/bash
PS1='$ '
. ~/.bashrc
echo "TEST_TEXT = $TEST_TEXT"
read
and .bashrc will get source everytime you run it.
nedelja, 1. januar 2012
2012
Let 2012 be a special one.
My New Year's resolution was also to blog more ofter with some interesting dtuff about Linux, version control, Java, ....
My New Year's resolution was also to blog more ofter with some interesting dtuff about Linux, version control, Java, ....
četrtek, 27. oktober 2011
Xmarks
Usually I'm using two web broswers: Firefox and Chrome.
I always tried having one bookmarks set. I never found a way to share them between those web browsers. I've tried exporting bookmarks from one browser and importing into another, but that didn't feel right.
Luckly, yesterday I found Xmarks. Now my bookmarks are in the cloud :)) and I can share them easyly between Firefox and Chrome, since Xmarks has plugins for both.
torek, 14. junij 2011
KDE Konsole
I've been a happy KDE user since the eary days of it.
I've also used Konsole as my primary terminal application, but in recent Kubuntu releases it became slow.
Yesterday I switched to good old xterm with screen:
and in xterm I start screen with 10 sessions.
Now everything is fast again. :)
I've also used Konsole as my primary terminal application, but in recent Kubuntu releases it became slow.
Yesterday I switched to good old xterm with screen:
xterm -bg black -fg grey -fn -*-console-*-*-*-*-*-*-*-*-*-*-*-* -geometry 166x45
and in xterm I start screen with 10 sessions.
Now everything is fast again. :)
sobota, 16. april 2011
Is my application running?
A neat way to check if a instance of an application is already running is to use FileChannel and it's ability to lock it.
An example:
lock() will block, but you could use tryLock() to check it the fileChannel is already locked.
I've been using it in our application on Linux and Windows.
An example:
File lockFile = new File("APP_NAME.lock");
FileChannel fileChannel = new RandomAccessFile(lockFile, "rw").getChannel();
FileLock fileLock = fileChannel.lock();
lock() will block, but you could use tryLock() to check it the fileChannel is already locked.
I've been using it in our application on Linux and Windows.
ponedeljek, 14. februar 2011
Mercurial server installation for Windows
Installation of hgweb interface:
- install Apache HTTPD 2.2 to c:/Apps/Apache
- install Python 2.6 to c:/Python26
- install Mercurial to C:/Apps/HG
- install EasyInstall
This will find your Python installation and install it there.
- put c:/Python26 and c:/Python26/Scripts in you PATH
- install Flup Python module
easy_install flup-1.0.3.dev_20110111-py2.6.egg
- unzip C:/Apps/HG/library.zip C:/Apps/HG/dev
- copy c:/Apps/HG/templates directory to c:/Apps/HG/dev/templates
I have my Mercurial repositories in d:/HG/repos.
hgweb.fcgi in d:/HG looks like:
- configuration file for hgweb (d:/HG/hgweb.config) looks like:
- each repository under d:/HG/ has hgrc (in UTF-8) like this:
NOTE: debug and verbose have to be false
- edit c:/Apps/Apache/conf/httpd.conf and add:
- if you want to limit access to repositories add this to c:/Apps/Apache/conf/httpd.conf
- then add valid users to D:/HG/hgusers like this:
- install Apache HTTPD 2.2 to c:/Apps/Apache
- install Python 2.6 to c:/Python26
- install Mercurial to C:/Apps/HG
- install EasyInstall
This will find your Python installation and install it there.
- put c:/Python26 and c:/Python26/Scripts in you PATH
- install Flup Python module
easy_install flup-1.0.3.dev_20110111-py2.6.egg
- unzip C:/Apps/HG/library.zip C:/Apps/HG/dev
- copy c:/Apps/HG/templates directory to c:/Apps/HG/dev/templates
I have my Mercurial repositories in d:/HG/repos.
hgweb.fcgi in d:/HG looks like:
#!C:/Python26/python.exe -u
#
# An example FastCGI script for use with flup, edit as necessary
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "d:/HG/hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide:
import sys
sys.path.insert(0, "C:/Apps/HG/dev")
# Uncomment to send python tracebacks to the browser if an error occurs:
import cgitb; cgitb.enable()
import os
os.environ["HGENCODING"] = "UTF-8"
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb
from flup.server.fcgi import WSGIServer
application = hgweb(config)
WSGIServer(application).run()
- configuration file for hgweb (d:/HG/hgweb.config) looks like:
[paths]
# One repository
#FOO = d:/HG/repos/FOO
# All repositories in d:/HG/repos
/ = d:/HG/repos/**
[web]
style = gitweb
- each repository under d:/HG/ has hgrc (in UTF-8) like this:
[web]
description = Repository description
style = gitweb
allow_push = *
push_ssl = false
verbose = false
allowbz2 = yes
allowgz = yes
allowzip = yes
[ui]
username = Owner of repo <repo.owner@example.com>
debug = false
NOTE: debug and verbose have to be false
- edit c:/Apps/Apache/conf/httpd.conf and add:
LoadModule cgi_module modules/mod_cgi.so
LoadModule env_module modules/mod_env.so
SetEnv FCGI_FORCE_CGI Y
ScriptAliasMatch ^/hg(.*) d:/HG/hgweb.fcgi$1
<Directory d:/HG>
Options ExecCGI FollowSymLinks
AllowOverride None
AddHandler cgi-script .cgi
Allow from all
AllowOverride All
</Directory>
- if you want to limit access to repositories add this to c:/Apps/Apache/conf/httpd.conf
<Location /hg>
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile D:/HG/hgusers
Require valid-user
</Location>
- then add valid users to D:/HG/hgusers like this:
htpasswd -c D:/HG/hgusers frodo # creates file D:/HG/hgusers and adds user frodo
htpasswd D:/HG/hgusers sam # only add usersam to exising D:/HG/hgusers file
DB2 SQL440 or SQL901 on DELETE
If you get SQL440 or SQL901 when you try to delete from a table, you might encountered this problem. The solution is to recreate all foreign keys that point to this table (MY_TABLE is the SQL script below).
The SQL to generate that SQL script for you is this (statement delimiter is #):
SELECT 'ALTER TABLE EMGSYS.' || TABNAME || ' DROP CONSTRAINT ' || CONSTNAME || '#' || CHR(13) || CHR(10) ||
'ALTER TABLE EMGSYS.' || TABNAME || ' ADD CONSTRAINT ' || CONSTNAME || ' FOREIGN KEY (' || TRIM(FK_COLNAMES) || ') REFERENCES EMGSYS.' || REFTABNAME || '(' || TRIM(PK_COL
NAMES) || ') ON DELETE ' ||
(CASE WHEN DELETERULE = 'R' THEN 'RESTRICT' WHEN DELETERULE = 'C' THEN 'CASCADE' END) || ' ON UPDATE ' || (CASE WHEN UPDATERULE = 'R' THEN 'RESTRICT' WHEN UPDATERULE = 'A
' THEN 'NO ACTION' END) || '#'
FROM SYSCAT.REFERENCES WHERE REFTABNAME = 'MY_TABLE' ORDER BY TABNAME WITH UR
There are still some constands missing in DELETERULE and UPDATERULE. The various values can be seen here.
The SQL to generate that SQL script for you is this (statement delimiter is #):
SELECT 'ALTER TABLE EMGSYS.' || TABNAME || ' DROP CONSTRAINT ' || CONSTNAME || '#' || CHR(13) || CHR(10) ||
'ALTER TABLE EMGSYS.' || TABNAME || ' ADD CONSTRAINT ' || CONSTNAME || ' FOREIGN KEY (' || TRIM(FK_COLNAMES) || ') REFERENCES EMGSYS.' || REFTABNAME || '(' || TRIM(PK_COL
NAMES) || ') ON DELETE ' ||
(CASE WHEN DELETERULE = 'R' THEN 'RESTRICT' WHEN DELETERULE = 'C' THEN 'CASCADE' END) || ' ON UPDATE ' || (CASE WHEN UPDATERULE = 'R' THEN 'RESTRICT' WHEN UPDATERULE = 'A
' THEN 'NO ACTION' END) || '#'
FROM SYSCAT.REFERENCES WHERE REFTABNAME = 'MY_TABLE' ORDER BY TABNAME WITH UR
There are still some constands missing in DELETERULE and UPDATERULE. The various values can be seen here.
ponedeljek, 7. februar 2011
Mercurial
At our company we used (well, still using) CVS as our versioning system. We've finally moved one of our main projects to Mercurial. I've been given a task to expose the repository over HTTP and securing access to it. In the following days I will post how I did that on Windows. Oh, well, I know. I'd rather use Linux, but what can you do....
sobota, 1. januar 2011
torek, 14. december 2010
Is this for real?
Read what Bjarne Stroustrup said about creating C++ here. Then tell me what you think.
I must admit I always found C++ a bit weird. :)
I must admit I always found C++ a bit weird. :)
petek, 15. oktober 2010
More space on Linux HOME partition
I've been trying to post this for a while, but never came to it.
Here it goes.
On every Linux partition there is a certain percent (usually 5%).
For certain partition you can check the amount of reserved space like this:
sudo dumpe2fs /dev/sda3 | grep "Reserved block count"
On my computer I had about 6Gb of reserved space.
You can gain those 6Gb of space back simply by using:
sudo tune2fs -m 0 /dev/sda3
I DON'T recomend using this on you root, boot, ... partitions. More on this can be read at How to Gain Couple Of Gb Of Free Space On Linux
Here it goes.
On every Linux partition there is a certain percent (usually 5%).
For certain partition you can check the amount of reserved space like this:
sudo dumpe2fs /dev/sda3 | grep "Reserved block count"
On my computer I had about 6Gb of reserved space.
You can gain those 6Gb of space back simply by using:
sudo tune2fs -m 0 /dev/sda3
I DON'T recomend using this on you root, boot, ... partitions. More on this can be read at How to Gain Couple Of Gb Of Free Space On Linux
četrtek, 23. september 2010
First
Two days ago I bought an HTC Desire phone with Android 2.2. I'm still learning, installing applications, ... This is my first smart phone and it's great. :))
This is also my first post from the phone.
petek, 7. maj 2010
Compile DB2 plugin for Qt on Linux
Steps:
- get Qt from Nokia's page
- install it
- run configure like this:
- this should compile DB2 plugin for Qt. Now you can use this installation or copy generated Qt db2 plugin (libsqldb2.so) to /usr/lib/qt4/plugins/sqldrivers
- get Qt from Nokia's page
- install it
- run configure like this:
./configure -plugin-sql-db2 -v -I /opt/ibm/db2/V9.7/include -L /opt/ibm/db2/V9.7/lib64/
make
make install (if you want to install it)
- this should compile DB2 plugin for Qt. Now you can use this installation or copy generated Qt db2 plugin (libsqldb2.so) to /usr/lib/qt4/plugins/sqldrivers
Access DB2 via ODBC on Linux
This is how to install ODBC on Linux (Kubuntu 10.04) and access it.
Steps:
- install DB2 (I always install everything)
- install unixODBC
- edit $HOME/.odbc.ini :
- run db2ca and add DB_NAME (don't forget to add ODBC)
- now you can use it on Qt for example like this:
Steps:
- install DB2 (I always install everything)
- install unixODBC
- edit $HOME/.odbc.ini :
[DB_NAME]
Description = Connection to DB_NAME
Driver=$HOME/sqllib/lib/libdb2.so
- run db2ca and add DB_NAME (don't forget to add ODBC)
- now you can use it on Qt for example like this:
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("DB_NAME");
db.setUserName("DB_USER");
db.setPassword("DB_PASS");
db.open();
QSqlError error = db.lastError();
qDebug() << "db error = " << error;
QSqlQuery query = db.exec("SELECT 1 FROM SYSIBM.SYSDUMMY1");
while (query.next() == true) {
qDebug() << query.value(0).toString();
}
petek, 5. februar 2010
DB2 9.7.1, db2start and SQL1042C
As you may know I'm running Kubuntu 9.10.
The other day I installed DB2 Express-C 9.7.1 on it. When I tried db2start I got:
SQL1042C An unexpected system error occurred. SQLSTATE=58004
If you get the same try running db2ftok and then db2start again. It works for me.
The other day I installed DB2 Express-C 9.7.1 on it. When I tried db2start I got:
SQL1042C An unexpected system error occurred. SQLSTATE=58004
If you get the same try running db2ftok and then db2start again. It works for me.
ponedeljek, 1. februar 2010
"How to shoot yourself in the foot" in various languages
Follow this link.
ActiveX is the one I like the most. How about you ?
ActiveX is the one I like the most. How about you ?
petek, 29. januar 2010
petek, 1. januar 2010
četrtek, 24. december 2009
Novatel Wireless MC950D on Kubuntu 9.10
All I had to do is:
- unmount the CD-ROM
- set a custom DNS server
- unmount the CD-ROM
- set a custom DNS server
petek, 18. december 2009
Opening OpenOffice.org application through Java crashes
This is on Kubuntu 9.10.
If you see an error:
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPainter::begin: Cannot paint on a null pixmap
CE> X-Error: BadDrawable (invalid Pixmap or Window parameter)
CE> Major opcode: 62 (X_CopyArea)
CE> Resource ID: 0x0
CE> Serial No: 621 (621)
CE> These errors are reported asynchronously,
CE> set environment variable SAL_SYNCHRONIZE to 1 to help debugging
com.sun.star.lang.DisposedException: java.io.EOFException
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java:171)
when you try to open OpenOffice.org program (scalc, swriter, ...) using Java you can uninstall openoffice.org-kde or openofice.org-gtk packages. I'm still not able to pinpoint why this is crashing.
If you see an error:
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPixmap: It is not safe to use pixmaps outside the GUI thread
CE> QPainter::begin: Cannot paint on a null pixmap
CE> X-Error: BadDrawable (invalid Pixmap or Window parameter)
CE> Major opcode: 62 (X_CopyArea)
CE> Resource ID: 0x0
CE> Serial No: 621 (621)
CE> These errors are reported asynchronously,
CE> set environment variable SAL_SYNCHRONIZE to 1 to help debugging
com.sun.star.lang.DisposedException: java.io.EOFException
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java:171)
when you try to open OpenOffice.org program (scalc, swriter, ...) using Java you can uninstall openoffice.org-kde or openofice.org-gtk packages. I'm still not able to pinpoint why this is crashing.
četrtek, 17. december 2009
Open 7-Zip archives in Midnight Commander
Edit Midnight Commander's extension file and look for "7zip archives". You should see something like this:
# 7zip archives (they are not man pages)
shell/.7z
View=%view{ascii} 7za l %f 2>/dev/null
Now add:
Open=%cd %p#u7z
to get:
# 7zip archives (they are not man pages)
shell/.7z
View=%view{ascii} 7za l %f 2>/dev/null
Open=%cd %p#u7z
# 7zip archives (they are not man pages)
shell/.7z
View=%view{ascii} 7za l %f 2>/dev/null
Now add:
Open=%cd %p#u7z
to get:
# 7zip archives (they are not man pages)
shell/.7z
View=%view{ascii} 7za l %f 2>/dev/null
Open=%cd %p#u7z
ponedeljek, 9. november 2009
Kubuntu 9.10, mc does not show files in zip/jar
Couple of days ago I upgraded my machine to Kubuntu 9.10. I like it a lot. :)
At lease hibernate is a lot faster. :))
I had a problem with mc not showing content of zip and jar archives. When I pressed Enter of them no files were displayed.
So the solution is:
- sudo vi /usr/share/mc/extfs/uzip
- set my $op_has_zipinfo to 1
- save and restart mc
At lease hibernate is a lot faster. :))
I had a problem with mc not showing content of zip and jar archives. When I pressed Enter of them no files were displayed.
So the solution is:
- sudo vi /usr/share/mc/extfs/uzip
- set my $op_has_zipinfo to 1
- save and restart mc
petek, 18. september 2009
Ws and HTTP Basic authentication
If you want to create a client for a web service that uses HTTP Basic authentication, you can authenticate in two different ways:
- use your own Authenticator class:
and then use it is you client like this:
- in your client you can write something like this:
- use your own Authenticator class:
public class SAPAuthenticator extends Authenticator
{
private String username;
private char[] password;
public SAPAuthenticator(String username, char[] password)
{
this.username = username;
this.password = password;
}
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(username, password);
}
}
and then use it is you client like this:
Authenticator.setDefault(new SAPAuthenticator("username", "password".toCharArray()));
- in your client you can write something like this:
((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "username");
((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
torek, 1. september 2009
the science of motivation
Dan Pink - The science of motivation 1/2
Dan Pink - The science of motivation 2/2

Dan Pink - The science of motivation 2/2
torek, 4. avgust 2009
sreda, 10. junij 2009
SQLCODE=-4214 on DB2 on Linux
If you get SQLCODE=-4214 when you try to connect to a database running on Linux then you can do:
The problem is that DB2 doesn't like SHA-512 hashes, but MD5.
On Ubuntu you can also change /etc/pam.d/common-password and change line
to
Now changing the password will use MD5 hashes instead of SHA-512. This is a bit unsecure, so you decide if you need it. usermod should do the trick anyway.
Just remember that DB2 expects username on Linux (probably on every UNIX) to be all lowercase.
usermod --password `openssl passwd PASSWORD_TO_USE` USERNAME
The problem is that DB2 doesn't like SHA-512 hashes, but MD5.
On Ubuntu you can also change /etc/pam.d/common-password and change line
password [success=1 default=ignore] pam_unix.so obscure sha512
to
password [success=1 default=ignore] pam_unix.so obscure md5
Now changing the password will use MD5 hashes instead of SHA-512. This is a bit unsecure, so you decide if you need it. usermod should do the trick anyway.
Just remember that DB2 expects username on Linux (probably on every UNIX) to be all lowercase.
torek, 26. maj 2009
Export public key from a X.509 certificate
If you have an X.509 certificate in .p12 file then you can export public key like this:
openssl pkcs12 -in myFile.p12 -out myPublicKey.pem -clcerts -nokeys
petek, 22. maj 2009
Enable/disable KDE 4 desktop effects on command-line
Today I had a problem that my laptop, running KDE4 with desktop effects turned on, froze before I could start systemsettings and disable it. So to manually disable it:
- start Ubuntu in recovery mode
- go to root console
- go to /home/$USER/.kde or /home/$USER/.kde4
- then edit share/config/kwinrc
- set Enabled to false under [Compositing]
- start Ubuntu in recovery mode
- go to root console
- go to /home/$USER/.kde or /home/$USER/.kde4
- then edit share/config/kwinrc
- set Enabled to false under [Compositing]
četrtek, 21. maj 2009
When I came to work
If I want to know when I came to work in the morning I use this piece of code:
I can use this since I power up my laptop every morning.
I got this one on a blog that I cannot find now, so I hope the author will not be angry with me. I just added LANG=en_us since the date format in syslog.0 is in en_us.
LANG=en_us date "+%b %d" | xargs -i grep -m1 -i {} /var/log/syslog.0 | awk '{ print "Today I got to work at " $3 }'
I can use this since I power up my laptop every morning.
I got this one on a blog that I cannot find now, so I hope the author will not be angry with me. I just added LANG=en_us since the date format in syslog.0 is in en_us.
nedelja, 10. maj 2009
sreda, 22. april 2009
COM port support on AMD64 and Sun JDK 6 under Linux
If you want to get support for COM ports under 64-bit Linux then you need to:
- go to http://www.ibm.com/developerworks/java/jdk/linux/download.html
- go to 64-bit AMD/Opteron/EM64T under Java SE Version 6
- download Java Communications API
Now you need to put:
- javax.comm.properties into $JAVA_HOME/jre/lib
- libLinuxSerialParallel.so into $JAVA_HOME/jre/lib/amd64
- comm.jar into your project or $JAVA_HOME/jre/lib/ext
Now you need to edit javax.comm.properties to point to a correct physical devices.
- go to http://www.ibm.com/developerworks/java/jdk/linux/download.html
- go to 64-bit AMD/Opteron/EM64T under Java SE Version 6
- download Java Communications API
Now you need to put:
- javax.comm.properties into $JAVA_HOME/jre/lib
- libLinuxSerialParallel.so into $JAVA_HOME/jre/lib/amd64
- comm.jar into your project or $JAVA_HOME/jre/lib/ext
Now you need to edit javax.comm.properties to point to a correct physical devices.
ponedeljek, 9. marec 2009
Child
I didn't post anything for a long time, but I have a good reason for that. About a month ago I got my first child, a daughter. :)))
She can only cry, eat, put things in her diper :)), make funny faces and sleep.
I'm over 30 and this is my first child. If I only knew how great is to have one I'd have her a long time ago. So anyone that is not decided to have one or not, just do it. Just make sure you have a child with a women you love.
She can only cry, eat, put things in her diper :)), make funny faces and sleep.
I'm over 30 and this is my first child. If I only knew how great is to have one I'd have her a long time ago. So anyone that is not decided to have one or not, just do it. Just make sure you have a child with a women you love.
četrtek, 11. december 2008
torek, 25. november 2008
rdesktop on Ubuntu 8.10
Running rdesktop on Ubuntu 8.10 is not as smooth as on 8.04, because the damn thing grabs keyboard input despite the -K parameter I specify.
Ubuntu 8.10
Few weeks ago I upgraded my Ubuntu 8.04 to 8.10 and I'm very happy with it. My laptop runs about 20°C cooler than before and it doesn't freeze on me. Since I run BOINC client all the time (running my Dual Core CPU at 100%) this happened daily with previous version, but not now. :))
So Ubuntu team, a great release and keep up the good work.
So Ubuntu team, a great release and keep up the good work.
torek, 7. oktober 2008
Control fan speed on T60 with Ubuntu 8.04
You can follow this link, but basically you do this:
- add "options thinkpad_acpi fan_control=1" without quotes to /etc/modprobe.d/options
- then you control fan speed with this commands (as root):
echo level 0 > /proc/acpi/ibm/fan (fan off)
echo level 2 > /proc/acpi/ibm/fan (low speed)
echo level 4 > /proc/acpi/ibm/fan (medium speed)
echo level 7 > /proc/acpi/ibm/fan (maximum speed)
echo level auto > /proc/acpi/ibm/fan (automatic - default)
echo level disengaged > /proc/acpi/ibm/fan (disengaged)
- add "options thinkpad_acpi fan_control=1" without quotes to /etc/modprobe.d/options
- then you control fan speed with this commands (as root):
echo level 0 > /proc/acpi/ibm/fan (fan off)
echo level 2 > /proc/acpi/ibm/fan (low speed)
echo level 4 > /proc/acpi/ibm/fan (medium speed)
echo level 7 > /proc/acpi/ibm/fan (maximum speed)
echo level auto > /proc/acpi/ibm/fan (automatic - default)
echo level disengaged > /proc/acpi/ibm/fan (disengaged)
sreda, 17. september 2008
sreda, 3. september 2008
Google's Chrome
Now that was a surprise, not.
It was expected for some time now and I personally don't like it, because it is just another web browser web administrators will have to support.
Oh and Google applications will, eventually, only work good on Chrome.
It was expected for some time now and I personally don't like it, because it is just another web browser web administrators will have to support.
Oh and Google applications will, eventually, only work good on Chrome.
nedelja, 27. julij 2008
Easter eggs in OpenOffice.org
I just came across some Easter Eggs in OpenOffice. I hope you'll enjoy them. :)
sobota, 19. julij 2008
Big projects and vi/emacs
I'm working with Java on couple of projects with couple of hundreds or even thousands of files of source code. I'm using NetBeans, because of the project management system it provides, it's editor with code completion, refactoring, GUI designer tool and other stuff.
I've always admired people who use vi or emacs on projects of that size. I can't imagine to live without code completion. There are too much methods with different parameters in a project to remember them all.
I'd like to hear from someone using vi/emacs on large projects how they do it. Thanks. :))
I've always admired people who use vi or emacs on projects of that size. I can't imagine to live without code completion. There are too much methods with different parameters in a project to remember them all.
I'd like to hear from someone using vi/emacs on large projects how they do it. Thanks. :))
petek, 18. julij 2008
Java in Hollywood
I've just finished watching movie called Antitrust. The movie is about a system called SYNAPSE. Couple of time you can see a snippet of code that makes SYNAPSE and the code is Java. Cool! I've never before seen Java in a movie.
četrtek, 12. junij 2008
ponedeljek, 14. april 2008
Why I like NetBeans 6.1
Of course, because it is getting faster and faster, better and better editor, JEE and Glassfish support,.. I could get on and on.
But the greatest thing, for me at least, is that when I open a file it gets opened on the far right side of all editor tabs. NetBeans 6.0 had this issue with this and files got put somewhere in the middle of tabs, sometimes at the end, ... The algorithm was a total mistery for me.
I just hope this won't get lost by the time 6.1 is released.
But the greatest thing, for me at least, is that when I open a file it gets opened on the far right side of all editor tabs. NetBeans 6.0 had this issue with this and files got put somewhere in the middle of tabs, sometimes at the end, ... The algorithm was a total mistery for me.
I just hope this won't get lost by the time 6.1 is released.
petek, 28. marec 2008
ponedeljek, 11. februar 2008
Custom resolution with VMWare Server
I'm using VMWare to run Windows on my Linux machine and the machine supports 1680x1050 which is not supported by default when you install VMware Tools.
To get it to work you can follow this steps:
- open regedit
- go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{device id}\0000 use {device id} that has VMWare SVGA II in the description
- add a new binary value Resolution.x (x being by one bigger that other Resolution.y values), for example Resolution.11
- enter the value 31 36 38 30 78 31 30 35 30 (binary for 1680x1050)
- exit regedit and reboot
You can read more here and here.
To get it to work you can follow this steps:
- open regedit
- go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{device id}\0000 use {device id} that has VMWare SVGA II in the description
- add a new binary value Resolution.x (x being by one bigger that other Resolution.y values), for example Resolution.11
- enter the value 31 36 38 30 78 31 30 35 30 (binary for 1680x1050)
- exit regedit and reboot
You can read more here and here.
četrtek, 31. januar 2008
Total size of a table in DB2
If you wonder how to get the total size of a table in DB2 you can use following SQL statement which gives you 30 largest tables:
SELECT TABSCHEMA, TABNAME, DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE + XML_OBJECT_P_SIZE AS TOTAL_SIZE FROM SYSIBMADM.ADMINTABINFO ORDER BY TOTAL_SIZE DESC FETCH FIRST 30 ROWS ONLY WITH UR
Total size here means size of data + size of indexes + size of long objects + size of LOB objects + size of XML objects.
More about this can be found at IBM DB2 InfoCenter or directly here.
SELECT TABSCHEMA, TABNAME, DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE + XML_OBJECT_P_SIZE AS TOTAL_SIZE FROM SYSIBMADM.ADMINTABINFO ORDER BY TOTAL_SIZE DESC FETCH FIRST 30 ROWS ONLY WITH UR
Total size here means size of data + size of indexes + size of long objects + size of LOB objects + size of XML objects.
More about this can be found at IBM DB2 InfoCenter or directly here.
New ATI drivers and hibernate
As you might remember I didn't have ATI drivers enabled since hibernate did not function correctly. Couple of days ago I installed ATI driver version 8.452.1 and hibernate does work.
ponedeljek, 21. januar 2008
GNUCash
For the past 18 days (yes, New Years' resolution) I've been using GnuCash for managing my finances. The biggest problem I've seen with it it that you cannot protect the file where transactions are written.
Today I came across a Wiki entry how to encrypt that file using GnuPG.
This script can be also used for other applications, not only GnuCash.
Today I came across a Wiki entry how to encrypt that file using GnuPG.
This script can be also used for other applications, not only GnuCash.
petek, 18. januar 2008
sobota, 12. januar 2008
Changing the CVS keywork substitution mode
If you want to change the CVS keywork substitution mode, you unfortunately cannot do it with NetBeans, but you can use this few steps:
- let's say the new keyword substitution mode should be -kkv
- cvs admin -kkv File.java
- cvs update -kkv File.java
- edit the File.java to change it a bit
- cvs commit -fm "Change substitution mode" File.java
I've used this on number of files, so it does work.
- let's say the new keyword substitution mode should be -kkv
- cvs admin -kkv File.java
- cvs update -kkv File.java
- edit the File.java to change it a bit
- cvs commit -fm "Change substitution mode" File.java
I've used this on number of files, so it does work.
History of CVS changes
If you want to know what you and your colleagues changed in a period of time in the whole CVS managed project, just right click the root directory of the CVS managed project and use Search history command. There you can search by revision or date. Great. :)
You can for example see how much work did you do in year.
You can for example see how much work did you do in year.
ponedeljek, 10. december 2007
Insert Unicode
If you need Insert Unicode module you can get it here. I didn't develop this module, I only compiled it to work on NetBeans 6.0. The original author is Jesse Glick.
ponedeljek, 3. december 2007
petek, 30. november 2007
Depp Copy of Objects
Ever wanted to do a clone of a Vector for example. You could use the clone() method on all objects that are in the Vector, but there are better solutions:
- Exploit Serialization To Perform Deep Copy
- Faster Deep Copies of Java Objects
- Low-Memory Deep Copy Technique for Java Objects
Whatever approach suits you best is the one for you. :)
- Exploit Serialization To Perform Deep Copy
- Faster Deep Copies of Java Objects
- Low-Memory Deep Copy Technique for Java Objects
Whatever approach suits you best is the one for you. :)
četrtek, 8. november 2007
Migrating Class libraries between NetBeans versions
There is a nice entry in NetBeans Wiki on how to migrate class libraries between different IDE versions, so you don't have to manually enter them.
Cooler T60
After a week of using Ubuntu 7.10 I've noticed that my T60 is much cooler that it was running Ubuntu 7.04. I'm running BOINC all day long and the temperature of the CPU is 10˚C lower than on Ubuntu 7.04.
petek, 2. november 2007
Ubuntu 7.10
I've upgraded my T60 to Ubuntu 7.10. the main thing I noticed is that now hibernate/resume works as it should. Ubuntu 7.04 had a nasty bug when sound did not work anymore after resume. This has been fixed now.
And since I have an ATI x1400 card inside I also wanted to test the latest ATI drivers that support composite so compiz-fusion can work. But the drivers have a bug which prevents a notebook to go to hibernate mode. So now, until ATI releases new driver's, I'll not be using compiz-fusion since hibernate is more important to me. And for me these compiz gets in a way after a while, but it has some very nice graphics effects.
And since I have an ATI x1400 card inside I also wanted to test the latest ATI drivers that support composite so compiz-fusion can work. But the drivers have a bug which prevents a notebook to go to hibernate mode. So now, until ATI releases new driver's, I'll not be using compiz-fusion since hibernate is more important to me. And for me these compiz gets in a way after a while, but it has some very nice graphics effects.
sobota, 29. september 2007
Description of DB2 sqlcodes
Did you ever need a description of a sqlcode in a programming language like Java? Did you ever wanted to know if an sqlcode is an error or a warning?
You can use SYSPROC.SQLERRM function for that:
VALUES(SYSPROC.SQLERRM('SQL0911N', '', '', 'en_US', 0))
There is a sqlcode: in the description and id this is negative then you have an error, otherwise a warning. I consider sqlcodes that don't have sqlcode: in the description as not important. :)
You can use SYSPROC.SQLERRM function for that:
VALUES(SYSPROC.SQLERRM('SQL0911N', '', '', 'en_US', 0))
There is a sqlcode: in the description and id this is negative then you have an error, otherwise a warning. I consider sqlcodes that don't have sqlcode: in the description as not important. :)
nedelja, 23. september 2007
sobota, 15. september 2007
Newline
Yesterday one of my coworkers said something that I'm laughing even today over it.
He was trying to open a CSV file with Excel, but he got some strange results. Then he noticed that a description column had newline characters in, so Excel made more lines as it should.
So he said: "Why don't they put newline in one line." :)))
He was trying to open a CSV file with Excel, but he got some strange results. Then he noticed that a description column had newline characters in, so Excel made more lines as it should.
So he said: "Why don't they put newline in one line." :)))
nedelja, 2. september 2007
Easter Egg in Google Earth
sreda, 22. avgust 2007
How to get modem in T60 working?
Steps:
- install driver using program provided at:
http://www.linuxant.com/drivers/hsf/downloads-installer.php
or look at section "Identifying your modem"
- run "sudo sh cnxtinstall.run"
- follow instructions
- reboot
- run "sudo hsfconfig --country" to set the country
- run "sudo hsfconfig --license" to set the license. Choose FREE here.
When I start minicom, the program can initialize the modem. I have to admit I did not try if the modem really works.
- install driver using program provided at:
http://www.linuxant.com/drivers/hsf/downloads-installer.php
or look at section "Identifying your modem"
- run "sudo sh cnxtinstall.run"
- follow instructions
- reboot
- run "sudo hsfconfig --country" to set the country
- run "sudo hsfconfig --license" to set the license. Choose FREE here.
When I start minicom, the program can initialize the modem. I have to admit I did not try if the modem really works.
torek, 21. avgust 2007
DB2 and string functions
If you have ever worked with DB2 and Unicode database, you must have stumbled across this problem:
If you are using characters that are not in ascii table, but nation specific ones, like đšžćč in my case, then function like LENGTH, SUBSTR, ... are not working right. Especially with JCC DB2 driver.
Example:
ResultSet rs = stmt.executeQuery("SELECT SUBSTR(NAME, 1, 10) AS NAME FROM TABLE1")
and then the tenth character is one of đšžćč(for example) then calling
rs.getstring("NAME") will give you an Exception.
There are three solutions:
- use APP/NET driver, so you at least don't get the exception
- do a substring in Java code
- use VARGRAPHIC like SELECT SUBSTR(VARGRAPHIC(NAME), 1, 10) AS NAME FROM TABLE1
At least I hope DB2 developers will fix this soon. Sometimes it really gets on my nerves.
If you are using characters that are not in ascii table, but nation specific ones, like đšžćč in my case, then function like LENGTH, SUBSTR, ... are not working right. Especially with JCC DB2 driver.
Example:
ResultSet rs = stmt.executeQuery("SELECT SUBSTR(NAME, 1, 10) AS NAME FROM TABLE1")
and then the tenth character is one of đšžćč(for example) then calling
rs.getstring("NAME") will give you an Exception.
There are three solutions:
- use APP/NET driver, so you at least don't get the exception
- do a substring in Java code
- use VARGRAPHIC like SELECT SUBSTR(VARGRAPHIC(NAME), 1, 10) AS NAME FROM TABLE1
At least I hope DB2 developers will fix this soon. Sometimes it really gets on my nerves.
četrtek, 9. avgust 2007
Specs
On Monday I got back from my R&R and started doing some work with a device that is connected to RS-232. I was following the specs for the protocol that it supports. But the device returned something that was not in the specs. Strange. Luckily I had a contact person at the company that provided the device. We figured out that the software on the device is not the right one, the one that supports the specs I got. Then we updated the software. And did it the second time, since the first was not the right version. The device still didn't function as written in the specs. Then we figured out that is was not set up correctly. Now after couple of days I have a working device as per spec. So the company says. :)
Then I found out that the specs are not right. They say something and the device says something else. Now who to believe? After three days I'm still not 100% sure if the spec and the device are on the same level.
Don't you just hate when this happens? And then your manager asks you why it took so long to send two lousy packets to the device. They are both 60 bytes long! Arrrgggg
Then I found out that the specs are not right. They say something and the device says something else. Now who to believe? After three days I'm still not 100% sure if the spec and the device are on the same level.
Don't you just hate when this happens? And then your manager asks you why it took so long to send two lousy packets to the device. They are both 60 bytes long! Arrrgggg
petek, 3. avgust 2007
R&R
Last 14 days I've been on R&R. :))
The first of there magnitude this year. I really needed it. I've been involved in couple of large project this year (introduction of Euro currency in my country, introduction of Selfcheckout tills, ....).
During my R&R I've kinda started some work on Neural networks. We'll some where it takes us.
The first of there magnitude this year. I really needed it. I've been involved in couple of large project this year (introduction of Euro currency in my country, introduction of Selfcheckout tills, ....).
During my R&R I've kinda started some work on Neural networks. We'll some where it takes us.
četrtek, 19. julij 2007
JSP form and UTF-8
Today I was trying to help one of my coworkers who had a problem accessing a value on a JSP page and storing it into a database. Of course he was using UFT-8 characters, so they ended up in database all wrong.
A solution is very simple :))))
Just add
before you access any parameter in the request object.
I got the solution from a blog.
A solution is very simple :))))
Just add
request.setCharacterEncoding("UTF-8");before you access any parameter in the request object.
I got the solution from a blog.
četrtek, 5. julij 2007
T-2 and IPTV and Ubuntu
If anyone has T-2 IPTV and wants to watch it on their computer then follow these steps:
- connect a cable from VOOD TV port to your computer
- have vlc installed and ready
- add a route like:
- get a playlist of all programs
- start vlc, load that playlist and enjoy
- connect a cable from VOOD TV port to your computer
- have vlc installed and ready
- add a route like:
ip route add 224.0.0.0/4 via YOUR_CURRENT_IP
- get a playlist of all programs
- start vlc, load that playlist and enjoy
6516858 fixed
A bug that I reported about 6 months ago for Java is now fixed and in Java 6u2 and Java 5u12. This is my first reported and fixed bug for Java. :)
sreda, 4. julij 2007
Update on sound on T60
In my last blog I mentioned that sound sometimes is working and sometimes is not. Now I know when it is and then it isn't.
If I put my T60 into hibernation then on next boot sound is not working. If I shut down my T60 and boot it sound is working. Oh well.. :))
If I put my T60 into hibernation then on next boot sound is not working. If I shut down my T60 and boot it sound is working. Oh well.. :))
My own notebook
Yuppiii! Last week I got my own notebook, a ThinkPad T60:
- Intel Core 2 Duo 2.16 GHz
- 2 Gb RAM
- 120 Gb HDD
- Atheros wireless card
- ATI Technologies Inc Radeon Mobility X1400
- 15.4" display with 1680x1050
Of course it came with Windows XP, but I soon deleted it from the machine. :))) I put Ubuntu 7.04 on following this and this tutorials.
You have to use text installer to install Ubuntu 7.04, because ATIs card is not supported in this stage. After installing Ubuntu I had to follow this thread.
I had a lot of problems with the Atheros wireless card, since it was not recognized by the system, so I had to go and download the latest drivers from MadWifi homepage and do a simple make, make install. Of course every time I upgrade kernel-modules I have to do this again. Now wireless works like a charm. :))
The second problem was my sound card. It is an Intel AD1981. At first it didn't work, meaning that when I tried to play something I got a lot of Device not opened type of errors. Then I read something about this in Ubuntu forum and this thread. It seems that you have to have modem enabled in your BIOS. Doing this I still couldn't hear sound, so I followed this part of UbuntuGuide. I still kinda have a feeling that sound sometimes works and sometimes does not, like it would have a mind of it's own. :))) The main thing is that I know it does work. :)) For the most part. :))
OSD (On Screen Display) for sound and brightness (Fn + Home, Fn + End) were working from the ground up.
Of course I wanted to try beryl on T60. I have done everything that is described in these steps, but display was are mixed up. You couldn't see anything. For now I'm going to stick to GNOME and maybe later try another approach.
What is still not working is my modem. I'll have to look into this problem a bit more.
Bottom line I'm now working with a T60 for a week now and I love it. :)))
I'll keep you informed.
- Intel Core 2 Duo 2.16 GHz
- 2 Gb RAM
- 120 Gb HDD
- Atheros wireless card
- ATI Technologies Inc Radeon Mobility X1400
- 15.4" display with 1680x1050
Of course it came with Windows XP, but I soon deleted it from the machine. :))) I put Ubuntu 7.04 on following this and this tutorials.
You have to use text installer to install Ubuntu 7.04, because ATIs card is not supported in this stage. After installing Ubuntu I had to follow this thread.
I had a lot of problems with the Atheros wireless card, since it was not recognized by the system, so I had to go and download the latest drivers from MadWifi homepage and do a simple make, make install. Of course every time I upgrade kernel-modules I have to do this again. Now wireless works like a charm. :))
The second problem was my sound card. It is an Intel AD1981. At first it didn't work, meaning that when I tried to play something I got a lot of Device not opened type of errors. Then I read something about this in Ubuntu forum and this thread. It seems that you have to have modem enabled in your BIOS. Doing this I still couldn't hear sound, so I followed this part of UbuntuGuide. I still kinda have a feeling that sound sometimes works and sometimes does not, like it would have a mind of it's own. :))) The main thing is that I know it does work. :)) For the most part. :))
OSD (On Screen Display) for sound and brightness (Fn + Home, Fn + End) were working from the ground up.
Of course I wanted to try beryl on T60. I have done everything that is described in these steps, but display was are mixed up. You couldn't see anything. For now I'm going to stick to GNOME and maybe later try another approach.
What is still not working is my modem. I'll have to look into this problem a bit more.
Bottom line I'm now working with a T60 for a week now and I love it. :)))
I'll keep you informed.
petek, 22. junij 2007
Glassfish on Windows and "space hell"
If you want to run Glassfish as a service on Windows than you have to use sc.exe and appservService.exe.
At first I tried this (D:\Apps\glassfish is my GLASSFISH_INSTALL directory):
and it didn't work. Why? Look at the command that does work:
See the difference? No... Well, there is a space after binPath= operation. This is not the first or the second or the third, ... time I had to deal with this. And I HAVE IT ENOUGH!!!
At first I tried this (D:\Apps\glassfish is my GLASSFISH_INSTALL directory):
D:\Apps\glassfish\lib>sc.exe create domain1 binPath="d:\Apps\glassfish\lib\appservService.exe
\"d:\Apps\glassfish\bin\asadmin.batstart-domaindomain1\"
\"d:\Apps\glassfish\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"
and it didn't work. Why? Look at the command that does work:
D:\Apps\glassfish\lib>sc.exe create domain1 binPath= "d:\Apps\glassfish\lib\appservService.exe
\"d:\Apps\glassfish\bin\asadmin.batstart-domaindomain1\"
\"d:\Apps\glassfish\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"
See the difference? No... Well, there is a space after binPath= operation. This is not the first or the second or the third, ... time I had to deal with this. And I HAVE IT ENOUGH!!!
nedelja, 10. junij 2007
Funny game
It's been a while since I played a game, but then I came accross this one.
It is very funny one to play. First time I saw it I laught for an hour. :)))
It is very funny one to play. First time I saw it I laught for an hour. :)))
četrtek, 24. maj 2007
četrtek, 17. maj 2007
Ubuntu and PPTP
Today I had to connect to a VPN server using PPTP.
Since this is a Microsoft protocol, my coworkers thought it won't work. So naturally I had to prove them wrong. Google to the rescue. :)))
If you have the same problem, just follow this link. I managed to get it to work using "configuring a tunnel by hand" part of the manual.
Since this is a Microsoft protocol, my coworkers thought it won't work. So naturally I had to prove them wrong. Google to the rescue. :)))
If you have the same problem, just follow this link. I managed to get it to work using "configuring a tunnel by hand" part of the manual.
ponedeljek, 14. maj 2007
I'm sooo sleeepyyy
Yesterday we went and prepared a big shop (17 POS systems) to be opened this morning. I'm still in work and haven't had any sleep for more that 24 hours .... The day before only 5 hours. I'm about to break down. My mind is not doing exactly what I want it to. :))) Ever felt like that ? Ever went without a sleep for three or four days... :)) Unforgettable experience.
petek, 11. maj 2007
Additional IP on Ubuntu 7.04
I've been using Ubuntu (6.10 and now 7.04) for couple of months now and I love it.
In my company there are a lot of computers with different IPs and netmasks and I need to access them. I haven't found a way how to do it with a GUI, since a lot of things can be done via GUI in Ubuntu.
So, for you who are interested in the solution, here it is:
and edit the file to get something like:
Now I have three IPs (192.168.0.2, 10.10.33.10 and 10.10.50.10).
In my company there are a lot of computers with different IPs and netmasks and I need to access them. I haven't found a way how to do it with a GUI, since a lot of things can be done via GUI in Ubuntu.
So, for you who are interested in the solution, here it is:
sudo vi /etc/network/interfaces
and edit the file to get something like:
auto eth0 eth0:1 eth0:2
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
iface eth0:1 inet static
address 10.10.33.10
netmask 255.255.255.0
iface eth0:2 inet static
address 10.10.50.10
netmask 255.255.255.0
Now I have three IPs (192.168.0.2, 10.10.33.10 and 10.10.50.10).
sreda, 9. maj 2007
Frustration
Damn !!!
I'm struggling with one "bug" in my program. Bug is in quotes because I'm not 100% sure it is a problem in my code. Why?
I'm doing an UPDATE of a table in DB2. DB2 has locking mechanism in behind, so until this transaction is committed no one can do anything on this row/table and their program is locked. Why I'm not sure the problem is in my code? Because there is only one thread and only one place in my entire project that does anything with that particular table. It drives me crazy !!!
I'm struggling with one "bug" in my program. Bug is in quotes because I'm not 100% sure it is a problem in my code. Why?
I'm doing an UPDATE of a table in DB2. DB2 has locking mechanism in behind, so until this transaction is committed no one can do anything on this row/table and their program is locked. Why I'm not sure the problem is in my code? Because there is only one thread and only one place in my entire project that does anything with that particular table. It drives me crazy !!!
petek, 4. maj 2007
Vacation
I just can't believe that I've been on vacation the whole week. :))) It was good and I'd love some more. hehe...
I hear that JavaOne is around the corner and as usual I won't be attending. :((
I will be attending our local conference OTS 2007. In fact my article was accepted. :)) A coworker will be on the stage with a big stage fright. :))))
I was planning to get my IPTV hooked up to my compuiter during this vacation, but didn't manage to. Ah, pitty... Maybe on my next vacation in couple of months. hehe...
I hear that JavaOne is around the corner and as usual I won't be attending. :((
I will be attending our local conference OTS 2007. In fact my article was accepted. :)) A coworker will be on the stage with a big stage fright. :))))
I was planning to get my IPTV hooked up to my compuiter during this vacation, but didn't manage to. Ah, pitty... Maybe on my next vacation in couple of months. hehe...
petek, 6. april 2007
Easter
Easter is coming. Families will get together, talk, have fun and great food. :))) I like great food. :)
And I like easter eggs. This ones too.
And the best of all, i get to stay at home for three days. Yuupiii!
And I like easter eggs. This ones too.
And the best of all, i get to stay at home for three days. Yuupiii!
četrtek, 5. april 2007
Digital books
I just read an article in a local computer magazine about why digital books, magazines, ... don't do well. As an example the author showed a case with Steven King when he tried to publish one of his books only in digital form and failed. He concludes that the problem is that each customer can get a digital form of the magazine easy and even not pay for it and he puts his hopes in an efficient methods to secure digital copyrighted work. Hmm... why do I smell DRM here ? I think that now more and more music record labels recognize that DRM is evil. :))
My opinion is that there are NO devices that would have properties of regular paper. I refuse to look at PDFs(for example) on LCDs or some other semi-appropriate device for reading them. I'd like to have a light device, that is nondestructable and easy to handle, like paper is. :)))
Maybe technologies like E-Ink, Digital ink and others will bring the ease of use.
My opinion is that there are NO devices that would have properties of regular paper. I refuse to look at PDFs(for example) on LCDs or some other semi-appropriate device for reading them. I'd like to have a light device, that is nondestructable and easy to handle, like paper is. :)))
Maybe technologies like E-Ink, Digital ink and others will bring the ease of use.
sreda, 14. marec 2007
New server
At my job, we are planning in developing a new version of our server application. More can be read at Javalobby. What I'd like to see in our new server:
- multiprotocol support: support for RMI, JMS, socket so the client can for example initiate a communication via RMI and server sends a reply via JMS. Server can also initiate a connection with a client.
- scalability: server would have to support hundreds, maybe even thousands of concurrent users
- support for file, ftp, mail monitors: sometime we have to import some data from a file that resides on ftp, mail, .... Now we are doing this by hand. I'd like a component that would monitor those things and notify me, maybe even call appropriate method based on where the file came from and it's name.
- transaction support on Object level: this is more a wish than a requirement. We can still use database transactions
- AOP support: this is also a wish, but in this way I'd only have to write my log statements once, maybe I could use it also for transaction support via database transactions.
I like Mule and ServiceMix. The problem is that I don't know how they will behave in real world, mission-critical application. What do you suggest?
- multiprotocol support: support for RMI, JMS, socket so the client can for example initiate a communication via RMI and server sends a reply via JMS. Server can also initiate a connection with a client.
- scalability: server would have to support hundreds, maybe even thousands of concurrent users
- support for file, ftp, mail monitors: sometime we have to import some data from a file that resides on ftp, mail, .... Now we are doing this by hand. I'd like a component that would monitor those things and notify me, maybe even call appropriate method based on where the file came from and it's name.
- transaction support on Object level: this is more a wish than a requirement. We can still use database transactions
- AOP support: this is also a wish, but in this way I'd only have to write my log statements once, maybe I could use it also for transaction support via database transactions.
I like Mule and ServiceMix. The problem is that I don't know how they will behave in real world, mission-critical application. What do you suggest?
torek, 13. marec 2007
NoMachine NX
Usually I use VNC to access my machine. But VNC is slow and it even doesn't transfer characters like {} and such. Maybe it's an issue with Ubuntu's VINO VNC server. I don't know. The fact is that VNC is slow.
Today I discovered that NoMachine provides free NXServer. It only supports 2 simultaneous connections, but it is enough since I'm the only one that accesses my computer remotely. The installation is easy (at least on Ubuntu 6.10):
I got nxclient_2.1.0-17_i386.deb, nxnode_2.1.0-15_i386.deb and nxserver_2.1.0-18_i386.deb
from NoMachine.
And that's it. Then you run nclient from a remote machine. :)))
Today I discovered that NoMachine provides free NXServer. It only supports 2 simultaneous connections, but it is enough since I'm the only one that accesses my computer remotely. The installation is easy (at least on Ubuntu 6.10):
sudo apt-get install openssh-server
sudo apt-get install libstdc++2.10-glibc2.2
sudo dpkg -i nxclient_2.1.0-17_i386.deb
sudo dpkg -i nxnode_2.1.0-15_i386.deb
sudo dpkg -i nxserver_2.1.0-18_i386.deb
I got nxclient_2.1.0-17_i386.deb, nxnode_2.1.0-15_i386.deb and nxserver_2.1.0-18_i386.deb
from NoMachine.
And that's it. Then you run nclient from a remote machine. :)))
četrtek, 8. marec 2007
New LCD monitor
I decided to buy a new LCD monitor. Today I'm using an old CRT Samsung 19" SyncMaster. It is a good monitor, but it does show it's age.
I'm a programmer so I need a good picture quality and a resolution at least 1280x1024. I'm thinking about an Samsung 971P. What do you think?
I'm a programmer so I need a good picture quality and a resolution at least 1280x1024. I'm thinking about an Samsung 971P. What do you think?
sreda, 28. februar 2007
NetBeans Book
I can wait to get my hands on this book . :)))
It should clear up a lot of things regarding developing modules for NetBeans and also using NetBeans Platform.
It should clear up a lot of things regarding developing modules for NetBeans and also using NetBeans Platform.
torek, 27. februar 2007
Linux editor's macro support
At work I'm working a lot with text files (data that is comma delimited, ...) and usually I have to change something in the files, like adding comma at the end of every line, ... So I need an editor with macro support. Well, with macros that can be recorded.
My favourite text editor is vi, but I didn't find that functionality in it. You can write a map command for it, but it is time consuming and not exactly what I want.
Since I'm using GNOME I've tried gedit and no macro support there too. :((
Then I tried Emacs. You can record key strokes, but you cannot link them to a keyboars shourtcut. At least I don't know how. :)))
Since I program in Java a lot I thought maybe some Java editor will help me. I've tried NetBeans (my main development environmet) and Jedit, but they don't feel like text editor to me. :))
Then I though: "Google is your friend." and it was. :))) I've found nedit editor. There you can record a macro and link it to a keyboard shourtcut. I has an ugly GUI, but it does the job fast. I'm happy with it. For now at least. :)))
Are any other editors that know macorded macros out there?
My favourite text editor is vi, but I didn't find that functionality in it. You can write a map command for it, but it is time consuming and not exactly what I want.
Since I'm using GNOME I've tried gedit and no macro support there too. :((
Then I tried Emacs. You can record key strokes, but you cannot link them to a keyboars shourtcut. At least I don't know how. :)))
Since I program in Java a lot I thought maybe some Java editor will help me. I've tried NetBeans (my main development environmet) and Jedit, but they don't feel like text editor to me. :))
Then I though: "Google is your friend." and it was. :))) I've found nedit editor. There you can record a macro and link it to a keyboard shourtcut. I has an ugly GUI, but it does the job fast. I'm happy with it. For now at least. :)))
Are any other editors that know macorded macros out there?
četrtek, 15. februar 2007
SelfCheckout progress
My last post is old :)))
This is because the work I've been doing. I had to do some catch up on the work I didn't do because of the "secret project" :))).
Now I also have to so some work on the communication between our application and the government customs application. It appears that our government is pushing XML into their processes. Interesting... The problem is that the specifications they gave out on how the XML document should look like is not exactly the same as their system want to receive it. The second problem is that when you send an XMl document you don't always get an answer back what was wrong with it. Oh, well... In couple of weeks everything should be OK. :))
This is because the work I've been doing. I had to do some catch up on the work I didn't do because of the "secret project" :))).
Now I also have to so some work on the communication between our application and the government customs application. It appears that our government is pushing XML into their processes. Interesting... The problem is that the specifications they gave out on how the XML document should look like is not exactly the same as their system want to receive it. The second problem is that when you send an XMl document you don't always get an answer back what was wrong with it. Oh, well... In couple of weeks everything should be OK. :))
petek, 2. februar 2007
Secret project revealed :))
Some of you may remember me mentioning a "secret" I was working on.
Now this "secret" project was just revealed on the 31st of January 2007.
It's a SelfCheckout terminal at one of our biggest retailer!!! Woohooo!! :)) It's also the first in this part of the Europe and the first commercial installation of the new version of IBM's SelfCheckout in the world (at least I was told so :))) .
Here are some news, but sadly only in Slovenian language:
- Siol
- Finance
- Planet.si
- Dnevnik
Now this "secret" project was just revealed on the 31st of January 2007.
It's a SelfCheckout terminal at one of our biggest retailer!!! Woohooo!! :)) It's also the first in this part of the Europe and the first commercial installation of the new version of IBM's SelfCheckout in the world (at least I was told so :))) .
Here are some news, but sadly only in Slovenian language:
- Siol
- Finance
- Planet.si
- Dnevnik
sreda, 24. januar 2007
First snow and my first Java bug
Today has started good. :)))
During the night we had our first snow, well only a couple of snowflakes, but nevertheless. :)))
When I came to work I found this in my Inbox:
We have determined that this report is a new bug and entered the bug into our internal bug tracking system under Bug Id: 6516858.
You can monitor this bug on the Java Bug Database at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516858
Woohoo... My first Java but was accepted!!!! It is not yet visible to the external world, since it takes a day or two to propagate through the infrastructure, I guess. :)))
During the night we had our first snow, well only a couple of snowflakes, but nevertheless. :)))
When I came to work I found this in my Inbox:
We have determined that this report is a new bug and entered the bug into our internal bug tracking system under Bug Id: 6516858.
You can monitor this bug on the Java Bug Database at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516858
Woohoo... My first Java but was accepted!!!! It is not yet visible to the external world, since it takes a day or two to propagate through the infrastructure, I guess. :)))
torek, 23. januar 2007
New Java update soon ?
Now you all know that Slovenia's currency is Euro. The problem is that this change is still not propagated into Java. Why? There is a bug reported, but is it closed as NOT A BUG. :))) It says that they will fix the problem as soon as ISO 4217 announced the change. I guess they still didn't do that. Why do standard bodies have to be so slow? It's a simple change!
nedelja, 21. januar 2007
Experiences with €
Slovenia is using € for 21 days now. The prices have gone up a bit (some even for 100,% 200 % :(( ) , my wallet is full of coins and I still don't have a right sence of the value of the currency. I'm sure with time I'll get the feeling. For example before you had to pay for a car couple of millions, but now "only" couple of tens of thousends, so it's a bit different.
The "secret" project I blogged about couple of weeks ago is comming to an end and more will be revealed by the end of the month. Stay tuned ! :))
The "secret" project I blogged about couple of weeks ago is comming to an end and more will be revealed by the end of the month. Stay tuned ! :))
ponedeljek, 1. januar 2007
Happy New Year 2007
I whish to you all a happy new year 2007, full of health, happiness and love. To my countryman I also wish welcome to euro-zone and may you see a lot of big euro notes. :))
Naročite se na:
Objave (Atom)