
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>mazzi.github.com</title>
        <description>Personal page.</description>
        <link>http://mazzi.github.com</link>
        <atom:link href="http://mazzi.github.com/atom.xml" rel="self" type="application/rss+xml" />
        
            
            <item>
                <title>Building Microservices - The Platform Team</title>
                <description>&lt;p&gt;A beautiful section from &lt;a href=&quot;https://www.amazon.com/Building-Microservices-Designing-Fine-Grained-Systems/dp/1492034029&quot;&gt;Building Microservices from Sam Newman&lt;/a&gt; about The Platform Team.&lt;/p&gt;

&lt;p&gt;Why exists? What’s the purpose?&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A platform needs someone to run and manage it. These technology stacks can be complex enough to warrant some specific expertise. My concern, though, is that on occasion it can be too easy for platform teams to lose sight of why they exist.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Who is the stakeholder?&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A platform team has users, in the same way that any other team has users. The users of the platform team are other developers—your job, if you are in a platform team, is to make their lives easier (this of course is the job of any enabling team). That means that the platform you create needs to fit the needs of the teams using it. It also means that you need to work with the teams using your platform not only to help them use it well but also to take on board their feedback and requirements to improve the platform you deliver.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thinking more widely about other ways to make developers’ lives easier.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;In the past, I’ve preferred calling such a team something like “delivery services” or “delivery support” to better articulate its goal. Really, the job of a platform team isn’t to build a platform; it’s to make developing and shipping functionality easy. Building a platform is just one way that the members of a platform team can achieve this. I do worry that by calling themselves a platform team they will see all problems as things that can and should be solved by the platform, rather than thinking more widely about other ways to make developers’ lives easier.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Enabling team. Build bridges, not walls.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Like any good enabling team, a platform team needs to operate almost like an internal consultancy to some extent. If you are in a platform team, you need to be going out to find out what problems people are facing and working with them to help them get these problems fixed. But as you also end up building the platform too, you need to have a heavy dose of product development work in there as well. In fact, taking a product development approach to how you build out your platform is a great idea and could be a great place to help grow new product owners.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
                <pubDate>Tue, 19 Dec 2023 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2023/The-Platform-team.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2023/The-Platform-team.html</guid>
            </item>
            
        
            
            <item>
                <title>Hubs and Wheels</title>
                <description>&lt;p&gt;Surprised about the quality of the Shimano hubs. With hubs cones and bearings cleaned and assembled, I have the feeling that they run smotther than the Campagnolos from the same era. Changed the bearings for new ones. They seem to run forever.&lt;/p&gt;

&lt;p&gt;More diagrams from the &lt;a href=&quot;https://si.shimano.com/#/&quot;&gt;Shimano website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2021/2021-04-10-FH-6400.png&quot; alt=&quot;FH 6400 Free Hub&quot; class=&quot;center&quot; width=&quot;500px&quot; /&gt;
&lt;img src=&quot;/images/2021/2021-04-10-HB-6400.png&quot; alt=&quot;HB 6400 Rear Hub&quot; class=&quot;center&quot; width=&quot;500px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The wheels look aligned. Until the last stage of the build, I will keep the Vittoria tyres to move the bike around. Nevertheless, pretty hard to get new tyres online nowadays. Looking for new 700x23c gum wall.&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Hubs and bearings&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Tyres + alignment&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;Got a new set of long allen keys to dissasemble the cockpit. Pretty nice system from Shimano to hide bolts.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2021/2021-04-10-HS-6400.png&quot; alt=&quot;HS 6400 Handle Stem&quot; class=&quot;center&quot; width=&quot;500px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Next step: Cockpit &amp;amp; Headset. Probably the last dirty job until I decided if I dive into the bottom bracket or not.&lt;/p&gt;

&lt;h2 id=&quot;checklist&quot;&gt;Checklist&lt;/h2&gt;
&lt;h3 id=&quot;frame&quot;&gt;Frame:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Seat &amp;amp; Seatpost&lt;/li&gt;
  &lt;li&gt;Cockpit&lt;/li&gt;
  &lt;li&gt;Headset&lt;/li&gt;
  &lt;li&gt;Frame itself&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;transmission&quot;&gt;Transmission:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Bottom Bracket (?)&lt;/li&gt;
  &lt;li&gt;Crankset (x_x)&lt;/li&gt;
  &lt;li&gt;Pedals (x_x)&lt;/li&gt;
