<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Fabrizio Cafolla</title>
    <description>The latest articles on DEV Community by Fabrizio Cafolla (@fabriziocafolla).</description>
    <link>https://dev.to/fabriziocafolla</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F167601%2Ffb68d772-7e62-4353-bdf5-988c6cb5a61e.png</url>
      <title>DEV Community: Fabrizio Cafolla</title>
      <link>https://dev.to/fabriziocafolla</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fabriziocafolla"/>
    <language>en</language>
    <item>
      <title>ChatGPT the new era of AI | OpenaAI</title>
      <dc:creator>Fabrizio Cafolla</dc:creator>
      <pubDate>Tue, 17 Jan 2023 21:00:46 +0000</pubDate>
      <link>https://dev.to/fabriziocafolla/chatgpt-the-new-era-of-ai-openaai-47g3</link>
      <guid>https://dev.to/fabriziocafolla/chatgpt-the-new-era-of-ai-openaai-47g3</guid>
      <description>&lt;h2&gt;
  
  
  ChatGPT the new era of AI | OpenaAI
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Introduction.
&lt;/h2&gt;

&lt;p&gt;This article comes from my desire to experiment with OpenAI's ChatGPT. &lt;/p&gt;

&lt;p&gt;I was intrigued by the recent hype around it, with some people condemning it while others can't get enough of it, so I had to test it out for myself to form my own opinion.&lt;/p&gt;

&lt;p&gt;The initial idea was to test the power of this AI, but it quickly evolved into an open-source project. I thought about creating a command for performing text translations from the command line using OpenAI's APIs, so I implemented a Python script that takes in text or a file and then asks ChatGPT to translate it into the desired language.&lt;/p&gt;

&lt;p&gt;Nothing special in terms of code, but it gave me a good overview of this technology.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/FabrizioCafolla/opentranslator"&gt;https://github.com/FabrizioCafolla/opentranslator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qSCGtefy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qSCGtefy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_1.jpg" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ChatGPT overview
&lt;/h2&gt;

&lt;p&gt;ChatGPT, released in November 2022, is a chatbot created by OpenAI, based on the GPT-3.5 language model, meaning it can answer questions, write essays, summarize long texts, translate languages, and even create code. GPT-3 was released in 2020 and in December 2022 GPT-3.5 was released, a high performing model with the ability to provide very human-like conversational responses, trained with over 750GB of data collected from various sources.  After reading several sources, I found one that explains the functioning of the model and its training very well (deepen &lt;a href="https://www.assemblyai.com/blog/how-chatgpt-actually-works/"&gt;source&lt;/a&gt;).  &lt;/p&gt;

&lt;p&gt;Algorithms are not public and the data used to train them is not well-defined, or rather, most of the sources are from Common Crawl, Reddit, Books, and Wikipedia, but we don't know which data was taken into consideration nor whether there are copyrighted data which could make the responses inaccurate or under a license.   &lt;/p&gt;

&lt;p&gt;It is not said that OpenAI will not make the GPT-3 model open source in the future, as it has already done with the &lt;a href="https://github.com/openai/whisper"&gt;Whisper&lt;/a&gt; model for voice recognition, another important aspect, there are models like LaMDA that are still not available to the public but when they are released they will raise the bar even higher. Certainly, the success it is having in terms of use is good for the AI world, even non-professionals are starting to use ChatGPT, some for fun, some out of curiosity and some are starting to integrate it into their work.   &lt;/p&gt;

&lt;p&gt;The energy cost for the computational calculations of the training is another important factor, the training requires enormous computing power and therefore an equal energy consumption, all of which translates into costs for the users (the current APIs are very expensive in my opinion).&lt;/p&gt;

&lt;h2&gt;
  
  
  Project
&lt;/h2&gt;

&lt;p&gt;Mine is a small project to interact with the OpenAi API which is accessible only through a token that has to be created from your own &lt;a href="https://beta.openai.com/account/api-keys"&gt;profile&lt;/a&gt;, if you don't have a profile you can create it for free, once created you will have a 3 month "Free trial" with a credit of 18$.&lt;/p&gt;

&lt;p&gt;Once you have generated the key copy it and add it to your environment variables so that it is usable by the user in any context.&lt;/p&gt;

&lt;p&gt;From the terminal install the &lt;strong&gt;&lt;a href="https://github.com/FabrizioCafolla/opentranslator"&gt;opentranslator&lt;/a&gt;&lt;/strong&gt; package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install opentranslator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use the terminal command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;opentranslator --translate english --text "Ciao, mondo!"

