tag:blogger.com,1999:blog-60854914590581463262024-03-14T05:30:14.394+01:00Apunts de software lliure / Notes about free softwareJordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.comBlogger136125tag:blogger.com,1999:blog-6085491459058146326.post-58452386372465787302017-11-21T14:59:00.000+01:002017-11-21T18:23:08.413+01:00Decentralized HA<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-lDAMtT3oGJI/WhQmgPTAzxI/AAAAAAAAecM/kc9yuj1pKLwc-IVpc2SAXjN5WWjFy8mPwCLcBGAs/s1600/decentralized_ha.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="899" data-original-width="1600" height="179" src="https://1.bp.blogspot.com/-lDAMtT3oGJI/WhQmgPTAzxI/AAAAAAAAecM/kc9yuj1pKLwc-IVpc2SAXjN5WWjFy8mPwCLcBGAs/s320/decentralized_ha.jpg" width="320" /></a></div>
Last week was <a href="https://hackweek.suse.com/">Hackweek 0x10 at SUSE</a> and I worked in this idea about how we could have a web available, even in the most difficult scenarios, i.e. on a <a href="https://thehackernews.com/2016/10/dyn-dns-ddos.html">DDOS Massive Attack on the DNS</a>.<br />
<br />
I've been playing with different ideas until I came across <a href="https://namecoin.org/">namecoin</a>, a decentralized DNS based on bitcoin technology.<br />
<br />
Then, I had this idea about combining it with <a href="https://en.wikipedia.org/wiki/Round-robin_DNS">DNS Round Robin for High Availability</a>, and so have Decentralized DNS Round Robin for High Availability, or in short,<b> Decentralized HA</b>.<br />
<br />
Thus, I downloaded the <i>namecoin</i> daemon and <i>namecoin</i> clients from <a href="http://namecoin.org/">namecoin.org</a> and started syncronizing the <i>blockchain</i> network... which was terrible slow, 48h!<br />
<br />
In the middle of that I got impatient and I just bought the "namecoin domain" <i>jordia65.bit</i> from <a href="http://peername.com/">peername.com</a>, which will add such domain into the <i>blockchain</i> for you (kind of a service proxy if you can't wait for the whole <i>blockchain</i> to be downloaded).<br />
<br />
Note you can not use any domain but a special zone domain, which is .bit. More at <a href="https://bit.namecoin.org/">https://bit.namecoin.org/ </a><br />
<br />
Anyway, after buying the domain, they also gave me good support, as my request was a bit special. I didn't want just <i>jordia65.bit</i> to map into an IP address, but to map to 2 IP adresses, to mimic what I would do with a classic DNS Round Robin setup, which would be to have at least 2 A records.<br />
<br />
This is the domain in the <i>namecoin blockchain</i>:<br />
<br />
<a href="https://namecha.in/name/d/jordia65">https://namecha.in/name/d/jordia65</a><br />
<br />
The 2 IP addresses are real servers running in a cloud. Actually they are floating ip addresses, but that is another story.<br />
<br />
Until here, all good. Then the fun started :) . The trick is to use a DNS daemon which queries the <i>namecoin</i> daemon. <i>namecoin</i> already provides that, which is called <a href="https://github.com/namecoin/nmcontrol">nmcontrol</a> *<br />
<br />
However, that daemon was not expecting 2 IP addresses per domain, and here is where I did my contribution: <a href="https://github.com/namecoin/nmcontrol/pull/121/">https://github.com/namecoin/nmcontrol/pull/121/</a><br />
<br />
With that, I was able to put down one of the servers and firefox redirected me to the other one automatically. And the whole beauty of this, is that this does not require a central server for storing neither the domain name nor the list of IP addresses to balance, and this list can also be updated on a decentralized way.<br />
<br />
Since setting up all this can be a bit difficult for a "regular user", I also did some tests on setting up an http proxy, with apache2, so that the proxy will be the one trying to resolve the<i> jordia65.bit</i> domain ... and it worked :) ! Also the HA part.<br />
<br />
Thus, you could set up your firefox to use that proxy and you would be able to browse .bit domains with high availability.<br />
<br />
However, as you may have guessed, adding a proxy has a drawback, which is that it introduces a "single point of failure". If the proxy is taken down, you would not be able to reach any internet at all.<br />
<br />
All this is "experimental" and so it will need some more testing and engineering, but all in all, I am very proud of the results and I had a lot of fun with this project :)<br />
<br />
<br />
<br />
<br />
(*) Actually it seems nmcontrol has been deprecated in favor of <span class="col-11 text-gray-dark mr-2" itemprop="about"><a href="https://github.com/namecoin/ncdns">https://github.com/namecoin/ncdns</a> , but nmcontrol was easier to hack.</span><br />
<br />
<br />
<br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com2tag:blogger.com,1999:blog-6085491459058146326.post-67195654360546985012017-07-24T18:14:00.002+02:002017-07-24T18:21:50.999+02:00Ruby gems security issues: Have hackers lost their interest?Security issues on rubygems have decreased over time, from 93 in 2013 to 8 in 2017 (expected).<br />
<br />
Is it because ruby programming community has gotten more mature? Are developers better? Or is it that hackers and researchers have lost interest?<br />
<br />
Whatever it is, here you have the numbers:<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-t5q7SjjUdBY/WXYcbDj6oAI/AAAAAAAAcQk/IIGL7WXAdp0pX-C_gMyTVi--kSLyCf79gCLcBGAs/s1600/rubygem_sec_issues.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="794" data-original-width="1058" height="240" src="https://1.bp.blogspot.com/-t5q7SjjUdBY/WXYcbDj6oAI/AAAAAAAAcQk/IIGL7WXAdp0pX-C_gMyTVi--kSLyCf79gCLcBGAs/s320/rubygem_sec_issues.png" width="320" /></a></div>
<br />
<br />
<i><span style="font-size: xx-small;">*data from https://github.com/rubysec/ruby-advisory-db</span></i><br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-32142322684152371242016-07-18T18:48:00.001+02:002016-07-18T18:48:28.856+02:00Rails maintainer jobHi! Do you know what is Rails? Do you also know what is an RPM? And more important, are you looking for a job?<br />
<br />
If your answer is "yes", "yes" and "yes", check this job offer<br />
<br />
https://jobs.suse.com/job/germany/rails-maintainer-global-location/3486/2468208<br />
<br />
We are looking for you!Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com2tag:blogger.com,1999:blog-6085491459058146326.post-78682734478365847652016-03-09T12:12:00.001+01:002016-03-09T12:12:33.811+01:00The simplest package everFrom time to time I need to some tweaking of our packages and then I need a simple package that builds lightning-fast in order to test stuff.<br />
<br />
This is the package I am using<br />
<br />
https://build.opensuse.org/package/show/home:jordimassaguerpla:test/simple<br />
<br />
Feel free to "fork" it.Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com5tag:blogger.com,1999:blog-6085491459058146326.post-31158095086545859512015-05-26T19:14:00.000+02:002015-05-26T19:14:38.206+02:00Working remotely as a Software Engineer<div class="separator" style="clear: both; text-align: center;">
<a href="https://weworkremotely.com/images/header.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="92" src="https://weworkremotely.com/images/header.jpg" width="320" /></a></div>
<div dir="ltr" id="docs-internal-guid-1cb4af62-9133-9d4a-a790-bca64e987451" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" id="docs-internal-guid-1cb4af62-9133-9d4a-a790-bca64e987451" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">If you are a Software Engineer, as I am, you can work from wherever you want! Look at these offerings from </span><a href="http://www.suse.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">SUSE</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">:</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307005&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Docker - Open Build Service Developer (2014432)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307007&company_id=15495&version=6&source=ONLINE&jobOwner=1013799&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Docker Core Specialist (2014434)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=306941&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Enterprise Build Service Engineer - Virtual Office (2014368)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307016&company_id=15495&version=6&source=ONLINE&jobOwner=1013811&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">High-Level Storage Engineer (2014443)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307022&company_id=15495&version=6&source=ONLINE&jobOwner=1013799&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Technical Architect for SUSE (2014449)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307003&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Java/Linux Developer (2014430)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307015&company_id=15495&version=6&source=ONLINE&jobOwner=1013811&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Kernel Scheduler Engineer (2014442)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=306899&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">OpenStack Developer (2014326)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=306892&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Performance Engineer (2014319)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=306994&company_id=15495&version=6&source=ONLINE&jobOwner=1013810&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Perl Developer (2014421)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=306908&company_id=15495&version=6&source=ONLINE&jobOwner=1013799&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Senior QA Automation Engineer for Distributed Storage (2014335)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307011&company_id=15495&version=6&source=ONLINE&jobOwner=1014217&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Senior Software Developer Distributed File Systems (2014438)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307010&company_id=15495&version=6&source=ONLINE&jobOwner=1014217&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Senior Software Developer Distributed Storage (2014437)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307012&company_id=15495&version=6&source=ONLINE&jobOwner=1014217&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Software Developer Distributed Storage Management (2014439)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307009&company_id=15495&version=6&source=ONLINE&jobOwner=1014217&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Software Developer Linux for SAP Applications (2014436)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307004&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">SUSE Cloud Developer (2014431)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307002&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">SUSE Cloud Developer (2014429)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307006&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">SUSE Manager – Docker Integration (2014433)</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://attachmatehr.silkroad.com/epostings/submit.cfm?fuseaction=app.jobinfo&jobid=307031&company_id=15495&version=6&source=ONLINE&jobOwner=1014205&aid=1" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Web application Backend Developer (Python) (2014458)</span></a></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">I am working on a coworking space from </span><a href="http://www.eltaller-coworking.cat/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">la Selva del Camp</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">, a small village 100 km south from Barcelona. Why can’t you do the same?</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">See other job offerings at:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://weworkremotely.com/"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">https://weworkremotely.com/</span></a></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"> </span></div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com1tag:blogger.com,1999:blog-6085491459058146326.post-46172534988121822162014-11-20T20:28:00.000+01:002014-11-20T20:28:13.183+01:00Service Design Patterns in Rails: Web Service EvolutionThis is my fourth post on Service Design Patterns in Rails. These posts have been inspired by the <a href="http://www.servicedesignpatterns.com/">Service Design Patterns book by Robert Daigneau</a>.<br />
<br />
The previous posts were:<br />
<br />
<ul>
<li>
<a href="http://jordimassaguerpla.blogspot.com.es/2014/11/service-design-patterns-in-rails-client.html">Client-Service Interaction </a>
</li>
<li>
<a href="http://jordimassaguerpla.blogspot.com.es/2014/11/service-design-patterns-in-rails.html">Request and Response Management</a></li>
<li><a href="http://jordimassaguerpla.blogspot.com.es/2014/11/service-design-patterns-in-rails-web.html">Web-Service Implementation Styles</a> </li>
</ul>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The Web Service Evolution patterns talk about what to do to make the API evolve with the minimum breaking changes. What that means? It means that changing your API should not break clients that consume it, otherwise said, that your API is backward compatible.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
From this chapter, three patterns apply to the Rails framework:</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<ul>
<li>Tolerant Reader</li>
<li>Consumer driven contract</li>
<li>Versioning</li>
</ul>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Tolerant Reader</b> refers to the client. It means that if you write a client, you should be "tolerant" on what you get as a response. Rails provides the <a href="http://api.rubyonrails.org/v3.2.13/classes/ActiveResource/Base.html">ActiveResource</a> object. This object will get the response and create an object from it. This object per se is very tolerant.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
However, only using that object does not make you tolerant reader. ActiveResource will create a model object like ActiveRecord does. For example, you can have a Product object that inherits from ActiveResource, the same way you would with ActiveRecord</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> class Product < ActiveResource</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
ActiveResource will create an attribute for each attribute found in the response. Thus if you expect a "name" attribute, you would try:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> Product.find(1).name</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
However, what if <i>name</i> is not in the response? Then, if you really want to be tolerant, you should do</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> p = Product.find(1)</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> if p.respond_to?(:name)</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> p.name</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Thus, with little effort you can have a tolerant reader, even thought Rails per se does not fully implement it.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<b>Consumer driven</b> <b>contract</b> means testing. Actually, it means having a test suite provided by your consumer on what it expects from the service. Testing is a common good practice in Rails and Rails provides you with a lot of resources for that (rspec, factory girl, stubs, mock ups). You only need to use them to specify what you expect from the API, or what a consumer should expect, depending on whether you are writing the producer or the consumer.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And finally, <b>versioning</b>. Versioning is a very good practice for an API. How you can implement versioning is very well explained on this rails cast, better than I could do myself, so I'd recommend you watching it, to see how to use namespaces in the routes file and in the controller implementation:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="http://railscasts.com/episodes/350-rest-api-versioning">http://railscasts.com/episodes/350-rest-api-versioning</a></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Web Service Evolution patterns are partly implemented on Rails. However, it needs you to do some implementation in order to follow them, because the typical example (the one you would generate with "rails generate") does not implement them, but give you the tools or the base so that you can do it.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
For example, <i>versioning</i> is not implemented when you generate a new rails application, but you can easily do it with <i>namespacing</i>; tests are not implemented but rails gives you the tools to do so; <i>tolerant reader</i> can be implemented by using <i>ActiveResource</i> and <i>respond_to?</i> method.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Thus, my conclusion is that Rails, even thought it is very cool for simple applications since "rails generate" can give you what you need right away, when it comes to more serious things, you need to do some work yourself.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
This means that, despite the fact that when you start using rails for simple things you don't need to know about patterns, if you want to do more, you need to know them.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-31383479864752590222014-11-16T20:52:00.001+01:002014-11-16T20:52:57.421+01:00Service Design Patterns in Rails: Web Service Implementation Styles<div style="text-align: justify;">
This is the third post on Service Design Patterns in Rails. The first two where</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="http://jordimassaguerpla.blogspot.com.es/2014/11/service-design-patterns-in-rails-client.html">Client-Service Interaction </a></div>
<div style="text-align: justify;">
<a href="http://jordimassaguerpla.blogspot.com.es/2014/11/service-design-patterns-in-rails.html">Request and Response Management</a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In these series of posts, I am trying to map the patterns described in the <b>Service Design Patterns</b> book by <b>Robert Daigneau</b> to a typical Rails application.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So far, I've proved that Rails already implements some of the patterns described in the book and thus, by only using the Rails framework, you are already following those patterns. This means you already follow certain good practices on implementing services without actually knowing about them.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
However, we've also seen that some patterns are not implemented by default. The common thing on them is that they are related to the response: Response Mapper, Response Data Transfer Object Mapper, and Linked Service.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The chapter about Web Service Implementation Styles, is about five patterns:</div>
<div style="text-align: justify;">
<br /></div>
<ul style="text-align: justify;">
<li>Transaction script</li>
<li>Datasource adapter</li>
<li>Operation script</li>
<li>Command invoker</li>
<li>Workflow connector</li>
</ul>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Transaction script</b> pattern means writing a service that, without any helper, nor model, accesses the database. This is not the Rails way, since in Rails we access the database through a domain model object. Personally, I think it is good that this pattern is not in the Rails framework. I am surprised to have find out this pattern in the book.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Datasource adapter</b> means having a class that will get the data from the database, making the controller unaware of, for example, if the data is stored on a postgresql db or sqlite, and managing metadata, like the relationships between different entities (i.e. one-to-many, belong-to, many-to-many). Does it sound familiar? Yes! This looks like ActiveRecord, doesn't it?</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Operation script</b> means delegating work to a class that can be used by different web-services. Translating that to Rails means implementing features in the model so that different controllers can reuse it.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Command invoker</b> means having a class that can be either call from a web service or put to a queue to be run later. For example, a class with a <i>perform</i> method can be run by calling the <i>perform</i> method, or queued to a <a href="https://github.com/collectiveidea/delayed_job">delayed job queue. </a>This may not be the preferred way of using <i>delayed job</i>, but certainly can be done (See <a href="https://github.com/collectiveidea/delayed_job">Custom Jobs</a>) . This class will then call domain model methods.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Workflow connector</b> is something more complicated. It means designing a workflow where each step can be a web service. However, you need to maintain information on the state and be able to rollback (typically done by compensating, by calling a web service that performs the negative function).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I don't think you can implement a workflow in Rails with what the framework provides, nor with the typical gems. From what I know, you will need to add additional gems/tools.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So far, I've seen that rails implements the patterns for a basic REST API, which is cool. However, when it comes to more complex workflows where the services you implement are part of a bigger services infraestucture, rails does not implement patterns for that, like the Workflow Connector, the Response Mapper or the Linked Service.</div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com3tag:blogger.com,1999:blog-6085491459058146326.post-55716478089523316882014-11-10T21:00:00.000+01:002014-11-13T20:28:29.385+01:00Service Design Patterns in Rails: Request and Response Management<div style="text-align: justify;">
This is the second post on the Service Design Patterns in Rails. The first one was about <a href="http://service-design-patterns-in-rails-client.html/">Client-Service Interaction styles patterns</a>. This one is about <i>Request and Response Management</i> patterns (from the book Service Design Patterns by Robert Daigneau).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The Request and Response Management patterns are:</div>
<ul style="text-align: justify;">
<li>Service Controller</li>
<li>Data Transfer Object</li>
<li>Request Mapper</li>
<li>Response Mapper</li>
</ul>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Service Controller </b>pattern means that there is a class that decides which controller should be called. The decision is made based on the Request (for example "GET /customer/123") and a set of rules.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Does it sound familiar? Yes! This is the <a href="http://guides.rubyonrails.org/routing.html">routes.rb</a><span id="goog_1913048903"></span><span id="goog_1913048904"></span> file. Here is the simplest rule of all:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">resources :products</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
which means, any request to /products will be routed to the products controller.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The <b>Data Transfer Object</b> is an intermediate object used in the request or the response instead of using the domain objects. That is, instead of serializing the Products object on the typical rails example, you would instead use another object populated from the values in the Product.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
On the <b>request</b> side, this is achieved through the <b>params</b> object. See this code which is typically in the typical Products controller example:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> def set_product<br /> @product = Product.find(params[:id])<br /> end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
this is how we find in the database a product with id "params[:id]".</div>
<div style="text-align: justify;">
"params[:id]" is the 123 from "GET products/123" request.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Another example, when we want to update, how we update it with the params object:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">def update</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> respond_to do |format|</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> if @product.update(params)</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> ....</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> else</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> ...</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
However, in the <b>response</b> side I have bad news. A rails typical application is not using a Data Transfer Object. See the typical example:</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><br /></span></span>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">class ProductsController < ApplicationController</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
</span></span>
</div>
<div style="text-align: justify;">
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
def index </span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
@products = Products.all </span></span></div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
respond_to do |format| </span></span>
<br />
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
format.json { render json @products} </span></span><br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
end</span></span></div>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
</span></span>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This code means that the object used in the response, is the Products object serialized as json. Under the hoods, the "ActiveRecord::to_json" call is made for this purpose. This means that the response is highly coupled with the domain object.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
What we should do instead is rendering the response in the view, by using a template.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Rails does come with builder for <i>"xml templating</i>". If we were using <i>xml</i>
for the response, the following code will work as long as we had an
<i>index.xml.builder</i> file.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">class ProductsController < ApplicationController</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
</span></span>
</div>
<div style="text-align: justify;">
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
def index </span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
@products = Products.all </span></span></div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
respond_to do |format| </span></span>
<br />
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
format.xml </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
end</span></span></div>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
</span></span>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Thus, for <i>json</i> to work, we would expect something like:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">class ProductsController < ApplicationController</span></span></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
</span></span>
</div>
<div style="text-align: justify;">
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
def index </span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
@products = Products.all </span></span></div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
respond_to do |format| </span></span>
<br />
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
format.json</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> end</span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
end</span></span></div>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">
</span></span>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">end</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
However, rails does not come by default with <i>"json templating"</i> and thus the previous code won't work unless we add some <i>"json templating"</i> gem.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Researching a bit on google, I've found this post that explains the case very well and much better than I could and gives some options on <i>"json templating":</i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="http://blog.codepath.com/2011/05/16/if-youre-using-to_json-youre-doing-it-wrong/">http://blog.codepath.com/2011/05/16/if-youre-using-to_json-youre-doing-it-wrong/</a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Finally,<b> Request and Response Mapper</b> are two patterns that can be used to interact with different web services, different on the syntax, but semantically equivalent. In that situation, you need an object that maps different request/responses to the same controller.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the case of the <b>Request Mapper</b>, we get back to the routes.rb file, where you can declare matching patterns. For example if you were authenticating against github, you may have this line on your <i>routes.rb</i> file<i><br /></i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> get "/auth/:provider/callback" => "sessions#create"</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The <b>Response Mapper</b> is used to construct a response but used by different web services. This can be used when you need to create a response that matches some kind of agreement between different parties. Sadly I don't know of a typical rails example that does that. If you know one, please tell me.</div>
<div style="text-align: justify;">
<pre class="ruby" data-result="[object Object]"><code><span class="symbol"><span class="identifier"> </span></span></code></pre>
<pre class="ruby" data-result="[object Object]"><code><span class="symbol"><span class="identifier"> </span></span></code></pre>
</div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com1tag:blogger.com,1999:blog-6085491459058146326.post-6891633567156878982014-11-06T21:41:00.002+01:002014-11-07T16:56:23.312+01:00Service Design Patterns in Rails: Client-Service Interaction stylesI have started reading this book that have been on my shelf for several months accumulating dust. The book is called "Service Design Patterns" by Robert Daigneau. Actually it looked cool on my shelf next to the "Design Patterns in Ruby".<br />
<br />
Anyway, I started reading it some days ago and while reading it, I've been trying to match the patterns described in it with what I know from having worked on Rails for the last few years. The examples in the book are Java and C#. It was a nice surprise to see that a typical Rails application already implements most of them, thus if you use Rails, you are already using them, the same way you use the MVC pattern.<br />
<br />
Thus, today I'll write a post on how Rails implements the <i>Client-Service Interaction Styles</i> patterns described in this book. Hopefully, I won't put the book back to the shelf for more dust and this post will be followed by other posts on the other patterns.<br />
<br />
Client-Service Interaction Styles patterns are:<br />
<br />
<ul>
<li>Request/Response</li>
<li>Request/Acknowledge</li>
<li>Media Type Negotiation</li>
<li>Linked Service</li>
</ul>
<br />
<br />
<b>Request/Response</b><br />
<br />
This is the simplest pattern and the default one. The Request/Response is nothing more than sending a Response to a Request. For example, if we take the typical Rails example application for maintaining a Product, the product controller would contain:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">class ProductsController < ApplicationController</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> def index</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @products = Product.all</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">end</span></div>
<div>
<br /></div>
<div>
Thus, a request like </div>
<div>
<br /></div>
<div>
GET /products.json</div>
<div>
<br /></div>
<div>
will return a Response with all the Products.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Request/Acknowledge</b></div>
<div>
<b><br /></b></div>
<div>
Request Acknowledge means that a Request will return without actually processing the data and no returning any data but an acknowledge code, and the data will get processed by another process in the background.</div>
<div>
<br /></div>
<div>
This can be accomplish with the <a href="https://github.com/collectiveidea/delayed_job">delayed_job</a> gem. In short, the delayed_job stores a task in the database instead of running that task, and then a background job will get that task and run it. This is very appropriate for long-running tasks so that you can give back control to the client and do the task later in the background.</div>
<div>
<br /></div>
<div>
For a task to be delayed, you just call:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">@post.delay.some_long_running_task</span></div>
<div>
<br /></div>
<div>
where some_long_running_task is the task you want to be delayed.</div>
<div>
<br /></div>
<div>
This is the typical architecture of having a<a href="https://devcenter.heroku.com/articles/background-jobs-queueing"> worker dyno</a> <a href="https://devcenter.heroku.com/articles/delayed-job">running a delayed job</a> in <a href="http://www.heroku.com/">Heroku</a>.</div>
<div>
<br /></div>
<div>
<b><br /></b></div>
<div>
<b>Media Type Negotiation</b></div>
<div>
<br /></div>
<div>
Getting back to the typical Products example, media type negotiation means that the client asks for a media type and the server creates a different response. In rails this means that these two requests:</div>
<div>
<br /></div>
<div>
GET /products.json</div>
<div>
GET /products.xml</div>
<div>
<br /></div>
<div>
will produce different responses with the same data. For example:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">class ProductsController < ApplicationController</span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> def index </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @products = Products.all </span></div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> respond_to do |format| format.xml { render xml @products}</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> format.json { render json @products} end</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span></div>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">end</span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Linked Service</b></div>
<div>
<b><br /></b></div>
<div>
The Linked Service patterns means that the response includes links to other services, so that the client should parse that information before deciding the next request.</div>
<div>
<br /></div>
<div>
Unfortunately, I haven't found any example nor in the rails itself nor in the gems that I know of such a pattern. If you know of a linked service example typically used in Rails, please respond to this post.</div>
<div>
<br /></div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-76749476406158404202014-10-31T14:03:00.001+01:002014-10-31T14:03:51.720+01:00Dice - A light weight build serviceLast week was <a href="https://hackweek.suse.com/11/projects/296">Hackweek on SUSE</a> and for 2 days I hacked on Marcus' project <a href="https://github.com/schaefi/dice">"Dice - A light weight build service"</a>.<br />
<br />
It was fun and Marcus code was very easy to understand, very well structured and with comprehensive tests.<br />
<br />
Dice is a simple build service for <a href="http://opensuse.github.com/kiwi">KIWI</a>
images using virtual instances controlled by vagrant or a directly
contacted build machine. It can be used to fire up build jobs
on e.g public cloud instances.<br />
<br />
What that means is that you can do:<br />
<br />
>dice build myimage<br />
<br />
and that will either:<br />
<br />
1- start a virtual machine on your workstation/laptop and build your image IN that virtual machine<br />
<br />
2- connect to a virtual machine on the cloud (i.e. google cloud) and build your image IN that cloud virtual machine<br />
<br />
<br />
And why all the trouble? the reasons:<br />
<br />
1- setting up an environment for building images on your laptop/workstation can be sometimes paintful<br />
<br />
2- running multiple builds on your laptop/workstation will make your host performance get low. Builds take time, thus you normally are doing something else meanwhile, and running the build on the cloud can be very good so that you can use your resources for something else<br />
<br />
3- security: building an image implies running custom scripts. If you have done this scripts, fine, but if not, better not run it on your laptop/ws.<br />
<br />
4- availability: having a build service on the cloud, makes it available to others that won't have to invest time on setting it up<br />
<br />
During those 2 days, I just implemented the ssh command as:<br />
<br />
> dice ssh myimage<br />
<br />
which will open an ssh connection to the build node, either virtual machine on you laptop/ws or in the cloud, so that you can easily debug when a build fails.<br />
<br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com1tag:blogger.com,1999:blog-6085491459058146326.post-37788034300842426702014-10-31T13:48:00.003+01:002014-10-31T13:50:24.895+01:00II Security on the nework CongressLast October 16th I assisted to the "II Security on the network Congress" organized by Universitat Oberta de Catalunya (UOC) and Universitat Rovira i Virgili (URV).<br />
<br />
This was held very close from where I live now and I was invited to give a speach there, which I happily did.<br />
<br />
I explained the timeline of CVE-2014-081 (see my <a href="http://jordimassaguerpla.blogspot.com.es/2014/02/cve-2104-0081-timeline.html">previous post</a> on it).<br />
<br />
There were about 300 people registered and was a very interesting event with very interesting talks on security.<br />
<br />
I was also very happy to meet a friend from my home town.<br />
<br />
Overall, it was fun and worth it.<br />
<br />
Thanks to the organizers! <br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-73730090242500644542014-10-31T13:39:00.002+01:002014-10-31T13:48:57.493+01:00security issues on ruby gems<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-O7ZCKjKLmHs/VFOCxMTk5gI/AAAAAAAAJmQ/NI2jIay0nbk/s1600/sec_on_ruby_gems.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-O7ZCKjKLmHs/VFOCxMTk5gI/AAAAAAAAJmQ/NI2jIay0nbk/s1600/sec_on_ruby_gems.png" height="300" width="400" /></a></div>
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-32363909298737269122014-02-20T19:08:00.001+01:002014-02-20T19:27:03.773+01:00CVE-2104-0081 timelineTwo days ago, a <a href="https://groups.google.com/forum/#!topic/rubyonrails-security/tfp6gZCtzr4">new vulnerability on rails was made public</a>. Since I am subscribed to different mailing lists, and use different security services, I got the information multiple times, and I though it could be interesting to draw a timeline on those alerts, to see which tools/services were faster and how the information flows:<br />
<br />
<br />
12.Feb.2014 - 02:36 CET - Rafael Modença França commits the fix (private)[1]<br />
<br />
14.Feb.2014 - 21:41 CET - RedHat create bugzilla entry (private)[2]<br />
<br />
18.Feb.2014 - 17:06 CET - SUSE creates bugzilla entry (private)[3]<br />
<br />
18.Feb.2014 - 20:00 CET - Rafael Modença França merges the fix to master[4]<br />
- version 4.1.0.beta2 is released [5]<br />
- version 4.0.3 is released [5]<br />
- version3.2.17 is released [5]<br />
<br />
18.Feb.2014 - 20:03 CET - aaron patterson sends email to rubyonrails-security@googlegroups.com, oss-security@lists.openwall.com, secalert@redhat.com[6][7]<br />
<br />
18.Feb.2014 - 20:10 CET - redruby.io service sends me an email[8]<br />
<br />
18.Feb.2014 - 20:12 CET - aaron patterson sends email to ruby-security-ann@googlegroups.com[9]<br />
<br />
18.Feb.2014 - 20:17 CET - Rafael França publishes on weblog.rubyonrails.org [10]<br />
<br />
18.Feb.2014 - 20:33 CET - hakiri.io service sends me an email[11]<br />
<br />
18.Feb.2014 - 20:36 CET - holepicker adds the security alerts in its database[12]<br />
<br />
18.Feb.2014 - 21:06 CET - hacker news publishes in its blog[13]<br />
<br />
18.Feb.2014 - 21:38 CET - RedHat removes embargoed[2]<br />
<br />
19.Feb.2014 - 03:30 CET - Added to osvdb[14]<br />
<br />
19.Feb.2014 - 09:03 CET - SUSE removes embargoed[3]<br />
<br />
19.Feb.2014 - 11:49 CET - gemnasium.com sends me an email [15]<br />
<br />
20.Feb.2014 - 15:24 CET - ruby weekly publishes the new (ruby weekly is released every Thursday)[16]<br />
<br />
<br />
<br />
[1] https://github.com/rails/rails/commit/08d0a11a3f62718d601d39e617c834759cf59bbb<br />
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1065520<br />
[3] https://bugzilla.novell.com/show_bug.cgi?id=864433<br />
[4] https://github.com/rails/rails/commit/1879c259b870938c42d5d52f63123bfa0b8c81c8<br />
[5] http://rubygems.org/gems/rails/versions<br />
[6] https://groups.google.com/forum/#!topic/rubyonrails-security/tfp6gZCtzr4<br />
[7] http://www.openwall.com/lists/oss-security/2014/02/18/8<br />
[8] https://www.redruby.io<br />
[9] https://groups.google.com/forum/#!topic/ruby-security-ann/1PWnwW4jRkY<br />
[10] http://weblog.rubyonrails.org/2014/2/18/Rails_3_2_17_4_0_3_and_4_1_0_beta2_have_been_released/<br />
[11] https://haikiri.io<br />
[12] https://github.com/jsuder/holepicker/commits/master/lib/holepicker/data/data.json<br />
[13] https://www.facebook.com/hnbot<br />
[14] http://osvdb.org/103439<br />
[15] https://gemnasium.com<br />
[16] http://rubyweekly.com<br />
<div>
<br /></div>
<div>
<br /></div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-26030851420729511242014-02-20T12:38:00.003+01:002014-02-20T19:13:45.711+01:00El model de negoci del software lliure a Berga el 27 de Març<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-1U8VesnQEKI/UwXo1KqjVAI/AAAAAAAADKc/t08HvDI6gT8/s1600/software+lliure.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-1U8VesnQEKI/UwXo1KqjVAI/AAAAAAAADKc/t08HvDI6gT8/s1600/software+lliure.jpg" height="320" width="227" /></a></div>
<br />
El 27 de Març a les 18:00 de la tarda faré una presentació al coworking loficina (loficina.cat) sobre com fer negoci amb software lliure. Animeu-vos a venir :) !Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-9867286624006216062014-02-06T23:04:00.002+01:002014-02-20T19:14:23.304+01:002013 and rubygems: 3 times more security issues, 6 times more security tools<div style="text-align: center;">
<span style="font-size: x-large;">3</span> <span style="font-size: x-large;">times</span> </div>
<div style="text-align: center;">
more security issues</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<span style="font-size: x-large;">7 times</span></div>
<div style="text-align: center;">
more security tools </div>
<br />
<br />
Today I discovered <a href="http://hakiri.io/">hakiri.io</a> , a web service that scans gems and code, and I have updated the presentation on security and ruby gems with this information as well as added a summary table.<br />
<br />
<br />
<a href="https://drive.google.com/file/d/0B7IDcViGrJDOSElEekhoRHVldDA/edit?usp=sharing">https://drive.google.com/file/d/0B7IDcViGrJDOSElEekhoRHVldDA/edit?usp=sharing</a><br />
<br />
In this presentation I state that 2013 had 3 times more security issues (regarding ruby gems) than 2012 and that 6 times more security tools appeared in 2013 than in 2012.<br />
<br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-75420962246414965302013-12-13T17:07:00.000+01:002014-02-20T19:21:17.364+01:00mitoi: kids sourvenirs from barcelona<div class="separator" style="clear: both; text-align: center;">
<a href="https://scontent-b-cdg.xx.fbcdn.net/hphotos-prn2/1395175_435443836579126_1935882368_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="https://scontent-b-cdg.xx.fbcdn.net/hphotos-prn2/1395175_435443836579126_1935882368_n.jpg" width="320" /></a></div>
<br />
That is a great idea. A kids toy and a barcelona souvenir all in one! Those conform the Barcelona skyline and I just bought one for myself as a souvenir since I am moving from Barcelona at the end of the year.<br />
<br />
I think this is a very nice and innovative idea designed in Barcelona by <a href="http://www.mitoibcn.com/">mitoi</a> .Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-8270388202101065802013-09-25T20:16:00.001+02:002013-09-25T20:27:13.648+02:00Olé to you nonethelessVery inspired TED talk:<br />
<a href="http://www.ted.com/playlists/11/the_creative_spark.html">http://www.ted.com/playlists/11/the_creative_spark.html</a><br />
<br />
"If your job is to dance, do your dance.
If the divine, cockeyed genius assigned to your case decides to let some sort of wonderment be glimpsed, for just one moment, through your efforts, then "Olé!".
And if not, do your dance anyhow.
And "Olé!" to you nonetheless."<br />
<br />
The talk is about how artists can get broken because of the anxiety of thinking they may not be able to do a great creation but I think that can actually be applied to any aspect of your life.<br />
<br />
In ancient times, people used to believe there was a God that was ruling our lifes and what was happening was because of his plans. This was a way of managing uncertainty in their lifes, since there were a plan and rules designed for some higher entity, despite people was not able to understand them.<br />
<br />
Then, people started to think that we are the center of the universe, ... and then we killed God when we tried to demonstrate every single thing through science and rules that are understandable by humans (well, not by all of them, but a set of humans). And we started believing we are in control and so we are responsibles of our own future (don't get me wrong, I think science has bring very very good things to humanity).<br />
<br />
However, believing we can control, brings great responsability on our lifes, new rules (to avoid damages we can avoid because WE are in control), and at the end anxiety and stress.
Then ... should we go back to believe in unnatural things?<br />
<br />
Well, why not go back to believe we are not in control and that we do our best and then, because of "Gods", coincidences or other unnatural "things" that we don't know, don't understand and can't control, things will go in a way or in another, thus leaving us living with some uncertainty? Is this the next step?
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-46524332266331249792013-06-17T19:10:00.001+02:002013-06-17T19:10:31.787+02:00Developer events in Bcn this weekHi!<br />
<br />
This week in Barcelona:<br />
<br />
Thursday 20, at 19:00 - Barcelona on Rails monthly meeting<br />
XING's office at Consell de Cent 332<br />
Topic still to be defined<br />
<a href="http://barcelonaonrails.com/">http://barcelonaonrails.com/</a><br />
<br />
<br />
The Barcelona Graphic + Web Design Meetup Group<br />
Thursday, June 20 at 8:30 PM<br />
<a href="http://www.meetup.com/graphicdesign-159/events/gfcdnyrjbbc/">http://www.meetup.com/graphicdesign-159/events/gfcdnyrjbbc/</a><br />
<div>
<br /></div>
Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-65826448775734195682013-03-04T18:30:00.000+01:002013-03-04T18:30:18.548+01:00Barcelona ruby conference<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-z2NYtUOGJcg/UTTY3PWG9UI/AAAAAAAAAlw/ImL4Qg8ULm8/s1600/logo-94d8599089b0acdda2c6a93aec1dab03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="222" src="http://3.bp.blogspot.com/-z2NYtUOGJcg/UTTY3PWG9UI/AAAAAAAAAlw/ImL4Qg8ULm8/s320/logo-94d8599089b0acdda2c6a93aec1dab03.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Check out the Barcelona Ruby conference 2013 speakers on the Weekend <em>14</em> & <em>15</em> September <em>2013</em><br />
<br />
<a href="http://www.baruco.org/speakers">http://www.baruco.org/speakers</a><br />
<br />
Yukihiro Matsumoto<br />Aaron Patterson<br />Avdi Grimm<br />Bryan Helmkamp<br />Charles Nutter<br />Corey Haines<br />David Chelimsky<br />Katrina Owen<br />Matt Wynne<br />Paolo Perrotta<br />Reg Braithwaite<br />Richard Schneeman<br />Sandi Metz<br />
<br />
Want to be in the list? Call for papers is open until 10th March<br />
<br />
<a href="http://www.baruco.org/call_for_papers">http://www.baruco.org/call_for_papers</a><br />
<br />
Want to sponsor?<br />
<br />
<a href="http://www.baruco.org/sponsors">http://www.baruco.org/sponsors</a><br />
<br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-16432480772635558672013-02-25T18:24:00.001+01:002013-02-25T18:24:24.625+01:00Location, Dates, and Times | Mobile World Congress 2013<a href="http://www.mobileworldcongress.com/event-info/#.USueLCBzMj8.blogger">Location, Dates, and Times | Mobile World Congress 2013</a>Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-88301397338429430572012-12-07T18:00:00.000+01:002012-12-07T18:00:14.076+01:00Developer Barcelona EventsLately I have been assisting to events in Barcelona related to programming not only because I consider part of my job to be up-to-date but also because I enjoy it: you always learn something or meet new people what is always interesting. Moreover, since I live in Barcelona, I could not miss them.<br />
<br />
Here is a list of the events I have assisted during the past months. If you know of other interesting events, please tell me.<br />
<br />
<a href="http://baruco.org/">Barcelona Ruby Conference</a><br />
<a href="http://2012.nosql-matters.org/bcn/">Nosql matters conference</a><br />
<a href="http://barcelonaonrails.com/">Barcelona On Rails events</a> (<a href="https://groups.google.com/forum/?fromgroups#%21forum/barcelonaonrails">barcelona rails group</a>)<br />
<a href="http://barcelona.agile-spain.org/barcelona-testing-open-space-2012/">Barcelona testing open space</a><br />
<a href="http://bcndevcon.org/">Barcelona DevCon</a><br />
<br />
I think Barcelona is a great city for such events since a lot of people from other countries enjoy visiting it and hence it makes it easier to convince them to come.<br />
<br />
In the other hand, I think it is very important for our economy, not only because of the hotels, restaurants, etc. but also for the business/jobs opportunities that this kind of events bring.<br />
<br />
By the way, I missed the <a href="http://events.linuxfoundation.org/events/linuxcon-europe">LinuxCon Europe</a>, but I think it is worth mentioning that this one took place in Barcelona.<br />
<br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com1tag:blogger.com,1999:blog-6085491459058146326.post-6774812748654677782012-09-12T13:33:00.000+02:002012-09-12T13:36:09.589+02:001.5 million of people under the slogan "Catalonia, a new European state<div class="separator" style="clear: both; text-align: center;">
<a href="http://static.guim.co.uk/sys-images/Guardian/About/General/2012/9/11/1347385425701/Supporters-of-independenc-008.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="http://static.guim.co.uk/sys-images/Guardian/About/General/2012/9/11/1347385425701/Supporters-of-independenc-008.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Yesterday, September 11th, 2012, 1.5 million people meet in Barcelona under the slogan "Catalonia, new European state.<br />
<br />
Spanish government is trying to minimize it. Please do not ignore us.<br />
<br />
See:<br />
<a href="http://rt.com/news/catalonian-national-day-protest-independence-925/">http://rt.com/news/catalonian-national-day-protest-independence-925/</a><br />
<a href="http://www.bbc.co.uk/news/world-europe-19564640">http://www.bbc.co.uk/news/world-europe-19564640</a><br />
<a href="http://edition.cnn.com/2012/09/11/world/europe/spain-catalonia-protests/index.html">http://edition.cnn.com/2012/09/11/world/europe/spain-catalonia-protests/index.html</a><br />
<a href="http://www.guardian.co.uk/world/2012/sep/11/catalan-independence-rally-barcelona?newsfeed=true">http://www.guardian.co.uk/world/2012/sep/11/catalan-independence-rally-barcelona?newsfeed=true</a><br />
<a href="http://www.digitaljournal.com/article/332659">http://www.digitaljournal.com/article/332659</a><br />
<br />
<br />
<br />
<br />
<br />
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-83182751051593084492012-05-29T18:30:00.001+02:002012-05-29T18:33:02.693+02:00LAMP appliance (phpmyadmin)It has been 3 years since I published a<a href="http://jordimassaguerpla.blogspot.com.es/2009/02/phpmyadmin-appliance.html"> phpmyadmin appliance</a> with SUSEStudio.<br />
<br />
A lot of things have changed since then, actually there was no gallery where to publish the appliance to.<br />
<br />
Today I am publishing a new LAMP appliance that contains <a href="http://www.phpmyadmin.net/">phpmyadmin</a> for managing the mysql, as well as <a href="http://webalizer.org/">webalizer</a> for apache statistics and webyast for managing the appliance.<br />
<br />
Check it out at:<br />
<br />
<a href="http://susestudio.com/a/61bKK8/lamp-server-32bit">http://susestudio.com/a/61bKK8/lamp-server-32bit</a><br />
<br />
It would be very great to get some feedback as I am planning to use it as a base for other php based appliances. <br />
<br />
Here some screenshots: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-cmDX5P15iL4/T8T4k3W-VMI/AAAAAAAAAgw/_ebtxvw3y8Q/s1600/phpmyadmin2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="183" src="http://2.bp.blogspot.com/-cmDX5P15iL4/T8T4k3W-VMI/AAAAAAAAAgw/_ebtxvw3y8Q/s320/phpmyadmin2.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">phpmyadmin</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-x0qyV6bkvXY/T8T4n9ojSII/AAAAAAAAAg4/y4bK4ZFpymM/s1600/webyastcontrolpanel.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="189" src="http://3.bp.blogspot.com/-x0qyV6bkvXY/T8T4n9ojSII/AAAAAAAAAg4/y4bK4ZFpymM/s320/webyastcontrolpanel.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">webyast control panel</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-KsgwtjWDK3w/T8T4svsOrPI/AAAAAAAAAhA/KYNRKdYwxn0/s1600/webalizer.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="177" src="http://3.bp.blogspot.com/-KsgwtjWDK3w/T8T4svsOrPI/AAAAAAAAAhA/KYNRKdYwxn0/s320/webalizer.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">webalizer</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-xEQ9U3neT6Q/T8T4tbL_abI/AAAAAAAAAhI/rGVMht6eiZw/s1600/webyast_initial_setup.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="148" src="http://4.bp.blogspot.com/-xEQ9U3neT6Q/T8T4tbL_abI/AAAAAAAAAhI/rGVMht6eiZw/s320/webyast_initial_setup.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">webyast initial setup</td></tr>
</tbody></table>
<br />Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com0tag:blogger.com,1999:blog-6085491459058146326.post-61997533082502713272012-02-14T13:22:00.000+01:002012-02-14T13:22:43.376+01:00SUSEStudio as a tool for master thesisMy third semester as an associate teacher at <a href="http://www.uoc.edu/">UOC</a> (Open University of Catalonia) has just finished. During this semesters, I've been helping students on doing their Bachelor thesis and Master thesis on the Free Software master and Computer Engineering.<br />
<br />
In some of them we've used SUSEStudio in order to build LiveCDs as a demonstration of their work. It has been a very useful tool and I am sure we'll be using it on the next semesters.<br />
<br />
This is the list of the projects that we've used susestudio:<br />
<br />
<a href="http://hdl.handle.net/10609/5925">Eucalyptus migration</a><br />
<br />
This project deals with all life cycle phases in a migration project of a Data Center to IAAS (Infrastructure as a Service). The chosen solution was Eucalyptus, an open source software. In practice it involved the creation of a Live CD to display this technology, it was developed with SuseStudio and published in SuseGallery.<br />
<br />
<a href="http://hdl.handle.net/10609/11902">SLES securization</a><br />
<br />
This project shows how to securize sles and how to create a livecd with suse studio with this securization.<br />
<br />
<a href="http://hdl.handle.net/10609/11913">Study and implementation of a cybercoffe with free software</a> <br />
<br />
This project shows how to build a cybercoffe by using free software. Different appliances are made with susestudio.<br />
<br />
<br />
Next semester is about to start. Students will be choosing their projects during the first week of March. As I am responsible for proposing projects (that they may or may not choose), any ideas will be very welcome.Jordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com5tag:blogger.com,1999:blog-6085491459058146326.post-45639681090077447982011-11-14T18:48:00.000+01:002011-11-14T18:48:37.605+01:00shutting down a iomega storcenterFor my backups I am using a iomega storcenter device.<br />
<br />
All management is done by web interface and I needed a way to shut it down from a script.<br />
<br />
Here is the script.<br />
<br />
<br />
1 COOKIE_FILE=/tmp/iomega-stor-center-cookie.txt<br />
2 IP=192.168.1.3<br />
3 curl -c $COOKIE_FILE -k --data "login=admin&passwordx=" https://$IP/index.html<br />
4 #curl -b $COOKIE_FILE -k --data "restart=identifyDevice" https://$IP/stg-device.html?t=6<br />
5 curl -b $COOKIE_FILE -k --data "restart=Poweroff" https://$IP/stg-device.html?t=6<br />
6 rm /tmp/iomega-stor-center-cookie.txtJordihttp://www.blogger.com/profile/00809725910914012647noreply@blogger.com1