&lt;/ul&gt;
</description>
                <pubDate>Sat, 10 Apr 2021 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2021/Hubs-and-wheels.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2021/Hubs-and-wheels.html</guid>
            </item>
            
        
            
            <item>
                <title>First batch ready</title>
                <description>&lt;p&gt;A couple of weeks had passed since I decided to start with the dissasemble of the &lt;a href=&quot;/2021/Panasonic-PR-5000-project.html&quot;&gt;PR-5000&lt;/a&gt;. This is the first update.&lt;/p&gt;

&lt;p&gt;No many surprises so far: seatpost and stem are not stuck; Shimano 600 tricolor groupset complete (not sure about the bottom bracket yet); original Panasonic bottle cage. Didn’t check the wheels so far (they are Atala).&lt;/p&gt;

&lt;p&gt;Started by dissasembling brakes (beatiful I must say), cables and the transmission. They are already dissasembled/degreased, cleaned, assembled/greased again. Same with the cable housings. I got a new set of cables (transmission/brakes) that they were totally destroyed.&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Front/Rear&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Cables/Housing&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Rear derallieur&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Front derallieur&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Cables &amp;amp; levers&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Chain&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Cog&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;Pretty useful the &lt;a href=&quot;https://si.shimano.com/#/&quot;&gt;Shimano website&lt;/a&gt; to find all the parts and pieces of each component. In this case, the rear derallieur&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2021/2021-03-01-RD-6400.png&quot; alt=&quot;RD 6400 rear derallieur&quot; class=&quot;center&quot; width=&quot;500px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I was not able to take out the pedals. They are pretty stuck and I don’t have enough leverage with my tools. I’ll see what I can do. Same with crackset.&lt;/p&gt;

&lt;p&gt;The brake handles rubber housings were removed. They were pretty dirty, but a good clean up with detergent made the first part of the job. Next one will be with CIF. Pretty good for rubber. I’ve tried to get replacements, but they are really hard to find and specially in white.&lt;/p&gt;

&lt;p&gt;Next stop: probably the wheelset to check aligment, cones, bearigns, inner tubes and tyres. That could be a couple of mornings (need to go out and cycle too).&lt;/p&gt;

&lt;h2 id=&quot;checklist&quot;&gt;Checklist&lt;/h2&gt;
&lt;h3 id=&quot;wheelset&quot;&gt;Wheelset:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Hubs and bearings&lt;/li&gt;
  &lt;li&gt;Tyres + alignment&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;frame&quot;&gt;Frame:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Seat &amp;amp; Seatpost&lt;/li&gt;
  &lt;li&gt;Cockpit&lt;/li&gt;
  &lt;li&gt;Frame itself&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;transmission&quot;&gt;Transmission:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Bottom Bracket (?)&lt;/li&gt;
  &lt;li&gt;Crankset (x_x)&lt;/li&gt;
  &lt;li&gt;Pedals (x_x)&lt;/li&gt;
&lt;/ul&gt;
</description>
                <pubDate>Mon, 01 Mar 2021 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2021/First-batch-ready.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2021/First-batch-ready.html</guid>
            </item>
            
        
            
            <item>
                <title>Panasonic PR 5000 project</title>
                <description>&lt;p&gt;Just got my hands on a beautiful Panasonic PR-5000 (size 56). So far seems 100% original. Complete Shimano 600 tricolor groupset, Araya black rims and Turbo saddle.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2021/2021-02-14-Pana18800.webp&quot; alt=&quot;PR 5000 catalog&quot; class=&quot;center&quot; width=&quot;500px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The tubing is Tange Cr-Mo. The body has some stickers and seems that was bought on a German speaking store called “Marty”. In the front tube has a serial number engraved. Nothing on the bottom bracket. Also has a registration number in the seatpost. I wander how this bike arrived to Spain.&lt;/p&gt;

&lt;p&gt;Looks like “PR” stands for Professional Racing. Here’s the team with the PR-6000.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2021/2021-02-14-Pana5800.webp&quot; alt=&quot;Panasonic team&quot; class=&quot;center&quot; width=&quot;500px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve decided to write a bit to keep a log on the steps that I will take to bring it back in good shape.&lt;/p&gt;

&lt;p&gt;After restoring, I’ll sell it (If I don’t fall in love with it).&lt;/p&gt;