opentranslator --translate english --filepath {FILENAME}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple command will allow you to translate into all languages supported by chatgpt directly from the terminal. &lt;br&gt;
Be aware that API calls have a variable cost based on the number of characters sent and the complexity of computation, plus there is a maximum character limit per request based on the engine used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;p&gt;The first consideration I want to make is this: why be afraid of AI?&lt;/p&gt;

&lt;p&gt;Many have raised doubts about how this technology can harm humans, thinking, creativity and many other things that make us feel unique, but I wonder what they are afraid of.&lt;/p&gt;

&lt;p&gt;The fact that an AI can do creative drawings does not mean that it is art, the fact that an AI can do summaries does not mean that we will forget how to do them, the fact that an AI can write code will not make programmers disappear. What scares me more is who uses the technology and not the technology itself.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cars didn't make us forget how to walk, so why should AI make us forget how to think?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;All the outraged and scared should fear social networks much more than a technology created to facilitate people in performing more or less complicated tasks.&lt;/p&gt;

&lt;p&gt;Revolution can be scary, but it must be faced, because of how much it can change the lives of people with disabilities. Glasses that transcribe lip reading in real time, devices that can alert a blind person to imminent dangers, help dyslexics understand a text, use in the processing of molecules to create and study drugs, and many other ideas that could facilitate and improve everyday life and work.&lt;/p&gt;

&lt;p&gt;The future that lies ahead of us gives us the opportunity to use machines to improve our lives and man must find the right symbiosis with them.&lt;/p&gt;

&lt;p&gt;Another consideration is the paternity of the answers, as mentioned before, the algorithms are not public and the data used are not clear. This could lead to copyright violations, debates are already being fueled in this regard, and a concrete petition has been made by the artistic world (&lt;a href="https://winbuzzer.com/2023/01/16/copyright-lawsuit-against-diffusion-and-midjounrey-led-by-same-team-battling-github-copilot-xcxwbn/"&gt;article&lt;/a&gt;) denouncing applications such as Midjourney for having used works of artists to train the model without the consent of the authors. So in the future there will be many legal and ethical aspects to be faced before this technology can be defined as usable.&lt;/p&gt;

&lt;p&gt;Summing up, I think it is still too early to have an outcome that will radically change the world of work or everyday life, still too immature, but definitely, something that will become more and more performant and accurate in the coming years. We will have to be very careful about the ethics and use of this technology because it could be used for non-legal purposes, or it could bring discrimination in decision-making, and many other things that would harm people or infrastructure. That is why Google and Microsoft, with the LaMDA and VALL-E models, respectively, state that they are tools with a great capacity, but that before they make them accessible they must ensure that they comply with some fundamental principles.&lt;/p&gt;

&lt;h2&gt;
  
  
  DALL-E
&lt;/h2&gt;

