SlideShare a Scribd company logo
Nubilus Perl
Librerie Perl in the cloud
IaaS - PaaS - SaaS



        2
IaaS - PaaS - SaaS
        2
Amazon
require Net::Amazon::EC2;
my $ec2 = Net::Amazon::EC2->new(
   AWSAccessKeyId => 'YOUR-AWS-KEY',
   SecretAccessKey => 'YOUR-AWS-SECRET',
);
require Net::Amazon::EC2;
my $ec2 = Net::Amazon::EC2->new(
   AWSAccessKeyId => 'YOUR-AWS-KEY',
   SecretAccessKey => 'YOUR-AWS-SECRET',
);
my $res = $ec2->run_instances(
   ImageId       => 'ami-8c1fece5',
   MinCount      => 1,
   MaxCount      => 1,
   SecurityGroup => 'quick-start-1',
   InstanceType => 'm1.small',
);
Instance
my $res = $ec2->run_instances(
   ImageId       => 'ami-8c1fece5',
   MinCount      => 1,
   MaxCount      => 1,
   SecurityGroup => 'quick-start-1',
   InstanceType => 'm1.small',
);
Instance
Image   Instance
Image                         Instance

#!/usr/bin/env perl
                        10715   gnome-terminal
use strict;
                        10719   _ gnome-pty-helper
use warnings;
                        10720   _ bash
use 5.012;
                        24910   _ bash
                        32549   _ bash
my $message = shift
                        27438   |   _ perl prg.pl
   || 'whatever!';
                        27444   _ bash
while ('necessary') {
                        27462   |   _ perl prg.pl hey you!
   say $message;
                        27463   _ bash
   sleep 1;
                        27480   |   _ perl prg.pl another
}
my $res = $ec2->run_instances(
   ImageId       => 'ami-8c1fece5',
   MinCount      => 1,
   MaxCount      => 1,
   SecurityGroup => 'quick-start-1',
   InstanceType => 'm1.small',
);
Image                         Instance

#!/usr/bin/env perl
                        10715   gnome-terminal
use strict;
                        10719   _ gnome-pty-helper
use warnings;
                        10720   _ bash
use 5.012;
                        24910   _ bash
                        32549   _ bash
my $message = shift
                        27438   |   _ perl prg.pl
   || 'whatever!';
                        27444   _ bash
while ('necessary') {
                        27462   |   _ perl prg.pl hey you!
   say $message;
                        27463   _ bash
   sleep 1;
                        27480   |   _ perl prg.pl another
}
Image          Instance



        Type
