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