Montag, 29. Juni 2009

LINUX: create cdrom iso

to copy a cd to an iso image:

dd if=/dev/sr0 of=image.iso bs=2048

or use brasero application

Freitag, 12. Juni 2009

PERL: get page with perl

a example



sub getpage($$) {
my $link = shift;
my $base = shift;

my @site_content;

my $ua = LWP::UserAgent->new();
$ua->agent('Mozilla/5.0');

my $request = HTTP::Request->new('GET', $link);
my $response = $ua->request($request);
print "Retrieving http-page...\n";
if ( $response->is_error() ) {
$urls{$base}{'error'} = "Error code : ". $response->code() . "\n" .
"Error message: " . $response->message() . "\n";
return ();
}
else {
#print Dumper($response);
@site_content = split /\n/, $response->content();
$urls{$base}{'lasturl'} = $response->request->uri;
return @site_content;
}
}

Freitag, 5. Juni 2009

encrypt with gpg

encrpyt:

gpg -c --cipher-algo blowfish filename.txt


decrypt:

gpg -d filename.txt.gpg > output.txt