The past few days I’ve been toying with Wifi equipment from D-Link – and access point (DWL-G700AP) and a wireless router (DI-524). These were pretty much the first to wifi-devices, which I’ve completely setup, and configured on my own, so it was an interesting experience. The first experience was in the weekend, when I tried to get a basic TDC Broadband (DSL) connection made avaiable wirelessly. Not knowing too much about Wifi, I though the Access Point was the thing to get, and the DWL-G700AP seemed to be a fair deal in the local IT-vendor.
Navigating around in mysql is quite easy. You can see which databases by using the command “show databases”. There will always exist a database called “mysql” which is used by mysql itself.
If your user account has access to a database, you can access it by using the “use DATABASENAME” command. You can se which tables exist within a database by using the “show tables” command - and see details for each table by issuing the “desc TABLENAME” command.
Micro tip of the day: How many days has past since a date field in the database?
SELECT (TO\_DAYS(NOW()) - TO\_DAYS(date\_field)) AS days\_past FROM tablename
This script fetches a list of available newsgroups (and descriptions) from a news server. The group list is returned as a hashref where the keys are the groupname and the value is a description of the group. #!/usr/bin/perl -w use strict; use Net::NNTP; use MIME::Base64 qw(decode\_base64); use MIME::QuotedPrint qw(decode\_qp); my $server= "sunsite.auc.dk"; print STDERR "connecting to $server... "; my $nntp= Net::NNTP->new($server); unless($nntp) { print STDERR "failedn"; exit 1; } print STDERR "okn"; print STDERR "getting messages.
The followig piece connects to a news-server and fetches subjects from the last week in a specific newsgroup (the Danish perl-newsgroup) and prints these. #!/usr/bin/perl -w use strict; use Net::NNTP; use MIME::Base64 qw(decode\_base64); use MIME::QuotedPrint qw(decode\_qp); my $server= "sunsite.auc.dk"; print STDERR "connecting to $server... "; my $nntp= Net::NNTP->new($server); unless($nntp) { print STDERR "failedn"; exit 1; } print STDERR "okn"; print STDERR "getting messages... "; my $newstuff= $nntp->newnews(time - 7\*24\*2600, "dk.edb.programmering.perl"); unless($newstuff) { print STDERR "failedn"; exit 1; } print STDERR "okn"; my @messages; foreach my $msgid (@$newstuff) { my $head= $nntp->head($msgid); next unless $head; my %msg; push @messages, %msg; foreach(@$head) { next unless /^(Newsgroups|Subject|From):s+(.