Γιατί ο Έλληνας για να διαπρέψει πρέπει να ξενιτευτεί;

Δίαβασα πρόσφατα αυτό το άρθρο. Παραθέτω την αρχή του:

"Έχει αναρωτηθεί ποτέ κανείς γιατί κανένας Έλληνας δεν έχει αναγνωριστεί ποτέ στον τόπο του; Γιατί ο Έλληνας για να διαπρέψει πρέπει να ξενιτευτεί;"

Δεν ξέρω ποιος ή τι εκνεύρισε τον alex για να το γράψει, αλλά η απάντηση είναι απλή: Φταίει η υπερσυγκέντρωση Ελλήνων στον ίδιο γεωγραφικό χώρο.

Installing OpenBSD 3.9 on a Soekris 4801

There are many ways to install OpenBSD 3.9 on a Soekris 4801. One can refer to flashdist and OpenSoekris. This is an alternate method. Why? Because it can be done. Flashdist and OpenSoekris aim at smaller distributions (~ 32MB) while using my way you get a more complete OpenBSD installation.

  1. Setup a DHCP server

    I use the ISC DHCP server. The relevant part in the dhcpd.conf is:

    host foo {
            hardware ethernet 00:00:24:XX:YY:ZZ;
            fixed-address foo.bar.tee.gr;
            filename "pxeboot";
    }
    

    The above configuration presupposes that your DHCP server is going to be used as a TFTP server also.

  2. Stuff to do on the TFTP server

    Assume that the tftp root directory is /tftpboot. Place on /tftpboot the file
    pxeboot that is found on the OpenBSD distribution.

    Also, place on /tftpboot the install kernel, bsd.rd.

    Next, mkdir /tftpboot/etc. Create a file named /tftpboot/etc/boot.conf with the following contents:

    set tty com0
    stty com0 9600
    boot bsd.rd
    
    

    If your 4801 console is setup to a different baud rate, either change this here, or on your 4801’s console. Refer to the Soekris BIOS documentation on how to do this.

    If your inetd/xinetd makes use of /etc/hosts.{allow,deny} then take care to allow foo.bar.tee.gr to access the tftp server.

  3. Netboot your Soekris 4801

    According to the Soekris documentation on the Soekris BIOS prompt you should type:

    boot f0
    

  4. Install OpenBSD 3.9

    This procedure is best covered by the OpenBSD documentation.

    What you need to remember is that you are installing on a Compact Flash. Therefore you do not need a swap partition. But OpenBSD does not install unless you have a swap partition. So you can create a swap
    partition with size of 1 (yes one):

    
    Initial label editor (enter '?' for help at any prompt)
    > p
    device: /dev/rwd0c
    type: ESDI
    disk: TOSHIBA THNCF25
    label:
    bytes/sector: 512
    sectors/track: 32
    tracks/cylinder: 16
    sectors/cylinder: 512
    cylinders: 978
    total sectors: 500736
    free sectors: 0
    rpm: 3600
    
    16 partitions:
    #             size        offset  fstype [fsize bsize  cpg]
      a:        500703            32  4.2BSD   2048 16384  578
      b:             1        500735    swap
      c:        500704            32  unused      0     0
    > w
    > q
    

    When you need to select what sets to install, you select only:

            [X] bsd
            [ ] bsd.rd
            [ ] bsd.mp
            [X] base39.tgz
            [X] etc39.tgz
            [ ] misc39.tgz
            [ ] comp39.tgz
            [ ] man39.tgz
            [ ] game39.tgz
            [ ] xbase39.tgz
            [ ] xetc39.tgz
            [ ] xshare39.tgz
            [ ] xfont39.tgz
            [ ] xserv39.tgz
    Set name? (or 'done') [bsd.mp] done
    

    Halt the system

  5. Configure the System

    Boot in single user mode. Interrupt the OpenBSD boot procedure (not the Soekris BIOS one) and type boot -s. When the system boots, perform the next steps:

    mount -o rw /
    mkdir /mfs
    

    Modify /etc/rc to execute the following script:

    # add a line after the rm -f /fastboot entry in /etc/rc to execute this
    # script: /usr/local/sbin/setup_mfs.sh
    #
    # This preassumes that you have moved /var/log to /var/log.template
    # and /var/mail to /var/mail.template
    #
    # /tmp -> /mfs/var/tmp
    # /var/tmp -> /mfs/var/tmp
    # /var/log -> /mfs/var/log
    # /var/run -> /mfs/var/run
    # /var/mail -> /mfs/mail
    #
    echo mfs: mounting /mfs...
    mount_mfs -s 16384 /dev/wd0b /mfs
    mkdir -p /mfs/var/run
    mkdir -p /mfs/var/tmp
    chmod 1777 /mfs/var/tmp
    cp -Rp /var/log.template /mfs/var/log
    cp -Rp /var/spool/mqueue /mfs/mqueue
    cp -Rp /var/spool/clientmqueue /mfs/clientmqueue
    cp -Rp /var/mail.template /mfs/mail
    #
    # EOF
    

    Do not create the symbolic links yet!

    chmod +x /usr/local/sbin/setup_mfs.sh
    

    Edit /etc/mail/sendmail.cf and /etc/mail/submit.cf and change the entries for clientmqueue and mqueue to point at /mfs/{clientmqueue,mqueue}

    Create all the symbolic links discussed above and reboot.

    After the first reboot, edit /etc/fstab to mount / as read-only:

    /dev/wd0a / ffs ro,noatime 1 1
    

    On a 256MB Compact Flash df -h shows:

    # df -h
    Filesystem     Size    Used   Avail Capacity  Mounted on
    /dev/wd0a      240M    136M   91.8M    60%    /
    mfs:28643      7.8M    112K    7.3M     1%    /mfs
    