&lt;h2 id=&quot;checklist&quot;&gt;Checklist&lt;/h2&gt;
&lt;h3 id=&quot;wheelset&quot;&gt;Wheelset:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Hubs and bearings&lt;/li&gt;
  &lt;li&gt;Tyres + alignment&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;frame&quot;&gt;Frame:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Seat &amp;amp; Seatpost&lt;/li&gt;
  &lt;li&gt;Cockpit&lt;/li&gt;
  &lt;li&gt;Frame itself&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;transmission&quot;&gt;Transmission:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Rear derallieur&lt;/li&gt;
  &lt;li&gt;Front derallieur&lt;/li&gt;
  &lt;li&gt;Cables &amp;amp; levers&lt;/li&gt;
  &lt;li&gt;Chain&lt;/li&gt;
  &lt;li&gt;Cog&lt;/li&gt;
  &lt;li&gt;Bottom Bracket&lt;/li&gt;
  &lt;li&gt;Crankset&lt;/li&gt;
  &lt;li&gt;Pedals&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;brakes&quot;&gt;Brakes:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Front/Rear&lt;/li&gt;
  &lt;li&gt;Cables/Housing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even found &lt;a href=&quot;https://www.youtube.com/watch?v=rfAbZlqQ68o&quot;&gt;how they were made in Japan&lt;/a&gt;. High tech stuff!&lt;/p&gt;
</description>
                <pubDate>Sun, 14 Feb 2021 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2021/Panasonic-PR-5000-project.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2021/Panasonic-PR-5000-project.html</guid>
            </item>
            
        
            
            <item>
                <title>Peter Drucker quotes</title>
                <description>&lt;p&gt;Peter Ferdinand Drucker was an Austrian-born American management consultant, educator, and author,
whose writings contributed to the philosophical and practical foundations of the modern business corporation.&lt;/p&gt;

&lt;p&gt;Here 10 quotes to keep in mind regularly.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Doing the right thing is more important than doing the thing right.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;If you want something new, you have to stop doing something old.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;There is nothing quite so useless as doing with great efficiency something that should not be done at all.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;What gets measured gets improved.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Results are gained by exploiting opportunities, not by solving problems.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;So much of what we call management consists of making it difficult for people to work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;People who don’t take risks generally make about two big mistakes a year. People who do take riswks generally make about two big mistakes a year.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Meetings are by definition a concession to a deficient organization. For one either meets or one works. One cannot do both at the same time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Long-range planning does not deal with the future decissions, but with the future of present decissions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Management is doing things right. Leadership is doing the right things.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
                <pubDate>Wed, 01 May 2019 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2019/Peter-Drucker-Quotes.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2019/Peter-Drucker-Quotes.html</guid>
            </item>
            
        
            
            <item>
                <title>Twelve arguments to sneak in features</title>
                <description>&lt;p&gt;When your product gets traction, you’ll  nd yourself inundated with good ideas for features. These will come from your customers, your colleagues, and yourself. Because they’re good ideas, there will always be lots of reasons to say yes to them. &lt;strong&gt;Here’s 12 arguments that are commonly used to sneak features into a product&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;But the data looks good&lt;/li&gt;
  &lt;li&gt;But it’ll only take a few minutes&lt;/li&gt;
  &lt;li&gt;But this customer is about to quit&lt;/li&gt;
  &lt;li&gt;But we can just make it optional&lt;/li&gt;
  &lt;li&gt;But my cousin’s neighbour said…&lt;/li&gt;
  &lt;li&gt;But we’ve nothing else planned&lt;/li&gt;
  &lt;li&gt;But we’re supposed to be allowed to work on whatever we want&lt;/li&gt;
  &lt;li&gt;But 713,000 people want it&lt;/li&gt;
  &lt;li&gt;But our competitors already have it&lt;/li&gt;
  &lt;li&gt;But if we don’t build it, someone else will&lt;/li&gt;
  &lt;li&gt;But the boss really wants it&lt;/li&gt;
  &lt;li&gt;But this could be “the one”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Extract from “Intercom on Product Management”.&lt;/p&gt;
