nedelja, 1. junij 2014

Touchscreen with multiple monitors

I'm using Xubuntu 12.04.4 and have two monitors (one touch and one regular).
I'm using arandr to set the extended desktop (regular monitor is right of touch monitor).
This also messes up touch input, since the system thinks the whole extended desktop is touch.

Recent X.org servers have a property for setting how input device events are translated to screen coordinates. The property is called "Coordinate Transformation Matrix". More on setting it can be found here.

In my case both montiors have resolution of 1366x768 so the transformation matrix looks like: 0.5 0 0 0 1 0 0 0 1 (touch has to work only on half of the extended desktop). You can set the matrix like this:

xinput set-prop TOUCH_DEVICE_ID "Coordinate Transformation Matrix" 0.5 0 0 0 1 0 0 0 1

You can get TOUCH_DEVICE_ID from "xinput --list".

nedelja, 11. maj 2014

D3GO in VirtualBox

D3GO service from Telemach uses ViewRight plugin for displaying TV picture on your computer. This plugin is not supported on Linux.
Well, I've tried installing Pipelight and using viewright-caiway plugin, but the plugin was constantly crashing.
I installed VirtualBox with Windows XP guest. I've also installed VirtualBox Guest addition in Windows safe mode. While installing Guest additions select 3D support.
When everything is installed go to settings for Windows XP virtual machine and select 2D acceleration, 3D acceleration support and set video RAM to 64 MB.
Now boot Windows XP virtual machine and D3GO should work after you install ViewRight.

EDIT: If you have choppy sound, try setting ALSA Audio Driver in VirtualBox Settings.

ponedeljek, 24. marec 2014

How to remotly restart/shutdown Linux box

Usual commands are:
sudo reboot
sudo shutdown -h now
But if those two don't work, you can use this as root:
- force reboot:
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
- force shutdown:
echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger
WARNING: This does not sync any disks, ....
You could also try
echo s > /proc/sysrq-trigger 
to sync disks before reboot/shutdown.
For all values of /proc/sysrq-trigger go to kernel documentation

sreda, 22. januar 2014

Monitor DB2 rollback progress

If you have a large transaction that is in rollback status and you want to know how much of the work is rollbacked then you can use this:
- get AGENT ID for the connection that is in rollback status (db2 list applications show detail)
- run db2 get snapshot for application agentid YOUR_AGENT_ID | grep Work

torek, 14. januar 2014

Running NetBeans from Unity launcher gives you two icons for NetBeans

When you add NetBeans desktop file to Unity launcher and run it, you could get two icons for NetBeans.
Steps to solve this:
- remove NetBeans from launcher
- add StartupWMClass=NetBeans IDE 7.4 to desktop file
- add NetBeand back to launcher

This is how my netbeans.desktop files looks like:
[Desktop Entry]
Encoding=UTF-8
Name=NetBeans IDE 7.4
Comment=The Smarter Way to Code
Exec=/bin/sh "PATH_TO_NETBEANS_EXEC"
Icon=PATH_TO_NETBEANS_ICON
Categories=Application;Development;Java;IDE
Version=1.0
Type=Application
Terminal=0
Name[sl]=NetBeans IDE 7.4
StartupWMClass=NetBeans IDE 7.4
OnlyShowIn=Unity;
X-UnityGenerated=true

četrtek, 9. januar 2014

Improving security in Firefox

Today I found a nice website that tells you how secure your TLS/SSL client is. 
I'm using Firefox 26.0 and the website said that my TLS client is "Bad".
Btw., Google Chrome  31.0.1650.63 is rated as "Probably OK" from the start.
Hmm, Firefox can't be so much worse than Chrome, right?

So, couple of minutes later that I found another website that helped me bring Firefox to the same level with couple of steps:
- go to about:config
- set security.tls.version.min to 1 (TLS 1.0)
- set security.tls.version.min to 3 (TLS 1.2)
- set security.ssl3.rsa_fips_des_ede3_sha to false to disable SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA chiper, which is known to be insecure

četrtek, 12. december 2013

VirtualBox error: UUID does not match the value ....

When you try and start a VirtualVM VM and get this error:
UUID {SOME_UUID} of the medium 'PATH_TO_VDI' does not match the value {SOME_UUID} stored in the media registry ('PATH/VirtualBox.xml')

then you could solve it with this steps:
- open File - Virtual Media Manager
- do Release on the problematic VDI
- do Remove on the problematic VDI. Don't delete the physical file
- on specific VM attach the VDI back

sreda, 27. november 2013

Faster fetch from DB2 cursor

