SlideShare a Scribd company logo
Ruby on Embedded
Devices
What is kinko.me
4 PGP-based email encryption
4 for your desktop and your mobiles
4 with your current email address
Also
4 comes on a dedicated device
ssshhh...
as of this afternoon we are crowdfunding.
Feel invited to check https://getkinko.com
Hardware
4 A10 1GHz Cortex-A8 ARMv7 CPU, VFPv3,
NEON, Mali 400 GPU, CedarX VPU
4 512MB DDR3 RAM memory
4 SD storage
Compared to modern machines
4 CPU: 10x
4 IO throughput: ~50x
(RAM is ok, though)
Is this good enough?
4 Compared to Intel 386: yes
4 Compared with servers: a different usage
patterns
4 low traffic volume
4 few requests to HTTPS frontend
Herding cats
Existing projects
4 nginx/dovecot: HTTP + IMAP servers (C)
4 GnuPG: PGP encryption (C)
4 imapsync: IMAP synchronization
(Python)
4 bonjour, monit (C)
4 OpenSSH: tunnelling (C/ruby)
4 roundcube webmail: Webmail (PHP)
+ not so secret sauce
4 imapsync patch (Python)
4 configuration frontend (Ruby)
4 smtp server + client (Go)
4 installer (Ruby+Shell)
4 gluing code: (Ruby, Shell, C, Flex)
Why Ruby?
4 greatest language in the world
4 good network libraries
4 platform independent, kind of
4 Sinatra rocks
Why not Ruby?
gems + bundler
gems, bundler and all that mess
4 gems are platform independent. Well,
mostly.
4 bundler: hard to manage over accounts
Performance
4 once started performance is ok:
4 ~10 to 20 pages rendered per second
4 startup performance is really bad:
4 starting a sinatra/ActiveRecord app:
~15 seconds
Performance Ruby vs C
# ~30 msecs
date
# ~150 msecs
ruby -e 'puts Time.now'
Lessons learned
4 Configuration UI in ruby/sinatra (for
now)
4 everything else: mostly not.
Tipps & Tricks
1. UN*X is your friend
UN*X is your friend
4 caching: file system cache
4 resources: cleans up after you
4 shared storage: file system
4 built-in authentication: users + groups
4 also: ulimit, chroot, etc.
... Don't rebuild it in ruby
A custom logger in ruby:
logger = Logger.new("#{Rails.root}/log/custom.log", 'daily')
logger.formatter = proc do |severity, time, _, msg|
"#{time.strftime("%B %d %H:%M:%S")} #{severity} #{msg}n"
end
config.logger = logger
... Don't rebuild it in ruby, pt. 2
A custom logger in external application:
reader, writer = IO.pipe
fork do
Process.setpgrp
STDIN.reopen reader
writer.close
exec("timestamp")
end
STDOUT.reopen writer
STDERR.reopen writer
reader.close
... Don't rebuild it in ruby, pt. 3
or simply:
rackup 2>&1 | timestamp
... Don't rebuild it
ditto:
4 daemons
4 process management
4 etc.
(Hello devops!)
2. Alternative Languages
fast and "portable": bash
#!/bin/bash
set -eu
set -o pipefail
echo "Yay!"
Commands are (sometimes) not portable:
echo -n "Is there a newline?"
small & fast: C
POSIX at your fingertips.
4 fast
4 small
4 source: somewhat portable; '#ifdef
linux' FTW!
Pattern matching: flex
Pattern matching done quickly; in portable
source code.
/* Replaces ${{NAME}} from the environment */
${{[a-zA-Z0-9_]+}} {
yytext[yyleng-2] = 0;
const char* env = yytext+3;
const char* value = getenv(env);
printf("%s", value ? value : "");
}
networking: Go
Go, the environment
4 fast, portable source
4 good networking + email libraries (even
SSH!)
4 crosscompiling: easy
Go, the language
4 terrible.
jit: Distribute scripted binaries
Use jit!
http://github.com/radiospiel/jit
4 Works with C, flex, Go
4 Compiles just in or ahead of time
4 Native speed
(Built in bash, BTW)
jit: C Example
Source:
#!/usr/bin/env jit.cc
#include <stdio.h>
void main() {
printf("Hello world!n");
}
Run:
chmod +755 hello
./hello
Links
4 flex: http://flex.sourceforge.net/
4 jit: http://github.com/radiospiel/jit
We are crowdfunding.
https://getkinko.com
Ruby on embedded devices rug::b Aug 2014