Comments, flames and improvements are welcome.

P.S. What about the PC Engines WRAP?

Using clamscan inside /etc/procmailrc

[ Originally I wrote this in June 2, 2004 ]

If for whatever reason you want to use ClamAV with sendmail and cannot use the clamav-milter (like when working with RedHat ES and its stock sendmail), using procmail as your local delivery agent might help. This is a very simple /etc/procmailrc:

# adamo, Thu May 27 16:26:48 EEST 2004

# Set the default path
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

# Uncomment this to monitor the recipes
#LOGFILE=/var/log/procmail.log

# NEVER forget the last dash (-) on the follwoing command
:0 Wc: /var/tmp/clamscan.${PPID}.$$.lock
| /usr/local/bin/clamscan --stdout --tempdir=/var/tmp --quiet --mbox -

# Delete emails that contain virii
:0 e: /var/tmp/formail.${PPID}.$$.lock
/dev/null

# Tag emails that contain virii
## :0 eWf: /var/tmp/formail.${PPID}.$$.lock
## | /usr/bin/formail -i "Subject: VIRUS FOUND -- PLEASE DELETE ME"

See also at the ClamAV wiki: ClamAndProcmail.

connect to a SMTP server via ssh

[ Originally this note was written in January 2004 in order to help dblab‘s users connect to the laboratory’s SMTP server while connected to the Internet via an ISP (from their home for example). At the time the University‘s NOC did not allow neither port 25/tcp nor port 587/tcp incoming connections. ]

  • Download plink.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (the PuTTY distribution site).
  • Open a DOS window and issue the command:
    C:\TEMP> plink -t -C -ssh -2 -L 25:lab.smtp.server:25 user@lab.smtp.server
  • For as long as the plink.exe shell is open, you can use localhost (IP address: 127.0.0.1) as the outgoing email server for your mail client (be it Outlook, Eudora, Lookout Express, whatever).

TERENA Anti Spam BoF 1998/01/28 minutes

* Όπως λέει και ο τίτλος, το κείμενο γράφτηκε τον Ιανουάριο του 1998 και περιγράφει ένα BoF στο οποίο συζητήθηκε για πρώτη φορά σε joint TERENA – RIPE meeting η ανάγκη οργάνωσης των μελών τους για την αντιμετώπιση του spam.

