su
apt-get install libdatetime-perl apt-get install libdbi-perl apt-get install libdbd-mysql-perl apt-get install libclass-autouse-perl apt-get install libmd5-perl apt-get install libdigest-sha1-perl apt-get install libhtml-template-perl apt-get install libimage-size-perl apt-get install libmime-lite-perl apt-get install libmime-perl apt-get install libcompress-zlib-perl apt-get install libnet-dns-perl apt-get install liburi-perl apt-get install libhtml-tagset-perl apt-get install libhtml-parser-perl apt-get install libwww-perl apt-get install libgd-gd2-perl apt-get install libmailtools-perl apt-get install libunicode-maputf8-perl apt-get install libxml-simple-perl apt-get install libio-stringy-perl apt-get install libcaptcha-recaptcha-perl apt-get install libdigest-hmac-perl |
su
apt-get install libgd-graph-perl apt-get install libproc-process-perl apt-get install librpc-xml-perl apt-get install libsoap-lite-perl apt-get install libxml-rss-perl apt-get install libstring-crc32-perl apt-get install libxml-atom-perl apt-get install libmath-bigint-gmp-perl apt-get install liburi-fetch-perl apt-get install libcrypt-dh-perl apt-get install perlmagick apt-get install libclass-accessor-perl apt-get install libclass-trigger-perl apt-get install libclass-data-inheritable-perl apt-get install libgnupg-interface-perl apt-get install libmail-gnupg-perl apt-get install libtext-vcard-perl |
sudo perl -MCPAN -e shell
|
cpan> install Bundle::CPAN
|
cpan> reload cpan
|
cpan> install DateTime
cpan> install DBI cpan> install DBD::mysql cpan> install Class::Autouse cpan> install Digest::MD5 cpan> install Digest::SHA1 cpan> install HTML::Template cpan> install Image::Size cpan> install MIME::Lite cpan> install MIME::Words cpan> install Compress::Zlib cpan> install Net::DNS cpan> install URI::URL cpan> install HTML::Tagset cpan> install HTML::Parser cpan> install LWP::Simple cpan> install LWP::UserAgent cpan> install GD cpan> install Mail::Address cpan> install Unicode::MapUTF8 cpan> install XML::Simple cpan> install IO::WrapTie cpan> install Unicode::CheckUTF8 cpan> install Captcha::reCAPTCHA cpan> install Digest::HMAC_SHA1 cpan> install Net::SFTP |
cpan> install GD::Graph
cpan> install Proc::ProcessTable cpan> install RPC::XML cpan> install SOAP::Lite cpan> install XML::RSS cpan> install String::CRC32 cpan> install XML::Atom cpan> install Math::BigInt::GMP cpan> install URI::Fetch cpan> install Crypt::DH cpan> install Image::Magick cpan> install Class::Accessor cpan> install Class::Trigger cpan> install Class::Data::Inheritable cpan> install GnuPG::Interface cpan> install Mail::GnuPG cpan> install Text::vCard cpan> install IP::Country::Fast cpan> install GTop |
sudo perl -MCPAN -e shell
cpan> install Net::SMTP::SSL cpan> bye |
sudo perl -MCPAN -e shell
cpan> install Net::SFTP cpan> bye |
sudo perl -MCPAN -e shell
cpan> install Net::SFTP::Foreign cpan> bye |
ssh-keygen -t rsa
Generating public/private rsa key pair. Enter file in which to save the key (/home/pi/.ssh/id_rsa): Enter passphrase (empty for no passphrase): ... Enter same passphrase again: ... Your identification has been saved in /home/pi/.ssh/id_rsa. Your public key has been saved in /home/pi/.ssh/id_rsa.pub. The key fingerprint is: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx pi@raspberrypi The key's randomart image is: +--[ RSA 2048]----+ | |
. ..bo | |
o+oo.. | |
. *ox o | |
o *.. | |
S.. | |
.A+ | |
=o. | |
+ o | |
. o |
sub upload_file { local($filenam,$ftpdestdir)=@_;
use Net::SFTP::Foreign; my $ftp; my $ftphost = "www.burgermeisters.de"; my $ftpuser = "..."; my $ftppass = "..."; my $errors; # ??? $ftp = Net::SFTP::Foreign->new($ftphost, user => $ftpuser, password => $ftppass) or die "new failed!" . $ftp->error; $ftp->mkdir("$ftpdestdir"); or die "setcwd failed!" . $ftp->error; $ftp->setcwd("$ftpdestdir") or die "setcwd failed!" . $ftp->error; $ftp->put("$filenam", "$filenam", copy_perm => 0 ) or die "put failed!" . $ftp->error; $ftp->disconnect or die "disconnect failed!" . $ftp->error; } |
mv ~/.ssh/known_hosts ~/.ssh/known_hosts_bak
mv ~/.ssh/id_rsa ~/.ssh/id_rsa_bak ssh-keygen -t rsa -N <new_passphrase> -f ~/.ssh/id_rsa sftp <username>@www.burgermeisters.de The authenticity of host 'www.burgermeisters.de (xxx.xxx.xxx.xxx)' can't be established. ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'www.burgermeisters.de,xxx.xxx.xxx.xxx' (ECDSA) to the list of known hosts. <username>@www.burgermeisters.de's password: <password> Connected to www.burgermeisters.de. exit |
perl -MCPAN -e 'install Net::SNMP'
|
make -f Makefile.PL
make make test su (falls man nicht als Root angemeldet ist) make install exit |
perl -MCPAN -e 'install Algorithm::Diff'
su (sofern man nicht als Root angemeldet ist) cd build/Algorithm-Diff-1.10 make install exit |
#!/usr/bin/perl -w
|
#!perl
|
perl dateiname.pl
|
#!/usr/bin/perl
printf"Hello World!\n"); sleep(10); exit(0); |
gnome-terminal -e "perl perlscript.pl Parameter1 Parameter2 "
|
#!/usr/bin/perl
# Tool output.pl for output from Linux Perl background task # (C) Axel Burgermeister, 08-Sep-2014 # call from perl script: # my $string = "Hello world!\n"; # my $displaytime = 3; # my $waitsymbol = "&"; # "" = wait process, "&" = continue process # system("gnome-terminal -e \"perl output.pl '$string' $displaytime \" $waitsymbol"); my $outstring = $ARGV[0]; my $waittime = $ARGV[1]; printf("$outstring"); sleep($waittime); exit(0); |
#!/usr/bin/perl
# Test of output.pl my $outstring = "Hello world!\n"; my $displaytime = 3; my $waitsymbol = "&"; # "" = wait process, "&" = continue process system("gnome-terminal -e \"perl /home/burgermeister/tools/output.pl '$outstring' $displaytime \" $waitsymbol"); exit(0); |
#!/usr/bin/perl
system("perl tool.pl &"); # hier wird der Hintergrundprozess gestartet, das Hauptprogramm läuft weiter exit(0); |
sudo perl -MCPAN -e shell
cpan> install Audio::Beep |
use Audio::Beep;
my $beeper = Audio::Beep->new; my $music = "g' f bes' c8 f d4 c8 f d4 bes c g f2"; $beeper->play ($music); |
speaker-test -t sine -f 1000 -l 1
|
_alarm() {
( \speaker-test --frequency $1 --test sine )& pid=$! \sleep 0.${2}s \kill -9 $pid } |
system("speaker-test -t sine -f 80");
|
sudo perl -MCPAN -e shell
cpan> install GD::Graph::lines cpan> install GD::Graph::area cpan> bye |
#!/usr/bin/perl
# Diagramm zeichnen use GD::Graph::lines; my $pathfile = "/.../www/html/temp/graf.png"; my $linkfile = "http://.../temp/graf.png"; my @x; my @y1; my @y2; my $graph; my @data; my $gd; for (my $i = 0; $i < 48; $i++) { $x[$i] = 0.5*$i; $y1[$i] = 10 * sin($x[$i]); $y2[$i] = 10 * cos($x[$i]); } @data = (\@x,\@y1,\@y2); $graph = GD::Graph::lines->new(800, 400); $graph->set( title => 'Temperatur im Tagesverlauf', x_label => 'Stunde', x_label_skip => 1, x_min_value => 0, x_max_value => 24, x_tick_number => 24, y_label => 'Grad Celsius', y_label_skip => 1, y_min_value => -15, y_max_value => 35, y_tick_number => 10, transparent => 0, bgclr => 'white', long_ticks => 1, fgclr => 'lgray', # Foreground Color = Gitternetz-Farbe dclrs => [ qw(red green blue cyan) ], # Data Colors = Datenlinien-Farben ) or die $graph->error; $gd = $graph->plot(\@data) or die $graph->error; open(IMG, ">$pathfile") or die $!; binmode IMG; print IMG $gd->png; close IMG; print ("Content-type: text/html\n\n"); print ("
exit(0); |
#!/usr/bin/perl
use Spreadsheet::WriteExcel; # Create a new Excel workbook my $workbook = Spreadsheet::WriteExcel->new('test.xls'); # Add a worksheet $worksheet = $workbook->add_worksheet(); # Add and define a format $format = $workbook->add_format(); # Add a format $format->set_bold(); $format->set_color('red'); $format->set_align('center'); # Write a formatted and unformatted string, row and column notation. $col = $row = 0; $worksheet->write($row, $col, 'Hi Excel!', $format); $worksheet->write(1, $col, 'Hi Excel!'); # Write a number and a formula using A1 notation $worksheet->write('A3', 1.2345); $worksheet->write('A4', '=SIN(PI()/4)'); |
#!/usr/bin/perl -w
use strict; use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('test.xls'); if ( !defined $workbook ) { die $parser->error(), ".\n"; } for my $worksheet ( $workbook->worksheets() ) { my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); next unless $cell; print "Row, Col = ($row, $col)\n"; print "Value = ", $cell->value(), "\n"; print "Unformatted = ", $cell->unformatted(), "\n"; print "\n"; } } } |
$string = sprintf("%.2f",$value);
print $string; |