More Related Content

What's hot

Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
amiable_indian
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
AdamFallon4
 
Linux file commands
Linux file commandsLinux file commands
Linux file commands
sundas Shabbir
 
Odoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo Online platform: architecture and challenges
Odoo Online platform: architecture and challenges
Odoo
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
Tola LENG
 
Mastering JUNOS DHCP
Mastering JUNOS DHCPMastering JUNOS DHCP
Mastering JUNOS DHCP
ZenSekibe
 
3 technical-dns-workshop-day2
3 technical-dns-workshop-day23 technical-dns-workshop-day2
3 technical-dns-workshop-day2
DNS Entrepreneurship Center
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking Needs
DigitalOcean
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Codemotion
 
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your applicationSpatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Steven Pousty
 
HTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS moduleHTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS module
Kazuho Oku
 
Script for the geomeetup presentation
Script for the geomeetup presentationScript for the geomeetup presentation
Script for the geomeetup presentation
Steven Pousty
 
Bsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicum
Bsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicumBsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicum
Bsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicum
Scott Tsai
 
Linux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comLinux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.com
Green Ecosystem
 
Dns
DnsDns
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
Anuchit Chalothorn
 
MongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script fileMongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script file
Steven Pousty
 
Gsummit apis-2013
Gsummit apis-2013Gsummit apis-2013
Gsummit apis-2013
Gluster.org
 
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for DummiesBartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Business Link Krakow
 

What's hot (20)

Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
 
Linux file commands
Linux file commandsLinux file commands
Linux file commands
 
Odoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo Online platform: architecture and challenges
Odoo Online platform: architecture and challenges
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
 
Mastering JUNOS DHCP
Mastering JUNOS DHCPMastering JUNOS DHCP
Mastering JUNOS DHCP
 
3 technical-dns-workshop-day2
3 technical-dns-workshop-day23 technical-dns-workshop-day2
3 technical-dns-workshop-day2
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking Needs
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
 
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your applicationSpatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
 
HTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS moduleHTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS module
 
Script for the geomeetup presentation
Script for the geomeetup presentationScript for the geomeetup presentation
Script for the geomeetup presentation
 
Bsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicum
Bsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicumBsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicum
Bsdtw17: mariusz zaborski: case studies of sandboxing base system with capsicum
 
Linux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comLinux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.com
 
Dns
DnsDns
Dns
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
MongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script fileMongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script file
 
Gsummit apis-2013
Gsummit apis-2013Gsummit apis-2013
Gsummit apis-2013
 
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for DummiesBartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
Bartosz Zaczyński (Grand Parade Poland) - WebSocket for Dummies
 

Viewers also liked

COXO Digital credentials
COXO Digital credentialsCOXO Digital credentials
COXO Digital credentials
COXO
 
Reddiar mail inside and cover
Reddiar mail inside and coverReddiar mail inside and cover
Reddiar mail inside and cover
Narayanasamy Prasannam
 
Munkh ts.hicheel
Munkh ts.hicheelMunkh ts.hicheel
Munkh ts.hicheelgerlee1981
 
Research into TV Guides
Research into TV GuidesResearch into TV Guides
Research into TV Guides
Harriet Trayling
 
In what ways does your media product use mag (1)
In what ways does your media product use mag (1)In what ways does your media product use mag (1)
In what ways does your media product use mag (1)
darakolajo
 
Visteon final.pdf presentation
Visteon final.pdf presentationVisteon final.pdf presentation
Visteon final.pdf presentation
Suzie Are
 
09 sollisellalamay tamil
09 sollisellalamay tamil09 sollisellalamay tamil
09 sollisellalamay tamil
Narayanasamy Prasannam
 
Evaluation q1
Evaluation q1Evaluation q1
Evaluation q1
sarahbiswell
 