TERENA Anti Spam BoF 1998/01/28 minutes.

Το antispam meeting έγινε στο Park Plazza Hotel στις 28/1. Το παρακολούθησαν περίπου 200 άτομα. Από πλευράς GRNET ήταν παρόντες ο Γιώργος Αδαμόπουλος και ο Παναγιώτης Χριστιάς. Η συνάντηση διήρκησε περίπου 2:30 ώρες.

Τη συζήτηση ξεκίνησε ο John Martin (JM) από το _TERENA_ staff. o JM πρότεινε να επικεντρωθεί η συζήτηση στο email spam (Unsolicited Commercial Email, Bulk Email), καθώς το _USENET_ spam είναι ένα ξεχωριστό κεφάλαιο από μόνο του. Σκοπός του για την οργάνωση αυτού του meeting ήταν η κατανόηση του φαινομένου από όλους και η διερεύνηση του τι μπορεί να γίνει στα πλαίσια του RIPE.

[ Το φαινόμενο ήταν πλήρως κατανοητό στο ακροατήριο γιατί περίπου το 70%των παρευρισκομένων ήταν Postmasters και άρα καλοί γνώστες του προβλήματος. ]

Οι τρεις στόχοι που καθορίστηκαν, ήταν:

  • maximum effect / least pain
  • measures
  • deployment

Το πρώτο πράγμα που προτάθηκε ήταν η δυνατότητα authentication στο SMTP επίπεδο. Ειπώθηκε από παρευρισκόμενο ότι ήδη στα πλαίσια του IETF υπάρχει προσπάθεια για την επίλυση αυτού του ζητούμενου στα πλαίσια κάποιου RFC. [ Ήδη έχει εκδοθεί και κάποιο σχετικό IETF draft ].

Mία πρόταση που έγινε ήταν να επεκταθεί το RIPE-DB ώστε να περιλαμβάνει τα modem-pools των διαφόρων providers και να αποφεύγονται οι απ’ευθείας συνδέσεις από και προς τις διευθύνσεις τους. Αυτή η πρόταση απορρίφθηκε ως σχεδόν αδύνατη να εφαρμοστεί στην πράξη.