&lt;p&gt;OpenAI's DALL-E project is an artificial intelligence system that generates images from textual descriptions. The system was developed using a deep neural network (Deep Learning) and a machine learning technique called "transfer learning". The system is able to generate realistic images from a textual description, such as "a cat with a cowboy hat". **&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Paint an oil painting of a dystopian future similar to Blade Runner&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H0-lOawB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_dall_e_1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H0-lOawB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_dall_e_1.png" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Oil painting on canvas of the Pontine marsh in Victorian style&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9bt8danX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_dall_e_2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9bt8danX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_dall_e_2.png" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Human fighting with lucifer, oil on canvas like Michelangelo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yXJkx1cN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_dall_e_3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yXJkx1cN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-005/posts/005/en/img_dall_e_3.png" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** This text was generated by ChatGPT&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.assemblyai.com/blog/how-chatgpt-actually-works/"&gt;https://www.assemblyai.com/blog/how-chatgpt-actually-works/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.springboard.com/blog/data-science/machine-learning-gpt-3-open-ai/"&gt;https://www.springboard.com/blog/data-science/machine-learning-gpt-3-open-ai/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scholar.harvard.edu/saghafian/blog/analytics-science-behind-chatgpt-human-algorithm-or-human-algorithm-centaur"&gt;https://scholar.harvard.edu/saghafian/blog/analytics-science-behind-chatgpt-human-algorithm-or-human-algorithm-centaur&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.forbes.com/sites/bernardmarr/2020/10/05/what-is-gpt-3-and-why-is-it-revolutionizing-artificial-intelligence/?sh=18296ec3481a"&gt;https://www.forbes.com/sites/bernardmarr/2020/10/05/what-is-gpt-3-and-why-is-it-revolutionizing-artificial-intelligence/?sh=18296ec3481a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.nytimes.com/2022/04/15/magazine/ai-language.html"&gt;https://www.nytimes.com/2022/04/15/magazine/ai-language.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codeforces.com/blog/entry/109815"&gt;https://codeforces.com/blog/entry/109815&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.google/technology/ai/lamda/"&gt;https://blog.google/technology/ai/lamda/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.blog.google/technology/ai/ai-principles/"&gt;https://www.blog.google/technology/ai/ai-principles/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>openai</category>
      <category>chatgpt</category>
      <category>python</category>
    </item>
    <item>
      <title>Open source is mainstream, and a new era is on the horizon!</title>
      <dc:creator>Fabrizio Cafolla</dc:creator>
      <pubDate>Sat, 08 Oct 2022 13:35:31 +0000</pubDate>
      <link>https://dev.to/fabriziocafolla/open-source-is-mainstream-and-a-new-era-is-on-the-horizon-3bl1</link>
      <guid>https://dev.to/fabriziocafolla/open-source-is-mainstream-and-a-new-era-is-on-the-horizon-3bl1</guid>
      <description>&lt;h1&gt;
  
  
  Open source is mainstream, and a new era is on the horizon!
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The open source world is mainstream! It has more than two decades behind it now; it came to life in 1998 with the Open Source Initiative (OSI), but back in the mid-1980s the Free Software Foundation (FSF) started the revolution: of software freedom (1).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The term open source may have multiple definitions, but it has constants; it must be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accessible&lt;/strong&gt; both source code and compiled&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Derviable&lt;/strong&gt;, meaning it can be modified and redistributed (under the same conditions as the original licenses)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nondiscriminatory&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I read and combed through articles and publications, it became clear how the market has changed and is currently in a Renaissance phase.&lt;br&gt;
To make a long story short we can group the phases of software into (2):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Custom software&lt;/strong&gt;, each company and university developed its software as needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercial off the shelf&lt;/strong&gt; (COTS), companies created proprietary software protected by license&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Software as a Service&lt;/strong&gt; (Saas), software moved to the cloud, and companies offering it as a service to their customers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercial open source software&lt;/strong&gt; (COSS), is the latest evolution of software, where projects are developed open source but the company also offers cloud solutions (Saas or Pass) for a fee, support, and training (3).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oxfoNtb_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-004-en/posts/004/community.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oxfoNtb_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-004-en/posts/004/community.jpg" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Market
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;The open source market is growing year by year. More companies are creating their business around open source, and more and more investors are investing capital in open companies.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The business of an open company can be different from each other, some companies make money on support, others on a hosted service (SaaS or PaaS), still others use restrictive licenses for commercial use, and finally some offer their core business in open mode but put additional features for a fee (4)&lt;/p&gt;

&lt;p&gt;In recent years there has been an increase of companies with an open approach to increasingly increase the interest of investors (5), the list of companies that have raised funds or have made IPOs is long, we can mention Red Hat which can be considered the progenitor. We can name HashiCorp, MongoDB, Gitlab, Docker which completely revolutionized the tech world, CoreOS, Mozilla, Apache. I could go on for a long time, but the point is that everyday companies whether they are giants or startups are producing open source software. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is wrong to think that open source means free! &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Unfortunately, there is still the idea that open is synonymous with free and that companies that base their business on open source are crazy, but there is no more wrong in thinking that way. An open source project can also be a business project (6), like any project that aims to sell it has to answer specific questions and requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is your community?&lt;/li&gt;
&lt;li&gt;Who are your users?&lt;/li&gt;
&lt;li&gt;Who are your buyers?&lt;/li&gt;
&lt;li&gt;How does your software offer a solution by solving the problem?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have answered these questions you need to focus on three key aspects:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Adaptation to the community&lt;/strong&gt;, interaction from developers to the project must be moderated and solicited. It is assessed by the number of stars, pr, issues, etc...&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adaptation to the product market&lt;/strong&gt;, adoption by users whether they are tech or not, the product must solve needs and adapt to demands. It can be assessed by downloads or uses&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adaptation to market value&lt;/strong&gt;, the creation of value based on buyers' interests. It is measured by revenue&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4HU-qZ9D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-004-en/posts/004/github.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4HU-qZ9D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/feat/add-post-004-en/posts/004/github.jpg" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro e Contro
&lt;/h2&gt;

&lt;p&gt;The open source approach benefits everyone, without having to repeat the usual things, open code is more maintainable, it is more secure, it is more scalable, and above all, it is useful to the community which in my opinion is the most important thing. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The philosophy of freedom of use is what is allowing information science to evolve day by day. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The mere fact that millions of people are working on a single project producing secure and reliable software suggests that this approach is the right one.&lt;br&gt;
If we think about PyTorch which a few weeks ago was donated to the Linux Foundation by Meta to make it independent of the corporate vision so that the project can be carried on in total transparency by the community.&lt;/p&gt;