In what ways does your media product use
In what ways does your media product useIn what ways does your media product use
In what ways does your media product use
sarahbiswell
 
Geriin daalgavaruud
Geriin daalgavaruudGeriin daalgavaruud
Geriin daalgavaruudgerlee1981
 
Unit 4 project 2
Unit 4 project 2Unit 4 project 2
Unit 4 project 2
rafaeljoseaguayo
 
Moms tamil
Moms tamilMoms tamil
Research into TV Listing Guides
Research into TV Listing GuidesResearch into TV Listing Guides
Research into TV Listing Guides
Harriet Trayling
 
Social Media: Creating an Effective Digital Strategy
Social Media: Creating an Effective Digital StrategySocial Media: Creating an Effective Digital Strategy
Social Media: Creating an Effective Digital Strategy
Bare Knuckle Digital
 
هيا نطير الطيارة الورقية
هيا نطير الطيارة الورقيةهيا نطير الطيارة الورقية
هيا نطير الطيارة الورقيةnaila600
 
2011
20112011
2011
BU052
 
Android platform
Android platformAndroid platform
Android platform
maya_slides
 
스파이럴캣츠 등급제1 수정안
스파이럴캣츠 등급제1 수정안스파이럴캣츠 등급제1 수정안
스파이럴캣츠 등급제1 수정안Geonyeong Ju
 
கிரிமினல் குற்றவாளிகளின் தந்திரங்கள் Criminal focus
கிரிமினல் குற்றவாளிகளின் தந்திரங்கள்  Criminal focusகிரிமினல் குற்றவாளிகளின் தந்திரங்கள்  Criminal focus
கிரிமினல் குற்றவாளிகளின் தந்திரங்கள் Criminal focus
Narayanasamy Prasannam
 

Viewers also liked (20)

COXO Digital credentials
COXO Digital credentialsCOXO Digital credentials
COXO Digital credentials
 
Reddiar mail inside and cover
Reddiar mail inside and coverReddiar mail inside and cover
Reddiar mail inside and cover
 
Munkh ts.hicheel
Munkh ts.hicheelMunkh ts.hicheel
Munkh ts.hicheel
 
Research into TV Guides
Research into TV GuidesResearch into TV Guides
Research into TV Guides
 
In what ways does your media product use mag (1)
In what ways does your media product use mag (1)In what ways does your media product use mag (1)
In what ways does your media product use mag (1)
 
Visteon final.pdf presentation
Visteon final.pdf presentationVisteon final.pdf presentation
Visteon final.pdf presentation
 
09 sollisellalamay tamil
09 sollisellalamay tamil09 sollisellalamay tamil
09 sollisellalamay tamil
 
Evaluation q1
Evaluation q1Evaluation q1
Evaluation q1
 
In what ways does your media product use
In what ways does your media product useIn what ways does your media product use
In what ways does your media product use
 
Geriin daalgavaruud
Geriin daalgavaruudGeriin daalgavaruud
Geriin daalgavaruud
 
Saioa p54
Saioa p54Saioa p54
Saioa p54
 
Unit 4 project 2
Unit 4 project 2Unit 4 project 2
Unit 4 project 2
 
Moms tamil
Moms tamilMoms tamil
Moms tamil
 
Research into TV Listing Guides
Research into TV Listing GuidesResearch into TV Listing Guides
Research into TV Listing Guides
 
Social Media: Creating an Effective Digital Strategy
Social Media: Creating an Effective Digital StrategySocial Media: Creating an Effective Digital Strategy
Social Media: Creating an Effective Digital Strategy
 
هيا نطير الطيارة الورقية
هيا نطير الطيارة الورقيةهيا نطير الطيارة الورقية
هيا نطير الطيارة الورقية
 
2011
20112011
2011
 
Android platform
Android platformAndroid platform
Android platform
 
스파이럴캣츠 등급제1 수정안
스파이럴캣츠 등급제1 수정안스파이럴캣츠 등급제1 수정안
스파이럴캣츠 등급제1 수정안
 