my $res = $ec2->run_instances(
   ImageId       => 'ami-8c1fece5',
   MinCount      => 1,
   MaxCount      => 1,
   SecurityGroup => 'quick-start-1',
   InstanceType => 'm1.small',
);
RUNNING_CHECK:
while ('necessary') {
   my $reservations
      = $ec2->describe_instances() || [];

    foreach my $res (@$reservations) {
       foreach my $instance ($res->instances_set()) {
          if ($instance->{instance_state}{name} eq 'running') {
             say 'active, IP: ', $instance->{ip_address};
             last RUNNING_CHECK;
          }
       }
    }
    sleep 1;
}
RUNNING_CHECK:
while ('necessary') {
   my $reservations
      = $ec2->describe_instances() || [];

    foreach my $res (@$reservations) {
       foreach my $instance ($res->instances_set()) {
          if ($instance->{instance_state}{name} eq 'running') {
             say 'active, IP: ', $instance->{ip_address};
             last RUNNING_CHECK;
          }
       }
    }
    sleep 1;
}
Ora?
Beh... PRIMA...
Sì, SSH
my $res = $ec2->run_instances(         RUNNING_CHECK:
   ImageId       => 'ami-8c1fece5',    while ('necessary') {
   MinCount      => 1,                    my $reservations
   MaxCount      => 1,                       = $ec2->describe_instances() || [];
   SecurityGroup => 'quick-start-1',
   InstanceType => 'm1.small',            foreach my $res (@$reservations) {
);                                        #...




     my $instance_id = $res->instance_id();

     $ec2->terminate_instances(
        InstanceId => $instance_id,
     );
my $reservations
   = $ec2->describe_instances() || [];

foreach my $res (@$reservations) {
   foreach my $instance ($res->instances_set()) {
      my $state = $instance->{instance_state}{name};
      # ... utilizzare $state...
   }
}
RackSpace
require Net::RackSpace::CloudServers;
my $cs = Net::RackSpace::CloudServers->new(
   user     => 'myusername',
   key      => 'mysecretkey',
   location => 'UK',
);
require Net::RackSpace::CloudServers;
my $cs = Net::RackSpace::CloudServers->new(
   user     => 'YOUR-CS-USERNAME',
   key      => 'YOUR-CS-SECRETKEY',
   location => 'UK',
);
require Net::RackSpace::CloudServers;
my $cs = Net::RackSpace::CloudServers->new(
   user     => 'YOUR-CS-USERNAME',
   key      => 'YOUR-CS-SECRETKEY',
   location => 'UK',
);
my $server = Net::RackSpace::CloudServers::Server->new(
   cloudservers => $cs, # N::R::CloudServers instance
   name         => 'my-instance',
   imageid      => 4, # Debian 5.0 (lenny)
   flavorid     => 1, # basic server, 256 MB RAM
);
Image          Instance



        Type
Image            Server



        Flavor
Ancora niente
my $real_server = $server->create_server();
my $root_pass = $real_server->adminpass();
Ora sì
my $id = $real_server->id();

RUNNING_CHECK:
while ('necessary') {
   my $instance = $cs->get_server($id);
   say 'completion status: ', $server->progress();
   if ($server->status eq 'ACTIVE') {
      say 'active, IP: ', $instance->public_address()->[0];
      last RUNNING_CHECK;
   }
   sleep 1;
}
my $id = $real_server->id();

RUNNING_CHECK:
while ('necessary') {
   my $instance = $cs->get_server($id);
   say 'completion status: ', $server->progress();
   if ($server->status eq 'ACTIVE') {
      say 'active, IP: ', $instance->public_address()->[0];
      last RUNNING_CHECK;
   }
   sleep 1;
}
Ora?
SSH con $root_pass
O anche...
Sì... root password
       via email
my $server = Net::RackSpace::CloudServers::Server->new(
   cloudservers => $cs, # N::R::CloudServers instance
   name         => 'my-instance',
   imageid      => 4, # Debian 5.0 (lenny)
   flavorid     => 1, # basic server, 256 MB RAM
   personality => [
      {
         path => '/root/.ssh/authorized_keys2',
         contents => <<END_OF_BASE64
SUlKckNyZWIxcU5NcGxuS1BIaFBBdFIxL2RMUVJ6SnNzSnNxTWUwRENlbXp5NlVMZ0g3Uy9seWZU
...
anExQWhSaE1zK0FHaDZDL01aV1N4QStZNmhqd2wwMFozSVl1R3AgaW1wb3J0ZWQtb3BlbnNzaC1r
ZXkK
END_OF_BASE64
      },
   ],
);
Chiave SSH
$real_server->delete();
Adieu
46

More Related Content

What's hot

Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
Mark Baker
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Kris Wallsmith
 
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
Hugo Hamon
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
bpmedley
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & REST
Hugo Hamon
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
Hugo Hamon
 
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkPHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
G Woo
 
Database Design Patterns
Database Design PatternsDatabase Design Patterns
Database Design Patterns
Hugo Hamon
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
Mark Baker
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
PHP 5.4
PHP 5.4PHP 5.4
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
Nate Abele
 
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsModels and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8PrinceGuru MS
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
Jakub Zalas
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
Wim Godden
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
Jakub Zalas
 
Command Bus To Awesome Town
Command Bus To Awesome TownCommand Bus To Awesome Town
Command Bus To Awesome Town
Ross Tuck
 

What's hot (20)

Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & REST
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkPHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
 
Database Design Patterns
Database Design PatternsDatabase Design Patterns
Database Design Patterns
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
PHP 5.4
PHP 5.4PHP 5.4
PHP 5.4
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsModels and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
 
Command Bus To Awesome Town
Command Bus To Awesome TownCommand Bus To Awesome Town
Command Bus To Awesome Town
 

Viewers also liked

Milestones tracker
Milestones trackerMilestones tracker
Milestones tracker
Luis Carlos Murillo Valencia
 
Sales process consulting
Sales process consultingSales process consulting
Sales process consulting
Saurabh Leekha
 
The challenges of managing a complex sales process
The challenges of managing a complex sales processThe challenges of managing a complex sales process
The challenges of managing a complex sales process
Ashutosh Bijoor
 
6 killer steps to creating a kick ass sales proposal
6 killer steps to creating a kick ass sales proposal6 killer steps to creating a kick ass sales proposal
6 killer steps to creating a kick ass sales proposal
Naveen GM
 
2. sales training sales process
2. sales training   sales process2. sales training   sales process
2. sales training sales processEarl Stevens
 
MAPPING YOUR SALES PROCESS
MAPPING YOUR SALES PROCESSMAPPING YOUR SALES PROCESS
MAPPING YOUR SALES PROCESS
Doble Group, LLC
 
How to Build a Proven Sales Process for Selling Software to Enterprises
How to Build a Proven Sales Process for Selling Software to EnterprisesHow to Build a Proven Sales Process for Selling Software to Enterprises
How to Build a Proven Sales Process for Selling Software to Enterprises
Landslide Technologies
 
10 step sales process
10 step sales process10 step sales process
10 step sales process
econnexx
 
How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team
How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team
How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team
Daniel Nilsson
 

Viewers also liked (9)

Milestones tracker
Milestones trackerMilestones tracker
Milestones tracker
 
Sales process consulting
Sales process consultingSales process consulting
Sales process consulting
 
The challenges of managing a complex sales process
The challenges of managing a complex sales processThe challenges of managing a complex sales process
The challenges of managing a complex sales process
 
6 killer steps to creating a kick ass sales proposal
6 killer steps to creating a kick ass sales proposal6 killer steps to creating a kick ass sales proposal
6 killer steps to creating a kick ass sales proposal
 
2. sales training sales process
2. sales training   sales process2. sales training   sales process
2. sales training sales process
 
MAPPING YOUR SALES PROCESS
MAPPING YOUR SALES PROCESSMAPPING YOUR SALES PROCESS
MAPPING YOUR SALES PROCESS
 
How to Build a Proven Sales Process for Selling Software to Enterprises
How to Build a Proven Sales Process for Selling Software to EnterprisesHow to Build a Proven Sales Process for Selling Software to Enterprises
How to Build a Proven Sales Process for Selling Software to Enterprises
 
10 step sales process
10 step sales process10 step sales process
10 step sales process
 
How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team
How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team
How to Design a Sales Process for B2B Sales - #1 Tool for the Dream Sales Team
 

Similar to Nubilus Perl

(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
Amazon Web Services
 
Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)
xSawyer
 
Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.
Alex S
 
Any event intro
Any event introAny event intro
Any event intro
qiang
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as CodePuppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet
 
Daily notes
Daily notesDaily notes
Daily notes
meghendra168
 
Perl object ?
Perl object ?Perl object ?
Perl object ?
ℕicolas ℝ.
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
Wim Godden
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
Wim Godden
 
Advanced php testing in action
Advanced php testing in actionAdvanced php testing in action
Advanced php testing in action
Jace Ju
 
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
Amazon Web Services
 
To infinity and beyond
To infinity and beyondTo infinity and beyond
To infinity and beyond
clintongormley
 
Lazy evaluation drupal camp moscow 2014
Lazy evaluation drupal camp moscow 2014Lazy evaluation drupal camp moscow 2014
Lazy evaluation drupal camp moscow 2014
Evgeny Nikitin
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
Wim Godden
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
Wim Godden
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)Night Sailer
 
Power shell voor developers
Power shell voor developersPower shell voor developers
Power shell voor developers
Dennis Vroegop
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years laterclkao
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
Nishan Subedi
 

Similar to Nubilus Perl (20)

(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
 
Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)Asynchronous Programming FTW! 2 (with AnyEvent)
Asynchronous Programming FTW! 2 (with AnyEvent)
 
Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.
 
Any event intro
Any event introAny event intro
Any event intro
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as CodePuppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
 
Daily notes
Daily notesDaily notes
Daily notes
 
Perl object ?
Perl object ?Perl object ?
Perl object ?
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
Advanced php testing in action
Advanced php testing in actionAdvanced php testing in action
Advanced php testing in action
 
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
 
To infinity and beyond
To infinity and beyondTo infinity and beyond
To infinity and beyond
 
Lazy evaluation drupal camp moscow 2014
Lazy evaluation drupal camp moscow 2014Lazy evaluation drupal camp moscow 2014
Lazy evaluation drupal camp moscow 2014
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
Power shell voor developers
Power shell voor developersPower shell voor developers
Power shell voor developers
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years later
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 

Recently uploaded

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Nubilus Perl

  • 2. IaaS - PaaS - SaaS 2
  • 3. IaaS - PaaS - SaaS 2
  • 5. require Net::Amazon::EC2; my $ec2 = Net::Amazon::EC2->new( AWSAccessKeyId => 'YOUR-AWS-KEY', SecretAccessKey => 'YOUR-AWS-SECRET', );
  • 6. require Net::Amazon::EC2; my $ec2 = Net::Amazon::EC2->new( AWSAccessKeyId => 'YOUR-AWS-KEY', SecretAccessKey => 'YOUR-AWS-SECRET', );
  • 7.
  • 8. my $res = $ec2->run_instances( ImageId => 'ami-8c1fece5', MinCount => 1, MaxCount => 1, SecurityGroup => 'quick-start-1', InstanceType => 'm1.small', );
  • 10. my $res = $ec2->run_instances( ImageId => 'ami-8c1fece5', MinCount => 1, MaxCount => 1, SecurityGroup => 'quick-start-1', InstanceType => 'm1.small', );
  • 12. Image Instance
  • 13. Image Instance #!/usr/bin/env perl 10715 gnome-terminal use strict; 10719 _ gnome-pty-helper use warnings; 10720 _ bash use 5.012; 24910 _ bash 32549 _ bash my $message = shift 27438 | _ perl prg.pl || 'whatever!'; 27444 _ bash while ('necessary') { 27462 | _ perl prg.pl hey you! say $message; 27463 _ bash sleep 1; 27480 | _ perl prg.pl another }
  • 14. my $res = $ec2->run_instances( ImageId => 'ami-8c1fece5', MinCount => 1, MaxCount => 1, SecurityGroup => 'quick-start-1', InstanceType => 'm1.small', );
  • 15. Image Instance #!/usr/bin/env perl 10715 gnome-terminal use strict; 10719 _ gnome-pty-helper use warnings; 10720 _ bash use 5.012; 24910 _ bash 32549 _ bash my $message = shift 27438 | _ perl prg.pl || 'whatever!'; 27444 _ bash while ('necessary') { 27462 | _ perl prg.pl hey you! say $message; 27463 _ bash sleep 1; 27480 | _ perl prg.pl another }
  • 16. Image Instance Type
  • 17. my $res = $ec2->run_instances( ImageId => 'ami-8c1fece5', MinCount => 1, MaxCount => 1, SecurityGroup => 'quick-start-1', InstanceType => 'm1.small', );
  • 18.
  • 19. RUNNING_CHECK: while ('necessary') { my $reservations = $ec2->describe_instances() || []; foreach my $res (@$reservations) { foreach my $instance ($res->instances_set()) { if ($instance->{instance_state}{name} eq 'running') { say 'active, IP: ', $instance->{ip_address}; last RUNNING_CHECK; } } } sleep 1; }
  • 20. RUNNING_CHECK: while ('necessary') { my $reservations = $ec2->describe_instances() || []; foreach my $res (@$reservations) { foreach my $instance ($res->instances_set()) { if ($instance->{instance_state}{name} eq 'running') { say 'active, IP: ', $instance->{ip_address}; last RUNNING_CHECK; } } } sleep 1; }
  • 21. Ora?
  • 23.
  • 24.
  • 26. my $res = $ec2->run_instances( RUNNING_CHECK: ImageId => 'ami-8c1fece5', while ('necessary') { MinCount => 1, my $reservations MaxCount => 1, = $ec2->describe_instances() || []; SecurityGroup => 'quick-start-1', InstanceType => 'm1.small', foreach my $res (@$reservations) { ); #... my $instance_id = $res->instance_id(); $ec2->terminate_instances( InstanceId => $instance_id, );
  • 27. my $reservations = $ec2->describe_instances() || []; foreach my $res (@$reservations) { foreach my $instance ($res->instances_set()) { my $state = $instance->{instance_state}{name}; # ... utilizzare $state... } }
  • 29. require Net::RackSpace::CloudServers; my $cs = Net::RackSpace::CloudServers->new( user => 'myusername', key => 'mysecretkey', location => 'UK', );
  • 30. require Net::RackSpace::CloudServers; my $cs = Net::RackSpace::CloudServers->new( user => 'YOUR-CS-USERNAME', key => 'YOUR-CS-SECRETKEY', location => 'UK', );
  • 31.
  • 32. require Net::RackSpace::CloudServers; my $cs = Net::RackSpace::CloudServers->new( user => 'YOUR-CS-USERNAME', key => 'YOUR-CS-SECRETKEY', location => 'UK', );
  • 33.
  • 34. my $server = Net::RackSpace::CloudServers::Server->new( cloudservers => $cs, # N::R::CloudServers instance name => 'my-instance', imageid => 4, # Debian 5.0 (lenny) flavorid => 1, # basic server, 256 MB RAM );
  • 35. Image Instance Type
  • 36. Image Server Flavor
  • 38. my $real_server = $server->create_server(); my $root_pass = $real_server->adminpass();
  • 40.
  • 41. my $id = $real_server->id(); RUNNING_CHECK: while ('necessary') { my $instance = $cs->get_server($id); say 'completion status: ', $server->progress(); if ($server->status eq 'ACTIVE') { say 'active, IP: ', $instance->public_address()->[0]; last RUNNING_CHECK; } sleep 1; }
  • 42. my $id = $real_server->id(); RUNNING_CHECK: while ('necessary') { my $instance = $cs->get_server($id); say 'completion status: ', $server->progress(); if ($server->status eq 'ACTIVE') { say 'active, IP: ', $instance->public_address()->[0]; last RUNNING_CHECK; } sleep 1; }
  • 45.
  • 46. Sì... root password via email
  • 47. my $server = Net::RackSpace::CloudServers::Server->new( cloudservers => $cs, # N::R::CloudServers instance name => 'my-instance', imageid => 4, # Debian 5.0 (lenny) flavorid => 1, # basic server, 256 MB RAM personality => [ { path => '/root/.ssh/authorized_keys2', contents => <<END_OF_BASE64 SUlKckNyZWIxcU5NcGxuS1BIaFBBdFIxL2RMUVJ6SnNzSnNxTWUwRENlbXp5NlVMZ0g3Uy9seWZU ... anExQWhSaE1zK0FHaDZDL01aV1N4QStZNmhqd2wwMFozSVl1R3AgaW1wb3J0ZWQtb3BlbnNzaC1r ZXkK END_OF_BASE64 }, ], );
  • 50. Adieu
  • 51. 46

Editor's Notes

  1. \n
  2. Di cloud c&amp;#x2019;&amp;#xE8; molto da parlare, soprattutto perch&amp;#xE9; dopo il calcio sembra un argomento in cui ognuno ha una sua idea. La tassonomia di partenza pi&amp;#xF9; tipica &amp;#xE8; basata sull&amp;#x2019;utilizzatore finale: si parte da IaaS (Infrastructure as a Service), ove quello che si tratta sono sostanzialmente server virtuali che interessano un amministratore di sistema, si passa per PaaS (Platform as a Service) ove il fornitore mette a disposizione un ambiente software pi&amp;#xF9; o meno ampio che interessa uno sviluppatore, atterrando poi su SaaS (Software as a Service ed il suo cugino Application as a Service) in cui il fornitore mette a disposizione un vero e proprio servizio all&amp;#x2019;utente finale. Per fare un esempio di quest&amp;#x2019;ultimo... qualcuno usa Gmail? \n
  3. Di cloud c&amp;#x2019;&amp;#xE8; molto da parlare, soprattutto perch&amp;#xE9; dopo il calcio sembra un argomento in cui ognuno ha una sua idea. La tassonomia di partenza pi&amp;#xF9; tipica &amp;#xE8; basata sull&amp;#x2019;utilizzatore finale: si parte da IaaS (Infrastructure as a Service), ove quello che si tratta sono sostanzialmente server virtuali che interessano un amministratore di sistema, si passa per PaaS (Platform as a Service) ove il fornitore mette a disposizione un ambiente software pi&amp;#xF9; o meno ampio che interessa uno sviluppatore, atterrando poi su SaaS (Software as a Service ed il suo cugino Application as a Service) in cui il fornitore mette a disposizione un vero e proprio servizio all&amp;#x2019;utente finale. Per fare un esempio di quest&amp;#x2019;ultimo... qualcuno usa Gmail? \n
  4. \n
  5. Nemmeno a dirlo, c&amp;#x2019;&amp;#xE8; un modulo su CPAN per gestire la parte di computazione di Amazon (Amazon Elastic Cloud Computing o EC2).\n
  6. Trattandosi di un servizio a pagamento, c&amp;#x2019;&amp;#xE8; bisogno di fornire delle credenziali di accesso che serviranno anche per la tariffazione dei servizi.\n
  7. Queste credenziali le trovate nel profilo.\n
  8. Una volta disponibile un oggetto $ec2, possiamo cominciare a lanciare dei server virtuali...\n
  9. ... o, in terminologia Amazon, delle istanze.\n
  10. Uno dei parametri da specificare obbligatoriamente &amp;#xE8; ImageId\n
  11. Un&amp;#x2019;immagine &amp;#xE8; una fotografia di una macchina comprensiva dell&amp;#x2019;intero sistema operativo. Un po&amp;#x2019; come se l&amp;#x2019;immagine fosse il programma, e l&amp;#x2019;istanza fosse il processo del programma in esecuzione: da un solo programma si possono lanciare pi&amp;#xF9; processi.\n
  12. Un&amp;#x2019;immagine &amp;#xE8; una fotografia di una macchina comprensiva dell&amp;#x2019;intero sistema operativo. Un po&amp;#x2019; come se l&amp;#x2019;immagine fosse il programma, e l&amp;#x2019;istanza fosse il processo del programma in esecuzione: da un solo programma si possono lanciare pi&amp;#xF9; processi.\n
  13. Un&amp;#x2019;immagine &amp;#xE8; una fotografia di una macchina comprensiva dell&amp;#x2019;intero sistema operativo. Un po&amp;#x2019; come se l&amp;#x2019;immagine fosse il programma, e l&amp;#x2019;istanza fosse il processo del programma in esecuzione: da un solo programma si possono lanciare pi&amp;#xF9; processi.\n
  14. Un&amp;#x2019;immagine &amp;#xE8; una fotografia di una macchina comprensiva dell&amp;#x2019;intero sistema operativo. Un po&amp;#x2019; come se l&amp;#x2019;immagine fosse il programma, e l&amp;#x2019;istanza fosse il processo del programma in esecuzione: da un solo programma si possono lanciare pi&amp;#xF9; processi.\n
  15. Un&amp;#x2019;immagine &amp;#xE8; una fotografia di una macchina comprensiva dell&amp;#x2019;intero sistema operativo. Un po&amp;#x2019; come se l&amp;#x2019;immagine fosse il programma, e l&amp;#x2019;istanza fosse il processo del programma in esecuzione: da un solo programma si possono lanciare pi&amp;#xF9; processi.\n
  16. Un&amp;#x2019;immagine &amp;#xE8; una fotografia di una macchina comprensiva dell&amp;#x2019;intero sistema operativo. Un po&amp;#x2019; come se l&amp;#x2019;immagine fosse il programma, e l&amp;#x2019;istanza fosse il processo del programma in esecuzione: da un solo programma si possono lanciare pi&amp;#xF9; processi.\n
  17. Un&amp;#x2019;altra informazione necessaria &amp;#xE8; InstanceType\n
  18. Il &amp;#x201C;tipo&amp;#x201D; rappresenta la classe di hardware virtuale su cui deve girare la nostra istanza. La stesa immagine, infatti, pu&amp;#xF2; essere lanciata su macchine virtuali aventi risorse differenti in termini di memoria, CPU e spazio disco disponibili.\n
  19. Il &amp;#x201C;tipo&amp;#x201D; rappresenta la classe di hardware virtuale su cui deve girare la nostra istanza. La stesa immagine, infatti, pu&amp;#xF2; essere lanciata su macchine virtuali aventi risorse differenti in termini di memoria, CPU e spazio disco disponibili.\n
  20. Il &amp;#x201C;tipo&amp;#x201D; rappresenta la classe di hardware virtuale su cui deve girare la nostra istanza. La stesa immagine, infatti, pu&amp;#xF2; essere lanciata su macchine virtuali aventi risorse differenti in termini di memoria, CPU e spazio disco disponibili.\n
  21. Altri due parametri obbligatori sono MinCount e MaxCount, che consentono di impostare quante istanze vadano fatte partire all&amp;#x2019;interno del particolare &amp;#x201C;ordine&amp;#x201D;. Il parametro SecurityGroup non &amp;#xE8; obbligatorio ma consente di impostare delle opzioni di accesso particolari. Esistono ovviamente altri parametri!\n
  22. Una volta dato l&amp;#x2019;ordine di lanciare una o pi&amp;#xF9; istanze occorre attendere che queste siano disponibili.\n
  23. Il controllo &amp;#xE8; possibile utilizzando il metodo describe_instances(), che restituisce una struttura dati multilivello. Di fatto &amp;#xE8; un array anonimo che andr&amp;#xE0; a contenere tutti gli &amp;#x201C;ordini&amp;#x201D; effettuati nel tempo ($reservations); all&amp;#x2019;interno di ciascun ordine potremo accedere all&amp;#x2019;insieme delle istanze proprie dell&amp;#x2019;ordine (da ricordare che con MinCount e MaxCount diversi da 1 potremmo ritrovarci con pi&amp;#xF9; di un&amp;#x2019;istanza per ordine) e quindi allo stato di ciascuna istanza. Quando abbiamo raggiunto il livello &amp;#x2018;running&amp;#x2019; la macchina virtuale &amp;#xE8; definitivamente pronta...\n
  24. ... per cui possiamo reperire le informazioni salienti su di essa, come ad esempio l&amp;#x2019;indirizzo IP su cui &amp;#xE8; raggiungibile.\n
  25. \n
  26. \n
  27. L&amp;#x2019;accesso in SSH alla macchina &amp;#xE8; condizionato per&amp;#xF2; al fatto che siano state impostate opportune chiavi di accesso.\n
  28. Queste possono essere impostate sia attraverso l&amp;#x2019;API che - pi&amp;#xF9; banalmente - attraverso la console web del servizio EC2.\n
  29. A questo punto potete accedere via SSH come utente root. Yay!\n
  30. L&amp;#x2019;ultima operazione principale di interesse &amp;#xE8; ovviamente la terminazione di una macchina virtuale, in modo da ridurre i costi quando questa non sia necessaria. Il metodo terminate_instances() richiede l&amp;#x2019;identificativo della macchina, che &amp;#xE8; reperibile attraverso l&amp;#x2019;oggetto di &amp;#x201C;prenotazione&amp;#x201D; dell&amp;#x2019;ordine.\n
  31. Anche qui &amp;#xE8; opportuno verificare che lo stato della macchina virtuale sia cambiato opportunamente in modo da assicurarci che l&amp;#x2019;ordine di terminazione sia in effettivo corso di smaltimento.\n
  32. \n
  33. Anche per RackSpace &amp;#xE8; disponibile un modulo Perl di astrazione dell&amp;#x2019;API, per quanto non sia esattamente matura e presenti dei punti di possibile miglioramento o comunque raffinamento.\n
  34. Analogamente a quanto avviene per Amazon, anche qui &amp;#xE8; necessario avere delle credenziali di accesso all&amp;#x2019;API che verranno utilizzate anche per la tariffazione dei servizi.\n
  35. Il nome utente lo decidete voi all&amp;#x2019;atto dell&amp;#x2019;iscrizione, mentre la chiave per l&amp;#x2019;API &amp;#xE8; disponibile all&amp;#x2019;interno del vostro profilo.\n
  36. Un altro aspetto che va indicato &amp;#xE8; se intendete connettervi all&amp;#x2019;infrastruttura americana (default) o a quella europea in UK. Si tratta in buona sostanza di due infrastrutture indipendenti che hanno punti di ingresso differenti (contrariamente ad Amazon che ha un punto di ingresso unico per l&amp;#x2019;API).\n
  37. In particolare, se vi interessano macchine virtuali in Europa, il sistema di gestione si trova a Londra.\n
  38. Arrivati a questo punto &amp;#xE8; possibile creare la descrizione di una macchina virtuale.\n
  39. I concetti di base sono gli stessi di Amazon, anche se invece di &amp;#x201C;istanza&amp;#x201D; si parla di &amp;#x201C;server&amp;#x201D; ed invece di &amp;#x201C;tipo&amp;#x201D; si parla di &amp;#x201C;gusto&amp;#x201D;.\n
  40. I concetti di base sono gli stessi di Amazon, anche se invece di &amp;#x201C;istanza&amp;#x201D; si parla di &amp;#x201C;server&amp;#x201D; ed invece di &amp;#x201C;tipo&amp;#x201D; si parla di &amp;#x201C;gusto&amp;#x201D;.\n
  41. I concetti di base sono gli stessi di Amazon, anche se invece di &amp;#x201C;istanza&amp;#x201D; si parla di &amp;#x201C;server&amp;#x201D; ed invece di &amp;#x201C;tipo&amp;#x201D; si parla di &amp;#x201C;gusto&amp;#x201D;.\n
  42. I concetti di base sono gli stessi di Amazon, anche se invece di &amp;#x201C;istanza&amp;#x201D; si parla di &amp;#x201C;server&amp;#x201D; ed invece di &amp;#x201C;tipo&amp;#x201D; si parla di &amp;#x201C;gusto&amp;#x201D;.\n
  43. Ma quello che abbiamo - $server - &amp;#xE8; solo una descrizione e non c&amp;#x2019;&amp;#xE8; nessuna macchina virtuale in cantiere. Ancora.\n
  44. Il metodo create_server() serve proprio ad utilizzare la descrizione creata per lanciare una macchina virtuale. Questa doppia strutturazione &amp;#xE8; uno dei punti di possibile miglioramento dell&amp;#x2019;interfaccia messa a disposizione dal modulo. Nel valore restituito - che rimappa la risposta proveniente da RackSpace - &amp;#xE8; anche disponibile la password dell&amp;#x2019;amministratore della macchina in corso di creazione.\n
  45. \n
  46. Anche qui c&amp;#x2019;&amp;#xE8; da aspettare un minimo per consentire alla macchina di essere lanciata propriamente...\n
  47. ... ed anche qui &amp;#xE8; possibile controllare periodicamente lo stato della macchina finch&amp;#xE9; questa non diventa &amp;#x2018;ACTIVE&amp;#x2019;.\n
  48. Una volta attiva, possiamo sapere qual &amp;#xE8; l&amp;#x2019;indirizzo IP...\n
  49. ... ed entrare in SSH con la password di root che abbiamo raccolto in precedenza.\n
  50. \n
  51. Purtroppo la password viene inviata anche via email...\n
  52. \n
  53. Un aspetto interessante messo a disposizione da RackSpace &amp;#xE8; la possibilit&amp;#xE0; di personalizzare alcuni file in relazione alla particolare istanza con il parametro &amp;#x201C;personality&amp;#x201D;. Un possibile utilizzo consiste nell&amp;#x2019;impostare il file /root/.ssh/authorized_keys2 che consente di utilizzare le chiavi SSH invece delle password. Ovviamente il meccanismo pu&amp;#xF2; essere anche utilizzato per impostare i parametri distintivi dell&amp;#x2019;istanza, come ad esempio il suo ruolo rispetto ad altre istanze lanciate a partire dalla stessa immagine.\n
  54. \n
  55. Molto semplicemente, terminare un server.\n
  56. Una volta lanciato il comando di terminazione la macchina virtuale viene subito fatta scomparire dalla lista delle macchine attive, quindi in questo caso il controllo &amp;#xE8; piuttosto semplice.\n
  57. \n