&lt;p&gt;Of course, there are downsides to this as well, to make a project open it is not enough to just throw the code on GitHub, that is the first step! To make a project open -in my opinion- you need a vision of the problem the project is going to solve, once you have a clear idea, you need to publish the code of course, but with caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Need a user guide for the use&lt;/li&gt;
&lt;li&gt;Need a guideline and/or procedures for development&lt;/li&gt;
&lt;li&gt;Need to outline the rules for the integration of code (Pull Request / Merge Request) by the community&lt;/li&gt;
&lt;li&gt;Need a code of conduct&lt;/li&gt;
&lt;li&gt;Need to choose the right license for the project and the business idea you want to pursue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the first mandatory steps to consider an "open source" project, then there are other aspects and difficulties in running an open project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coordinating implementations and tasks efficiently, while managing to maintain a balance between business and community needs&lt;/li&gt;
&lt;li&gt;Managing pr/mr by carefully reviewing code and running automated tests for errors&lt;/li&gt;
&lt;li&gt;Transparency, you need to engage the community by giving a clear view of the development and release timeline&lt;/li&gt;
&lt;li&gt;Pay close attention to security issues not only of the code itself but also of installed dependencies&lt;/li&gt;
&lt;li&gt;Use libraries that are compatible with your license&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The open source world is the present and the future for software, it is all very well, but it has its difficulties that one must pay attention to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project
&lt;/h2&gt;

&lt;p&gt;With the Italia Opensource project, we are trying to shake up the Italian tech ecosystem, our goal can be divided into two:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first is to give visibility to open source projects developed by Italian companies and/or developers.&lt;/li&gt;
&lt;li&gt;The second is to give 360-degree visibility to the Italian tech world through open data that provides information about companies, startups, scale-up, incubators, accelerators, events, and more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://github.com/italia-opensource"&gt;Italy Opensource&lt;/a&gt; project is on GitHub and everyone can contribute to add data and information through pr, we are still at the beginning but it is the community response has been strong and in a few weeks we already have many contributors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/italia-opensource"&gt;https://github.com/italia-opensource&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;p&gt;I have not spoken to you with numbers, those you can very well find in the resources listed below, mine is meant to be an article to start a debate, spark a discussion, and make it clear that the tech world is going in that direction. &lt;/p&gt;

&lt;p&gt;It will surely evolve further in the future, maybe there will be a way to reward open library creators according to usage, maybe ads will be introduced, or maybe there will be a way to reward contributors according to their contributions. &lt;/p&gt;

&lt;p&gt;I want to leave you with provocation. We complain that the Italian and European tech ecosystem lags behind the American one, which is true if we consider the degree of digital illiteracy and technologies used (by tech and non-tech companies). &lt;br&gt;
So I ask you how many tech companies in Italy and Europe base their business on the open model? &lt;br&gt;
How many companies contribute to open source projects?&lt;/p&gt;

&lt;p&gt;I have my answers, I leave yours to you (in case let me know in the comments).&lt;/p&gt;