Το επόμενο που συζητήθηκε ήταν η χρήση του MAPS/RBL project. Τα σχετκά links είναι στο . [ Σημ.: Το sendmail.8.9.0.Beta3 ήδη προβλέπει το FEATURE(`rbl’) για αυτό το σκοπό ]. Παρ’όλο που οι περισσότεροι συμφώνησαν πως η πληροφορία του RBL είναι χρήσιμη, οι περισσότεροι δήλωσαν πως δεν το χρησιμοποιούν για να αρνούται SMTP connections.

Παρ’όλο που ειπώθηκε πως οι Ευρωπαίοι γενικά δεν είναι spammers, υπήρξαν διάφοροι που σημείωσαν πως στις Ευρωπαϊκές χώρες το spamming περιορίζεται εντός των συνόρων. [ Σε αυτό το σημείο ο συγγραφέας του draft για το SMTP authentication είπε: “If the US spammers are the problem, I say cut the wire!” ;-) ].

Από παρευρισκόμενο προτάθηκε να ακολουθολυνται οι εξής απλές διαδικασίες για να αποφεύγεται το φαινόμενο:

  • Stop unauthorised relaying
  • IP SMTP filtering
  • DNS lookups

Το πρόβλημα που σημειώθηκε σε σχέση με τα παραπάνω είναι ο κίνδυνος το DNS lookup cache να μεγαλώσει τόσο πολύ ώστε να είναι επικίνδυνο για τη σταθερότητα του συστήματος. Ο ομηλιτής είπε: “Sure, you all say do *always* DNS lookups. But no one speaks of the cost when the DNS cache reaches up to more than 20Mbytes”.

Μια πρόταση για να δημιουργηθεί ένα προτόκολο για SPAM-MTAs απορρίφθηκε μετά βαϊων και κλάδων, κυρίως γιατί κανείς spammer δεν θα χρησιμοποιεί ένα τέτοιο MTA.

Ο JM στη συνέχεια θέλησε να κάνει ένα profile “του καλού spammer”: Υπέθεσε με ασφάλεια ότι οι spammers είναι μάλλον αρκετά έξυπνα άτομα με τεχνική κατάρτιση και γνώση του αντικειμένου. Πολλοί όμως από το ακροατήριο παρατήρησαν πως σε αρκετές από τις περιπτώσεις spamming που κυνήγησαν, διαπίστωσαν πως είχαν να κάνουν με ανθρώπους που έστελναν τα μηνύματά τους μέσω point-and-click GUIs και που δεν είχαν καμία γνώση για το πιθανό προβλημα που μπορεί να προκαλούσαν.

Από το παραπάνω κατέληξαν όλοι πως τελικά οι ISPs οφείλουν να έχουν ένα τέτοιο AUP (Acceptable Usage Policy) ώστε να προβλέπουν κυρώσεις για τέτοια συμβάντα. Σε αυτό το σημείο έγινε και η παρατήρηση πως το cost-model στο Internet είναι τέτοιο ώστε ο spammer να μπορεί να κάνει πολύ εύκολα τη δουλεία του. Το κόστος να στείλει κανείς 10000 spam mails από το Internet είναι το ίδιο με το να στείλει ένα. Σε αυτό το σημείο υπάρχει μια σημαντική διαφορά κόστους ανάμεσα στο snailmail (Ταχυδρομείο) και το Email.

Σε αυτό το σημείο σχολιάστηκαν οι διάφορες τεχνικές για την αντιμετώπιση των spams. Οι περισσότεροι Postmasters αρνούνται emails με βάση anti-relaying rulesets και κάποια γνωστά originating sites. Όλοι συμφώνησαν πως το content-based filtering είναι πολύ επικύνδινο και πρέπει να αποφεύγεται, εκτός εάν γίνεται από τον τελικό χρήστη. Εδώ ένας ομιλητής είπε οτι κρατάνε ένα MD5-hash για κάθε mail που γίνεται relay από τα μηχανήματά τους, ώστε αν ξανασταλεί ενώ έχει διαπιστωθεί πως είναι spam, να κόβεται από το server. Κι εδώ όμως αρκετοί θεώρησαν πως η προτεινόμενη λύση διεισδύει στα δικαιώματα του χρήστη, καθώς πάλι το φιλτράρισμα γίνεται με βάση το περιεχόμενο.

Εδώ πολλοί μίλησαν για την αδυναμία των άλλων MTAs (90% των παρευρισκομένων χρησιμοποιούσε sendmail) να αμυνθούν επαρκώς στο spam. Επίσης πολλοί μίλησαν για την ανικανότητα και την αδιαφορία πολλών ISPs να αντιδράσουν στο φαινόμενο, όπως και την αδιαφορία τους αν περιληφθούν σε λίστες όπως αυτές του RBL και του MAPS project. Οι ΜΤΑ της Μ$ και της Ν$ ήταν αυτοί που δέχτηκαν τη μεγαλύτερη κριτική.

Προτάθηκε να δημιουργηθεί στα πλαίσια του RIPE (ή ακόμα και ως ξεχωριστό EC project) ένα spam report abuse center. Πολλοί συμφώνησαν με την ιδέα, αλλά ο εκπρόσωπος της AOL στη συνάντηση παρατήρησε ότι μια τέτοια λύση δεν θα μπορούσε να δουλέψει και έδωσε ένα παράδειγμα: “I would forward at least 60Mbytes of spam to this center every day- it simply does not scale..”

Τελικά αυτό που αποφασίστηκε ήταν να δημιουργηθεί ένα Working Group που θα γράψει ένα Best Current Practice για τους ISPs για τη διαχείριση και αντιμετώπιση toy email spam. Αν αυτό το WG προχωρήσει σωστά, τότε το επόμενο βήμα θα είναι η δημιουργία ενός Abuse NCC (όχι ενός spam-handling center) που θα δουλεύει όπως τα διάφορα CERT/CCs, αλλά για Abuse (κυρίως spamming γεγονότα). Όλοι τέλος συμφώνησαν ότι πρέπει το RIPE να ηγηθεί της προσπάθειας να υπάρχουν contact-addresses για αυτό το φαινόμενο σε όλα τουλαχιστον τα Ευρωπαϊκά δίκτυα.

[ Για το ISP BCP, δημιουργήθηκε μια ομάδα εθελοντών- κι εγώ μέσα σε αυτή- η οποία θα ενεργοποιηθεί μετά τη δημοσιευση των “επισήμων” πρακτικών του meeting- τα οποία δεν είναι έτοιμα ακόμα ].

Yiorgos Adamopoulos, NTUA-NOC

Y.Adamopoulos@noc.ntua.gr

Some notes on DragonFlyBSD 1.x

* Version 1.4 of DragonFly was made available on January 7, 2006. Information below is about older versions.

  • Sample cvsupfile for DragonFlyBSD sources:
    *default host=cvsup.dragonflybsd.org
    *default base=/usr
    *default prefix=/usr
    *default release=cvs tag=DragonFly_Preview
    *default delete use-rel-suffix
    *default compress
    
    cvs-root
    cvs-src
    
  • Sample cvsupfile for DragonFlyBSD pkgsrc:
    *default release=cvs tag=.
    *default delete use-rel-suffix
    *default umask=022
    *default host=cvsup.us.NetBSD.org
    *default base=/usr
    *default prefix=/usr
    *default compress
    
    netbsd-pkgsrc
    

    Do not forget to:

    # cd /usr/pkgsrc/bootstrap
    # ./bootstrap
    # cp -i work/mk.conf.example /etc/mk.conf
    
  • Simple update procedure, but it is best that you read /usr/src/UPDATING first:
    # make buildworld buildkernel installkernel installworld upgrade && \
    newaliases && reboot
    
  • Note on using ftp-proxy(8) on DFLY (Information current for at least 1.3-Preview as built at 2005/06/15):

    DFLY’s inetd listens on all network interfaces and cannot be instructed to bind on one (as does OpenBSD’s inetd). So while the manual says that your /etc/inetd.conf entry should be:

    127.0.0.1:8021 stream tcp nowait root /usr/libexec/ftp-proxy ftp-proxy

    instead for DFLY it should be:

    ftp-proxy stream tcp nowait root /usr/libexec/ftp-proxy ftp-proxy

    and you should use /etc/hosts.allow to wrap/control access to ftp-proxy. You must allow access to ftp-proxy from the networks that you expect to use it. This is somewhat different than what you expect if you have used OpenBSD/pf/ftp-proxy where the redirection is done on 127.0.0.1. So while the manual instructs:

    rdr pass on $int_if proto tcp from any to any port 21 -> 127.0.0.1 port 8021

    you should use:

    rdr pass on $int_if proto tcp from any to any port 21 -> $int_if port 8021
  • I cannot install DragonFlyBSD from the install CD. It fails with:
    ad0: READ command timeout tag=0 serv=0 - resetting
    ata0: resetting devices ..
    

    or something similar. Why?

    *** Information current with at least 1.2.0-RELEASE ISO image ***

    Well, some of the newer motherboards cannot fallback at PIO mode if DMA fails. Have no fear, you can still install DFLY. At the boot selection prompt, select option 6 which starts the loader prompt. While there type the following three commands and you are OK:

    > set hw.ata.ata_dma=0
    > set hw.ata.atapi_dma=0
    > boot
    

    Voila!

    PS: You may need to put these values to /boot/loader.conf.local:

    	
    hw.ata.ata_dma=0
    hw.ata.atapi_dma=0
    

    man loader.conf and man ata for syntax and more

  • Perl: If you have Perl installed from pkgsrc and you have made a copy or a symbolic link so as to have /usr/bin/perl be the same as /usr/pkg/bin/perl , after runnning make upgrade you have to remake the link in /usr/bin (or recopy /usr/pkg/bin/perl there).

Using Annoyance Filter

Annoyance Filter is an adaptive Bayesian junk email filter written by John Walker.

Training annoyance-filter on what is and what is not spam:

/usr/bin/annoyance-filter --mail ${MAIL} \
	--junk ${HOME}/Mail/spam \
	--prune \
	--write ${HOME}/.annoyance.dict

Note: The same command retrains annoyance-filter.

To use annoyance-filter with procmail edit your ${HOME}/.procmailrc:

 
:0fw:
| ${HOME}/bin/annoyance-filter-run
 
:0:
* ^X-Annoyance-Filter-Classification: Junk
${MBOXDIR}/annoyance

The above recipe executes the script annoyance-run on incoming email.

 
#!/bin/sh
# annoyance-run - Script to run annoyance-filter from .procmailrc

exec /usr/bin/annoyance-filter \
	--read ${HOME}/.annoyance.dict \
	--transcript - \
	--test -

Using bogofilter

* This note was written on September 7, 2003

  1. Keep some (~50) spams in a separate folder (eg. ~/Mail/spam)
  2. Edit your ~/.bogofilter.cf
    bogofilter_dir=~/.bogofilter
    user_config_file=~/.bogofilter.cf
    db_transaction=no
    spam_header_name=X-Bogosity
    spam_subject_tag={BOGOSPAM}
    unsure_subject_tag={BOGOSPAM}
    stats_in_header=Yes
    db_cachesize=32
    db_log_autoremove=yes
    db_lk_max_locks=16384
    db_lk_max_objects=16384
    timestamp=Yes
    spamicity_tags = Yes, No, Unsure
    spamicity_formats = %0.6f, %0.6f, %0.6f
    header_format = %h: %c, tests=bogofilter, spamicity=%p, version=%v
    terse_format = %1.1c %f
    log_header_format = %h: %c, spamicity=%p, version=%v
    log_update_format = register-%r, %w words, %m messages
    terse=no
    block_on_subnets=no
    charset_default=iso-8859-7
    replace_nonascii_characters=N
    min_dev=0.375
    robs=0.0178
    robx=0.52
    ham_cutoff  = 0.00
    spam_cutoff = 0.99
    ns_esf = 1.000
    sp_esf = 1.000
    thresh_update=0.01
    
  3. bogofilter -Mn < ${MAIL} /* learn what is NOT spam */
  4. bogofilter -Ms < Mail/spam /* learn what IS spam */
  5. Add the following four (4) lines to your ~/.procmailrc:
    # http://bogofilter.sf.net
    :0HB:
    * ? bogofilter -u
    ${HOME}/Mail/bogofilter
     
    

How I became a system administrator

* Originally written at Thu Sep 2 05:17:58 EEST 1999.

This is how it started


Every penny that I have made today and every one that I will make, I owe it to my Prof. Timos Sellis who has trusted me more than enough:

When I entered the NTUA EE School (Fall of 1990), I had no computer and no money to buy one. Also I wanted to become a Computer Engineer. The labs are not always open and keys are not the easiest thing to find. Somehow until Fall of 1993 I managed. But by then it was impossible to continue without a computer.

It was then that I heard from a friend that Prof. Sellis was looking for a System’s Administrator for his lab machines. The Following dialog is real:

 
Yiorgos: Hi, I heard that you are looking for a System's Administrator
Timos: Yes, do you know of any?
Yiorgos: Yes, actually I'd like to do that
Timos: Do you know anything about it?
Yiorgos: No, not a thing!
Timos: That's OK, you will learn

This dialog changed my professional life. It is because of Timos’ trust that I am able to make my living today.

[ I was not a total ignorant of Unix internals. I was a Unix power user who could do anything that could be done without root access. It was just that I was ignorant of administering systems and maintaining things like DNS and sendmail ]

The least I can do as to thank Timos for the door he opened to me into the amazing world of System Administration is to document the story down.

[ needless to say that I graduated without owning a computer ;-) ]

With lots of gratitude,

Yiorgos Adamopoulos.