</description>
                <pubDate>Fri, 01 Feb 2019 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2019/Twelve-arguments-to-sneak-in-features.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2019/Twelve-arguments-to-sneak-in-features.html</guid>
            </item>
            
        
            
            <item>
                <title>An acid test for new features</title>
                <description>&lt;p&gt;Here’s a simple set of Yes/No questions that you can quickly answer before you add another feature to your product roadmap.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Does it fit your vision?&lt;/li&gt;
  &lt;li&gt;Will it still matter in 5 years?&lt;/li&gt;
  &lt;li&gt;Will everyone beneffit from it?&lt;/li&gt;
  &lt;li&gt;Will it improve, complement or innovate on the existing workfow?&lt;/li&gt;
  &lt;li&gt;Does it grow the business?&lt;/li&gt;
  &lt;li&gt;Will it generate new meaningful engagement?&lt;/li&gt;
  &lt;li&gt;If it succeeds, can we support and afford it?&lt;/li&gt;
&lt;/ol&gt;
</description>
                <pubDate>Fri, 01 Feb 2019 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2019/An-acid-test-for-new-features.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2019/An-acid-test-for-new-features.html</guid>
            </item>
            
        
            
            <item>
                <title>Ben Horowitz's on Good and Bad Product Managers</title>
                <description>&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; know the market, the product, the product line and the competition extremely well and operate from a strong basis of knowledge and confidence. Is the CEO of the product. Takes full responsibility and measures themselves in terms of the success of the product. They are responsible for right product/right time and all that entails. &lt;strong&gt;A good product manager&lt;/strong&gt; &lt;em&gt;knows the context&lt;/em&gt; going in (the company, our revenue funding, competition, etc.), and they take responsibility for devising and executing a winning plan (no excuses).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad product managers&lt;/strong&gt; have lots of excuses. Not enough funding, the engineering manager is an idiot, Microsoft has 11 times as many engineers working on it, I’m overworked, I don’t get enough direction. Barksdale doesn’t make these kinds of excuses and neither should the CEO of a product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; don’t get all of their time sucked up by the various organizations that must work together to deliver right product right time. They don’t take all the product team minutes, they don’t project manage the various functions, &lt;em&gt;they are not gophers for engineering&lt;/em&gt;. They are not part of the product team; &lt;em&gt;they manage the product team&lt;/em&gt;. Engineering teams don’t consider Good Product Managers a “marketing resource.” Good product managers are the marketing counterpart of the engineering manager. They crisply define &lt;em&gt;the target&lt;/em&gt;, the &lt;em&gt;what&lt;/em&gt; (as opposed to the &lt;em&gt;how&lt;/em&gt;) and manage the delivery of the &lt;em&gt;what&lt;/em&gt;. &lt;strong&gt;Bad product managers&lt;/strong&gt; feel best about themselves when they figure out &lt;em&gt;how&lt;/em&gt;. &lt;strong&gt;Good product managers&lt;/strong&gt; communicate crisply to engineering in writing as well as verbally. They don’t give direction informally but they &lt;em&gt;gather information informally&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; create leveragable collateral, FAQs, presentations, white papers. &lt;strong&gt;Bad product managers&lt;/strong&gt; complain that they spend all day answering questions for the sales force and are swamped. &lt;strong&gt;Good product managers&lt;/strong&gt; anticipate the serious product flaws and build real solutions. &lt;strong&gt;Bad product managers&lt;/strong&gt; put out fires all day. &lt;strong&gt;Good product managers&lt;/strong&gt; take written positions on important issues (competitive silver bullets, tough architectural choices, tough product decisions, markets to attack or yield). &lt;strong&gt;Bad product managers&lt;/strong&gt; voice their opinion verbally and lament that the “powers that be” won’t let it happen. Once bad product managers fail, &lt;em&gt;they point out that they predicted they would fail&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; &lt;em&gt;focus the team on revenue and customers&lt;/em&gt;. &lt;strong&gt;Bad product managers&lt;/strong&gt; focus team on how many features Microsoft is building. &lt;strong&gt;Good product managers&lt;/strong&gt; define good products that can be executed with a strong effort. &lt;strong&gt;Bad product managers&lt;/strong&gt; define good products that can’t be executed or let engineering build whatever they want (i.e. solve the hardest problem).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; think in terms of &lt;em&gt;delivering superior value to the market place&lt;/em&gt; during inbound planning and achieving market share and revenue goals during outbound. &lt;strong&gt;Bad product managers&lt;/strong&gt; get very confused about the differences amongst delivering value, matching competitive features, pricing, and ubiquity. &lt;strong&gt;Good product managers&lt;/strong&gt; decompose problems. &lt;strong&gt;Bad product managers&lt;/strong&gt; combine all problems into one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; think about the story they want written by the press. &lt;strong&gt;Bad product managers&lt;/strong&gt; think about covering every feature and being really technically accurate with the press. &lt;strong&gt;Good product managers&lt;/strong&gt; ask the press questions. &lt;strong&gt;Bad product managers&lt;/strong&gt; answer any press question. &lt;strong&gt;Good product managers&lt;/strong&gt; assume press and analyst people are really smart. &lt;strong&gt;Bad product managers&lt;/strong&gt; assume that press and analysts are dumb because they don’t understand the difference between “push” and “simulated push.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; err on the side of clarity vs. explaining the obvious. &lt;strong&gt;Bad product managers&lt;/strong&gt; never explain the obvious. &lt;strong&gt;Good product managers&lt;/strong&gt; &lt;em&gt;define their job and their success&lt;/em&gt;. &lt;strong&gt;Bad product managers&lt;/strong&gt; constantly &lt;em&gt;want to be told what to do&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good product managers&lt;/strong&gt; send their status reports in on time every week, because &lt;em&gt;they are disciplined&lt;/em&gt;. &lt;strong&gt;Bad product managers&lt;/strong&gt; forget to send in their status reports on time, because they don’t value discipline.&lt;/p&gt;