&lt;h2&gt;
  
  
  Ref
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/difference-between-free-software-and-open-source-software"&gt;Difference between Free software and Open source software&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/gitlab-magazine/enterprise-software-evolution-from-custom-to-cots-to-saas-to-coss-879611a944d"&gt;Software Evolution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://coss.fi/en/opensource/"&gt;COSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hackernoon.com/wtf-is-commercial-open-source-software-ep143e5t"&gt;COSS Market&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zdnet.com/article/open-source-growth-and-venture-capital-investment-data-databases-challenges-and-opportunities/"&gt;VC Investment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://future.com/open-source-community-commercialization/"&gt;OSS Commercialization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.synopsys.com/blogs/software-security/open-source-trends-ossra-report"&gt;OSS Trends&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://pimcore.com/en/why-open-source"&gt;https://pimcore.com/en/why-open-source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.zdnet.com/article/its-an-open-source-world-78-percent-of-companies-run-open-source-software/"&gt;https://www.zdnet.com/article/its-an-open-source-world-78-percent-of-companies-run-open-source-software/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codemag.com/Article/2009041/When-Open-Source-Came-to-Microsoft"&gt;https://www.codemag.com/Article/2009041/When-Open-Source-Came-to-Microsoft&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://linuxfoundation.org/wp-content/uploads/LFResearch_Harvard_Census_II.pdf"&gt;https://linuxfoundation.org/wp-content/uploads/LFResearch_Harvard_Census_II.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linuxfoundation.org/wp-content/uploads/2020FOSSContributorSurveyReport_121020.pdf"&gt;https://www.linuxfoundation.org/wp-content/uploads/2020FOSSContributorSurveyReport_121020.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.synopsys.com/content/dam/synopsys/sig-assets/reports/rep-ossra-2022.pdf"&gt;https://www.synopsys.com/content/dam/synopsys/sig-assets/reports/rep-ossra-2022.pdf&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opnesource</category>
      <category>cloud</category>
      <category>business</category>
      <category>investing</category>
    </item>
    <item>
      <title>IaC management on AWS cloud environment with CDK (pt. 1)</title>
      <dc:creator>Fabrizio Cafolla</dc:creator>
      <pubDate>Mon, 01 Aug 2022 20:42:00 +0000</pubDate>
      <link>https://dev.to/fabriziocafolla/iac-management-on-aws-cloud-environment-with-cdk-pt-1-1inb</link>
      <guid>https://dev.to/fabriziocafolla/iac-management-on-aws-cloud-environment-with-cdk-pt-1-1inb</guid>
      <description>&lt;h1&gt;
  
  
  IaC management on AWS cloud environment with CDK (pt. 1)
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;The concept for this series of articles is to explain what and how the &lt;strong&gt;CDK&lt;/strong&gt; framework interacts with AWS to create cloud infrastructure.&lt;br&gt;
The series will be split into three articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first -this one- will introduce the logic of the framework and its steps, starting with getting hands-on with the code.&lt;/li&gt;
&lt;li&gt;The second article will address the management of IAM permissions and CI/CD pipelines on Github.&lt;/li&gt;
&lt;li&gt;The third article is the implementation of a small project that will cover the use of some AWS services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;The language of reference will be Python.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to aws cdk
&lt;/h2&gt;

&lt;p&gt;Cloud Development Kit (aka CDK) è un framework con il quale si definisce l'infrastruttura che dovrà essere creata su AWS. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The AWS CDK lets you build reliable, scalable, cost-effective applications in the cloud with the considerable expressive power of a programming language.&lt;br&gt;
- Official docs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Currently the supported languages are Typescript, Python, Go, C#, and Java&lt;/strong&gt;. The definition of the infrastructure then is done through programming languages that allow for greater flexibility and maintainability than Cloudformation, as well as the fact that it is not necessary to learn new semantics, but rather it is enough to know a language and the aws_cdk libraries/API. The output of CDK is a Cloudformation file that can be used to deploy your infrastructure.&lt;/p&gt;

&lt;p&gt;CDK is a framework that allows the creation of infrastructure exclusively on AWS, making it locked to a single vendor; however, there are alternatives such as Pulumi or Terraform, which give the ability to interface across multiple providers. What you recommend then is to evaluate well the purpose and goals of your cloud structure. Although I think that multi-cloud makes sense in a few business contexts. &lt;/p&gt;

&lt;p&gt;To elaborate further, there are also two other CDK frameworks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://cdk8s.io/"&gt;cdk8s&lt;/a&gt; that allows manifest definition using programming languages so that .yml or Helm files are avoided&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.terraform.io/cdktf"&gt;cdktf&lt;/a&gt; which wraps terraform allowing infrastructure definition using a language (Still not very mature)&lt;/li&gt;
&lt;li&gt;
## How it works? &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CDK can be divided into three distinct phases, bootstrap, synth, and deployment, let's look at them in detail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html"&gt;&lt;strong&gt;bootstrap&lt;/strong&gt;&lt;/a&gt; is the phase in which the deployed code is executed generating the Cloudformation Toolkit template as output. In practice, it connects to AWS using the profile, account, and region chosen. It will then go on to create a stack that will lay out the basic resources for the CDK environment, i.e., an S3 bucket containing the Cloudformation infrastructure files, IAM roles to run the stacks, SSM parameter for versioning, and ECR.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/hello_world.html#hello_world_tutorial_synth"&gt;&lt;strong&gt;synth&lt;/strong&gt;&lt;/a&gt; is the phase where the defined code is translated into Cloudformation files, by default it is written to the &lt;em&gt;cdk.out&lt;/em&gt; folder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;deploy&lt;/strong&gt; in this phase the infrastructure stack is created and deployed using the files in cdk.out. The provisioning of required resources may vary by service, in output, all progress is shown&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dVFNOrlJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/002/cdk-lifecycle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dVFNOrlJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/002/cdk-lifecycle.png" alt="image" width="880" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The concept behind CDK is that by using one programming language among those supported it is possible to implement the AWS infrastructure for your services, as seen above it is divided into several phases, and it is possible to manage each phase separately thus having full control over provisioning.&lt;br&gt;
The versatility of CDK allows you to define multiple stacks in the same repository and manage their deployment separately and independently, so there are three key files to consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;cdk.json&lt;/strong&gt; is the configuration file where the application to be used when running the CLI &lt;code&gt;cdk&lt;/code&gt; commands in the repository and other settings are defined. For a &lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/apps.html#apps_cloud_assembly"&gt;more in-depth&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;app.py&lt;/strong&gt; (the counterpart of &lt;strong&gt;cdk.ts&lt;/strong&gt; in Typescript) is the entry point of our infrastructure in this file the stacks are declared, each stack can be deployed autonomously and independently through the CLI, and it can also contain security logic such as region constraints on which to provisioning. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;stack.py&lt;/strong&gt; (the name may change depending on how you ran the &lt;em&gt;CDK init&lt;/em&gt; command) is the file where the infrastructure will be defined using the constructs and classes for the services you want to use&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other concepts regarding cdk's application logic you can learn more about in the &lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/apps.html"&gt;official documentation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Review
&lt;/h2&gt;