கிரிமினல் குற்றவாளிகளின் தந்திரங்கள் Criminal focus
கிரிமினல் குற்றவாளிகளின் தந்திரங்கள்  Criminal focusகிரிமினல் குற்றவாளிகளின் தந்திரங்கள்  Criminal focus
கிரிமினல் குற்றவாளிகளின் தந்திரங்கள் Criminal focus
 

Similar to Ruby on embedded devices rug::b Aug 2014

Application Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.keyApplication Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.key
Tim Bunce
 
Php through the eyes of a hoster
Php through the eyes of a hosterPhp through the eyes of a hoster
Php through the eyes of a hoster
Combell NV
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
Amin Astaneh
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
Iker Coranti
 
Death matchtournament del2014
Death matchtournament del2014Death matchtournament del2014
Death matchtournament del2014
Nabil Munawar
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios
 
Interoperable PHP
Interoperable PHPInteroperable PHP
Interoperable PHP
weltling
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11
Combell NV
 
Open Source Logging and Monitoring Tools
Open Source Logging and Monitoring ToolsOpen Source Logging and Monitoring Tools
Open Source Logging and Monitoring Tools
Phase2
 
Open Source Logging and Metrics Tools
Open Source Logging and Metrics ToolsOpen Source Logging and Metrics Tools
Open Source Logging and Metrics Tools
Phase2
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
Rishu Seth
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
Quey-Liang Kao
 
Don’t turn your logs into cuneiform
Don’t turn your logs into cuneiformDon’t turn your logs into cuneiform
Don’t turn your logs into cuneiform
Andrey Rebrov
 
Logstash
LogstashLogstash
Logstash
琛琳 饶
 
Servers and Processes: Behavior and Analysis
Servers and Processes: Behavior and AnalysisServers and Processes: Behavior and Analysis
Servers and Processes: Behavior and Analysis
dreamwidth
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
Bachkoutou Toutou
 
Compiling P4 to XDP, IOVISOR Summit 2017
Compiling P4 to XDP, IOVISOR Summit 2017Compiling P4 to XDP, IOVISOR Summit 2017
Compiling P4 to XDP, IOVISOR Summit 2017
Cheng-Chun William Tu
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
Salman Baset
 

Similar to Ruby on embedded devices rug::b Aug 2014 (20)

Application Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.keyApplication Logging in the 21st century - 2014.key
Application Logging in the 21st century - 2014.key
 
Php through the eyes of a hoster
Php through the eyes of a hosterPhp through the eyes of a hoster
Php through the eyes of a hoster
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
 
Death matchtournament del2014
Death matchtournament del2014Death matchtournament del2014
Death matchtournament del2014
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
 
Interoperable PHP
Interoperable PHPInteroperable PHP
Interoperable PHP
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11
 
Open Source Logging and Monitoring Tools
Open Source Logging and Monitoring ToolsOpen Source Logging and Monitoring Tools
Open Source Logging and Monitoring Tools
 
Open Source Logging and Metrics Tools
Open Source Logging and Metrics ToolsOpen Source Logging and Metrics Tools
Open Source Logging and Metrics Tools
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
 
Don’t turn your logs into cuneiform
Don’t turn your logs into cuneiformDon’t turn your logs into cuneiform
Don’t turn your logs into cuneiform
 
Logstash
LogstashLogstash
Logstash
 
Servers and Processes: Behavior and Analysis
Servers and Processes: Behavior and AnalysisServers and Processes: Behavior and Analysis
Servers and Processes: Behavior and Analysis
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Compiling P4 to XDP, IOVISOR Summit 2017
Compiling P4 to XDP, IOVISOR Summit 2017Compiling P4 to XDP, IOVISOR Summit 2017
Compiling P4 to XDP, IOVISOR Summit 2017
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
 

Recently uploaded

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 

Recently uploaded (20)

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 