</description>
                <pubDate>Thu, 13 Dec 2018 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2018/Ben-Horowitzs-on-Good-PMs,-Bad-PMs.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2018/Ben-Horowitzs-on-Good-PMs,-Bad-PMs.html</guid>
            </item>
            
        
            
            <item>
                <title>PoC RoR React and CSV</title>
                <description>&lt;p&gt;Has been a while without writing a technical post. Looking at startups I see often a webstack made out of Ruby on Rails (RoR) and React. With the facilities that RoR gives to create a REST API and the popularity of React, I understand the reasons.&lt;/p&gt;

&lt;p&gt;To make a small PoC, I decided to import a random CSV to sqlite3 (why bother to use mysql/postgres for this example right?) so I can build a small backend with a service to find information easily.&lt;/p&gt;

&lt;p&gt;Let’s start bottom up.&lt;/p&gt;

&lt;h3 id=&quot;model-creation-and-importing-the-data&quot;&gt;Model creation and importing the data&lt;/h3&gt;

&lt;p&gt;Download from &lt;a href=&quot;https://opendata-ajuntament.barcelona.cat/data/en/dataset/est-padro-domicilis-sexe/resource/39106a1d-de6d-4fb1-a39c-261c472a7c8&quot;&gt;this url&lt;/a&gt; the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2019_domicilis_sexe.csv&lt;/code&gt;. It’s open data from Barcelona, identifiying “Homes of the city of Barcelona according to the sex of the people who live in them.” It’s just an example. Any other CSV file should be good as well, but you’ll need to change the mapping of the fields and the types.&lt;/p&gt;

&lt;p&gt;How to import this data into sqlite3 using Rails, and &lt;a href=&quot;https://edgeguides.rubyonrails.org/active_record_migrations.html#migrations-and-seed-data&quot;&gt;seeds&lt;/a&gt;?&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Copy &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2019_domicilis_sexe.csv&lt;/code&gt; into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./lib/seeds/&lt;/code&gt; directory (if not exists create it)&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Modify &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./db/seeds.rb&lt;/code&gt; and add the following code&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; require &apos;csv&apos;

 csv_text = File.read(Rails.root.join(&apos;lib&apos;, &apos;seeds&apos;, &apos;2019_domicilis_sexe.csv&apos;))
 csv = CSV.parse(csv_text, :headers =&amp;gt; true, :encoding =&amp;gt; &apos;ISO-8859-1&apos;)
 csv.each do |row|
     sd = SexDatum.new
     sd.year = row[&apos;Any&apos;]
     sd.district_code = row[&apos;Codi_districte&apos;]
     sd.district_name = row[&apos;Nom_districte&apos;]
     sd.neighbourhood_code = row[&apos;Codi_barri&apos;]
     sd.neighbourhood_name = row[&apos;Nom_barri&apos;]
     sd.sex = row[&apos;Sexe&apos;]
     sd.number = row[&apos;Nombre&apos;]
        
     sd.save
     puts &quot;Entry saved&quot;
 end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Let’s create the model for this table using:
     rails g model SexData year:integer district_code district_name neighbourhood_code:integer neighbourhood_name sex number:integer