&lt;p&gt;To recap we have our repository containing configuration files, dependencies, and one or more stack files.&lt;br&gt;
Each stack file defines the services to be created, specifically, each stack class uses modules for each service it is intended to implement. The modules contain the service constructors, which can be of two types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/constructs.html#constructs_l1_using"&gt;&lt;strong&gt;L1&lt;/strong&gt;&lt;/a&gt; which is exactly how the resources defined by Cloduformation are. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/constructs.html#constructs_using"&gt;&lt;strong&gt;L2&lt;/strong&gt;&lt;/a&gt; are constructs that extend the base class &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/python/constructs/Construct.html"&gt;Construct&lt;/a&gt; and define a set of methods and properties to interact with the resource. You can then manipulate the resource or pass it to other constructs so that you can define connections, &lt;a href="https://docs.aws.amazon.com/it_it/cdk/v2/guide/constructs.html#constructs_interact"&gt;example grant permissions&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ovdmrwOA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/002/cdk-AppStacks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ovdmrwOA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/002/cdk-AppStacks.png" alt="image" width="774" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-on
&lt;/h2&gt;

&lt;p&gt;Our goal is to create the infrastructure with CDK. &lt;br&gt;
You can clone the project related to this series from then&lt;br&gt;
&lt;a href="https://github.com/FabrizioCafolla/cdk-demo"&gt;https://github.com/FabrizioCafolla/cdk-demo&lt;/a&gt; or follow the following steps by hand:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install cdk
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g aws-cdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create repository
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export APPNAME="cdk-demo"
mkdir ${APPNAME}
cd ${APPNAME}

cdk init app --language=python

code . # if use vscode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now we can implement the stack in &lt;em&gt;cdk_demo/cdk_demo_stack.py&lt;/em&gt; (if you used the same APPNAME). Let's create a simple S3 bucket:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os

from aws_cdk import Stack
from aws_cdk import aws_s3 as s3
from constructs import Construct


class CdkDemoStack(Stack):

    def __init__(self, scope: Construct, construct_id: str, **kwargs) -&amp;gt; None:
        super().__init__(scope, construct_id, **kwargs)

        self.stage = os.environ['ENVIRONMENT']

        s3.Bucket(
            self,
            'DemoBucket',
            bucket_name=f'demo-{self.environment.account}-{self.stage}-{self.environment.region}',
        )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now we define the stack in the &lt;strong&gt;app.py&lt;/strong&gt; file
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env python3
import os

import aws_cdk as cdk

from cdk_demo.cdk_demo_stack import CdkDemoStack

app = cdk.App()

region = os.getenv('CDK_DEFAULT_REGION')
account_id = os.getenv('CDK_DEFAULT_ACCOUNT')

if region not in ['eu-west-1']:
    raise Exception(f'CDK_DEFAULT_REGION must be eu-west-1, but is: {region}')

if os.getenv('ENVIRONMENT') is None:
    raise Exception(f'var ENVIRONMENT is not set')

environment = cdk.Environment(account=account_id, region=region)

CdkDemoStack(
    app,
    construct_id='CdkDemoStack',
    stack_name='CdkDemoStack',
    description='Demo stack with cdk',
    env=environment,
    synthesizer=cdk.DefaultStackSynthesizer(
        qualifier='demo',
        file_assets_bucket_name=f'{account_id}-cdk-demo-toolkit',
    )
)