Ruby on embedded devices rug::b Aug 2014

  • 2.
  • 3. What is kinko.me 4 PGP-based email encryption 4 for your desktop and your mobiles 4 with your current email address Also 4 comes on a dedicated device
  • 4. ssshhh... as of this afternoon we are crowdfunding. Feel invited to check https://getkinko.com
  • 5. Hardware 4 A10 1GHz Cortex-A8 ARMv7 CPU, VFPv3, NEON, Mali 400 GPU, CedarX VPU 4 512MB DDR3 RAM memory 4 SD storage
  • 6. Compared to modern machines 4 CPU: 10x 4 IO throughput: ~50x (RAM is ok, though)
  • 7. Is this good enough? 4 Compared to Intel 386: yes 4 Compared with servers: a different usage patterns 4 low traffic volume 4 few requests to HTTPS frontend
  • 9. Existing projects 4 nginx/dovecot: HTTP + IMAP servers (C) 4 GnuPG: PGP encryption (C) 4 imapsync: IMAP synchronization (Python) 4 bonjour, monit (C) 4 OpenSSH: tunnelling (C/ruby) 4 roundcube webmail: Webmail (PHP)
  • 10. + not so secret sauce 4 imapsync patch (Python) 4 configuration frontend (Ruby) 4 smtp server + client (Go) 4 installer (Ruby+Shell) 4 gluing code: (Ruby, Shell, C, Flex)
  • 12. 4 greatest language in the world 4 good network libraries 4 platform independent, kind of 4 Sinatra rocks
  • 14. gems + bundler gems, bundler and all that mess 4 gems are platform independent. Well, mostly. 4 bundler: hard to manage over accounts
  • 15. Performance 4 once started performance is ok: 4 ~10 to 20 pages rendered per second 4 startup performance is really bad: 4 starting a sinatra/ActiveRecord app: ~15 seconds
  • 16. Performance Ruby vs C # ~30 msecs date # ~150 msecs ruby -e 'puts Time.now'
  • 17. Lessons learned 4 Configuration UI in ruby/sinatra (for now) 4 everything else: mostly not.
  • 19. 1. UN*X is your friend
  • 20. UN*X is your friend 4 caching: file system cache 4 resources: cleans up after you 4 shared storage: file system 4 built-in authentication: users + groups 4 also: ulimit, chroot, etc.
  • 21. ... Don't rebuild it in ruby A custom logger in ruby: logger = Logger.new("#{Rails.root}/log/custom.log", 'daily') logger.formatter = proc do |severity, time, _, msg| "#{time.strftime("%B %d %H:%M:%S")} #{severity} #{msg}n" end config.logger = logger
  • 22. ... Don't rebuild it in ruby, pt. 2 A custom logger in external application: reader, writer = IO.pipe fork do Process.setpgrp STDIN.reopen reader writer.close exec("timestamp") end STDOUT.reopen writer STDERR.reopen writer reader.close
  • 23. ... Don't rebuild it in ruby, pt. 3 or simply: rackup 2>&1 | timestamp
  • 24. ... Don't rebuild it ditto: 4 daemons 4 process management 4 etc. (Hello devops!)
  • 26. fast and "portable": bash #!/bin/bash set -eu set -o pipefail echo "Yay!" Commands are (sometimes) not portable: echo -n "Is there a newline?"
  • 27. small & fast: C POSIX at your fingertips. 4 fast 4 small 4 source: somewhat portable; '#ifdef linux' FTW!
  • 28. Pattern matching: flex Pattern matching done quickly; in portable source code. /* Replaces ${{NAME}} from the environment */ ${{[a-zA-Z0-9_]+}} { yytext[yyleng-2] = 0; const char* env = yytext+3; const char* value = getenv(env); printf("%s", value ? value : ""); }
  • 29. networking: Go Go, the environment 4 fast, portable source 4 good networking + email libraries (even SSH!) 4 crosscompiling: easy Go, the language 4 terrible.
  • 30. jit: Distribute scripted binaries Use jit! http://github.com/radiospiel/jit 4 Works with C, flex, Go 4 Compiles just in or ahead of time 4 Native speed (Built in bash, BTW)
  • 31. jit: C Example Source: #!/usr/bin/env jit.cc #include <stdio.h> void main() { printf("Hello world!n"); } Run: chmod +755 hello ./hello
  • 32. Links 4 flex: http://flex.sourceforge.net/ 4 jit: http://github.com/radiospiel/jit