By default Rails uses &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;strings&lt;/code&gt; as type for db fields. Just be explicit on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;integers&lt;/code&gt; on this case.&lt;/li&gt;
  &lt;li&gt;If the model was successfully created, you should see &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./app/models/sex_datum.rb&lt;/code&gt; on your filesystem. A migration then, should be executed for the creation of the table: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rake db:migrate&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Now with the model, the csv data and the seeds, let’s import the data: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rake db:seed&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;To check that the model was created and the data imported, let’s use rails console: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rails c&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Once there, let’s find records: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SexDatum.all&lt;/code&gt; Check names, types and values. All set!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;writing-the-controller-and-handling-the-routes&quot;&gt;Writing the Controller and handling the routes&lt;/h3&gt;

&lt;p&gt;Let’s create the namespace for the routes, so we can handle versions in the future.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create the directory &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./controllers/api/v1/&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;And the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sex_datum_controller.rb&lt;/code&gt; in the same directory containing two methods: one to return all the records (just a test) and another one that will filter records by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;district_code&lt;/code&gt; (as an example)&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; class Api::V1::SexDatumController &amp;lt; ApplicationController
     def index
         render json: SexDatum.all
     end

     def show
         datum = SexDatum.where district_code:params[:id]
         render json: datum
     end
 end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Rewrite the contents (asumming that we have a project from scratch) of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;routes.rb&lt;/code&gt; so we can hit two urls
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://localhost:3000/&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://localhost:3000/api/v1/sex_datum/2&lt;/code&gt;. The number 2 is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;district_code&lt;/code&gt; and is just an example.&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; Rails.application.routes.draw do
     namespace :api do 
         namespace :v1 do 
             resources :sex_datum, only: [:index, :show]
         end 
     end 
     root to: &apos;home#index&apos;
 end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;writing-the-view-in-reactjs&quot;&gt;Writing the View in React.js&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;An empty file should be created in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./app/views/home/index.html.erb&lt;/code&gt;. This file should act as a placeholder. The real content will be on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./app/javascript/components/App.jsx&lt;/code&gt; served by webpack. Remember to install the gem and configure the path on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;webpacker.yml&lt;/code&gt; (sorry, maybe a long topic for the same post) The tile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;App.jsx&lt;/code&gt; will have the following content:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; import React from &apos;react&apos;
 import InputDistrictCode from &apos;./InputDistrictCode&apos;

 const App = () =&amp;gt; {
     return (
         &amp;lt;div&amp;gt;
             Hello, I am a react component rendered via rails webpacker
             &amp;lt;InputDistrictCode /&amp;gt;
         &amp;lt;/div&amp;gt;
     )
 }
 export default App
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now defining &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;InputDistrictCode.jsx&lt;/code&gt;&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; import React, {Component} from &apos;react&apos;;
 import Result from &apos;./Result&apos;;

 class InputDistrictCode extends Component {

     state = {
         code : &apos;&apos;,
         result : [],
     }

     handleClick = (event) =&amp;gt; {
         event.preventDefault();
         fetch(`http://localhost:3000/api/v1/sex_datum/${this.state.code}`)
             .then(response =&amp;gt; response.json())
             .then(data =&amp;gt; this.setState( {result : data}))
     }

     handleChange = (event) =&amp;gt; {
         const {name, value} = event.target
         this.setState({ [name] : value })
     }

     render() {
         return(
             &amp;lt;div&amp;gt;
                 &amp;lt;input
                     name=&apos;code&apos;
                     onChange={this.handleChange}&amp;gt;
                 &amp;lt;/input&amp;gt;
                 &amp;lt;button
                     onClick={this.handleClick}&amp;gt;
                     Find it
                 &amp;lt;/button&amp;gt;
                 &amp;lt;Result
                     data={this.state.result} /&amp;gt;
             &amp;lt;/div&amp;gt;
         )
     }
 }

 export default InputDistrictCode;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;And the last component, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Result.jsx&lt;/code&gt;&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; import React from &apos;react&apos;

 const Result = ({data}) =&amp;gt; (
     &amp;lt;&amp;gt;
         {data.map( item =&amp;gt; (
             &amp;lt;div key={item.id}&amp;gt;
             {item.district_name} - {item.id}
             &amp;lt;/div&amp;gt;))}
     &amp;lt;/&amp;gt;
 )

 export default Result;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run the rails server with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rails s&lt;/code&gt; and the webpack sever &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./bin/webpack-dev-server&lt;/code&gt;. Heading now to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://localhost:3000/&lt;/code&gt; you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2019/2019-08-07-form.png&quot; alt=&quot;Simple form in React and RoR&quot; class=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Writing an integer in the input field and then hitting the button, some results from the database will be retrieved.&lt;/p&gt;