app.synth()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case we defined constraints on the region, and set the Synthesizer defining which bucket to fetch Cloudformation files from. Of defualt the &lt;em&gt;synthesizer&lt;/em&gt; parameter can be non-passed but only in case the &lt;code&gt;--toolkit-bucket-name&lt;/code&gt; option was not used at bootstrap, which allows you to choose a name instead of letting it be defined automatically&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now that we have defined the stack and constructs to create an s3 bucket we can deploy the infrastructure
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export AWS_PROFILE=name-of-aws-profile      # req. | or export aws credentials
export AWS_ACCOUNT_ID=aws-account-id        # req. 
export AWS_REGION=region-name               # if profile has default region, this line is not needed
export ENVIRONMENT=staging|qa|production    # if you need inside the stack to know the environment  

# Create CdkDemoToolkit stack on Cloudformation
cdk bootstrap --toolkit-stack-name CdkDemoToolkit --toolkit-bucket-name ${AWS_ACCOUNT_ID}-cdk-demo-toolkit --qualifier demo

# Create cdk.out folder with templates
cdk synth CdkDemoStack

# Upload templete on ${AWS_ACCOUNT_ID}-cdk-demo-toolkit bucket and deploy stack 
cdk deploy CdkDemoStack
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Delete stack
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cdk destroy CdkDemoStack
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice well how in &lt;strong&gt;step 3&lt;/strong&gt; resources are defined through L2 constructs (in this case an S3 bucket) while in &lt;strong&gt;step 4&lt;/strong&gt; stacks are implemented (in this case CdkDemoStack).&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;p&gt;There are some of the best practices that should be followed to have more control over the infrastructure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Separate the logic carefully from the logic of the Constructs from the Stacks, and make the constructs agnostic, so that they can be instantiated in multiple tasks if needed&lt;/li&gt;
&lt;li&gt;Separate Stacks only if necessary, it is recommended to separate them in case of stateful stacks and stateless stacks, for example, separate DB or S3 from the application stack.&lt;/li&gt;
&lt;li&gt;Assign Tags to created resources, beware that by default CDK adds tags, if they conflict CDK will fail&lt;/li&gt;
&lt;li&gt;Try to omit names to resources as much as possible so that they are gender by CDK, this improves management as it avoids name conflicts.&lt;/li&gt;
&lt;li&gt;Avoid using Conditions and Parameters constructs, but use the programming language for handling parameters and conditions &lt;/li&gt;
&lt;li&gt;Set when needed outputs and possibly export them for use in other stacks &lt;/li&gt;
&lt;li&gt;Test the infrastructure using unit tests&lt;/li&gt;
&lt;li&gt;Avoid using environment variables in constructs or stacks&lt;/li&gt;
&lt;li&gt;Use roles with permissions that are consistent with the infrastructure you create so you don't give too much power during deployment&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;p&gt;Creating the infrastructure directly on Cloudformation is now ever discouraged, as it is not very maintainable, but more importantly, it requires knowledge of a syntax that is not exactly easy (enough on yaml or json), so it is recommended to use CDK.&lt;br&gt;
Another consideration is that as much as CDK is tied to AWS, the fact that it is written in a programming language then allows for integration with Pulumi or Terraform (if using cdktf) with the respective language, so that they can work in synergy.&lt;br&gt;
The CDK community is very active, mainly because you will see tutorials or other things based on Typescript, but the constructs are the same for all supported languages.&lt;br&gt;
The following site &lt;a href="https://constructs.dev/"&gt;constructs&lt;/a&gt; offers basic constructs/snippets to implement your services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/home.html"&gt;https://docs.aws.amazon.com/cdk/v2/guide/home.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/cdk/api/v2/"&gt;https://docs.aws.amazon.com/cdk/api/v2/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.pulumi.com/docs/intro/vs/cloud-template-transpilers/aws-cdk/"&gt;https://www.pulumi.com/docs/intro/vs/cloud-template-transpilers/aws-cdk/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/codex/points-to-consider-for-structuring-infrastructure-as-code-repositories-886ff58404b8"&gt;https://medium.com/codex/points-to-consider-for-structuring-infrastructure-as-code-repositories-886ff58404b8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://reflectoring.io/getting-started-with-aws-cdk/"&gt;https://reflectoring.io/getting-started-with-aws-cdk/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/it_it/cdk/v2/guide/best-practices.html"&gt;https://docs.aws.amazon.com/it_it/cdk/v2/guide/best-practices.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cdk</category>
      <category>aws</category>
      <category>python</category>
    </item>
    <item>
      <title>Deploy article with GitHub workflow on dev.to and medium.com</title>
      <dc:creator>Fabrizio Cafolla</dc:creator>
      <pubDate>Tue, 10 May 2022 18:32:50 +0000</pubDate>
      <link>https://dev.to/fabriziocafolla/deploy-article-with-github-workflow-on-devto-and-mediumcom-625</link>
      <guid>https://dev.to/fabriziocafolla/deploy-article-with-github-workflow-on-devto-and-mediumcom-625</guid>
      <description>&lt;h1&gt;
  
  
  Deploy article with GitHub workflow on dev.to and medium.com
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Intro
&lt;/h3&gt;

