Asian characters accidently showing up in Word, Outlook, ...

Submitted by Jochus on Sun, 02/06/2013 - 21:44 | Posted in: Windows
Posted in

I sometimes accidently press a key combination in Word or Outlook which suddenly activates some Asian keyboard. I'm unable to type any other Western character.

The problem was related to me: when you press Alt + Shift, the Asian keyboard is activated. By pressing this key combination again, the Western keyboard is reactivated.

Copy/paste fails in CoRD when multiple remote desktop sessions are active

Submitted by Jochus on Thu, 16/05/2013 - 21:40 | Posted in: Mac
Posted in

I often ran into an issue with CoRD failing to copy/paste between my host machine and my remote desktop machine. This only occured when multiple remote desktop session were active. The clipboard chain gets broken and copy/paste between the host machine and the remote desktop stops working.

To solve this, you need to execute the following batch file on the remote machine:

@echo off
taskkill /IM rdpclip.exe /F
start %SystemRoot%\system32\rdpclip.exe

Logging all queries executed on MSSQL database

Submitted by Jochus on Sat, 30/03/2013 - 18:00 | Posted in: Database
Posted in

Related to this blogpost, I wanted to log all queries executed on a Microsoft SQL Server database.

This can easily be done by the SQL Server Profiler, which gets shipped with the SQL Studio Express application of Microsoft.
However, after navigating through my webapplication (which uses JPA (Hibernate)), I could only see a bunch of the following SQL statements:

EXEC sp_execute 6, 8
EXEC sp_execute 7, 8
EXEC sp_execute 4, 8

Hibernate is running a prepared query. To get the actual SQL query, you can run the following query (you will still have to look for the query, but, it's getting you a lot closer then sp_execute :-)):

SELECT        SQLTEXT.text, STATS.last_execution_time
FROM          sys.dm_exec_query_stats STATS
CROSS APPLY   sys.dm_exec_sql_text(STATS.sql_handle) AS SQLTEXT
WHERE         STATS.last_execution_time > GETDATE()-1
ORDER BY      STATS.last_execution_time DESC

By tweaking the WHERE clause, you can easily retrieve the quer(y)(ies) you are looking for :-)!

Cron entries removed after Synology DS213 reboot

Submitted by Jochus on Sat, 23/03/2013 - 13:45 | Posted in: Linux
Posted in

Yesterday, I came to the conclusion all my cron entries were removed (for the second time!) in my /etc/crontab file on my Synology DS213 NAS server.

I noticed the cron entries were removed after a system reboot. I figured out Synology has some problems with cron entries having columns separated with spaces (not tabs). All entries including spaces are removed on system startup.

Updating my crontab by putting tabs (\t) between the columns, fixed the problem.