Greek in console for old linux systems (readline)

The readline library is responsible for interaction with programs like bash, ftp and psql. With recent versions of the library you don’t need to make the changes described below if you have set LC_CTYPE correctly (see locales part above).

However, with potato or a prior release of Debian, you will need additional configuration. There are two files where you may configure this: /etc/inputrc (system-wide) and ˜/.inputrc (per user). The following configuration should enable you to type foreign characters as well as making programs output them properly.

set meta-flag on
set convert-meta off
set input-meta on
set output-meta on

Advertisement

DNS Performance Testing Project

Σήμερα ένας φίλος sysadmin μου είπε για το DNS Performance Testing Project του ISC. Λέει ότι είναι ακόμα work in progress, αλλά έχει πραγματικά ενδιαφέρον από πολλές απόψεις..

Κατ’ αρχήν μας δείχνει τη μεθοδολογία που χρησιμοποίησε το ISC για να διαλέξει το Server Hardware που θα τρέξει το BIND.

Our experience as authors of the BIND software is that the performance of BIND is limited primarily by the processor and memory performance of the server computer. […] We have identified several candidate server computer configurations based on price and availability and have measured the memory performance (bandwidth, latency, and cache performance) of each.

Και μας δίνει μια σειρά από software tools για να μετρήσουμε κι εμείς στα δικά μας συστήματα ακριβώς αυτά.. memtest86 για memory και cache transfer rates, Calibrator, lmbench και STREAM για (cache-) memory latency και TLB performance.

Μετά, για το Operating System Evaluation, κάνουν capture με tcpdump την κίνηση του F-root και με τη βοήθεια του queryperf το στέλνουν στο BIND που τρέχει σε διάφορα λειτουργικά..

Αφήνω το προφανές σχεδόν ασχολίαστο, γιατί δε θέλω να ξεκινήσουμε Holly War.. Δηλαδή ότι το BIND που έτρεξε σε linux kernel 2.6.x είχε περισσότερα queries/sec απ’ότι σε FreeBSD.. Είναι προφανές ότι δεν το περίμεναν και οι ίδιοι, γιατί λένε ότι θα επαναλάβουν τις μετρήσεις όταν βγει το FreeBSD 7.1.

Σημαντικές παρατηρήσεις είναι ότι

  • Δεν έχει επίπτωση στο server performance το filesize του zone file (αρκεί να είναι μικρότερο από το μέγεθος της physical RAM).
  • Επίσης δεν υπάρχει διαφορά σε performance αν το zone file είναι signed ή unsigned (βλέπε DNSSEC), εκτός του ότι στη signed υπάρχει περισσότερο συνολικό network traffic.
  • Σ’έναν authoritative name server που θέλουμε top performance βάζουμε και τα options
    • check-sibling no;
    • fetch-glue no;
    • recursion no;
    • acache-enable yes;
    • max-acache-size 128M;

    (Για εξηγήσεις βλέπε στο BIND 9.4 Administrator Reference Manual)

milter verify from

Μετά το milter-quota, ένα ακόμα milter βασισμένο στο sample.pl του Sendmail::Milter. Χρειάζεται και το Net::LDAP.

Υποθέτει ότι έχουμε έναν authoritative LDAP με όλα τα emails για τα domains που είναι υπεύθυνος ο mail server μας. Αν κάποιος πάει να μας στείλει mail με envelope from address (από δικό μας domain) που όμως δεν υπάρχει στον LDAP, το κάνουμε REJECT. Ετσι γλιτώνουμε το spam και backscatter από πολλά malware που στέλνουν κάνοντας randomize το from address και κολάνε το domain στο τέλος..


use Net::LDAP;