&lt;p&gt;This article was born from the laziness that usually surrounds us, programmers. &lt;/p&gt;

&lt;p&gt;Let's be clear, it's constructive laziness, where the core concept is:&lt;/p&gt;

&lt;p&gt;If you have to do it more than once automate the process...&lt;/p&gt;

&lt;p&gt;My need is to be able to write an article in the fastest and easiest way, but also be replicable on multiple platforms.&lt;br&gt;
So I started looking for a way that using a Markdown file containing the article I could publish it on dev.to and medium.com.&lt;/p&gt;

&lt;p&gt;Fortunately, as often happens, someone thought of it before me and implemented a solution.&lt;br&gt;
The beauty of open source!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/protiumx/blogpub/tree/v0.4.1"&gt;https://github.com/protiumx/blogpub/tree/v0.4.1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ip6uui0Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/001/preview.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ip6uui0Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/001/preview.jpg" alt="image" width="880" height="472"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Implementation
&lt;/h3&gt;

&lt;p&gt;You can look at the repository containing the sources of the articles&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/FabrizioCafolla/blog"&gt;https://github.com/FabrizioCafolla/blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The structure is very simple inside the blog folder there are all my articles written with .md extension, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ---
    title: "Example"
    description: "Exmpale desc. "
    tags: tag1, tag2, tag3, tag4, tag5
    ---

    # Title

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

    ![image](https://raw.githubusercontent.com/FabrizioCafolla/blog/main/posts/001/images/img.png) ==&amp;gt; ![image](https://raw.githubusercontent.com/&amp;lt;owner&amp;gt;/&amp;lt;repo&amp;gt;/&amp;lt;articles_folder&amp;gt;/images/img.png)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember inside the file you need the header (for more info &lt;a href="https://github.com/protiumx/blogpub#articles-configuration"&gt;see here&lt;/a&gt;) then you can use all the features of the markdown including the images, which in case they refer to an image in the repository, will be rendered as in the example&lt;/p&gt;

&lt;p&gt;Now to have the articles deployed with pipeline on both platforms you have to create the file inside your repository in the following path &lt;strong&gt;.github/workflows&lt;/strong&gt;, the name of the file is indifferent, and inside it you have to insert:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Publish articles

on:
  push:
    branches: [main]

jobs:
  publish:
    name: Publish blog
    runs-on: ubuntu-20.04   
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Deploy
        uses: protiumx/blogpub@v0.4.1
        with:
          articles_folder: %PATH%
          devto_api_key: $
          gh_token: $
          medium_token: $
          medium_user_id: $
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note well to insert instead of %PATH% the path where the articles are contained, in my case is simply &lt;strong&gt;posts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have created and uploaded your repository on GitHub you have to insert the secrets so that the pipeline can connect to the API of the platforms. Then enter the following keys:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DEVTO_TOKEN&lt;/strong&gt;: &lt;a href="https://dev.to/settings/account"&gt;generate token&lt;/a&gt; on dev.to&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MEDIUM_TOKEN&lt;/strong&gt;: &lt;a href="https://help.medium.com/hc/en-us/articles/213480228-Get-an-integration-token-for-your-writing-app"&gt;generate token&lt;/a&gt; on medium&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MEDIUM_ID&lt;/strong&gt;: &lt;a href="https://github.com/Medium/medium-api-docs#31-users"&gt;get user id&lt;/a&gt; medium from API &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have inserted the secrets and written the articles the deployment pipeline will be executed only by main you can change it to your liking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Considerations
&lt;/h3&gt;

&lt;p&gt;The first consideration is that I still don't understand well how the update of the articles works in case of modification after the publication.&lt;/p&gt;

&lt;p&gt;A second consideration is that using this process from a single source I can publish on multiple platforms simply and effortlessly, if one day I wanted to publish on other sites I would just change the pipeline.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>tutorial</category>
      <category>github</category>
      <category>writing</category>
    </item>
  </channel>
</rss>