If you are using cursors in DB2 procedures, for example, and you don't use them to update the data, you can significantly improve fetch performance using FOR READ ONLY:

    DECLARE XSQL                    VARCHAR(10240);
    DECLARE XSQLSTATE_1             STATEMENT;
    DECLARE XRESULT_SET_1           CURSOR WITH RETURN TO CLIENT FOR XSQLSTATE_1;

    SET XSQL = 'SELECT * FROM SYSIBM.SYSDUMMY1 FOR READ ONLY WITH UR';
    PREPARE XSQLSTATE_1 FROM XSQL;
    OPEN XRESULT_SET_1;

XRESULT_SET_1 is returned back to the client, so it can iterate over the data.

No menus in Java applications under Ubuntu

If you run a Java application under Ubuntu and you don't see any menus (when you klick on a menu, you don't see menu items) run the application like this (example for running jmc):
UBUNTU_MENUPROXY= jmc

This will disable menu proxy for this application. More on disabling menu proxy here.

nedelja, 24. november 2013

Disc burning software under Ubuntu

Take my advice and only use k3b. It does install a lot of stuff from KDE, but it is worth it.
I've used brasero, cdw, bashburn, ... but k3b is the only one that works as you'd expect.

Not able to change desktop wallpaper on Ubuntu

sudo apt-get install dconf-tools
dconf-editor
go to org -> gnome -> settings-daemon -> plugins -> background and activate "active" :)

Now you will be able to change desktop backgroup

četrtek, 17. oktober 2013

Make java plugin run in Chrome under Linux

If you go to http://www.java.com/verify/ and Chrome want's you to install Java plugin follow this steps:

mkdir /opt/google/chrome/plugins
cd /opt/google/chrome/plugins
ln -s /usr/local/jre1.7.0_45/lib/i386/libnpjp2.so .

torek, 10. september 2013

Getting SQL917 on DB2 while executing DDL statements

I'm using DB2 9.7.5 Express-C on Windows and Linux. Usually I get this if I'm running a lot of DDL statements in a transaction.
The only solution until now that I found is to restart the database and reissue DDL statements.

If anyone knows more about this please comment.

Grouping icons on Unity launcher

During past months that I've been using Ubuntu and Unity the Launcher got crowded with vaious icons of program I installed and program I put on the launcher.
Things gor messa, so I needed a solution. It came to me in a form of "Drawers". More on the can be found here and here.

Tabs in Skype

I'm using Skype 4.2.0.11 and I'd like to have Skype use one window for all the things I do with it. By default it has two winodws (Contact and Chat window).
This can be changed by using SkypeTab found at http://keks-n.net/skypetab/
Now I can see my contacts on the left side of the windows and chats, each in it's own tab, on the right side.

ponedeljek, 1. julij 2013

How to drop a DB2 instance if instance owner does not exist anymore

Let's say that your instance owner was user db2inst1 and you removed it via OS tools. When you want to uninstall DB2 it complains that you have to drop db2inst1 instance. Running db2idrop gives you error, since user db2inst1 does not exist anymore. In this case you can use this:
db2greg -delinstrec instancename=db2inst1
db2greg is a nice tool that lets you display and alter global registry. More at DB2 10.1 Info Center

Enable hibernate in Ubuntu 13.04

Follow these steps:
- open terminal
- sudo vi /var/lib/polkit-1/localauthority/50-local.d/hibernate.pkla
- paste these lines:

[Re-enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

- reboot

torek, 25. junij 2013

NetBeans in maximized mode on Ubuntu 13.04

Today I upgraded my laptop (Dell Latitude E5520) to Ubuntu 13.04.
On there I'm also running NetBeans 7.3.1 on JDK 1.7.0_25. The problem I had was that when I maximized NetBeans the content of the window was not refreshed.
After testing several settings I found that setting sun.java2d.opengl=false fixed the problem.

Laptop is using Intel graphics card with a i915 driver. Maybe there is some kind of a problem between this setting and Java. I don't know.

petek, 19. april 2013

Mouse not working after suspend in Ubuntu 12.04

If you mouse is now working after computer gets back from suspend try this:

  • sudo vi /etc/pm/sleep.d/20_custom-ehci_hcd:
#!/bin/sh
# File: "/etc/pm/sleep.d/20_custom-ehci_hcd".
TMPLIST=/tmp/ehci-dev-list
case "${1}" in
        hibernate|suspend)
        ;;
        resume|thaw)
     chvt 1
     chvt 7
        ;;
esac

  • sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd 

četrtek, 28. marec 2013

Initialize DB2 environment in cmd

Usually when I want to work with DB2 on Windows I run db2cmd, so the DB2 environment gets initialized. However this does not work if I'm connected to a Windows machine via SSH, since db2cmd opens new cmd window.
Solution to this problem is typing "db2cmd -i -w db2clpsetcp" in cmd. Wihout quotes of course.