Ruhe in Frieden

Eben habe ich meinen alten Server bei IPX gekündigt. Daraufhin kam die Kündigungsbestätigung mit diesem Text:

„… Ihr Server 10138 ist seit dem 18.10.03 online. …“

Ich behaupte mal der hat sich abbezahlt…

shutdown -h now

RIP

QIOS DevSuite

„Build your professional applications faster and at a lower cost with the QIOS DevSuite .NET Components Library. QIOS DevSuite is an advanced .NET control library, that is fully integrated with Visual Studio.NET and can be used with all .NET languages, such as C#, VB.NET and C++.NET. „

QIOS DevSuite

Mail-Attachments via Perl über POP3 abrufen und in einem Ordner ablegen

Etwas speziell, kann aber vielleicht der eine oder andere brauchen: Von einem POP3-Server sollen alle Attachments extrahiert werden und danach die Mails gelöscht werden. Die Anforderung ist hier speziell für die Veröffentlichung von Content per E-Mail. Es werden per Cron einmal täglich die Anhänge ausgelesen und veröffentlicht.

Ich habe das ganze mit Perl und den beiden Modulen Mail::POP3Client und Mail::MboxParser umgesetzt. Diese müssen vorher per CPAN installiert werden.
Das geht ganz einfach so:

cpan install Mail::POP3Client
cpan install Mail::MboxParser
cpan install Date::Format

Falls ihr cpan das erste mal startet, will es noch konfiguriert werden. Die meisten Einstellungen können einfach per Return mit dem Standardwert bestätigt werden.

Das Script ist extrem simpel, ohne Fehlerhandling und kann leicht angepasst werden:

#!/usr/bin/perl -w

#Muss vorher per CPAN installiert werden
use Mail::POP3Client;
use Mail::MboxParser::Mail;
use Date::Format;

#USESSL wird z.B. bei GMail gebraucht
my $pop = new Mail::POP3Client (USER => ‚user‘,
PASSWORD => ‚pass‘,
HOST => ‚pop.gmail.com‘,
DEBUG => 1,
USESSL => 1);

print $pop->Message();

for my $i (1 .. $pop->Count) {
my $datetime = time2str(‚%Y%m%d%H%M%S‘, time);
my $msg = Mail::MboxParser::Mail->new( [ $pop->Head($i) ],
[ $pop->Body($i) ] );
#Wo sollen die Attachments hin?
$msg->store_all_attachments( path => ‚/tmp/test‘, prefix => $datetime );

#Auskommentieren, falls die Mails vom Server gelöscht werden sollen
#$pop->Delete($i);

print $pop->Message();
}

$pop->Close();

Update am 20.02.2009: Timestamp-Prefix für die Dateinamen hinzugefügt. Achtung: Jetzt wird das Paket Date::Format gebraucht!

Command-line Fu & The best UNIX commands on the web

„Command-Line-Fu is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you’ve been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on and discussed – digg-esque voting is also encouraged so the best float to the top. „

Command-line Fu & The best UNIX commands on the web

All commands | Command-line Fu & The best UNIX commands on the web

„Command-Line-Fu is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you’ve been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on and discussed – digg-esque voting is also encouraged so the best float to the top. „

All commands | Command-line Fu & The best UNIX commands on the web

ImageOptim – a PNG/JPEG graphics optimizer for Mac OS X

„ImageOptim is a front-end (GUI) for set of tools for optimisation of PNG and JPEG images.

Optimisation makes files smaller (in terms of disk space) by finding optimal compression parameters and by removing unneccessary information, like file comments, EXIF tags and color profiles.

It’s excellent for publishing images on the web (easily beats â??Save for Webâ? option in Photoshop).

ImageOptim uses:

* AdvPNG from AdvanceCOMP
* OptiPNG
* PngCrush
* JpegOptim
* jpegtran from libjpeg
* and optionally PNGOUT“

ImageOptim – a PNG/JPEG graphics optimizer for Mac OS X