Visualizzazione post con etichetta linux. Mostra tutti i post
Visualizzazione post con etichetta linux. Mostra tutti i post

martedì 7 dicembre 2010

[Linux] Perl

Perl è un linguaggio di programmazione (una specie di linguaggio interpretato (ma la questione non è banale)) che eredita molte delle caratteristiche del C, dell'awk, di sed e di chissà quanti altri linguaggi, creato nel 1987 da Larry Wall (un tipo.. interessante!).

Perl è un ottimo strumento per la manipolazione di stringhe e testo (leggi espressioni regolari) e per le sue caratteristiche è usato da moltissimi sistemisti. (Perl non è un acronimo, anche se ci si riferisce a questo linguaggio come al Practical Extraction and Report Language) pensato per essere facile da imparare e intuitivo (il motto preferito dai perlisti è TMTOWTDI). Questo NON significa che non possa essere utilizzato in modo del tutto incomprensibile. Il numero di moduli ne testimonia l'evoluzione a tutto campo.

http://www.perl.org/

per chi come me volesse cominciare

http://www.perl.org/learn.html


Barzelletta per voi

#!/usr/bin/perl
# joke1.pl
use strict;
use strict;
my @questions = qw(Java Python Perl C);
my @punchlines = (
    "None. Change it once, and it's the same everywhere.",
    "One. He just stands below the socket and the world revolves around him.",
    "A million. One to change it, the rest to try and do it in one line of code.",
    '"CHANGE?!!"'
);
print "Please enter a number between 1 and 4: ";
my $selection = <STDIN>;
$selection -= 1;
print "How many $questions[$selection] ";
print "programmers does it take to change a lightbulb?\n\n";
sleep 2;
print $punchlines[$selection], "\n";
                                                                (fonte: Beginning Perl, 3rd ed)

lunedì 22 novembre 2010

[Linux] Compiz

Ecco una cosa di cui non sono un fanatico, appena installata e configurata sul pc di un amico. Il mio pensiero è: se volete sprecare le risorse del vostro sistema e siete attratti come falene dagli effettini, fate pure e divertitevi. Io non mi sento un fanatico, ma meno c'è, meglio è. Provare per credere.

Per usare una metafora sportiva: quando giocavo a beach volley (esercizio: confrontare il # di culi qui, qui e qui), il mio allenatore una volta disse che schiacciare fa bagnare le fighe, ma non serve a fare punto. 


Compiz is an OpenGL compositing manager that use GLX_EXT_texture_from_pixmap for binding redirected top-level windows to texture objects. It has a flexible plug-in system and it is designed to run well on most graphics hardware.

Okay, this description isn’t really meaningful. In a nutshell, Compiz is a compositing manager, which means that it enhances the overall user interaction by adding fancy effects to your windows, from drop shadows to awesome desktop effects like the Desktop Cube or the Expo
Compiz can also be a window manager, which means that it is the software between you and your desktop apps. It enables you to move or resize windows, to switch workspaces, to switch windows easily (using alt-tab or so), and so on.
       http://www.compiz.org/


giovedì 11 novembre 2010

Email con Telnet

Telnet è un (vecchio) protocollo di rete basato su TCP. Il suo uso è oggi altamente sconsigliato data la sua estrema vulnerabilità (le sessioni telnet non sono criptate). Un utilizzo classico è collegarsi via telnet alla porta 25 (sulla quale tipicamente è in ascolto un server SMTP) per effettuare il debugging di un server di posta. E' possibile, ad esempio, inviare un messaggio di posta via telnet.

Ovviamente e' necessario conoscere l'indirizzo del server smtp da usare, che in generale può anche essere diverso da quello del vostro ISP (se non sapete di cosa sto parlando, fatevi un giro tra le impostazioni del vostro client di posta). Chiaramente non è difficile trovare in rete una lista di servers smtp.

Ovviamente controllate le impostazioni del vostro firewall ed eventualmente aprite un buco opportuno. La porta 25 è la porta standard, ma eventualmente dovrete connettervi su altre porte.

In maniera altrettanto ovvia vi potete aspettare di non riuscire a mandare e-mail da server SMTP "esterni"  (usandoli come open relay: dovreste ricevere errori tipo: relay access denied) senza dovervi autenticare per ovvie ragioni. A meno che non siano configurati davvero male.

Ecco qui un esempio: buon divertimento con il VOSTRO server SMTP

luke@edi:~$ telnet $MAILOUTESEMPIOPUNTOIT 25
Trying $IPDIMAILOUTESEMPIOPUNTOIT
Connected to $MAILOUTESEMPIOPUNTOIT.
Escape character is '^]'.


 S: 220 welcome ESMTP Postfix
 C: HELO mydomain.com
 S: 250 Hello mydomain.com
 C: MAIL FROM: <sender@mydomain.com>
 S: 250 sender@mydomain.com ... Sender ok
 C: RCPT TO: <you@example.com>
 S: 250 you@example.com ... Recipient Ok
 C: DATA
 S: 354 End data with "."
 C: Subject: who needs viagra? or a fake rolex?
 C: From: sender@mydomain.com
 C: To: you@example.com
 C:
 C: questa è una prova.
 C: .
 S: 250 Ok: queued as 145345
 C: QUIT