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

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:
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

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:
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]

č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:
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.

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.

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.

č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.

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)

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.

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. :))

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.