Archive for May, 2008

Converting openssh key from seahorse to putty

If you want to use your key generated in Seahorse in Putty you’ll have to convert it. The process is clear – make export of private key in Seahorse and import it to Puttygen. However one extra step is required – you have to delete everything before —–BEGIN DSA PRIVATE KEY—– mark. Otherwise Puttygen won’t recognise private key.

Saturday, May 31st, 2008

Finding matrix’s max or min element in MatLab

Function max(A) (or min(A)) return a row vector with maximum (minimum) elements from each column of matrix A. If you need to find largest or smallest element in the vhole matrix, you should use max() or min() function once again: max(max(A)) or min(min(A)).

Sunday, May 18th, 2008

Prototype.js formElmt.request() and non-valid HTML

Handy and pretty $('myform').request() can be easily broken if you have really broken HTML. For example:

<table>
<form id="myform">
  <input />
  <input />
  <tr><td></td></tr>
</table></form>

$('myform').serialize() will return empty string for such html. As a result you’ll have ajax request with no parameters, obviously not what you’ve expected. Fix html and everything will work.

Friday, May 16th, 2008

Add font to your system (Windows)

When you working with graphics, for example in Photoshop, you may need to use nonstandart fonts. To add new font you can copy font file to Windows/Fonts directory. You can access it using usual file manager or via Control Panel -> Fonts.

Tuesday, May 13th, 2008

tty’s killed on Ubuntu Hardy Heron VPS

If you’ve upgraded your Ubuntu VPS to 8.04 check your syslog. It could happen that getty processes are being killed all the time:

May  2 06:28:54 vps_server init: tty3 main process (19690) terminated with status 1
May  2 06:28:54 vps_server init: tty3 main process ended, respawning
May  2 06:28:59 vps_server init: tty6 main process (19753) terminated with status 1
May  2 06:28:59 vps_server init: tty6 main process ended, respawning
May  2 06:29:00 vps_server init: tty5 main process (19764) terminated with status 1
May  2 06:29:00 vps_server init: tty5 main process ended, respawning
May  2 06:29:00 vps_server init: tty1 main process (19772) terminated with status 1
May  2 06:29:00 vps_server init: tty1 main process ended, respawning
May  2 06:29:02 vps_server init: tty4 main process (19891) terminated with status 1
May  2 06:29:02 vps_server init: tty4 main process ended, respawning
May  2 06:29:02 vps_server init: tty2 main process (19892) terminated with status 1
May  2 06:29:02 vps_server init: tty2 main process ended, respawning
...

To get rid of this (you don’t need terminals on remote machine) edit files /etc/event.d/tty1, /etc/event.d/tty2, etc and comment lines that causes respawning:

respawn
exec /sbin/getty 38400 tty1

Friday, May 9th, 2008