Create relationship diagrams with Graphviz

I discovered this amazing article about a a program called Graphviz.

It produces stunning graphs, like this one:

I already see an opertunity for dynamic data in MySQL and using the Graphviz Perl module :)



Mandriva LE ADSL Fix for Telkom ADSL

I have noticed that on Mandriva LE, ADSL is a bit broken. Problems include DNS and routing info which is not correctly retrieved remotely.

I have done my own hack, so I hope some body else can find it useful.

First you will need to create two files:

File 1 : /root/bin/adsl-fix.sh
1 #!/bin/sh
3 echo 'nameserver' > /etc/resolv.conf
4 echo 'nameserver' >> /etc/resolv.conf
6 route add default gw dev ppp0
7 route del -host

File 2 : /root/bin/adsl-monitor.pl
 1 #!/usr/bin/perl
my $statuscmd = "/usr/bin/HEAD -t 30 www.google.com | /usr/bin/head -1";
4 my $statusres = `$statuscmd`;
5 chomp( $statusres );
6 $statusres =~ /(\d+)/;
7 if( $1 == 200 ) {
9 print "Test web site status OK.\n";
11 } else {
13 print "Reloading ADSL settings...";
14 my $res = `/root/bin/adsl-fix.sh`;
15 print " DONE.\n";
17 }

The following crontab can be added to the root user:
*/15 * * * * /root/bin/adsl-monitor.pl

The above interval is set to run every 15 minutes. What will happen is that the program adsl-monitor.pl will check for the availability for the www.google.com site. If the operation times out, the DNS and routing table is corrected.

This solution might not work for every one. I still don't know if you have to maybe change the default gateway address? Maybe some one knows :)

Anyway - I hope this helps some one. In the mean time I will try to get a cleaner solution working.


This page is powered by Blogger. Isn't yours?