fire.java

fire.java

I wrote this small applet twenty years ago, lost it to the sands of time – and found it again at http://www.1archive.com/java/fire/… (Thanks guys!)

If you have a half-decent browser, it will probably refuse to show the embedded applet in the fire.html page,
so use this command instead:

$ appletviewer https://javier.rodriguez.org.mx/java/fire/fire.html

The source code is available at https://javier.rodriguez.org.mx/java/fire/.

Happy 20th Birthday, Java!

uHOWTO: NTP in Windows 2003 – manual intervention required

Atomic Clock Up to Windows 2000, using an NTP server as the time source was as simple as entering the server address in the Time/Date control panel. From 2003 onwards, you must follow the procedure detailed in KB816042 to configure the Windows Time service to use an external time source.

Paraphrasing:

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type=”NTP”
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags=5
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer=1
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters=”pool.ntp.org,0x1″
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval=900
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxPosPhaseCorrection=3600
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxNegPhaseCorrection =3600
  • net stop w32time && net start w32time

You may replace pool.ntp.org above for any other server (or servers, space-separated) with “,0x1” after each host name. And keep an eye in the Event Log after you restart the service.

MySQL fails after upgrade to 5.1 on Debian Squeeze

Are you running Debian Squeeze?
Did you upgrade to mysql-server-5.1 ?
Are you getting a message like this?

Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

Did you read /usr/share/doc/mysql-server-5.1/README.Debian.gz ?
Go read it again and this time *comment out* skip-bdb in /etc/mysql/my.cnf:
perl -i.bak -pe 's/^(skip-bdb)/#$1/' /etc/mysql/my.cnf

Missing vmnetcfg.exe?

It turns out that from VMware Player 3.0 onwards, vmnetcfg.exe is included in the installer package but is not installed by default, so configuring NAT or additional network interfaces is next to impossible. Luckily, Tony has devised a solution for this particularly annoying problem.

uHOWTO: Force script recompilation in embedded Perl Nagios

nagiosI just implemented elwell’s notify_via_jabber and it did not work at first. I got the following message in nagios.log:

[1237223883] **ePN failed to compile /usr/local/bin/notify_via_jabber: "Can't locate Net/XMPP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/sh
are/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at (eval 1) line 14,
BEGIN failed--compilatio" at /usr/lib/nagios2/p1.pl line 157.

I promptly apt-get installed libnet-xmpp-perl but the problem persisted — with the exact same error message. But Net::XMPP was now there!!
Well it happens that Embedded Perl Nagios (ePN) caches the compiled script and does not try to recompile it until its timestamp changes. So I touched(1) the script and this time the dependency was resolved correctly and the script was compiled sucessfully.

# touch /usr/local/bin/notify_via_jabber

This is probably documented somewhere, but I could not find any reference to this kind of problem with Nagios cached scripts so I tought I would share this simple recipe.

uHOWTO: Recover an empty Podcast playlist in iTunes

PodcastOur main iTunes box had flaky RAM -a heck of a problem to debug by itself- so it used to BSOD quite a lot during the past couple of months. One of the most common side effects was that the iTunes Podcast playlist would appear empty every now and then. Luckily this is addressed in the Apple Knowledge Base and the solution amounts to using File|Add Folder to Library to add the {iTunes Music folder}/podcast folder to the library. Then you will have to re-activate your subscriptions by pressing the “Subscribe” button for all your favorite podcasts.

uHOWTO: Recover stuck modified keys from VMware Player or Workstation

If you use VMware Player or VMware workstation under Linux and you’re an alt-tab fan like me, you might end up with stuck modifier keys, so you can’t use keys like Ctrl, Alt or Shift outside of VMware. Xiao Feng has written a nice script to recover from this annoying condition without having to reboot, and I tought I’d share it with everyone out there:

#!/bin/sh
# Xiao Feng's "Recovering from stuck modifier keys caused by VMware"
# http://bitubique.com/tutorials/recovering-from-stuck-modifier-keys
/usr/bin/xmodmap - << fixme clear shift add shift = Shift_L Shift_R clear lock add lock = Caps_Lock clear control add control = Control_L Control_R clear mod1 add mod1 = Alt_L Alt_R clear mod2 add mod2 = Num_Lock clear mod3 clear mod4 add mod4 = Super_L Super_R clear mod5 add mod5 = Scroll_Lock fixme xset r on xset m 3.5 4 xset b off xset s off