&lt;p&gt;Hope it helps! If you need the code let me know in the comments.&lt;/p&gt;
</description>
                <pubDate>Tue, 07 Aug 2018 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2018/PoC-RoR-React-and-csv.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2018/PoC-RoR-React-and-csv.html</guid>
            </item>
            
        
            
            <item>
                <title>Deploying node</title>
                <description>&lt;p&gt;All good. You wrote your first &lt;a href=&quot;http://nodejs.org/&quot;&gt;node&lt;/a&gt; app using &lt;a href=&quot;http://expressjs.com/&quot;&gt;express&lt;/a&gt; as your web application framework and everything looks amazing locally. Now the big question: how we deploy this live?&lt;/p&gt;

&lt;p&gt;First of all, I had to do it in a &lt;a href=&quot;http://www.digitalocean.com&quot;&gt;DigitalOcean&lt;/a&gt; VPS using Ubuntu 12.04 TLS, so my first idea was to install node using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-get install nodejs&lt;/code&gt;. No problems at all, except that was an extremely old version. Node ecosystem is changing day by day so if you are not aware of that you can end with an edge version in development and a stable in production. To get then the latest version, I suggest to use &lt;a href=&quot;https://launchpad.net/~chris-lea/+archive/node.js/&quot;&gt;Chris Lea’s repository&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo apt-get install python-software-properties
$ sudo apt-add-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So far, so good. Next will be install &lt;a href=&quot;https://npmjs.org&quot;&gt;npm&lt;/a&gt;, the node package manager with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-get install npm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Your node + express app will have a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;package.json&lt;/code&gt; file with all the project dependencies. In a good day doing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install&lt;/code&gt; in your project root folder will be enough. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm&lt;/code&gt; on ubuntu has a differnt way to handle source repositories, so to be able to download all the dependencies we need to change an npm configuration setting.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npm config set registry http://registry.npmjs.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above command will tell npm were to go to download dependencies then. Re-executing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install&lt;/code&gt; will download then all the dependencies.&lt;/p&gt;

&lt;p&gt;Fair enough. Our application will be running without problems at this point. Now is time to configure nginx to serve the app.&lt;/p&gt;

&lt;p&gt;When using node + express, executing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node app.js&lt;/code&gt; in the project root folder will be enough to server the app in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://localhost:3000&lt;/code&gt;. Now we need to do the same but as a service in our Ubuntu box. For this task I’ve used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;upstart&lt;/code&gt;. Creating an file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/init/myapp.conf&lt;/code&gt; with the following content will do the trick.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;description     &quot;My Express App&quot;

env HOME=/var/www/myexpressapp

start on runlevel [2345]
stop on runlevel [!2345]

respawn

env NODE_ENV=production
exec start-stop-daemon --start --umask 000 --exec /usr/bin/node -- /var/www/myexpressapp/app.js &amp;gt;&amp;gt;/var/log/myexpressapp.sys.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It’s important to execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;env NODE_ENV=production&lt;/code&gt; so the express app is able to run in production with different setting than development. In some &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;upstart&lt;/code&gt; versions this command is not compatible. Excecuting then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;service myapp start&lt;/code&gt; will start the service.&lt;/p&gt;

&lt;p&gt;Finally, we can create a virtual host in nginx to serve the app to the ouside world in a good way.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;upstream nodejs {
      server 127.0.0.1:3000 max_fails=0; 
} 
server { 
  server_name mynodeapp.com; 

  add_header Strict-Transport-Security max-age=500; 

  location / { 
    proxy_pass  http://nodejs; 
    proxy_redirect off; 
    proxy_set_header Host $host ; 
    proxy_set_header X-Real-IP $remote_addr ; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ; 
    proxy_set_header X-Forwarded-Proto https; 
  }     }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Like this, nginx is acting as a proxy with the express service.
Do not forget to set up logs at nginx level to see what’s going on!&lt;/p&gt;

</description>
                <pubDate>Wed, 29 Jan 2014 00:00:00 +0000</pubDate>
                <link>http://mazzi.github.com/2014/Deploying-node.html</link>
                <guid isPermaLink="true">http://mazzi.github.com/2014/Deploying-node.html</guid>
            </item>
            
        
    </channel>
</rss>
