SlideShare a Scribd company logo
1 of 30

      
       1H.com 
      
     
      
       1H.com 
      
     
      
       
       
       Exploiting the Newer Perl  
       to Improve Your Plugins 
      
     
      
       Marian Marinov - mm@1h.com 
       Co-founder & CEO of 1H Ltd.

      
       AGENDA 
      
     
      
       ,[object Object],

      
       $  $$  $$$  $$  $ 
      
     
      
       
       If you rate my survey, I'll hook you up with $20 cPCache $$$. 
       
       Go to this address to take the survey: 
       http://go.cpanel.net/b27 
       
       and come up to the podium once you've completed it.

      
       Plug-ins creation 
      
     
      
       ,[object Object],

      
       cPanel plug-ins with jQuery 
      
     
      
       #!/usr/bin/perl -w 
       use strict; 
       use JQuery::Demo; 
       use JQuery::CSS; 
       use CGI; 
       
       package main; 
       my $tester = new JQuery::Demo; 
       $tester->run; 
       
       package JQuery::Demo; 
       use JQuery::Tabs;

      
       cPanel plug-ins with jQuery 
      
     
      
       
       
       sub start { 
       my $my = shift; 
       my $q = new CGI; 
       $my->{info}{TITLE} = "Tabs"; 
       my $jquery = $my->{jquery}; 
       my @tabs = ("tab 1","tab 2","tab 3","tab 4"); 
       my @texts = ("line 1","line 2","line 3","line4");

      
       cPanel plug-ins with jQuery 
      
     
      
       my $tab = JQuery::Tabs->new(id => 'myTab', 
       addToJQuery => $jquery, 
       tabs => tabs, 
       remote => 'true',  
       remoteProgram => 'jquery_tabs_results.pl', 
       rm => 'myMode', 
       spinner => 1 ); 
       my $html = $tab->HTML; 
       $my->{info}{BODY} = qq[<h1>START OF TAB EXAMPLE</h1>$html</div>END OF EXAMPLE</h1>]; 
       }

      
       cPanel plug-ins with jQuery

      
       JavaScript::Packer 
      
     
      
       $ wc -l uncompressed.js  
       1078 uncompressed.js 
       $ ls -l uncompressed.js  
       -rw-r--r-- 1 hackman hackman 31609 Oct  8 00:43 uncompressed.js 
       $ ./minify-js.pl  
       $ ls -l compressed.js  
       -rw-rw-r-- 1 hackman hackman 15847 Oct  8 00:43 compressed.js 
       $ wc -l compressed.js  
       0 compressed.js

      
       JavaScript::Packer 
      
     
      
       #!/usr/bin/perl -w 
       use strict; 
       use JavaScript::Packer; 
       my $packer = JavaScript::Packer->init(); 
       open( UNCOMPRESSED, 'uncompressed.js' ); 
       open( COMPRESSED,  '>compressed.js' ); 
       my $js = join( '', <UNCOMPRESSED> ); 
       $packer->minify( js, { compress => 'best' }); 
       print COMPRESSED $js; 
       close(UNCOMPRESSED); 
       close(COMPRESSED);

      
       Why JSON and why JSON::XS 
      
     
      
       ,[object Object],

      
       Example with JSON 
      
     
      
       #!/usr/bin/perl -w 
       use strict; 
       use JSON::XS; 
       my %res = ( 'a' => 'line1', 'b' => 'line2' ); 
       my $json = JSON::XS->new->ascii->pretty->allow_nonref; 
       print $json->encode(res); 
       
       $ ./json-ex.pl  
       {&quot;a&quot;:&quot;line1&quot;,&quot;b&quot;:&quot;line2&quot;}

      
       Why queuing is helpful 
      
     
      
       ,[object Object],

      
       Introduce Queuing 
      
     
      
       ,[object Object],

      
       Gearman Architecture 
      
     
      
       ,[object Object],
      
     
      
       Worker 
      
     
      
       Client 
      
     
      gearmand 
      
       
       
       
       
       
       
      
     
      Web App 
      
       
       
       
       
       
       
      
     
      Daemon

      
       Gearman client 
      
     
      
       #!/usr/bin/perl -w 
       use strict; 
       use Gearman::Client; 
       my $client = Gearman::Client->new; 
       $client->job_servers('127.0.0.1:4730'); 
       $str = &quot;my client has called&quot;; 
       eval { 
       local $SIG{ALRM} = sub { die 'timeout'; }; 
       alarm(3); 
       $client->dispatch_background('log_me', $str); 
       alarm(0);  
       };

      
       Gearman worker 
      
     
      
       #!/usr/bin/perl -w 
       use strict; 
       use Gearman::Worker; 
       use POSIX qw(strftime); 
       $logfile = '/home/hackman/test.log'; 
       open LOG, '>>', $logfile; 
       select((select(LOG), $| = 1)[0]); 
       my $logger = sub { ... }; 
       my $w = Gearman::Worker->new; 
       $w->job_servers('127.0.0.1:4730'); 
       $w->register_function( log_me => $logger ); 
       $w->work while 1;

      
       Gearman setup 
      
     
      
       # make && make install 
       # gearmand -d -u gearman -p 4730 
       
       # gearman_status.pl  
       function name  queue  exec worker 
       log_me  1  1  1 
       check_oneh  0  0  1 
       gather_child  154  72  72

      
       RabbitMQ architecture 
      
     
      RabbitMQ 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      
      
       
       
       
       
       
       
       
       
       
      
     
      
      
       
       
       
       
       
       
       
       
       
      
     
      
      
       
       
       
       
       
       
       
       
       
      
     
      
      
       
       
       
       
       
       
       
       
       
      
     
      Queue 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Exchange 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Server 
      
       
       
       
       
       
       
      
     
      Server 
      
       
       
       
       
       
       
      
     
      Queue 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Server

      
       RabbitMQ architecture 
      
     
      
     
      RabbitMQ 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      AMQP 
      
       
       
       
       
       
       
      
     
      XMPP 
      
       
       
       
       
       
       
      
     
      STOMP 
      
       
       
       
       
       
       
      
     
      HTTP 
      
       
       
       
       
       
       
      
     
      AMQP 
      
       
       
       
       
       
       
      
     
      XMPP 
      
       
       
       
       
       
       
      
     
      STOMP 
      
       
       
       
       
       
       
      
     
      HTTP

      
       ,[object Object],
      
     
      
       # yum install erlang 
       # rpm -Uvh rabbitmq-server-2.6.1-1.noarch.rpm 
       
       # rabbitmq-server -detached 
       # rabbitmqctl status 
       Status of node rabbit@gamelon ... 
       [{pid,6829}, {running_applications, 
       [{rabbit,&quot;RabbitMQ&quot;,&quot;2.6.1&quot;}, 
       ....

      
       ,[object Object],
      
     
      
       #!/usr/bin/perl -w 
       use strict; 
       use Net::RabbitMQ; 
       my $mq = Net::RabbitMQ->new(); 
       $mq->connect(&quot;localhost&quot;, { user => &quot;guest&quot;, password => &quot;guest&quot; }); 
       $mq->channel_open(1); 
       $mq->publish(1, &quot;testqueue&quot;, &quot;Hi there!&quot;); 
       $mq->disconnect();

      
       ,[object Object],
      
     
      
       #!/usr/bin/perl -w 
       use strict; use Data::Dumper ;  use Net::RabbitMQ; 
       my $mq = Net::RabbitMQ->new(); 
       $mq->connect(&quot;localhost&quot;,{user=>&quot;guest&quot;,password=>&quot;guest&quot;}); 
       $mq->channel_open(1); 
       $mq->exchange_declare(1, 'my_x',{auto_delete => 0}); 
       $mq->queue_declare(1, 'testqueue',{auto_delete => 0}); 
       $mq->queue_bind(1, 'testqueue', 'my_x', 'foo'); 
       while(1){ 
       my $hashref = $mq->get(1, 'testqueue'); 
       print Dumper($hashref) if (defined($hashref)); 
       }

      
       ,[object Object],
      
     
      
       ,[object Object],

      
       ,[object Object],
      
     
      
     
      memcached 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      CGI 
      
       
       
       
       
       
       
      
     
      CGI 
      
       
       
       
       
       
       
      
     
      CGI 
      
       
       
       
       
       
       
      
     
      CGI 
      
       
       
       
       
       
       
      
     
      CGI

      
       ,[object Object],

      
       Conclusions 
      
     
      
       ,[object Object],

      
       Questions 
      
     
      
         ?  ?  ?  ? 
       ?  ?  ?  ?    ?  ? 
       ?  ? ?  ? ?  ?  ? 
       ?    ? ?  ?    ?    ? 
       ?      ?

      
       
       Thank you 
       
       Please visit us at Booth 23 
      
     
      
       Marian Marinov - mm@1h.com 
       Co-founder & CIO at 1H Ltd. 
      
     
      
       1H.com 
      
     
      
       1H.com

      
       $  $$  $$$  $$  $ 
      
     
      
       
       If you rate my survey, I'll hook you up with $20 cPCache $$$. 
       
       Go to this address to take the survey: 
       http://go.cpanel.net/b27 
       
       and come up to the podium once you've completed it.

More Related Content

What's hot

Sinatra Rack And Middleware
Sinatra Rack And MiddlewareSinatra Rack And Middleware
Sinatra Rack And MiddlewareBen Schwarz
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webWallace Reis
 
Perl: Hate it for the Right Reasons
Perl: Hate it for the Right ReasonsPerl: Hate it for the Right Reasons
Perl: Hate it for the Right ReasonsMatt Follett
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principlesPerl Careers
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015Fernando Hamasaki de Amorim
 
Symfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendSymfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendKirill Chebunin
 
Zend Framework Study@Tokyo vol1
Zend Framework Study@Tokyo vol1Zend Framework Study@Tokyo vol1
Zend Framework Study@Tokyo vol1Shinya Ohyanagi
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire playerMarcin Czarnecki
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
Apache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-Thon
Apache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-ThonApache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-Thon
Apache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-ThonMasahiro Nagano
 
And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...Codemotion
 
Implementing pattern-matching in JavaScript (short version)
Implementing pattern-matching in JavaScript (short version)Implementing pattern-matching in JavaScript (short version)
Implementing pattern-matching in JavaScript (short version)François-Guillaume Ribreau
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Shinya Ohyanagi
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsMark Baker
 
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Gosuke Miyashita
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
What you need to remember when you upload to CPAN
What you need to remember when you upload to CPANWhat you need to remember when you upload to CPAN
What you need to remember when you upload to CPANcharsbar
 
Effective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersEffective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersMarcin Chwedziak
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Masahiro Nagano
 

What's hot (20)

Sinatra Rack And Middleware
Sinatra Rack And MiddlewareSinatra Rack And Middleware
Sinatra Rack And Middleware
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
 
Perl: Hate it for the Right Reasons
Perl: Hate it for the Right ReasonsPerl: Hate it for the Right Reasons
Perl: Hate it for the Right Reasons
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
 
Symfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendSymfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friend
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
 
Zend Framework Study@Tokyo vol1
Zend Framework Study@Tokyo vol1Zend Framework Study@Tokyo vol1
Zend Framework Study@Tokyo vol1
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire player
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Apache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-Thon
Apache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-ThonApache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-Thon
Apache::LogFormat::Compiler YAPC::Asia 2013 Tokyo LT-Thon
 
And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...
 
Implementing pattern-matching in JavaScript (short version)
Implementing pattern-matching in JavaScript (short version)Implementing pattern-matching in JavaScript (short version)
Implementing pattern-matching in JavaScript (short version)
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
What you need to remember when you upload to CPAN
What you need to remember when you upload to CPANWhat you need to remember when you upload to CPAN
What you need to remember when you upload to CPAN
 
Effective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersEffective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 Developers
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
 

Similar to Exploiting the newer perl to improve your plugins

What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?brynary
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practicesXenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practicesLucas Jellema
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Curscatalyst
CurscatalystCurscatalyst
CurscatalystKar Juan
 
Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
Ultra fast web development with sinatra
Ultra fast web development with sinatraUltra fast web development with sinatra
Ultra fast web development with sinatraSérgio Santos
 
Ten modules I haven't yet talked about
Ten modules I haven't yet talked aboutTen modules I haven't yet talked about
Ten modules I haven't yet talked aboutacme
 
FOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngineFOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEnginedottedmag
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleGeoffrey De Smet
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Robin Fernandes
 

Similar to Exploiting the newer perl to improve your plugins (20)

WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
Xenogenetics
XenogeneticsXenogenetics
Xenogenetics
 
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practicesXenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practices
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
Ultra fast web development with sinatra
Ultra fast web development with sinatraUltra fast web development with sinatra
Ultra fast web development with sinatra
 
Capistrano
CapistranoCapistrano
Capistrano
 
Api Design
Api DesignApi Design
Api Design
 
Ten modules I haven't yet talked about
Ten modules I haven't yet talked aboutTen modules I haven't yet talked about
Ten modules I haven't yet talked about
 
FOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngineFOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngine
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605
 

More from Marian Marinov

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingMarian Marinov
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsMarian Marinov
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Marian Marinov
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDBMarian Marinov
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMarian Marinov
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfMarian Marinov
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home eraMarian Marinov
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefsMarian Marinov
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd Marian Marinov
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storageMarian Marinov
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Marian Marinov
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL serverMarian Marinov
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKMarian Marinov
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networksMarian Marinov
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automationMarian Marinov
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingMarian Marinov
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of serversMarian Marinov
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failuresMarian Marinov
 

More from Marian Marinov (20)

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automation
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of servers
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failures
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Exploiting the newer perl to improve your plugins

  • 1. 1H.com 1H.com Exploiting the Newer Perl to Improve Your Plugins Marian Marinov - mm@1h.com Co-founder & CEO of 1H Ltd.
  • 2.
  • 3. $ $$ $$$ $$ $ If you rate my survey, I'll hook you up with $20 cPCache $$$. Go to this address to take the survey: http://go.cpanel.net/b27 and come up to the podium once you've completed it.
  • 4.
  • 5. cPanel plug-ins with jQuery #!/usr/bin/perl -w use strict; use JQuery::Demo; use JQuery::CSS; use CGI; package main; my $tester = new JQuery::Demo; $tester->run; package JQuery::Demo; use JQuery::Tabs;
  • 6. cPanel plug-ins with jQuery sub start { my $my = shift; my $q = new CGI; $my->{info}{TITLE} = &quot;Tabs&quot;; my $jquery = $my->{jquery}; my @tabs = (&quot;tab 1&quot;,&quot;tab 2&quot;,&quot;tab 3&quot;,&quot;tab 4&quot;); my @texts = (&quot;line 1&quot;,&quot;line 2&quot;,&quot;line 3&quot;,&quot;line4&quot;);
  • 7. cPanel plug-ins with jQuery my $tab = JQuery::Tabs->new(id => 'myTab', addToJQuery => $jquery, tabs => tabs, remote => 'true', remoteProgram => 'jquery_tabs_results.pl', rm => 'myMode', spinner => 1 ); my $html = $tab->HTML; $my->{info}{BODY} = qq[<h1>START OF TAB EXAMPLE</h1>$html</div>END OF EXAMPLE</h1>]; }
  • 8. cPanel plug-ins with jQuery
  • 9. JavaScript::Packer $ wc -l uncompressed.js 1078 uncompressed.js $ ls -l uncompressed.js -rw-r--r-- 1 hackman hackman 31609 Oct 8 00:43 uncompressed.js $ ./minify-js.pl $ ls -l compressed.js -rw-rw-r-- 1 hackman hackman 15847 Oct 8 00:43 compressed.js $ wc -l compressed.js 0 compressed.js
  • 10. JavaScript::Packer #!/usr/bin/perl -w use strict; use JavaScript::Packer; my $packer = JavaScript::Packer->init(); open( UNCOMPRESSED, 'uncompressed.js' ); open( COMPRESSED, '>compressed.js' ); my $js = join( '', <UNCOMPRESSED> ); $packer->minify( js, { compress => 'best' }); print COMPRESSED $js; close(UNCOMPRESSED); close(COMPRESSED);
  • 11.
  • 12. Example with JSON #!/usr/bin/perl -w use strict; use JSON::XS; my %res = ( 'a' => 'line1', 'b' => 'line2' ); my $json = JSON::XS->new->ascii->pretty->allow_nonref; print $json->encode(res); $ ./json-ex.pl {&quot;a&quot;:&quot;line1&quot;,&quot;b&quot;:&quot;line2&quot;}
  • 13.
  • 14.
  • 15.
  • 16. Gearman client #!/usr/bin/perl -w use strict; use Gearman::Client; my $client = Gearman::Client->new; $client->job_servers('127.0.0.1:4730'); $str = &quot;my client has called&quot;; eval { local $SIG{ALRM} = sub { die 'timeout'; }; alarm(3); $client->dispatch_background('log_me', $str); alarm(0); };
  • 17. Gearman worker #!/usr/bin/perl -w use strict; use Gearman::Worker; use POSIX qw(strftime); $logfile = '/home/hackman/test.log'; open LOG, '>>', $logfile; select((select(LOG), $| = 1)[0]); my $logger = sub { ... }; my $w = Gearman::Worker->new; $w->job_servers('127.0.0.1:4730'); $w->register_function( log_me => $logger ); $w->work while 1;
  • 18. Gearman setup # make && make install # gearmand -d -u gearman -p 4730 # gearman_status.pl function name queue exec worker log_me 1 1 1 check_oneh 0 0 1 gather_child 154 72 72
  • 19. RabbitMQ architecture RabbitMQ Queue Exchange Server Server Queue Server
  • 20. RabbitMQ architecture RabbitMQ AMQP XMPP STOMP HTTP AMQP XMPP STOMP HTTP
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Questions ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 29. Thank you Please visit us at Booth 23 Marian Marinov - mm@1h.com Co-founder & CIO at 1H Ltd. 1H.com 1H.com
  • 30. $ $$ $$$ $$ $ If you rate my survey, I'll hook you up with $20 cPCache $$$. Go to this address to take the survey: http://go.cpanel.net/b27 and come up to the podium once you've completed it.

Editor's Notes

  1. \n \n \n \n \n \n
  2. \n \n \n \n \n
  3. \n \n \n \n \n
  4. \n \n \n \n \n
  5. \n \n \n \n \n \n
  6. \n \n \n \n \n @tabs – name of the tabs \n @texts – tabs contents \n \n \n
  7. \n \n \n \n \n header - start of tab example \n footer – end of tab example \n combine this with HTML::Template or Template::Toolkit \n \n \n
  8. \n \n \n \n \n
  9. \n \n \n \n \n
  10. \n \n \n \n \n
  11. \n \n \n \n \n
  12. \n \n \n \n \n
  13. \n \n \n \n \n
  14. \n \n \n \n Who is using gearman: \n LiveJurnal \n Booking.com \n \n Who is using RabbitMQ: \n JPMorgan \n Goldman Sachs \n Cisco \n Novell \n Microsoft \n RedHat \n \n \n \n
  15. \n \n \n \n \n
  16. \n \n \n \n \n
  17. \n \n \n \n \n
  18. \n \n \n \n \n
  19. \n \n \n \n \n
  20. \n \n \n \n AMQP - Advanced Message Queuing Protocol \n STOMP - Streaming Text Oriented Messaging Protocol \n XMPP - Extensible Messaging and Presence Protocol \n \n \n \n
  21. \n \n \n \n \n
  22. \n \n \n \n \n
  23. \n \n \n \n \n
  24. \n \n \n \n \n
  25. \n \n \n \n \n
  26. \n \n \n \n \n
  27. \n \n \n \n Premature optimizations are infecting all of us \n \n Wrongly implemented algorithms or usage of things like for/foreach when you can use while are clear performance hogs. \n \n \n
  28. \n \n \n \n \n
  29. \n \n \n \n \n
  30. \n \n \n \n \n