Saturday, October 25, 2008

Integrate Growl with syslog

Growl is a great notification system for Mac OS X. Integrating Growl is easy, you only have to write a small perl script and reconfigure the syslog system.

syslog.conf
*.notice;authpriv.none;kern.debug;    |exec /bin/growl_log.pl

Perl script
#!/usr/bin/perl
use strict;
use Net::Growl;

my $host = "0.0.0.0"; // Your Apple computer
my $app = "Syslog Integrator";
my $pwd = "xyz123";

Net::Growl::register(host => $host, application => $app, password => $pwd) ;

my $log = `tail -n 1 /var/log/messages`;

Net::Growl::notify(host => $host, application => $app, password => $pwd, title => "Syslog", description => $log);

exit 0;

For more information about Growl, click here.

Saturday, October 11, 2008

Turbo C

Borland Turbo C was my first serious attempt to be an software developer. Earlier I have tried to create computer software with Borland Turbo Pascal with various success.

After a few month I discovered the only limit is your imagination, not the development tool. This knowledge is a "silver bullet" for my professional work today. 

Saturday, October 4, 2008

Powered by FreeBSD 7.0

When I installed a new hard disc drive after a hardware failure on the server, I decided to use FreeBSD version 7.0 instead of Debian GNU/Linux. Like other Unix systems, FreeBSD is a complex, advanced and extremely robust operating system.

Friday, October 3, 2008

Use Perl to Base64 encode and decode files

#!/usr/bin/perl
use MIME::Base64;

# Read entire file at once
local($/) = undef;

if($ARGV[0] eq "enc") {
  print encode_base64(<STDIN>);
}
else {
  print decode_base64(<STDIN>);
}