<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paolo Ferretti on Medium]]></title>
        <description><![CDATA[Stories by Paolo Ferretti on Medium]]></description>
        <link>https://medium.com/@paoferretti?source=rss-13ef8d2ae8d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uWO2p7O2W58jUwTEp77xDg.jpeg</url>
            <title>Stories by Paolo Ferretti on Medium</title>
            <link>https://medium.com/@paoferretti?source=rss-13ef8d2ae8d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 16:39:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paoferretti/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Secrets and configuration management with AWS Parameter Store]]></title>
            <link>https://medium.com/growens-innovation-blog/secrets-and-configuration-management-with-aws-parameter-store-27729fd5c1c8?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/27729fd5c1c8</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws-system-manager]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Thu, 17 Jun 2021 07:50:36 GMT</pubDate>
            <atom:updated>2021-06-17T07:50:36.016Z</atom:updated>
            <content:encoded><![CDATA[<h4>How we found a solution for effective secrets management</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYd41LhU8PZ6BRo-1ZReWg.jpeg" /><figcaption><a href="https://www.flickr.com/photos/nuagedenuit/2169354682/">Secrets are green</a> by <a href="https://www.flickr.com/photos/nuagedenuit/">Chiara Vitellozzi</a></figcaption></figure><p>One of the big challenges of modern software development is about the security of our code and, therefore, our applications.</p><p>Probably one of the pillars of secure code is the correct management of secrets and configuration settings. These are plain-text strings, so they should be simple to manage. In this simplicity, however, we should keep in mind these three principles:</p><ul><li><strong>confidentiality</strong>: only users with permissions must access the data</li><li><strong>integrity</strong>: data must not be altered by unauthorized users</li><li><strong>availability</strong>: data is available to authorized users when they need it</li></ul><p>Most of <a href="https://growens.io/">Growens</a>’ infrastructure is on AWS, so we ended up choosing <a href="https://aws.amazon.com/systems-manager/">AWS Systems Manager</a> Parameter Store.</p><h3>What is Parameter Store?</h3><p>This is a service that provides a centralized store to manage configuration data. Values can be stored as plain-text or encrypted data.</p><p>Every value is identified by a unique name and parameters can be organized in hierarchies and version tracked.</p><h3>Why Parameter Store?</h3><p>There are a lot of alternatives, like <a href="https://www.vaultproject.io/">HashiCorp Vault</a>. Parameter Store is a very good service and it has a very good integration with a lot of AWS services.<br>All the external services evaluated by our team required a lot of work for the integration with our AWS infrastructure. The cost wasn’t worth the benefit.<br>In addition to this, we consider the secret and configuration management a core part of our system, so the excellent integration of Parameter Store with our infrastructure was an invaluable feature.</p><h3>What about our three security pillars?</h3><p>All the three principles are respected: <em>confidentiality</em> and <em>integrity</em> are provided by IAM Policies attached to Roles and Users, while <em>availability</em> is guaranteed by the Parameter Store APIs.</p><h3>The implementation</h3><p>The management of our keys with Parameter Store is very straigthforward. We defined a pattern for generic keys, something like:</p><pre>/[type]/[environment]/[service]/[key]/[subkey]</pre><p>Where:</p><ul><li><strong>type</strong> is the root of the tree: <em>inventory</em> for generic keys, <em>app</em> for specific applications keys</li><li><strong>environment</strong> is something like <em>dev</em>, <em>pre</em>, <em>qa</em>, <em>pro</em></li><li><strong>service</strong> is name of the service like <em>postgresql</em>, <em>rabbitmq</em> or microservice proper name</li><li><strong>key (optional) </strong>is the entity, something similar to service and relative to the service itself. Useful, for example, to define keys for database access specific to a microservice (example below)</li><li><strong>subkey</strong> is the last leaf of our tree, so the key name itself like <em>user</em>, <em>password</em>, <em>host</em>, etc…</li></ul><p>Here some examples:</p><pre>/inventory/pre/rabbitmq/management/host<br>/inventory/pre/rabbitmq/management/user<br>/inventory/pre/rabbitmq/management/password</pre><pre>/app/qa/single_sign_on/db/host<br>/app/qa/single_sign_on/db/user<br>/app/qa/single_sign_on/db/password</pre><p>So, in our hypotetical <strong>single_sign_on</strong> application, for <strong>qa</strong> environment we need to do basically two things: configure an IAM Role for our application and ask Parameter Store API the path /app/qa/single_sign_on/*. With these simple two steps we have all our configurations and secrets with a single API call.</p><p>The IAM Policy, for example, could be:</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Action&quot;: [<br>                &quot;kms:Decrypt&quot;,<br>                &quot;ssm:GetParametersByPath&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;arn:aws:kms:*:*:key/your-key&quot;,<br>                &quot;arn:aws:ssm:*:*:parameter/app/qa/single_sign_on/*&quot;<br>            ],<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Sid&quot;: &quot;VisualEditor0&quot;<br>        }<br>    ]<br>}</pre><p>No secrets or configurations hardcoded in our settings files: this happens at runtime with an on-the-fly authentication thanks to IAM Roles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27729fd5c1c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/growens-innovation-blog/secrets-and-configuration-management-with-aws-parameter-store-27729fd5c1c8">Secrets and configuration management with AWS Parameter Store</a> was originally published in <a href="https://medium.com/growens-innovation-blog">Growens Innovation Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview: how Nutanix Innovation Tour changed our perspective]]></title>
            <link>https://medium.com/growens-innovation-blog/interview-how-nutanix-innovation-tour-changed-our-perspective-84423fdfcafe?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/84423fdfcafe</guid>
            <category><![CDATA[nutanix]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 13:20:08 GMT</pubDate>
            <atom:updated>2020-04-14T16:11:15.770Z</atom:updated>
            <content:encoded><![CDATA[<h4>A deep dive in a community where everything is connected</h4><p>MailUp Group and Nutanix have been working together for nearly three years. The switch to a new infrastructure supplier can be tricky, so, for us, building a strong and honest relationship was of utmost importance.</p><p>This is why we were extremely glad to take part to a number of events organized by Nutanix to get to know the company better, consolidate our knowledge of the tool, and tie personal bonds with the Nutanix staff that would bring mutual advantage to both companies.</p><p>In early February, <strong>Marco Aroldi</strong> (MailUp Group Infrastructure Engineer) and <strong>Michele Cappellini</strong> (MailUp Group CIO) took part to the <em>Nutanix Innovation Tour</em>, in San Jose (CA).</p><p>So, I decided to interview them to share with you their experience.</p><p><strong>Paolo: Tell me something about the <em>Nutanix Innovation Tour</em>: what was it about?</strong></p><p><strong>Marco</strong>: It consisted of five days full of events, talks and deep dives about the Nutanix services galaxy. It was an excellent opportunity to meet a lot of people from the Nutanix team that shared with us their way of thinking and working.</p><p><strong>Michele</strong>: It was a challenging tour that allowed us not only to visit the Nutanix headquarters but also to get in touch with the Silicon Valley. We were able to see how IT companies work, and we met people that work in a lot of different businesses, from small startups to structured companies like Nutanix itself. It was also a good opportunity to absorb the “American” way of thinking that, in many ways, is different from our European mindset.</p><p>In these five days, I realized that the Silicon Valley is not only a place where there are a lot of IT companies: it’s a community where everything is connected. These connections generate energy that encourages everyone to push the boundaries.</p><p><strong>Paolo: Ok, this is very interesting, especially the fact that it was an experience that blew away your minds!<br>Let’s go to the next question: what were the steps that brought MailUp Group to participate in this event?</strong></p><p><strong>Marco</strong>: It was an offer by Nutanix, MailUp Group didn’t ask for participation. I think that, probably, Nutanix invited MailUp Group in this event because they saw good potential in our company. It was a great recognition and pleasure because it means that our vendors, and not only our customers, appreciate our way of thinking and working.</p><p><strong>Michele</strong>: I think that Nutanix had they had the foresight to let their customers live this experience that was not only a Nutanix experience but was a full immersion into the Silicon Valley ecosystem. In fact, in only one of the five days dedicated to this tour, we had the opportunity to see and work on Nutanix.</p><p>Back to your question, I think that they choose to invite MailUp Group because we used their platform to solve a real problem. In 2017 we had some issues with MailUp infrastructure, especially with the SAN and storage: a long time issue for us! We identified in hyper-convergence a possible solution. The key points were:</p><ul><li>innovation</li><li>performances</li><li>reliability</li></ul><p>After scouting to find the right product, we selected Nutanix: a new organization that developed very interesting software on existing hardware. We were among the first customers in Italy to use Nutanix. There was an immediate connection probably because we are similar companies: fast-growing and in close contact with our customers. This affinity allowed us to give them fast feedback that led us to a stable relationship that took MailUp Group to local, national and European events. In one of these events, <em>.Next</em> in Copenhagen, the Nutanix staff interviewed us as one of the leading customers in Italy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gi9IqyZkum20hXbvt8RtuQ.png" /></figure><p><strong>Paolo: so your perception is that MailUp Group was invited thanks to the advanced use of Nutanix software, coupled with mutual sympathy. I think that it’s a special recognition for your work.</strong></p><p><strong>Marco</strong>: yes, I think that Nutanix Italy sees MailUp as an excellent customer, not only thanks to our bills but also because we push their platform beyond the limit.</p><p><strong>Michele</strong>: you are right. They often say that, as customers, we add special value because we push the boundaries of their platform. Our engineers are very meticulous, and very often they split hairs when they open issues and give feedback to the Nutanix team. This accurate and direct feedback is crucial for them because, as a young company, they need this clear and close relationship to grow better and faster. Furthermore, we are evolving the use of their product in the same way in which they are developing their business: a win-win situation that brings our companies to share the same perspective.</p><p><strong>Paolo: you told me that we use their platform in a particular way. Please, tell me more about this.</strong></p><p><strong>Marco</strong>: our prerequisite was to maintain one of our infrastructure pillars: Hyper-V. Nutanix supports Hyper-V. As soon as we had the first Nutanix POC in our hands, we began to tear it to shred. Like a child that disassembles a toy, we saw what worked well and what would have given us problems. Without any doubt, compared to the other two virtualization methods supported by Nutanix, Hyper-V was the worst implemented in their platform. So we began to hack their software (obviously in a good way) to see what could be accomplished and what could not. The day we brought them our feedback, they were thrilled because probably no-one had ever raised such kind of issues and feedback.</p><p>Our way of working consists in being aware of the tools that we use: we do not consider ourselves regular users. Instead, our technical culture is a mix of engineering and hacking.</p><p><strong>Paolo: wow, now I like the idea of having hackers as colleagues! Now, coming back to <em>Nutanix Innovation Tour</em>, what did you bring home from this journey?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PQK8UoRLDWUuwMxR38T4mg.jpeg" /><figcaption>Michele and Marco</figcaption></figure><p><strong>Marco</strong>: undoubtedly, the primary thing that I learned is the American way of thinking. It’s not easy to explain. We talked a lot with Nutanix people and with other companies. They have big numbers. In the Silicon Valley, if you have an idea, you do everything to make it happen. The cool thing is that if you know that you don’t have enough resources or skills to develop your project, you can quite easily find an investor that can believe in you. Thanks to this system based on mutual trust, everyone with a good idea can be successful.</p><p>Probably the geographical proximity of all these successful companies is a catalyst: in a handful of meters, you have Intel on one side of the road and AMD on the other side.</p><p>For us in Europe, it’s not quite simple or easy. If I can use an analogy, these are fireworks for us European!</p><p>This experience opened my mind and allowed me to think differently. Surely my way of working and thinking will not be the same anymore.</p><p><strong>Michele</strong>: personally, from this journey, I brought home an innovative way of thinking. Probably it was the goal of Nutanix since this experience was called “<em>Innovation Tour</em>”! I realized that strong motivation, in conjunction with an exciting ecosystem, allows everyone that has an idea to have the possibility to develop it. As an “inventor” you can be supported not only on the financial side but also on legal advice, agreements, coaching and mentorship.</p><p>Although our journey in the Silicon Valley lasted only five days, we had the opportunity to absorb their mentality.</p><p>For someone like me that has to manage a department and a lot of people, the next challenge will be to transfer this ecosystem, or at least part of it, to Italy. In this way, we can try to connect big structured companies with startups or just with someone that has a good idea and wants to develop it. I think that the key to moving forward is the free flows of ideas and the continuous knowledge sharing between companies and people. Probably this is the best way to have a motivational boost and to try to grow together.</p><p>There is also another important thing that I brought home: discussing with our European colleagues, we shared our common problems, with the awareness that in the Silicon Valley probably these problems are already overcome. It comes to light that in Europe, we put less emphasis on communication and sharing. We need to work on that.</p><p><strong>Paolo: both Marco and Michele talked a lot about mentality and way of thinking. It must be something pervasive in Silicon Valley.<br>In the recent past, you have attended other events organized by Nutanix. How do you compare these events to the <em>Nutanix Innovation Tour</em>?</strong></p><p><strong>Marco</strong>: there is another event, the <em>Nutanix .Next</em>, organized every year both in the USA and in Europe. As MailUp Group we attended to the European one. The <em>Nutanix Innovation Tour</em> was a deep dive into their modus operandi: in fact, keynotes were mainly hig-level, and Nutanix people acted as facilitators for knowledge sharing.</p><p><em>.Next</em> is addressed to technical people, so it’s a very different kind of experience. It’s an event where Nutanix shows off its muscles, exhibiting their new features and product previews.</p><p><strong>Michele</strong>: I agree with Marco there is no doubt that they are two different kinds of events. <em>.Next</em> is a conference with thousands of people. There you can have a full immersion into Nutanix features preview, case studies and example projects provided by their customers. Also, there are a lot of satellite events that contribute to creating a community around the Nutanix products.</p><p>The <em>Nutanix Innovation Tour</em> was different and not complementary to <em>.Next</em>. Here there were just a few dozens of people in closer contact with the Nutanix staff.</p><p><em>.Next</em> is multicast, <em>Innovation Tour</em> is almost one on one. The first is technical, and the latter is non-technical.</p><p>For example, during the <em>Innovation Tour</em>, there were occasions to talk and share experiences about how to manage a feature release with large engineering teams. It was a unique occasion in which we could ask for advice to managers that had solved their problems on a larger scale than ours.</p><p>Moreover, we had the privilege to discuss with their engineers about our feedback. They pay significant attention to customer points of view, and they note everything down to bring continuous improvement to their product. This behaviour is undoubtedly a successful strategy.</p><p><strong>Paolo: do you have any feedback about your experience at the <em>Innovation tour</em>?</strong></p><p><strong>Marco and Michele</strong>: probably the only feedback is about the organization. It was a guided tour, and sometimes we felt the need to skip some meetings to deepen some arguments in front of a coffee with the Nutanix staff and other customers like us. We think that probably if we had more free time between meetings, the entire experience would have been more enjoyable.</p><p>More time doesn’t mean that we wanted to visit San Francisco or the Golden Gate bridge, but instead, we would have used it to expand our knowledge about the topics of our interest.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84423fdfcafe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/growens-innovation-blog/interview-how-nutanix-innovation-tour-changed-our-perspective-84423fdfcafe">Interview: how Nutanix Innovation Tour changed our perspective</a> was originally published in <a href="https://medium.com/growens-innovation-blog">Growens Innovation Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design patterns for team software development]]></title>
            <link>https://medium.com/growens-innovation-blog/design-patterns-for-team-software-development-91ad361de8ee?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/91ad361de8ee</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[team-collaboration]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Mon, 02 Dec 2019 09:01:02 GMT</pubDate>
            <atom:updated>2019-12-02T09:01:02.067Z</atom:updated>
            <content:encoded><![CDATA[<h4>Knowledge doesn’t spread automatically, but we can do something to help this process</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNRkVlODm8BqWnIj_vwryA.jpeg" /><figcaption><a href="https://flic.kr/p/S2aY5P">Colorful Patterns</a> by <a href="https://www.flickr.com/photos/91613124@N05/">Tarra Kongsrude</a></figcaption></figure><p>Teamwork is a very good thing, but the coordination of a group of people sometimes leads to some problems.</p><h3>The problem</h3><p>With a large codebase, largely heterogeneous, we needed to share the knowledge about the code design.<br>In general it is difficult and boring to write technical documentation about how the application code is written. In fact, probably, this activity is a waste of time for the majority of developers.<br>In an ideal world, code should be clear, concise and self documented. In our reality, it isn’t.</p><p>We believe that code design is very important, especially for developers who don’t know the code base. The consciousness about how the code is written is fundamental because it leads to:</p><ul><li>a shorter time needed by the developer to edit the code with efficacy</li><li>less bugs due to code misunderstanding and mistakes</li><li>easier tests maintenance, because the developer has a better understanding of the code structure and on how he/she cloud test it</li></ul><h3>The solution</h3><p>There are many ways to solve this problem, mainly related to documentation:</p><ul><li><strong>in-code documentation</strong>: efficient, but only for new code. Old undocumented code is difficult to manage and to update. Last but not least, a lot of developers think that in-code documentation should not exist because the code must document itself.</li><li><strong>project technical documentation</strong>: inefficient without an automated tool, very expensive and difficult to maintain and update</li><li><strong>confluence wiki</strong>: good tool, but we are not so disciplined, so for us it’s practically impossible to maintain update docs</li><li><strong>meetings</strong>: probably the worst way to share knowledge about code design</li></ul><blockquote>Given the fact that unfortunately knowledge doesn’t spread automatically, we found a and elegant, fast and efficient solution.</blockquote><p>So we decided to approach our problem from a new (at least for us!) point of view: <strong>software and architectural design patterns</strong>. What is a software design pattern?</p><blockquote>A software design pattern is a general, reusable solution to a commonly occurring problem withing a given context</blockquote><p>Our infrastructure is mainly based on microservices, so we have identified and created some design patterns that fitted well with our existing software. Some of them were very simple: for example we designed a pattern for queue consumers and another for queue producers.</p><p>The effectiveness of this approach was restricted only to a couple of simple rules:</p><ul><li>every developer <strong>must</strong> know all our design patterns (obviously!)</li><li>every software/microservice <strong>must</strong> be designed and implemented using a design pattern previously defined</li></ul><p>Following this simple rule, in a few months, we had our code base aligned with our pre-defined design patterns.<br>In this way, we don’t have to document our code because everyone that has the knowledge on our design patterns automatically know the structure of all our code. Basically, we have nothing to document.</p><p>Now we can focus on writing better documentation about the domain of our applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91ad361de8ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/growens-innovation-blog/design-patterns-for-team-software-development-91ad361de8ee">Design patterns for team software development</a> was originally published in <a href="https://medium.com/growens-innovation-blog">Growens Innovation Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coming Soon]]></title>
            <link>https://medium.com/growens-innovation-blog/coming-soon-e7704b20e0eb?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7704b20e0eb</guid>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Fri, 22 Nov 2019 13:51:51 GMT</pubDate>
            <atom:updated>2019-11-22T13:51:51.277Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrlMASBXNVB4xUgwLOoPNQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7704b20e0eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/growens-innovation-blog/coming-soon-e7704b20e0eb">Coming Soon</a> was originally published in <a href="https://medium.com/growens-innovation-blog">Growens Innovation Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Saray: API data stubbing done right]]></title>
            <link>https://medium.com/@paoferretti/saray-api-data-stubbing-done-right-6bdd01e59e73?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bdd01e59e73</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[mocking]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Fri, 19 May 2017 14:30:02 GMT</pubDate>
            <atom:updated>2017-05-19T14:30:02.046Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l6fTCNfhGiEL_lan9Mjf4A.jpeg" /><figcaption>Image courtesy of Etienne on Flickr <a href="https://flic.kr/p/zx1UbW">https://flic.kr/p/zx1UbW</a></figcaption></figure><p>&#39;Yet Another Rest API Stubber&#39;.split(&#39; &#39;).reverse().map(item =&gt; item[0].toLowerCase()).join(&#39;&#39;)</p><blockquote>An API data stubber completely free and Open Source, made for a better and more consistent API mocking between projects.</blockquote><p>At Contactlab we develop web applications that need to interact with a large set of heterogeneus RESTful webservices.<br>These webservices may suffer of downtime or may be temporarily unavailable, especially when used in a development environment.<br>So we started thinking about a tool which would allow us to develop our applications without a strict dependency to the underlying services.</p><p>We needed a data stubber simple enough to be used by non technical people, but powerful enough to be used by software developers.<br>We also needed a tool to ensure that data for automated tests were consistent and always accessible.</p><p>So we started thinking about Saray.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*7CSrW4x_F32Tdh5SzDnQeg.png" /><figcaption>Saray logo by <a href="https://medium.com/@carloaudino">carlo</a></figcaption></figure><h3>What is Saray?</h3><p>Saray is an open source lightweight API data stubber written in Node.js.<br>In its first version, it took JSON files structured in a filesystem hierarchy and served them like real API endpoint.</p><h3>The simple part</h3><p>In his essence, Saray can transform something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87e86b2a587405c1b54cb482237a2076/href">https://medium.com/media/87e86b2a587405c1b54cb482237a2076/href</a></iframe><p>Into a complete HTTP response:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/650018384230a2b25c69d375da1997f0/href">https://medium.com/media/650018384230a2b25c69d375da1997f0/href</a></iframe><p>The filename can also be something more complex, like</p><pre>simple?param=value.GET.json<br>simple.POST.json<br>anotherCall.PATCH.json</pre><p>Notice how the HTTP verb is simply specified in the filename, so without hassle you can stub whatever you want.</p><p>This was the <em>simple enough</em> part for non technical people.</p><h3>The powerful part</h3><p>However, software developers at Contactlab needed something more powerful, so in the following versions Saray has <strong>evolved</strong> to a more complete tool for developers and now it’s able to interpret Javascript files on the fly.</p><p>So, in addition to the previously JSON data stub, Saray can handle something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f753d39851eb882497d278dd34fcc972/href">https://medium.com/media/f753d39851eb882497d278dd34fcc972/href</a></iframe><p>This kind of stubbing opens unlimited possibilities for data mocking, like a simple data pagination or an error simulation.</p><p>Today Saray can:</p><ul><li>stub data in <strong>JSON and Javascript format</strong></li><li><strong>act as a proxy between the client and your API endpoint</strong>: so if you define an endpoint, saray can redirect your calls that don’t have stubbed data directly to your real APIs</li><li>handle preflight calls</li><li>forward HTTP headers correctly</li><li>handle real endpoint timeout</li><li>handle dynamic substring in URL paths</li></ul><h3>Future development</h3><p>Internally we are working for “<em>Saray as a servic</em>e”: Saray as a long running process to serve our automated test pipelines.</p><p>Another interesting feature will be the <strong>recording of an HTTP</strong> session using Saray as a proxy, with the intention to remove some of the repetitive work spent actually to produce fake data.</p><p>We have also an open issue about a <strong>feature request on throttling</strong>, to simulate server slow response under heavy duty.</p><h3>References</h3><p>Saray is a Node.js based project, built on top of Open Source libraries like <a href="http://expressjs.com/">Express</a>, <a href="https://github.com/tj/commander.js">Commander</a> and <a href="https://github.com/trentm/node-bunyan">Bunyan</a>.</p><p>There is an <strong>NPM package</strong> <a href="https://www.npmjs.com/package/saray">https://www.npmjs.com/package/saray</a> , so you can install it system wide or as a project internal dependency.</p><p>Source code is available on <strong>GitHub</strong> at <a href="https://github.com/contactlab/saray">https://github.com/contactlab/saray</a>, so you can support Saray giving you feedback or hacking our code!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bdd01e59e73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ubuntu: how to convert a color PDF in grayscale]]></title>
            <link>https://medium.com/@paoferretti/ubuntu-how-to-convert-a-color-pdf-in-grayscale-c61330bf06f7?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c61330bf06f7</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[quick-notes]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Mon, 16 May 2016 07:00:17 GMT</pubDate>
            <atom:updated>2016-11-04T20:36:20.453Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is a quick note about a thing that could be useful, but it’s not pertinent with programming.</p><p>To convert a color PDF to a grayscale PDF, the command is very simple:</p><pre>$ convert -colorspace GRAY -density 150 -quality 100 -gamma 2 source.pdf destination.pdf</pre><p>More details:</p><ul><li><strong>convert</strong> is an utility for image manipulation and it’s a member of ImageMagick suite of tools</li><li><strong>-colorspac</strong>e, obviously, permits to set the image colorspace ti grayscale</li><li><strong>-density</strong> sets horizontal and vertical density of the image (I think this is the DPI)</li><li><strong>-quality</strong> sets the compression level, if applicable</li><li><strong>-gamma</strong> it’s useful for gamma level correction. This command is very useful if the result is very dark because with gamma correction you can lighten the image</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c61330bf06f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript: string primitives or String objects?]]></title>
            <link>https://medium.com/@paoferretti/javascript-string-primitives-or-string-objects-99489a68527d?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/99489a68527d</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Mon, 02 May 2016 07:00:21 GMT</pubDate>
            <atom:updated>2016-11-04T20:36:19.350Z</atom:updated>
            <content:encoded><![CDATA[<p>In Javascript, String objects and primitive strings are not the same thing. Javascript is able to distinguish between them and it’s very simple to break things.</p><p>String literals and strings returned from String calls (the one without the <em>new</em> keyword) are primitive strings. Javascript, if necessary, automatically converts primitive strings to String objects, so it is possible to use String properties and methods on string primitives.</p><p>When using eval, string primitives and String objects are not the same, unfortunately, and have very different behaviours: the former are treated as source code, while the latter as normal objects.<br>So be careful, code may break when it expects primitives instead of String objects or viceversa.</p><p>There are also some differences in performance. During initialization, primitive strings are generally faster that String objects, during property access the performances are approximately the same and during method access String objects are faster.</p><p>Here is the code used to track performances:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/894a31eb42c718fc5266880765e2c608/href">https://medium.com/media/894a31eb42c718fc5266880765e2c608/href</a></iframe><p>I tried this code with Node.js 6.0, Chrome 50 and Firefox 46. The results are:</p><h3>Node.js 6.0</h3><ul><li>Primitive array initialization: <strong>43.969ms</strong></li><li>String object array initialization: <strong>46.293ms</strong></li><li>Primitive array string length property call: <strong>1.809ms</strong></li><li>String object array string length property call: <strong>1.807ms</strong></li><li>Primitive array string toUpperCase method call: <strong>14.322ms</strong></li><li>String object array string toUpperCase method call: <strong>8.187ms</strong></li></ul><h3>Chrome 50</h3><ul><li>Primitive array initialization: <strong>62.189ms</strong></li><li>String object array initialization: <strong>73.949ms</strong></li><li>Primitive array string length property call: <strong>2.963ms</strong></li><li>String object array string length property call: <strong>2.981ms</strong></li><li>Primitive array string toUpperCase method call: <strong>27.348ms</strong></li><li>String object array string toUpperCase method call: <strong>15.595ms</strong></li></ul><h3>Firefox 46</h3><ul><li>Primitive array initialization: <strong>180.16ms</strong></li><li>String object array initialization: <strong>219.2ms</strong></li><li>Primitive array string length property call: <strong>152.6ms</strong></li><li>String object array string length property call: <strong>151.76ms</strong></li><li>Primitive array string toUpperCase method call: <strong>157.77ms</strong></li><li>String object array string toUpperCase method call: <strong>157.34ms</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99489a68527d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript: how to format numbers to locale with currency]]></title>
            <link>https://medium.com/@paoferretti/javascript-how-to-format-numbers-to-locale-with-currency-960b49434226?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/960b49434226</guid>
            <category><![CDATA[quick-notes]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Thu, 10 Mar 2016 12:30:17 GMT</pubDate>
            <atom:updated>2016-11-04T20:36:41.269Z</atom:updated>
            <content:encoded><![CDATA[<p>To format numbers with locale formatting conditions, you can use toLocaleString() method of Javascript Number object. So, for example:</p><pre>var data = 10000000;</pre><pre>data.toLocaleString(&#39;it-IT&#39;)<br>// → 10.000.000</pre><pre>data.toLocaleString(&#39;en-US&#39;)<br>// → 10,000,000</pre><pre>With this method, you can also format numbers with currency informations:</pre><pre>data.toLocaleString(&#39;it-IT&#39;, {style: &#39;currency&#39;, currency: &#39;EUR&#39;})<br>// → 10.000.000,00 €</pre><pre>data.toLocaleString(&#39;it-IT&#39;, {style: &#39;currency&#39;, currency: &#39;USD&#39;})<br>// → 10.000.000,00 US$</pre><pre>data.toLocaleString(&#39;en-US&#39;, {style: &#39;currency&#39;, currency: &#39;EUR&#39;})<br>// → €10,000,000.00</pre><pre>data.toLocaleString(&#39;en-US&#39;, {style: &#39;currency&#39;, currency: &#39;USD&#39;})<br>// → $10,000,000.00</pre><pre>For more details: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString">https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=960b49434226" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password security]]></title>
            <link>https://medium.com/@paoferretti/password-security-90857953e6fb?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/90857953e6fb</guid>
            <category><![CDATA[quotes]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Fri, 04 Mar 2016 08:22:12 GMT</pubDate>
            <atom:updated>2016-11-04T20:36:21.270Z</atom:updated>
            <content:encoded><![CDATA[<p>If you pick a password that requires a minimal amount of effort to remember, it is likely to require an equally minimal amount of effort to break.</p><p>Thom Langford</p><p>See <a href="http://xkcd.com/936/">http://xkcd.com/936/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90857953e6fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Symfony: how to use configuration parameters from config.yml]]></title>
            <link>https://medium.com/@paoferretti/symfony-how-to-use-configuration-parameters-from-config-yml-ce2b74359098?source=rss-13ef8d2ae8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce2b74359098</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[symfony]]></category>
            <dc:creator><![CDATA[Paolo Ferretti]]></dc:creator>
            <pubDate>Sun, 28 Feb 2016 15:04:15 GMT</pubDate>
            <atom:updated>2016-11-04T20:36:23.391Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to write your own generic bundle to redistribute, probably your intention is to permit a setting of some configuration parameters in the global config.yml. Although not very documented, it’s easy to implement.</p><p>First of all let’s define our configuration. For example, you have a bundle called MyAPIBundle that’s a wrapper for an API service. So you want to give the final user (in this case the developer that will use our bundle) the possibility to configure a username, a password and an API key like this:</p><pre>// config.yml<br>my_api_bundle:<br>    username: &quot;paolo&quot;<br>    password: &quot;idontwantastupidpassword&quot;<br>    api_key: &quot;PulSCqMnXGchW0pC0s5o9ngHVTWMeLqk&quot;</pre><p>After you have defined a configuration, you need to find your Configuration class. By default Symfony puts this configuration class under the DependencyInjection directory inside your bundle folder. Here you can locate the Configuration.php file. This file contains the Configurations class that implements the ConfigurationInterface. In this class, you should see only one method called getConfigTreeBuilder:</p><pre>// Configuration.php<br>public function getConfigTreeBuilder() {<br>    $treeBuilder = new TreeBuilder();<br>    $rootNode = $treeBuilder-&gt;root(&#39;my_api_bundle&#39;);</pre><pre>    // Here you should define the parameters that are allowed to<br>    // configure your bundle. See the documentation linked above for<br>    // more information on that topic.</pre><pre>    return $treeBuilder;<br>}</pre><pre>In this method you can define how Symfony should read your custom configuration parameters. The most interesting thing here is that you can see the definition of your configuration tree root: my_api_bundle. This shows symfony how to identificate the line of your config.yml file and where to start reading your configuration parameters. Let&#39;s complete our method:</pre><pre>// Configuration.php<br>public function getConfigTreeBuilder() {<br>    $treeBuilder = new TreeBuilder();<br>    $rootNode = $treeBuilder-&gt;root(&#39;my_api_bundle&#39;);</pre><pre>    // Here you should define the parameters that are allowed to<br>    // configure your bundle. See the documentation linked above for<br>    // more information on that topic.</pre><pre>    $rootNode<br>        -&gt;children()<br>            -&gt;scalarNode(&#39;username&#39;)-&gt;isRequired()-&gt;end()<br>            -&gt;scalarNode(&#39;password&#39;)-&gt;isRequired()-&gt;end()<br>            -&gt;scalarNode(&#39;api_key&#39;)-&gt;isRequired()-&gt;end()<br>        -&gt;end();</pre><pre>    return $treeBuilder;<br>}</pre><pre>So, starting from our root node you have defined three scalar nodes. Each scalar node is obviously required. At this step you have defined your bundle configuration. Now it&#39;s time to load this configuration and make it available to your bundle. To make this possible, you have to open your bundle extension class. You can find it inside the DependencyInjection folder of your bundle, near the configuration class. By default this class has the name of your bundle, followed by “Extension”. In this class you should see only a method:</pre><pre>// MyAPIBundleExtension.php<br>public function load(array $configs, ContainerBuilder $container) {<br>    $configuration = new Configuration();<br>    $config = $this-&gt;processConfiguration($configuration, $configs);</pre><pre>    $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.&#39;/../Resources/config&#39;));<br>    $loader-&gt;load(&#39;services.yml&#39;);<br>}</pre><pre>Here, after the loading of your services.yml, you have to load your config parameters and set them as parameters on current service container:</pre><pre>// MyAPIBundleExtension.php<br>public function load(array $configs, ContainerBuilder $container) {<br>    $configuration = new Configuration();<br>    $config = $this-&gt;processConfiguration($configuration, $configs);</pre><pre>    $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.&#39;/../Resources/config&#39;));<br>    $loader-&gt;load(&#39;services.yml&#39;);</pre><pre>    $container-&gt;setParameter(&#39;my_namespace.my_api_bundle.username&#39;, $config[&#39;username&#39;]);<br>    $container-&gt;setParameter(&#39;my_namespace.my_api_bundle.password&#39;, $config[&#39;password&#39;]);<br>    $container-&gt;setParameter(&#39;my_namespace.my_api_bundle.api_key&#39;, $config[&#39;api_key&#39;]);<br>}</pre><pre>Now you can use your parameters anywhere you want.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce2b74359098" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>