sub envfrom_callback
{
        my $ctx = shift;
        my @args = @_;

        $email=@args[0]; # format is <user @dom.ain>
        $email =~ s/< (.*)>/$1/; # strip <>
        ($username, $domain) = split (/@/, $email);
        #print "username=$username domain=$domain\n";

        $ldap = Net::LDAP->new("ldapserver");
        $ldap->bind("cn=postmaster,ou=sendmail,dc=mail", password=>"xxxx");
        $mesg = $ldap->search(filter=>"(sendmailMTAClassValue=$domain)",
                 base=>"sendmailMTAClassName=LDAPRoute,ou=classes,ou=sendmail,dc=mail");
        @entries = $mesg->entries;

        if (@entries) { # domain exists in our LDAP
                #print "domain $domain exists in our LDAP, so perform user lookup\n";
                $mesg2 = $ldap->search(filter=>"(mailLocalAddress=$username\@$domain)",
                        base=>"ou=$domain,ou=hosted,dc=mail");
                @entries2 = $mesg2->entries;

                if (@entries2) { # user exists in ldap
                        #print "address $username\@$domain exists in ldap. accept.\n";
                        return SMFIS_CONTINUE;
                } else {
                        #print "address $username\@$domain does not exist in ldap. reject.\n";
                        $ctx->setreply('550', '5.7.1', "Reject: your From address $email does not exist."); #rfc3463
                        return SMFIS_REJECT;
                }
        } else { # domain is not in our LDAP
                #print "domain $domain does not exist in LDAP. accept.\n";
                return SMFIS_CONTINUE;
        }
}

Αλλα παρόμοια milters:

milter quota

Ενα milter για να γλιτώσουμε (κι άλλο) backscatter.

Υποθέτουμε οτι στο mail σύστημά μας έχουμε Frontend και Backend mail servers.

Ενας τυπικός frontend mail server κάνει μία σειρά από ελέγχους, πχ. Reverse DNS Lookups, dnsbl lookups, whitelist/blacklist checks, Level-1 attachment cut-off, Anti-Virus scan κλπ.

Το mail που περνάει επιτυχώς όλα τα παραπάνω, πρέπει να πάει στους backend servers και αφού γραφτεί στο mailbox, να περιμένει τον χρήστη να το διαβάσει. Στην περίπτωση όμως που ο χρήστης υπερβαίνει το quota του, τότε το backend δε θα καταφέρει να γράψει το mail στο mailbox, και θα αναγκαστεί να στείλει ένα NDR bounce message, το οποίο είναι backscatter..

Χρειαζόμαστε ένα μικρό (web)service στο backend, που θα μας λέει αν ένα mailbox είναι στο όριο ή όχι (overquota).

Για παράδειγμα αυτό το cgi script:

#!/usr/bin/perl
# This is /cgi-bin/quota.cgi

use CGI qw(:standard);

$username = param("u");
exit if ($username eq "");

$quota=200*1024*1024; # assume 200MB quota
$home="/var/mail"; # assume mbox format

$size = ( -s "$home/$username" );

print "Content-Type: text/plain\n\n");

if ($size>quota) {
    print "OVERQUOTA $username $size $quota\n";
} else {
    print "OK $username $size $quota\n";
}

Στο frontend εγκαθιστούμε τα perl modules LWP και Sendmail::Milter.

Παίρνουμε το sample.pl από το Sendmail::Milter και το διαμορφώνουμε κατάλληλα:

use LWP::Simple;

sub envrcpt_callback
{
        my $ctx = shift;
        my @args = @_;

        $email=@args[0]; # format is <user @dom.ain>
        $email =~ s/< (.*)>/$1/; # strip <>
        ($username, $domain) = split (/@/, $email);

        $be_response = get("http://$backend/cgi-bin/quota.cgi?u=$username");

        if ($be_response =~ /OVERQUOTA/) {
                #print "$email overquota\n";
                #RCODE 452 Requested action not taken: insufficient system storage (RFC 2821)
                #XCODE 4.2.2 Mailbox full (RFC 3463)
                $ctx->setreply('452', '4.2.2', "Quota exceeded for $email, try again later");
                return SMFIS_TEMPFAIL;
        }
        else {
                #print "$email not overquota\n";
                return SMFIS_CONTINUE;
        }
}

Το mail προς κάποιο overquota mailbox γίνεται tempfail και όχι reject, ώστε αν ο χρήστης αδειάσει το mailbox του να πάρει τα mails αργότερα..

Update: There is now a proof-of-concept cgi script for Maildir.

IPv6 Addresses for the Root zone

Από χθες μπήκαν IPv6 addresses στο root zone για 6 root servers.

On or about 4 February 2008, for the first time AAAA records for some of the authoritative name servers for the DNS root zone will be introduced. These records will provide for access to the root servers over IPv6 transport, and will be implemented in both the root zone data, and the root hints file. We are providing this advanced notification in case unexpected network events occur that might be related to this change.

Οπότε καλό είναι να κάνουμε update το hint file σε όλους τους name servers μας (δεν πέρασε και πολύς καιρός από την τελευταία αλλαγή)..

(via)