<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="https://ricma.co/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hi, I&#39;m Riccardo</title>
    <link>https://ricma.co/</link>
    <atom:link href="https://ricma.co/feed.xml" rel="self" type="application/rss+xml" />
    <description>Riccardo Macoratti personal website</description>
    <language>en</language>
    <item>
      <title>Tailwind CSS on 11ty</title>
      <link>https://ricma.co/posts/tech/tutorials/11ty-tailwind-css/</link>
      <description>&lt;p&gt;I don&#39;t think introductions are needed here, as, if you are on this page, it means you are looking for a proper solution to use &lt;a href=https://tailwindcss.com/&gt;Tailwind CSS&lt;/a&gt; on &lt;a href=https://www.11ty.dev/&gt;Eleventy&lt;/a&gt; static site generator.&lt;/p&gt;&lt;h2 id=problem-context&gt;Problem context&lt;/h2&gt;&lt;p&gt;Tailwind can be installed via &lt;a href=https://tailwindcss.com/docs/installation&gt;three main approaches&lt;/a&gt;: &lt;a href=https://vite.dev/&gt;Vite&lt;/a&gt;, &lt;a href=https://postcss.org/&gt;PostCSS&lt;/a&gt; or the &lt;a href=https://tailwindcss.com/docs/installation/tailwind-cli&gt;CLI&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;None of the three is well suited to a tool such as 11ty, where the &quot;compilation&quot; step doesn&#39;t call any well-known bundlers or frameworks.&lt;/p&gt;&lt;h2 id=simple-approach&gt;Simple approach&lt;/h2&gt;&lt;p&gt;The most straightforward approach would be to use the Tailwind CLI and some old-fashioned &lt;a href=https://www.npmjs.com/package/concurrently&gt;concurrently&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Just follow the Tailwind installation guide for the CLI and then add the &lt;code&gt;build&lt;/code&gt; and &lt;code&gt;start&lt;/code&gt; commands to your &lt;code&gt;package.json&lt;/code&gt;, like the following:&lt;/p&gt;&lt;pre class=language-json&gt;&lt;code class=language-json&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;//...&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;&quot;scripts&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&quot;build&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;npm run build:eleventy &amp;&amp; npm run build:tailwind&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&quot;build:eleventy&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;eleventy&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&quot;build:tailwind&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tailwindcss -i content/style.css -o _site/style.css --minify&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&quot;start&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;concurrently --kill-others -c=&#39;magenta,blue&#39; --names=&#39;11ty,tailwind&#39; &#39;npm run start:eleventy&#39; &#39;npm run start:tailwind&#39;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&quot;start:eleventy&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;eleventy --serve&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;&quot;start:tailwind&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tailwindcss -i content/style.css -o _site/style.css --watch&quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;//...&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally, for a touch of developer experience, add a watcher on the Tailwind CSS stylesheet in your &lt;code&gt;eleventy.config.mjs&lt;/code&gt; or similar:&lt;/p&gt;&lt;pre class=language-js&gt;&lt;code class=language-js&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;configureEleventy&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;eleventyConfig&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
  eleventyConfig&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addWatchTarget&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;./content/style.css&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Although this approach kind of works, there are two major drawbacks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;if you use &lt;a href=https://mozilla.github.io/nunjucks/templating.html#macro&gt;Nunjucks macros&lt;/a&gt; in your templates, those classes are not going to be picked up by Tailwind, unless you instruct it in the stylesheet to look for classes in the output folder, like&lt;/p&gt; &lt;pre class=language-css&gt;&lt;code class=language-css&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tailwindcss&quot;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;../_site&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;if you edit your stylesheet, you need to restart the 11ty dev server to observe the changes&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=final-solution&gt;Final solution&lt;/h2&gt;&lt;p&gt;If you search online for people that have solved this problem, they are using PostCSS and hooking into the &lt;a href=https://www.11ty.dev/docs/events/#eleventy-before&gt;&lt;code&gt;eleventy.before&lt;/code&gt;&lt;/a&gt; configuration event.&lt;/p&gt;&lt;p&gt;Having tried it, it works far better than the naive solution, but I still had problems with some classes in macros not being discovered. That&#39;s understandable: we are attaching to &lt;code&gt;eleventy.before&lt;/code&gt;, which happens before the build stage. I switched to &lt;code&gt;eleventy.after&lt;/code&gt; method, which fires at build complete.&lt;/p&gt;&lt;p&gt;See in the next section for the code.&lt;/p&gt;&lt;h2 id=tl-dr&gt;TL;DR&lt;/h2&gt;&lt;p&gt;Just write some supporting JavaScript method and place it in e.g. &lt;code&gt;config/css.mjs&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-js&gt;&lt;code class=language-js&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; fsSync &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;node:fs&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; fs &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;node:fs/promises&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; path &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;node:path&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; tailwindcss &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;@tailwindcss/postcss&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; cssnano &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;cssnano&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; postcss &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;postcss/lib/postcss&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;process&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;inputPath&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; outputPath&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; logger&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; minify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; postcssProcessor &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;postcss&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    minify &lt;span class=&quot;token operator&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;tailwindcss&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cssnano&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;preset&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;default&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;tailwindcss&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; outputDir &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;outputPath&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;fsSync&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;existsSync&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;outputDir&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;await&lt;/span&gt; fs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;outputDir&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;recursive&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; cssContent &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;await&lt;/span&gt; fs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;readFile&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;inputPath&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;utf8&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; processed &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;await&lt;/span&gt; postcssProcessor&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;cssContent&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; inputPath&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; outputPath&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  logger&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;Writing &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;outputPath&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;await&lt;/span&gt; fs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;writeFile&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;outputPath&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; processed&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;css&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; css &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  process&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then attach the &lt;code&gt;css.process&lt;/code&gt; function to the event in your &lt;code&gt;eleventy.config.mjs&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-js&gt;&lt;code class=language-js&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; css &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;./config/css.mjs&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;configureEleventy&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;eleventyConfig&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
  eleventyConfig&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token string&quot;&gt;&quot;eleventy.after&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    css&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
      &lt;span class=&quot;token string&quot;&gt;&quot;./content/style.css&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;./_site/style.css&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
      eleventyConfig&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;logger&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
      isBuild&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  eleventyConfig&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addWatchTarget&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;./content/**/*.css&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note the watcher on the Tailwind stylesheet is still there.&lt;/p&gt;&lt;h2 id=conclusion&gt;Conclusion&lt;/h2&gt;&lt;p&gt;I haven&#39;t noticed any compromise or annoying behavior with the final solution. If you happen to find one, let me know.&lt;/p&gt;</description>
      <pubDate>Sun, 18 Jan 2026 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/11ty-tailwind-css/</guid>
    </item>
    <item>
      <title>London Science Museum</title>
      <link>https://ricma.co/posts/personal/events/london-science-museum/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;me at london science museum in front a lem reproduction&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/personal/events/london-science-museum/london-science-museum-lem.webp&gt;&lt;/figure&gt;&lt;p&gt;I recently had the chance to visit the &lt;a href=https://www.sciencemuseum.org.uk&gt;London Science Museum&lt;/a&gt; on February 15, 2025, and I must say, it was an absolute blast!&lt;/p&gt;&lt;p&gt;We were mesmerized by the incredible collection of exhibits that showcased the fascinating world of science and technology. One of the highlights of our visit was the space age exhibit, which left us starstruck and eager to learn more about that curious history period.&lt;/p&gt;&lt;p&gt;But what really caught our attention was the way the museum had curated exhibits that displayed the evolution of common objects over time. It was amazing to see how everyday items had transformed over the years, and we found ourselves getting lost in the journey.&lt;/p&gt;&lt;p&gt;Unfortunately, with so much to see and explore, we didn&#39;t get to visit the entire museum in one go. Which means, we have a great excuse to go back for another round.&lt;/p&gt;&lt;p&gt;We did, however, manage to squeeze in a visit to the &quot;&lt;a href=https://www.sciencemuseum.org.uk/see-and-do/power&gt;Power Up&lt;/a&gt;&quot; section, which is a stepping stone for any retrogaming enthusiast. With a vast array of consoles from different eras, we had an amazing time exploring and playing with the various devices on display.&lt;/p&gt;&lt;p&gt;Our visit to the London Science Museum was definitely a worth experience. If you&#39;re a science buff, a tech enthusiast, or just someone who loves to learn and have fun, then this museum is definitely a must-visit destination.&lt;/p&gt;</description>
      <pubDate>Sat, 15 Feb 2025 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/personal/events/london-science-museum/</guid>
    </item>
    <item>
      <title>Chrome OS: Nerd Fonts for the terminal</title>
      <link>https://ricma.co/posts/tech/tutorials/chrome-os-nerd-fonts/</link>
      <description>&lt;p&gt;Recently I got hold of a Chrome OS device. While I usually do not sponsor Google products, I quite like this one, because although being low spec, it brings me a viable Linux environment with close to 12 hours of battery.&lt;/p&gt;&lt;p&gt;Since it is such an underpowered device, but I still want to grind some code, the usual VSCode setup is not an option, so I leaned towards a &lt;a href=https://neovim.io/&gt;Neovim&lt;/a&gt; setup, &lt;a href=https://www.lunarvim.org/&gt;LunarVim&lt;/a&gt; specifically.&lt;/p&gt;&lt;p&gt;To be able to use LunarVim a prerequisite is to use &lt;a href=https://www.nerdfonts.com/&gt;Nerd Fonts&lt;/a&gt;, a distribution of some popular programming fonts bundled with all sort of icons. To my surprise there is no straightforward way of setting a custom font, neiter in the Chrome OS UI, nor in the Terminal application itself (although the font selection on the latter is not bad).&lt;/p&gt;&lt;p&gt;But... When there is a will, there is a way, they say.&lt;/p&gt;&lt;h2 id=a-piece-of-configuration-tool-left-over-and-a-tutorial&gt;A piece of configuration tool left over and a tutorial&lt;/h2&gt;&lt;p&gt;Searching online I discovered the old configuration interface for the Terminal app, from the times it was only an SSH app, was still around and reachable.&lt;/p&gt;&lt;p&gt;Open Chrome and paste the following address in the search bar: &lt;code&gt;chrome-untrusted://terminal/html/nassh_preferences_editor.html&lt;/code&gt; (I can&#39;t put a link, since being &lt;em&gt;untrusted&lt;/em&gt;, as the name suggests, Chrome refuses to open it). A view like the following should open:&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;screenshot of chrome os terminal old preferences view&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/tutorials/chrome-os-nerd-fonts/terminal-preferences.webp&gt;&lt;figcaption&gt;Chrome OS old Terminal preferences&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;From this screen, setting a custom font is a breeze, since there is a field to input custom CSS.&lt;/p&gt;&lt;p&gt;In the &quot;Custom CSS (inline text)&quot; field, put the following lines to fetch &lt;a href=https://www.programmingfonts.org/#cascadia-code&gt;Caskaydia Cove&lt;/a&gt;, the Nerd Font version of &lt;a href=https://github.com/microsoft/cascadia-code&gt;Cascadia Cove&lt;/a&gt;:&lt;/p&gt;&lt;pre class=language-css&gt;&lt;code class=language-css&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@font-face&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Caskaydia Cove NFM&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string url&quot;&gt;&quot;https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v3.1.1/patched-fonts/CascadiaCode/Regular/CaskaydiaCoveNerdFontMono-Regular.ttf&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; normal&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; normal&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;x-row&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-rendering&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; optimizeLegibility&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-variant-ligatures&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; normal&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Last &lt;code&gt;x-row&lt;/code&gt; rules, should optimize the font for legibility and enable font ligatures, but the latter do not seem to work at the moment.&lt;/p&gt;&lt;p&gt;Finally locate the &quot;Text font family&quot; field, and prepend to the already present text the &lt;code&gt;@font-face&lt;/code&gt; &lt;code&gt;font-family&lt;/code&gt; name that you chose earlier between single quotes. In my example I should use &lt;code&gt;&#39;Caskaydia Cove NFM&#39;&lt;/code&gt;, so that the full line becomes &lt;code&gt;&#39;Caskaydia Cove NFM&#39;, &#39;Fira Code&#39;, &#39;Noto Sans Mono&#39;&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Now the terminal app should use the selected font.&lt;/p&gt;&lt;h2 id=other-fonts&gt;Other fonts&lt;/h2&gt;&lt;p&gt;You could use any font you like, as long as it is hosted somewhere on the Internet, the Terminal app will fetch it and cache it.&lt;/p&gt;&lt;p&gt;In the specific case that you want to use a font hosted on GitHub, like Nerd Fonts, you should be careful to use the link to the Raw GitHub CDN and not the one you get from the GitHub UI, otherwise you will have CORS error. Remember, after all, Chrome OS is a glorified web browser.&lt;/p&gt;&lt;p&gt;The technique that I use to find that link is to use the Network tab on the Chrome Developer Tools (&lt;code&gt;Ctrl+Shift+i&lt;/code&gt;) and try to download the font from GitHub. Once you identify the request and click on it, the URL used will be the right one. Take a look at the following screenshot:&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;screenshot of chrome dev tools network tab after downloading a font&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/tutorials/chrome-os-nerd-fonts/dev-tools-network.webp&gt;&lt;/figure&gt;&lt;p&gt;For completeness, you can find all the supported Nerd Fonts, by looking at their GitHub repo, specifically &lt;a href=https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sun, 25 Feb 2024 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/chrome-os-nerd-fonts/</guid>
    </item>
    <item>
      <title>Migrating to Spring Boot 6.1 | javac -parameters</title>
      <link>https://ricma.co/posts/tech/dev/migrating-to-spring-61-javac-parameters/</link>
      <description>&lt;p&gt;I&#39;ll start with a very loud &lt;strong&gt;sorry&lt;/strong&gt;... Would you have lost the chance to post this meme while talking of Java? Me neither.&lt;/p&gt;&lt;p&gt;Now, back to the serious stuff.&lt;/p&gt;&lt;h2 id=the-problem&gt;The problem&lt;/h2&gt;&lt;p&gt;Although I have a love-hate relationship with Java, it is what pays my bills every single day. Yes, I am a Java dev.&lt;/p&gt;&lt;p&gt;I was porting a project from Java 17 to Java 20 (or Java 21) and consequently from Spring Boot 3.0.x to Spring Boot 3.2.0 (which at the time of writing is on Milestone stage). Boot 3.2.0 used Spring 6.1 under the hood, whereas 3.0.x used 6.0.&lt;/p&gt;&lt;p&gt;The update worked like a breeze, but when I ran the test suite, there it was an error. Something along the lines of:&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;org.springframework.data.mapping.MappingException: Parameter org.springframework.data.mapping.PreferredConstructor$Parameter@c3f657893 does not have a name!&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Something inside Spring Data was not working correctly. Obviously I searched every corner of the web for a solution, but to no avail. I don&#39;t know if it was a real undocumented issue or something out of my ignorance, but either way the only way left was the debugger.&lt;/p&gt;&lt;p&gt;After some fiddling, I stumbled upon &lt;a href=https://github.com/spring-projects/spring-framework/blob/main/spring-core/src/main/java/org/springframework/core/StandardReflectionParameterNameDiscoverer.java&gt;StandardReflectionParameterNameDiscoverer.java&lt;/a&gt;:&lt;/p&gt;&lt;pre class=language-java&gt;&lt;code class=language-java&gt;&lt;span class=&quot;token annotation punctuation&quot;&gt;@Nullable&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;getParameterNames&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;Parameter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; parameters&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; parameterNames &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;parameters&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; parameters&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token class-name&quot;&gt;Parameter&lt;/span&gt; param &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; parameters&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;param&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;isNamePresent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// the debugger takes this route&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        parameterNames&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; param&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; parameterNames&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I learned &lt;code&gt;isNamePresent()&lt;/code&gt; goes to some native code to understand if the parameter name is available in the compiled bytecode. Spoiler: it wasn&#39;t. Now it was clear it was a reflection issue.&lt;/p&gt;&lt;h2 id=the-solution&gt;The solution&lt;/h2&gt;&lt;p&gt;Again, back to the search. What I found was that to have reflection metadata bundled inside the &lt;code&gt;.class&lt;/code&gt; files, the code has to be compiled with &lt;code&gt;java -parameters&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;I was not using Gradle to run the tests, but IntelliJ. And guess what? Gradle does this automatically granted you have set your &lt;code&gt;sourceCompatibility&lt;/code&gt; above 11, while IntelliJ does not. Once I configured the IDE to use &lt;code&gt;javac -parameters&lt;/code&gt; everything was back to working order.&lt;/p&gt;&lt;h2 id=the-documentation&gt;The documentation&lt;/h2&gt;&lt;p&gt;Could it be that such a big change went unannounced? Or again was it due to my ignorance?&lt;/p&gt;&lt;p&gt;The answer can be found promptly on the wiki of the Spring Framework project at &lt;a href=https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x&gt;this page&lt;/a&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;code&gt;LocalVariableTableParameterNameDiscoverer&lt;/code&gt; has been removed in 6.1. Compile your Java sources with the common Java 8+ &lt;code&gt;-parameters&lt;/code&gt; flag for parameter name retention (instead of relying on the &lt;code&gt;-debug&lt;/code&gt; compiler flag) in order to be compatible with &lt;code&gt;StandardReflectionParameterNameDiscoverer&lt;/code&gt;. With the Kotlin compiler, we recommend the &lt;code&gt;-java-parameters&lt;/code&gt; flag.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;It was indeed communicated in some way, although I would have preferred a somewhat louder announcement.&lt;/p&gt;&lt;h2 id=final-considerations&gt;Final considerations&lt;/h2&gt;&lt;p&gt;Why was this change done only on this minor version update? And why &lt;code&gt;javac&lt;/code&gt; does not put parameter names into the bytecode by default?&lt;/p&gt;&lt;p&gt;Well, as this very informative &lt;a href=https://stackoverflow.com/questions/44067477/drawbacks-of-javac-parameters-flag#44075684&gt;Stack Overflow answer&lt;/a&gt; states, nothing comes for free.&lt;/p&gt;&lt;p&gt;Summarizing the answer, there are three major concerns:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;File size&lt;/li&gt;&lt;li&gt;Compatibility&lt;/li&gt;&lt;li&gt;Exposure of sensible information&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=file-size&gt;File size&lt;/h3&gt;&lt;p&gt;As imaginable, filling the &lt;code&gt;.class&lt;/code&gt; files with reflection metadata even if not needed increases the size of the class file itself. I don&#39;t consider this a real-world problem: Java application tend to be chunky anyway, a couple of megs more are not &lt;em&gt;the&lt;/em&gt; issue here.&lt;/p&gt;&lt;h3 id=compatibility&gt;Compatibility&lt;/h3&gt;&lt;p&gt;Although changing the parameter names doesn&#39;t hurt the binary compatibility of bytecode in the JVM, Java embraces very strictly the segregation pattern and treats them as local variables. You shouldn&#39;t really depend on them.&lt;/p&gt;&lt;p&gt;But, sometimes reflection is convenient, think JSON to class mapping or ORMs. I take convenience over dependence every day, especially because Java is already too verbose. Adding other boilerplate to manually map Jackson POJOs is one step more in the direction of &quot;too much&quot;.&lt;/p&gt;&lt;h3 id=exposure-of-sensible-information&gt;Exposure of sensible information&lt;/h3&gt;&lt;p&gt;This can be true. If an attacker gains knowledge of the &lt;code&gt;.class&lt;/code&gt; file source (looking at you Log4j), exposing the internal parameter names inherently broadens the attack surface area.&lt;/p&gt;&lt;p&gt;Hopefully my code artifacts will stay well hidden and protected behind some server and not reach any unwanted end user.&lt;/p&gt;&lt;h1 id=useful-links&gt;Useful links&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=https://stackoverflow.com/questions/44067477/drawbacks-of-javac-parameters-flag&gt;Stack Overflow on the drawbacks of &lt;code&gt;-parameters&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x&gt;Upgrading to Spring Framework 6.x&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/spring-projects/spring-data-jpa/issues/1129&gt;Spring Data JPA GitHub issue showing an example of error&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
      <pubDate>Fri, 22 Sep 2023 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/dev/migrating-to-spring-61-javac-parameters/</guid>
    </item>
    <item>
      <title>Hack the Router! Technicolor DGA4132</title>
      <link>https://ricma.co/posts/tech/tutorials/hack-dga4132/</link>
      <description>&lt;p&gt;Let&#39;s start saying that I &lt;strong&gt;hate&lt;/strong&gt; throwing away working stuff, especially if it means producing useless e-waste.&lt;/p&gt;&lt;p&gt;So, I found myself owning two vendor-locked routers, given to me by my previous ISPs, Fastweb and TIM (yes, I am based in Italy). The models were both Technicolor and both very similar: &lt;a href=https://www.fastweb.it/adsl-fibra-ottica/dettagli/modem-fastweb-fastgate/&gt;DGA4131&lt;/a&gt;, also known as FASTGate, and &lt;a href=https://www.tim.it/assistenza/assistenza-tecnica/guide-manuali/modem-timhub&gt;DGA4132&lt;/a&gt;, also known as TIM HUB.&lt;/p&gt;&lt;p&gt;Since they looked like capable models, I decided to search if they actually were any good and if there was any possibility to free them from the vendor lock. Not only I discovered they were better than my current model (a &lt;a href=https://www.tp-link.com/uk/home-networking/dsl-modem-router/archer-vr1210v/&gt;TP-Link Archer VR1210v&lt;/a&gt;), but also that there existed a project to hack them called &lt;a href=https://hack-technicolor.readthedocs.io&gt;Hacking Technicolor Gateways&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Although the model are quite the same, I chose to use the DGA4132 (TIM HUB) purely due to its shape: it is more like a brick and can be hung on the wall, whereas the DGA4131 (FASTGate) is made to stand on a surface.&lt;/p&gt;&lt;p&gt;I decided to document my journey to this router unlocking process, since most of the documentation is in Italian and I also wanted to compile a vademecum for the future me in case I needed it.&lt;/p&gt;&lt;h2 id=hacking-101-first-steps&gt;Hacking 101 - First steps&lt;/h2&gt;&lt;p&gt;A summary of the equipment you&#39;ll need to perform the feat:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The router itself (duh!)&lt;/li&gt;&lt;li&gt;Its power supply (or a 18v/3A equivalent)&lt;/li&gt;&lt;li&gt;An ethernet cable&lt;/li&gt;&lt;li&gt;A Linux, Windows or Mac computer with an ethernet port (a USB adapter is good as well)&lt;/li&gt;&lt;li&gt;A working internet connection (different from the one you are configuring)&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=hacking-procedure&gt;Hacking procedure&lt;/h2&gt;&lt;h3 id=check-your-firmware-version&gt;Check your firmware version&lt;/h3&gt;&lt;p&gt;Making things short, there are three types of firmwares that can be loaded on your router:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Type 1&lt;/strong&gt;: you are halfway there, you can load a Type 2 and root from there&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Type 2&lt;/strong&gt;: that is the firmware you want on the DGA4132, it is directly rootable, so most of the hassle is already done&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Type 3&lt;/strong&gt;: complicated stuff, we won&#39;t consider this case in the scope of this guide&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In order to check which version you have, log in to the router interface (usually its &lt;a href=http://192.168.1.1&gt;http://192.168.1.1&lt;/a&gt;) and take note of the firmware version. It should be something like &lt;code&gt;2.1.0_003&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Then go to the Hacking Technicolor Gateways &lt;a href=https://hack-technicolor.readthedocs.io/en/latest/Repository/#tim-tim-hub&gt;firmware page for DGA4132&lt;/a&gt; and identify the firmware with the version you took note of before.&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;firmware repository dga4132 screenshot&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/tutorials/hack-dga4132/dga4132-firmware-list.webp&gt;&lt;/figure&gt;&lt;p&gt;Unfortunately, versions are not explicitly written into the table, but you should hover on the HTTP or Torrent links to compare. Once you identified your version, the first column will tell you which Type your firmware is and the second column will give you the Homeware version.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Homeware&lt;/strong&gt; is the name of Technicolor router OS. It is based on some version of OpenWrt, so it retains 90% of the compatibility. Below, there is a table explaining the forking.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Homeware&lt;/th&gt;&lt;th&gt;OpenWrt&lt;/th&gt;&lt;th&gt;DGA4132&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;&amp;lt; 15&lt;/td&gt;&lt;td&gt;&amp;lt;= 2.0.0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;18(.3)&lt;/td&gt;&lt;td&gt;15.05.1&lt;/td&gt;&lt;td&gt;&gt;= 2.1.0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt;r13941 (between 19 and 21)&lt;/td&gt;&lt;td&gt;&gt;= 2.3.0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;If you obtained:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Type 1 and your firmware version is &gt;= 2.0.0: proceed with the method I am proposing below.&lt;/li&gt;&lt;li&gt;Type 1 and your firmware version is &amp;lt; 2.0.0: proceed with the method I am proposing below (but when noted follow the additional instructions).&lt;/li&gt;&lt;li&gt;Type 2: good to go, just skip the Type 2 firmware flashing and proceed to the actual rooting.&lt;/li&gt;&lt;li&gt;Type 3: outside the scope of this guide (if interested you can look &lt;a href=https://www.ilpuntotecnico.com/forum/index.php/topic,79458.msg239670.html#msg239670&gt;this forum topic&lt;/a&gt;).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Right now you are probably wondering what you should do if you obtained a &lt;strong&gt;???&lt;/strong&gt; Type; well, probably nobody tested that version that well, so it is safer to treat it as a Type 3.&lt;/p&gt;&lt;h3 id=downloading-firmwares&gt;Downloading firmwares&lt;/h3&gt;&lt;p&gt;Before starting to get the hands dirty, some files are needed on your local hard drive. I am dedicating a section to this, since it is not easy to get hold of them. If you noticed, in the screenshot above, the HTTP download is marked with a &lt;code&gt;*&lt;/code&gt; and that is because you can download firmwares over HTTP only if you are under TIM network.&lt;/p&gt;&lt;p&gt;In the contrary case, you should resort to Torrent. I believe there already are a ton of tutorials on how to set up a torrent client, so I won&#39;t be writing another.&lt;/p&gt;&lt;p&gt;You should download:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/hack-technicolor/hack-technicolor/blob/master/torrents/vbnt-s/AGTHP_1.0.3_CLOSED.rbi.torrent?raw=true&quot;&gt;1.0.3_CLOSED&lt;/a&gt; (only if you currently are on a Type 1)&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/kevdagoat/hack-technicolor/blob/master/torrents/vbnt-s/AGTHP_2.2.3_003_CLOSED.rbi.torrent?raw=true&quot;&gt;2.2.3_CLOSED&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;w-full flex flex-col text-fg bg-mg rounded-2xl opacity-80&quot;&gt;&lt;div class=&quot;flex flex-row gap-4 items-center text-2xl p-4 bg-mg brightness-70 rounded-t-2xl&quot;&gt;&lt;i class=&quot;ph ph-siren&quot;&gt;&lt;/i&gt;&lt;strong class=text-fg&gt;Note&lt;/strong&gt;&lt;/div&gt;&lt;div class=p-4&gt;You aren&#39;t going to need 1.0.3_CLOSED if you are already on a Type 2 firmware, since this is a Type 2 known to work and is needed for the firmare downgrade at next chapter, which you should not perform if you are already on Type 2.&lt;/div&gt;&lt;/div&gt;&lt;h3 id=changing-firmware-only-for-type-1&gt;Changing firmware (only for Type 1)&lt;/h3&gt;&lt;p&gt;In order to change the firmware to a Type 2 firmware, such as the 1.0.3_CLOSED, it is necessary to perform the following steps:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Reach to the back of your DGA4132 and take note of the &quot;Access Key&quot; written there, typically on the lower right.&lt;/li&gt;&lt;li&gt;Go to the router login page, that if you didn&#39;t change any settings is at &lt;a href=http://192.168.1.1&gt;http://192.168.1.1&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Once there, insert &lt;code&gt;admin&lt;/code&gt; as username and your access key as password.&lt;/li&gt;&lt;li&gt;In the &quot;Gateway&quot; section of the interface you should be able to see the function to update your firmware manually.&lt;/li&gt;&lt;li&gt;From there just select the 1.0.3_CLOSED &lt;code&gt;.rbi&lt;/code&gt; file that you downloaded earlier and proceed with the flashing.&lt;/li&gt;&lt;li&gt;Finally reset the DGA4132 to factory settings using the pinhole on the back.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=rooting&gt;Rooting&lt;/h3&gt;&lt;p&gt;The actual rooting process is very simple compared to all we did on the way here. You&#39;ll be using a tool called &lt;a href=https://github.com/mswhirl/autoflashgui&gt;AutoFlashGUI&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;AutoFlashGUI is written using the Python language, so a necessary step is to configure the Python environment in order to install the necessary dependencies. I won&#39;t guide you through the install of Python, there already are a lot of nice tutorials out there. This is the &lt;a href=https://wiki.python.org/moin/BeginnersGuide/Download&gt;official guide&lt;/a&gt;. Be sure to install a recent version of Python (starting from Python 3.7) together with the included graphical library based on Tkinter.&lt;/p&gt;&lt;p&gt;Then, I&#39;ll assume a Python interpreter is installed, available in your &lt;code&gt;PATH&lt;/code&gt; and you are running on something resembling a terminal (a Windows CMD, a Linux or Mac &lt;code&gt;bash&lt;/code&gt; or even a simple &lt;code&gt;sh&lt;/code&gt;).&lt;/p&gt;&lt;p&gt;First of all, let&#39;s begin by downloading the actual utility code clicking &lt;a href=https://github.com/mswhirl/autoflashgui/archive/master.zip&gt;here&lt;/a&gt;. The decompress the archive to a folder of your choice. For this tutorial &lt;code&gt;~/download/autoflashgui&lt;/code&gt; will be used.&lt;/p&gt;&lt;p&gt;Navigate to the aforementioned directory and create a &lt;em&gt;virtualenv&lt;/em&gt; to contain all the dependencies:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/donwload/autoflashgui
python &lt;span class=&quot;token parameter variable&quot;&gt;-m&lt;/span&gt; venv .venv
&lt;span class=&quot;token builtin class-name&quot;&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;robobrowser&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;.3&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The you can finally start the program, from the very same terminal window:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;python autoflashgui.py&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A window just like the following should appear.&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;screenshot of the autoflashgui utility&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/tutorials/hack-dga4132/autoflashgui.webp&gt;&lt;/figure&gt;&lt;p&gt;Be sure to have all configured as in the image:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Select &quot;Generic (Advanced DDNS)&quot;.&lt;/li&gt;&lt;li&gt;Use &lt;code&gt;192.168.1.1&lt;/code&gt; as Target IP.&lt;/li&gt;&lt;li&gt;Username should be &lt;code&gt;admin&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Password should be &lt;code&gt;admin&lt;/code&gt; as well.&lt;/li&gt;&lt;li&gt;Be very sure the the &quot;Flash firmware?&quot; option is &lt;strong&gt;empty and deactivated&lt;/strong&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Finally just click the &quot;Run&quot; button and wait. Do not turn the router off or do anything else, just wait for the process to complete.&lt;/p&gt;&lt;p&gt;In order to check if everything went according to plan, we need to log in to the system using a secure remote shell called SSH. Since in 2023 a SSH client is available in most OSes as the &lt;code&gt;ssh&lt;/code&gt; executable, I won&#39;t cover the installation process.&lt;/p&gt;&lt;p&gt;Unfortunately the Homeware OS does not use a full blown version of OpenSSH, but a lighter and smaller alternative called &lt;a href=https://matt.ucc.asn.au/dropbear/dropbear.html&gt;Dropbear&lt;/a&gt;. Due to this reason, some more configuration is needed.&lt;/p&gt;&lt;p&gt;Under your home directory (user directory for the Windows folks) create the &lt;code&gt;.ssh&lt;/code&gt; folder and inside of that a &lt;code&gt;config&lt;/code&gt; file:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; ~/.ssh
&lt;span class=&quot;token function&quot;&gt;touch&lt;/span&gt; ~/.ssh/config&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With whatever editor you like, write this contents to the file:&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;Host router
    User root
    HostName 192.168.1.1
    HostKeyAlgorithms=+ssh-rsa
    KexAlgorithms=+diffie-hellman-group1-sha1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you should be able to access your router with the following command:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; router
root@192.168.1.1&#39;s password:&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you obtain a prompt similar to the following, the rooting procedure went well:&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;
BusyBox v1.23.2 (2020-04-24 18:04:19 UTC) built-in shell (ash)

  _______              __           __              __             
 |_     _|.-----.----.|  |--.-----.|__|.----.-----.|  |.-----.----.
   |   |  |  -__|  __||     |     ||  ||  __|  _  ||  ||  _  |   _|
   |___|  |_____|____||__|__|__|__||__||____|_____||__||_____|__|  
                 N E X T   G E N E R A T I O N   G A T E W A Y
 --------------------------------------------------------------------
 NG GATEWAY SIGNATURE DRINK
 --------------------------------------------------------------------
  * 1 oz Vodka          Pour all ingredients into mixing
  * 1 oz Triple Sec     tin with ice, strain into glass.
  * 1 oz Orange juice
 --------------------------------------------------------------------


Software program:

Copyright � 2018 - Technicolor Delivery Technology SAS and/or its Group Company (Technicolor)

All Rights Reserved


This program contains proprietary information which is a trade secret of Technicolor
and also is protected by intellectual property as an unpublished work 
under applicable Copyright laws/right of authorship. 

This program is also subject to some patent and pending patent applications. 
Technicolor� is registered trademark and trade name of Technicolor group company,
and shall not be used in any manner without express written from Technicolor. 

The use of the program and documentation is strictly limited to your own internal
evaluation of the product embedding such program, unless expressly agreed otherwise
by Technicolor under a specific agreement. 

Recipient is to retain this program in confidence and is not permitted to use
or make copies thereof other than as permitted in a written agreement with Technicolor,
unless otherwise expressly allowed by applicable laws. 

Recipient is not allowed to make any copy, decompile, reverse engineer, disassemble,
and attempt to derive the source code of, modify, or
create derivative works of the program, any update, or any part thereof. 

Any violation or attempt to do so is a violation of the rights of Technicolor.
If you or any person under your control or authority breach this restriction,
you may be subject to prosecution and damages.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we can proceed to the next section, which is &lt;em&gt;bank planning&lt;/em&gt;. The following sections are taken and directly paraphrased from the &lt;a href=https://hack-technicolor.readthedocs.io&gt;Hacking Technicolor Gateways&lt;/a&gt; itself.&lt;/p&gt;&lt;h3 id=bank-planning-original&gt;Bank planning (&lt;a href=https://hack-technicolor.readthedocs.io/en/stable/Hacking/PostRoot/&gt;original&lt;/a&gt;)&lt;/h3&gt;&lt;p&gt;The DGA4132 router has two &quot;&lt;em&gt;banks&lt;/em&gt;&quot;, that to say two zones of memory where two different firmware versions can lay and that you can boot from. In order to make use of all the available software and mods, you should maintain your router always in the optimal bank configuration.&lt;/p&gt;&lt;p&gt;The optimal bank plan should look something like this:&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;/proc/banktable/active
bank_1
/proc/banktable/activeversion
Unknown
/proc/banktable/booted
bank_2
/proc/banktable/bootedversion
xx.x.xxxx-...&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Summarizing: bank 1 should be active and left alone, bank 2 will be used to boot from and apply all the sweet software stuff.&lt;/p&gt;&lt;p&gt;To check your current bank plan, launch:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token function&quot;&gt;find&lt;/span&gt; /proc/banktable &lt;span class=&quot;token parameter variable&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;token parameter variable&quot;&gt;-print&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;;&#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;;&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the output does not match the above, just lunch the following very long script:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token comment&quot;&gt;# Ensure two banks match in sizes&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-c&lt;/span&gt; bank_ /proc/mtd&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; bank_1 /proc/mtd &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cut&lt;/span&gt; -d&lt;span class=&quot;token string&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-f2&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; bank_2 /proc/mtd &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cut&lt;/span&gt; -d&lt;span class=&quot;token string&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-f2&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Clone and verify firmware into bank_2 if applicable&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;bank_1&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
mtd &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; bank_2 &lt;span class=&quot;token function&quot;&gt;write&lt;/span&gt; /dev/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; bank_1 /proc/mtd &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cut&lt;/span&gt; -d: &lt;span class=&quot;token parameter variable&quot;&gt;-f1&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; bank_2 &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; Verifying &lt;span class=&quot;token punctuation&quot;&gt;..&lt;/span&gt;. &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;sha256sum /dev/&lt;span class=&quot;token punctuation&quot;&gt;$(&lt;/span&gt;grep bank_1 /proc/mtd &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cut&lt;/span&gt; -d: -f1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; /dev/&lt;span class=&quot;token punctuation&quot;&gt;$(&lt;/span&gt;grep bank_2 /proc/mtd &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cut&lt;/span&gt; -d: -f1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cut&lt;/span&gt; -d&lt;span class=&quot;token string&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-f1&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-eq&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; Clone verification failed, retry&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Make a temp copy of overlay for booted firmware&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; /tmp/bank_overlay_backup
&lt;span class=&quot;token comment&quot;&gt;# Clean up jffs2 space by removing existing old overlays&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; /overlay/*
&lt;span class=&quot;token comment&quot;&gt;# Use the previously made temp copy as overlay for bank_2&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; /tmp/bank_overlay_backup /overlay/bank_2
&lt;span class=&quot;token comment&quot;&gt;# Activate bank_1&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; bank_1 &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /proc/banktable/active
&lt;span class=&quot;token comment&quot;&gt;# Make sure above changes get written to flash&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;sync&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Erase firmware in bank_1&lt;/span&gt;
mtd erase bank_1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Emulate system crash to hard reboot&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; c &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /proc/sysrq-trigger&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you router should slowly reboot. Once up again, launch the following again to check if the optimal bank configuration has been reached:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token function&quot;&gt;find&lt;/span&gt; /proc/banktable &lt;span class=&quot;token parameter variable&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;token parameter variable&quot;&gt;-print&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;;&#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;;&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let&#39;s now upgrade to a more recent version of the DGA4132 firmware.&lt;/p&gt;&lt;h3 id=upgrade-to-a-recent-firmware-original&gt;Upgrade to a recent firmware (&lt;a href=https://hack-technicolor.readthedocs.io/en/stable/Upgrade/&gt;original&lt;/a&gt;)&lt;/h3&gt;&lt;p&gt;Since to root the devices, you probably have downgraded your device to an older version, now it is the time to safely update it, while retaining the root access. Obviously this is not a mandatory step, but since routers in a home environment are often the last barrier to the Internet, the more updates the better.&lt;/p&gt;&lt;p&gt;In the &quot;Downloading firmwares&quot; section, I told you to download firmware version 2.2.3_CLOSED. That is because it is the last version still working with the stable version of Answel custom GUI that will be installed in the next chapter.&lt;/p&gt;&lt;p&gt;You will need to copy files to the devices and for that you need to use &lt;code&gt;scp -O&lt;/code&gt; which tells &lt;code&gt;scp&lt;/code&gt; to use the old SCP protocol instead of the newer SFTP, unsupported on Homeware.&lt;/p&gt;&lt;p&gt;As a first step, let&#39;s do a backup of the current and working configuration. SSH into the device and launch:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-C&lt;/span&gt; /overlay &lt;span class=&quot;token parameter variable&quot;&gt;-cz&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-f&lt;/span&gt; /tmp/backup-&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-I&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;.tar.gz &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then on your local machine SCP the backup:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;scp&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-O&lt;/span&gt; router:/tmp/backup-&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-I&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;.tar.gz &lt;span class=&quot;token builtin class-name&quot;&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now the updating process can start. I&#39;ll assume you have the &lt;code&gt;.rbi&lt;/code&gt; file at &lt;code&gt;~/download/2.2.3_CLOSED.rbi&lt;/code&gt;. So, copy the firmware to the device &lt;code&gt;/tmp/&lt;/code&gt; folder:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;scp&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-O&lt;/span&gt; ~/download/2.2.3_CLOSED.rbi router:/tmp/new.rbi&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then SSH into the device and extract it:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/tmp/new.rbi&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;bli_parser &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Please wait...&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;bli_unseal &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;dd&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/tmp/new.bin&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Erase all the current configuration from the device:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally launch this big command to secure root access:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;/etc
&lt;span class=&quot;token function&quot;&gt;chmod&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;755&lt;/span&gt; /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;/etc
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;echo root:root | chpasswd
sed -i &#39;s#/root:.*&#92;&lt;span class=&quot;token variable&quot;&gt;$#&lt;/span&gt;/root:/bin/ash#&#39; /etc/passwd
sed -i -e &#39;s/#//&#39; -e &#39;s#askconsole:.*&#92;&lt;span class=&quot;token variable&quot;&gt;$#&lt;/span&gt;askconsole:/bin/ash#&#39; /etc/inittab
uci -q set &#92;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;uci show firewall &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;$(&lt;/span&gt;fw3 &lt;span class=&quot;token parameter variable&quot;&gt;-q&lt;/span&gt; print &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;egrep&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;iptables -t filter -A zone_lan_input -p tcp -m tcp --dport 22 -m comment --comment &#92;&quot;!fw3: .+&#92;&quot; -j DROP&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;s/^iptables.&#92;+fw3: &#92;(.&#92;+&#92;)&#92;&quot;.&#92;+/&#92;1/p&#39;&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; | &#92;
sed -n -e &lt;span class=&quot;token entity&quot; title=&#39;&#92;&quot;&#39;&gt;&#92;&quot;&lt;/span&gt;s/&#92;(.&#92;+&#92;).name=&#39;.&#92;+&#39;$/&lt;span class=&quot;token entity&quot; title=&#92;1&gt;&#92;1&lt;/span&gt;/p&lt;span class=&quot;token entity&quot; title=&#39;&#92;&quot;&#39;&gt;&#92;&quot;&lt;/span&gt;).target=&#39;ACCEPT&#39;
uci add dropbear dropbear
uci rename dropbear.@dropbear[-1]=afg
uci set dropbear.afg.enable=&#39;1&#39;
uci set dropbear.afg.Interface=&#39;lan&#39;
uci set dropbear.afg.Port=&#39;22&#39;
uci set dropbear.afg.IdleTimeout=&#39;600&#39;
uci set dropbear.afg.PasswordAuth=&#39;on&#39;
uci set dropbear.afg.RootPasswordAuth=&#39;on&#39;
uci set dropbear.afg.RootLogin=&#39;1&#39;
uci set dropbear.lan.enable=&#39;0&#39;
uci commit dropbear
/etc/init.d/dropbear enable
/etc/init.d/dropbear restart
rm /overlay/&#92;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;/etc/rc.local
source /rom/etc/rc.local
&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;/etc/rc.local
&lt;span class=&quot;token function&quot;&gt;chmod&lt;/span&gt; +x /overlay/&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;/etc/rc.local
&lt;span class=&quot;token function&quot;&gt;sync&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let the show begin. Initiate the flashing procedure:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token comment&quot;&gt;# Erase and write new firmware into booted bank&lt;/span&gt;
mtd &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/tmp/new.bin&quot;&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; /proc/banktable/booted&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Emulate system crash to hard reboot&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; c &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /proc/sysrq-trigger&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When the process ends, the device will crash and reboot. First thing to do once you regain SSH access to it, is change the root password using:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;passwd&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=install-ansuel-custom-gui-tch-nginx-gui&gt;Install Ansuel custom GUI (tch-nginx-gui)&lt;/h3&gt;&lt;p&gt;As a final step, a custom GUI unlocking most of the router functionality is needed. Luckily for us, Ansuel did a great job developing one. You can find it on the &lt;a href=https://github.com/Ansuel/tch-nginx-gui&gt;GitHub page&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Making a long story short, first download the GUI from &lt;a href=https://raw.githubusercontent.com/Ansuel/gui-dev-build-auto/master/GUI.tar.bz2&gt;this page&lt;/a&gt;. I&#39;ll assume the archive lies at &lt;code&gt;~/download/GUI.tar.bz2&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Copy the archive to the device using SCP:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;scp&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-O&lt;/span&gt; ~/download/GUI.tar.bz2 router:/tmp/GUI.tar.bz2&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then SSH into the device and launch the following commands:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;bzcat /tmp/GUI.tar.bz2 &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-C&lt;/span&gt; / &lt;span class=&quot;token parameter variable&quot;&gt;-xvf&lt;/span&gt; -
/etc/init.d/rootdevice force&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Wait for the process to complete and reboot (if the device does not reboot by itself).&lt;/p&gt;&lt;p&gt;Congratulation the hard part is finished, your devices is rooter and its power completely unleashed. Have fun!&lt;/p&gt;&lt;h2 id=a-bonus-step-sqm&gt;A bonus step: SQM&lt;/h2&gt;&lt;p&gt;You probably noticed (or not, very luckily for you) that if you bomb router with packets, e.g. when someone else on the network is watching a 4K video, updating Windows or downloading something, the connection drops. That can be a real PITA if you are playing online or have a running download server.&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;the office michael scott fast meme&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/tutorials/hack-dga4132/michael-scott-fast.webp&gt;&lt;/figure&gt;&lt;p&gt;This issue is called &lt;a href=https://www.bufferbloat.net/projects/bloat/wiki/More_about_Bufferbloat/#what-is-bufferbloat&gt;bufferbloat&lt;/a&gt; and affects a lot of routing devices. Read &lt;a href=https://randomneuronsfiring.com/best-bufferbloat-analogy-ever/&gt;Best Bufferbloat Analogy - Ever&lt;/a&gt; to understand bufferbloat better.&lt;/p&gt;&lt;p&gt;The bad news is that you cannot really eliminate it, especially if you run a stock firmware. The good news is that since Homeware is basically OpenWrt, it is possible to install a package called SQM to mitigate bufferbloat. SQM stays for &lt;strong&gt;S&lt;/strong&gt;mart &lt;strong&gt;Q&lt;/strong&gt;ueue &lt;strong&gt;M&lt;/strong&gt;anagement and is a term to group a series of algorithm used to manage packet queues (or really any queue) in a &quot;nicer&quot; way, considering package flow and congestion as parameters in the game.&lt;/p&gt;&lt;h3 id=test-for-bufferbloat&gt;Test for bufferbloat&lt;/h3&gt;&lt;p&gt;Before pointing fingers, perform a bufferbloat test. There are some easy online tools for that:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=https://www.waveform.com/tools/bufferbloat&gt;Waveform&lt;/a&gt;: it gives you a very informative score of your bufferbloat, but is a little biased due to wanting you to buy one of their devices.&lt;/li&gt;&lt;li&gt;&lt;a href=https://fast.com/&gt;Fast&lt;/a&gt;: an unbiased Netflix tool to do a speed test and measure bufferbloat, once you press the &lt;em&gt;Show more info&lt;/em&gt; link.&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;screenshot of waveform bufferbloat test after sqm applied&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/tutorials/hack-dga4132/waveform-bufferbloat-test.webp&gt;&lt;/figure&gt;&lt;p&gt;Once you identified bufferbloat as your culprit, proceed to apply the SQM fix.&lt;/p&gt;&lt;h3 id=configure-openwrt-packages-for-homeware-18&gt;Configure OpenWrt packages for Homeware 18&lt;/h3&gt;&lt;p&gt;To install SQM, we can use the &lt;code&gt;opkg&lt;/code&gt; package manager of OpenWrt. In the current state Homeware 18 is referencing an hardware branch that doesn&#39;t exist, so an &lt;code&gt;opkg update&lt;/code&gt; will fail.&lt;/p&gt;&lt;p&gt;Luckily &lt;a href=https://www.macoers.com/blog/antonio-macolino/repository_openwrt_homeware_18_brcm63xx_tch&gt;Macoers&lt;/a&gt; has provided some packages for the DGA4132 on Homeware 18.&lt;/p&gt;&lt;p&gt;SSH into the router as root.&lt;/p&gt;&lt;p&gt;Check that &lt;code&gt;/etc/opkg.conf&lt;/code&gt; contains the following rows:&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;arch all 100
arch noarch 100
arch arm_cortex-a9 200
arch arm_cortex-a9_neon 300&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then, download the following &lt;code&gt;IPK&lt;/code&gt; packages and proceed to install them all:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-k&lt;/span&gt; https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/base/openssl-util_1.0.2t-1_arm_cortex-a9_neon.ipk &lt;span class=&quot;token parameter variable&quot;&gt;--output&lt;/span&gt; /tmp/openssl-util_1.0.2t-1_arm_cortex-a9_neon.ipk
&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-k&lt;/span&gt; https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/base/libopenssl_1.0.2t-1_arm_cortex-a9_neon.ipk &lt;span class=&quot;token parameter variable&quot;&gt;--output&lt;/span&gt; /tmp/libopenssl_1.0.2t-1_arm_cortex-a9_neon.ipk
&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-k&lt;/span&gt; https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/packages/wget_1.19.5-4_arm_cortex-a9_neon.ipk &lt;span class=&quot;token parameter variable&quot;&gt;--output&lt;/span&gt; /tmp/wget_1.19.5-4_arm_cortex-a9_neon.ipk
opkg &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; --force-overwrite /tmp/*.ipk&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally check that &lt;code&gt;/etc/opkg.conf&lt;/code&gt; contains the following rows:&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;src/gz chaos_calmer_base_macoers https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/base
src/gz chaos_calmer_packages_macoers https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/packages
src/gz chaos_calmer_luci_macoers https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/luci
src/gz chaos_calmer_routing_macoers https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/routing
src/gz chaos_calmer_telephony_macoers https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/telephony
src/gz chaos_calmer_core_macoers https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/target/packages&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If it does, do nothing. In case it doesn&#39;t, the best strategy is to put them inside the &lt;code&gt;/etc/opkg/customfeeds.conf&lt;/code&gt; file.&lt;/p&gt;&lt;p&gt;Finally launch a &lt;code&gt;opkg update&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=install-sqm&gt;Install SQM&lt;/h3&gt;&lt;p&gt;To install the OpenWrt SQM package do:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;opkg &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; sqm-scripts&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then enable it to start at boot and start it now:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;/etc/init.d/sqm &lt;span class=&quot;token builtin class-name&quot;&gt;enable&lt;/span&gt;
/etc/init.d/sqm start&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=the-fun-part-trial-and-error&gt;The fun part: trial and error&lt;/h2&gt;&lt;p&gt;Installing SQM is not enough. For it to be effective, you should apply the right configuration.&lt;/p&gt;&lt;p&gt;Open the &lt;code&gt;/etc/config/sqm&lt;/code&gt; file and edit the contents to your liking. I will post my configuration below, you can take it as example. I don&#39;t really understand all the values there, I just edited the interface name and download and upload speed.&lt;/p&gt;&lt;pre class=language-plaintext&gt;&lt;code class=language-plaintext&gt;config queue &#39;wan&#39;
        option enabled &#39;1&#39;
        option interface &#39;wanptm0&#39;
        option download &#39;47500&#39;
        option upload &#39;9020&#39;
        option qdisc &#39;fq_codel&#39;
        option script &#39;simple.qos&#39;
        option qdisc_advanced &#39;0&#39;
        option ingress_ecn &#39;ECN&#39;
        option egress_ecn &#39;ECN&#39;
        option qdisc_really_really_advanced &#39;0&#39;
        option itarget &#39;auto&#39;
        option etarget &#39;auto&#39;
        option linklayer &#39;none&#39;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To find the interface name, just launch this command:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;uci get network.wan.ifname&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To populate download and upload speeds, I used a trial and error process.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Detach all your devices from perfoming any relevant network operations.&lt;/li&gt;&lt;li&gt;Perform a speed test using &lt;a href=https://fast.com/&gt;Fast&lt;/a&gt;. Take note of the download and upload speeds, e.g. 50Mbps and 10Mbps.&lt;/li&gt;&lt;li&gt;Populate &lt;code&gt;option download&lt;/code&gt; and &lt;code&gt;option upload&lt;/code&gt; with the obtained speed multiplied by 1000, e.g. 50000 and 10000.&lt;/li&gt;&lt;li&gt;Perform a &lt;a href=https://www.waveform.com/tools/bufferbloat&gt;Waveform bufferbloat test&lt;/a&gt;. This is your baseline score, e.g. F.&lt;/li&gt;&lt;li&gt;Remove 1% from the uplink and downlink speeds. E.g. 49500 and 9900.&lt;/li&gt;&lt;li&gt;Reload the SQM service using &lt;code&gt;/etc/init.d/sqm restart&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Retry from point 4, until you get better scores, e.g. A or A+.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;If you reach an upper bound and you can&#39;t improve your score anymore, you can try applying a different percentage for downlink and uplink speeds. For reference my optimum percentages were 95% of download speed and 82% of upload.&lt;/p&gt;&lt;p&gt;You will pay some speed, but your network will maintain its performance even when under heavy load.&lt;/p&gt;&lt;h2 id=useful-links&gt;Useful links&lt;/h2&gt;&lt;p&gt;The following are the sources of my information. Some of the links you can find directly in the related paragraph.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=https://hack-technicolor.readthedocs.io&gt;Hacking Technicolor Gateways&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.ilpuntotecnico.com/forum/index.php?topic=81542.0&quot;&gt;ilpuntotecnico DGA4132 forum topic [ITA]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://www.ilpuntotecnico.com/forum/index.php/topic,78162.0.html&gt;ilpuntotecnico DGA4132 unlock forum topic [ITA]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://www.ilpuntotecnico.com/forum/index.php/topic,79458.msg239670.html#msg239670&gt;ilpuntotecnico DGA4132 Type 3 or ??? guide [ITA]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://www.ilpuntotecnico.com/forum/index.php/topic,81461.0.html&gt;ilpuntotecnico Ansuel custom GUI forum topic [ITA]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/Ansuel/tch-nginx-gui&gt;Ansuel custom GUI repository&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.ilpuntotecnico.com/forum/index.php?topic=85190.0&quot;&gt;SQM on DGA4132 [ITA]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://www.macoers.com/blog/antonio-macolino/repository_openwrt_homeware_18_brcm63xx_tch&gt;OpenWrt packages on Homeware 18 [ITA]&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://www.waveform.com/tools/bufferbloat&gt;Waveform bufferbloat test&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
      <pubDate>Tue, 19 Sep 2023 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/hack-dga4132/</guid>
    </item>
    <item>
      <title>Bash | Tips &amp; Tricks I would have wanted to know when I started</title>
      <link>https://ricma.co/posts/tech/tutorials/bash-tip-tricks/</link>
      <description>&lt;p&gt;When I started using the Bash (&lt;strong&gt;B&lt;/strong&gt;ourne &lt;strong&gt;A&lt;/strong&gt;gain) shell and producing my subsequent first scripts, I treated it just like the old plain &lt;strong&gt;B&lt;/strong&gt;ourne shell, the one we all already love and use in quite a few environments. Fortunately, Bash is much more than it appears to the eye and could be a real game changer in the life of the average developer.&lt;/p&gt;&lt;p&gt;This article will give more emphasis to the scripting side of Bash, but the occasional concept can be adapted to be applied when used as a command launcher in an interactive way.&lt;/p&gt;&lt;p&gt;Regarding scripts, although the strict POSIX compatibility is sometimes required, preventing us from using Bash directly and reverting to the standard Bourne shell capabilities, it is often easier and quicker to use &lt;em&gt;bashisms&lt;/em&gt; (Bash-only features) to write our scripts.&lt;/p&gt;&lt;p&gt;So below let&#39;s see some tricks I learned throughout my Bash adventure.&lt;/p&gt;&lt;div class=&quot;w-full flex flex-col text-fg bg-mg rounded-2xl opacity-80&quot;&gt;&lt;div class=&quot;flex flex-row gap-4 items-center text-2xl p-4 bg-mg brightness-70 rounded-t-2xl&quot;&gt;&lt;i class=&quot;ph ph-siren&quot;&gt;&lt;/i&gt;&lt;strong class=text-fg&gt;Note&lt;/strong&gt;&lt;/div&gt;&lt;div class=p-4&gt;Maybe, for some people this features are granted, but for me, and I suspect for a lot of people like me, at the time they were quite a discovery. Therefore if you are already more knowledgeable than me, great, let&#39;s have a chat, otherwise I hope all this will be useful to you. As always, feel free to let me know if I made some imprecisions somewhere.&lt;/div&gt;&lt;/div&gt;&lt;h2 id=interactive-interpreter&gt;Interactive interpreter&lt;/h2&gt;&lt;h3&gt;&lt;code&gt;!&lt;/code&gt;&lt;/h3&gt;&lt;p&gt;For interactive Bash use, I have only one small trick to remember: &lt;code&gt;!&lt;/code&gt;. &lt;code&gt;!&lt;/code&gt; is part of a bigger world called &lt;a href=https://www.gnu.org/software/bash/manual/html_node/History-Interaction.html#History-Interaction&gt;&lt;em&gt;history expansion&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Long before the up arrow let you search in your history, there was a mean of referring to a past history line and, you guessed it, was &lt;code&gt;!&lt;/code&gt;.&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;42&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# this would execute the command at line 42 of your history&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What if we need to repeat a command? It is possible to refer to a number of lines relative to the current line. Summarized in one sentence: &#39;execute the command I typed &lt;em&gt;n&lt;/em&gt; lines ago&#39;.&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;-42 &lt;span class=&quot;token comment&quot;&gt;# this would print the command used 42 lines ago&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And arguably the most useful of all &lt;code&gt;!&lt;/code&gt; shortcuts, it is possible to repeat command at last line.&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;-1
&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# simpler version, synonym of &#39;!-1&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And &lt;code&gt;!!&lt;/code&gt; can be used as a &quot;variable&quot;. The classical example in this case is &lt;code&gt;sudo&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$ &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; firefox
E: Could not &lt;span class=&quot;token function&quot;&gt;open&lt;/span&gt; lock &lt;span class=&quot;token function&quot;&gt;file&lt;/span&gt; /var/lib/dpkg/lock-frontend - &lt;span class=&quot;token function&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;13&lt;/span&gt;: Permission denied&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
E: Unable to acquire the dpkg frontend lock &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;/var/lib/dpkg/lock-frontend&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;, are you root?
$ &lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;
$ &lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; firefox &lt;/code&gt;&lt;/pre&gt;&lt;h3 id=reverse-i-search-or-reverse-search-history&gt;reverse-i-search (or reverse-search-history)&lt;/h3&gt;&lt;p&gt;There are a number of situations where so many commands has been typed, that it is impossible to remember them by name or by line. In this cases, it is possible to search through history incrementally, using some parts of the command as search key.&lt;/p&gt;&lt;p&gt;For example, let&#39;s suppose that we have to search for the command &lt;code&gt;find . -name &quot;*.rst&quot; -type f | python3 /usr/local/bin/scripts/pelican_importer.py&lt;/code&gt; but we don&#39;t want to type it all by hand, incurring in the risk of errors and subsequent re-typing. It is possible to press &lt;code&gt;CRTL&lt;/code&gt; + &lt;code&gt;R&lt;/code&gt; to search:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$
bck-i-search: _&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then type in the search key and press &lt;code&gt;CRTL&lt;/code&gt; + &lt;code&gt;R&lt;/code&gt; over to scroll through results:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$ &lt;span class=&quot;token function&quot;&gt;find&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-name&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;*.rst&quot;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; python3 /usr/local/bin/scripts/pelican_importer.py
bck-i-search: find_&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When the command is the one we desire to execute, it is sufficient to press &lt;code&gt;Enter&lt;/code&gt; to fire it.&lt;/p&gt;&lt;h2 id=bash-scripts&gt;Bash scripts&lt;/h2&gt;&lt;h3 id=shebangs&gt;Shebangs&lt;/h3&gt;&lt;p&gt;This one should already be common knowledge to every developer using POSIX systems, but every script should declare at its start the interpreter that is going to execute the actual code. This is accomplished using the so called &lt;a href=&quot;https://en.wikipedia.org/w/index.php?title=Shebang_(Unix)&amp;oldid=921706257&quot;&gt;&lt;em&gt;shebang&lt;/em&gt;&lt;/a&gt; line. My personal receipt is:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That line should tell the current shell to execute the current script (if made executable with &lt;code&gt;chmod +x&lt;/code&gt;) with the command written after the &lt;code&gt;!#&lt;/code&gt; characters. A disclaimer though, in some exotic environments there is no &lt;code&gt;/usr/bin/env&lt;/code&gt; executable and thus the shebang line will be invalid. In such cases, we need to revert to:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or even:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;By the way, shebangs are a general scripting &quot;rule&quot;, therefore they do work with a number of different scripting languages, such as Python, Perl, PHP and JavaScript.&lt;/p&gt;&lt;h3 id=bash-options&gt;Bash options&lt;/h3&gt;&lt;p&gt;Have you ever noticed Bash does not halt when an error happens? Or that it will happily use uninitialized variables?&lt;/p&gt;&lt;p&gt;Well, there is a solution to all this issues (even if they are not &lt;em&gt;real&lt;/em&gt; issues) that involves Bash options. As our trusted manual says:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token function&quot;&gt;man&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;bash&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;&lt;p&gt;The options are off by default unless otherwise noted.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;We need to enable them one by one if we want to exploit their behavior.&lt;/p&gt;&lt;p&gt;For example, let&#39;s make some script up to show some feature.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;

&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; /foo
&lt;span class=&quot;token function&quot;&gt;ls&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Clearly this scripts changes directory to &lt;code&gt;/foo&lt;/code&gt; and then tries to list its contents. If &lt;code&gt;/foo&lt;/code&gt; doesn&#39;t exist, will &lt;code&gt;ls&lt;/code&gt; be executed? Yes, it will. To prevent this behavior and exit if some command, simple or complex, throws an error, we need to use the &lt;code&gt;errexit&lt;/code&gt; option:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# enable errexit option&lt;/span&gt;

&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; /foo
&lt;span class=&quot;token function&quot;&gt;ls&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This time the shell is going to stop execution with a &lt;code&gt;cd: can&#39;t cd to /foo&lt;/code&gt; error.&lt;/p&gt;&lt;p&gt;Another example (that YOU SHOULD &lt;strong&gt;NOT&lt;/strong&gt; RUN):&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;

&lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$prefix&lt;/span&gt;/*&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here &lt;code&gt;$prefix&lt;/code&gt; is clearly undefined, so the command will expand to:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;

&lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; /*&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In case you haven&#39;t understood the situation, this command, granted &lt;code&gt;root&lt;/code&gt; privileges, will destroy your installation, even your machine in some situations. To prevent this, use the &lt;code&gt;nounset&lt;/code&gt; option&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# enable nounset option&lt;/span&gt;

&lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$prefix&lt;/span&gt;/*&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally an option useful during the script writing or debugging. Since a lot of expansions are taking place when Bash interprets your commands, a useful capability to have would be to be able to see the command after expansion has been performed. That&#39;s why the &lt;code&gt;xtrace&lt;/code&gt; exists.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# enable xtrace option&lt;/span&gt;

&lt;span class=&quot;token assign-left variable&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;This variable content: &lt;span class=&quot;token variable&quot;&gt;$prefix&lt;/span&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once called, this will print out every command executed:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$ &lt;span class=&quot;token function&quot;&gt;bash&lt;/span&gt; script.sh
+ &lt;span class=&quot;token assign-left variable&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;Hello, world&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;
+ &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; This variable content: Hello, world&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;
This variable content: Hello, world&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Summing all up, I tend to begin my scripts with the following header:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-x&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# ...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then, when I finished writing them, I just comment out the &lt;code&gt;xtrace&lt;/code&gt; option (or more elegantly disable it).&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; +x &lt;span class=&quot;token comment&quot;&gt;# disable xtrace&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# ...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=expansions&gt;Expansions&lt;/h3&gt;&lt;p&gt;In the Bash world, &lt;em&gt;expansion&lt;/em&gt; is a quite a scaring word, especially to a newcomer. Actually, there are just a couple rules to follow when we talk about expansion, or at least its common occurrences.&lt;/p&gt;&lt;p&gt;First, what is expansion? Expansion is a transformation that is performed on a number of constructs, after each line has been split into tokens. One example made earlier is:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token assign-left variable&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;This variable content: &lt;span class=&quot;token variable&quot;&gt;$prefix&lt;/span&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here, the variable &lt;code&gt;$prefix&lt;/code&gt; gets expanded replacing it with its content, so that the string &lt;code&gt;&quot;This variable content: $prefix&quot;&lt;/code&gt; becomes &lt;code&gt;This variable content: Hello, world!&lt;/code&gt;. Results of these kind of operations could be unintuitive at times, leading to a lot of common errors.&lt;/p&gt;&lt;p&gt;Let&#39;s start from variable expansion. It is possible to decide if expansion is desired in a string using double or single quotes: the first does get transformed, the second doesn&#39;t.&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$ &lt;span class=&quot;token assign-left variable&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Riccardo&quot;&lt;/span&gt;
$ &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;My name is &lt;span class=&quot;token variable&quot;&gt;$name&lt;/span&gt;&quot;&lt;/span&gt;
My name is Riccardo
$ &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;My name is $name&#39;&lt;/span&gt;
My name is &lt;span class=&quot;token variable&quot;&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Also, let&#39;s reason on an example. Suppose we want to compose a string like &lt;code&gt;Name_Surname&lt;/code&gt; (e.g. &lt;code&gt;Riccardo_Macoratti&lt;/code&gt;), but we want the user to provide the name and surname.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; +x

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Name: &quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;read&lt;/span&gt; name
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Surname: &quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;read&lt;/span&gt; surname

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$name_&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$surname&lt;/span&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Easy enough, but when we try to execute the script, an error shows up:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$ &lt;span class=&quot;token function&quot;&gt;bash&lt;/span&gt; script.sh
Name: Riccardo 
Surname: Macoratti
name_: parameter not &lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It is because Bash doesn&#39;t know what variable to expand, &lt;code&gt;$name&lt;/code&gt; or &lt;code&gt;$name_&lt;/code&gt;, and chooses to expand the longest one, that is to say &lt;code&gt;$name_&lt;/code&gt;, which is obviously unset. Preventing this behavior is easy, just wrap the variable name in curly brackets.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; +x

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Name: &quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;read&lt;/span&gt; name
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Surname: &quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;read&lt;/span&gt; surname

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;${name}&lt;/span&gt;_&lt;span class=&quot;token variable&quot;&gt;$surname&lt;/span&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;$ &lt;span class=&quot;token function&quot;&gt;bash&lt;/span&gt; script.sh
Name: Riccardo  
Surname: Macoratti
Riccardo_Macoratti&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The second (and IMHO most useful) form of expansion is command expansion. It si the power of &quot;transform every command output into a variable&quot;, accomplished with the syntax &lt;code&gt;$(command)&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Let&#39;s say that we are in a hurry and need to perform a one-time task in the most time-efficient way we can think of. In this kind of situations, there is usually next to no time or interest to look for a clean solution on the manual or on the internet. For example, I tend to forget how to read a file in Bash.&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token assign-left variable&quot;&gt;file_contents&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; file.txt&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now &lt;code&gt;$file_contents&lt;/code&gt; contains the contents of &lt;code&gt;file.txt&lt;/code&gt;. Another classical example is caching. When a long computation is terminated and it is desirable to store the result in memory, that is the time for a command expansion.&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token assign-left variable&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;find&lt;/span&gt; / &lt;span class=&quot;token parameter variable&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;^.+&#92;.conf&#39;&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# search for every .conf file in your root&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And yoy can see, command expansion leads the way to fun (and sometimes ugly...) one-liner, pipe expressions.&lt;/p&gt;&lt;h3 id=short-circuit-boolean-operators&gt;Short-circuit boolean operators&lt;/h3&gt;&lt;p&gt;Every programmer worth of its name should know boolean operators and surely the most used are logical conjunction (∧), commonly called &lt;em&gt;and&lt;/em&gt;, and logical disjunction (∨), commonly called &lt;em&gt;or&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Bash unsurprisingly has them too and uses the &lt;a href=https://en.wikipedia.org/wiki/Short-circuit_evaluation&gt;short-circuiting&lt;/a&gt; variant. Boolean expressions are usually composed of multiple boolean operations chained together in some way, by means of an operator. It can happen that the result of the boolean expression may be known just after evaluating the first operation. Let&#39;s think of this examples:&lt;/p&gt;&lt;pre class=language-shell&gt;&lt;code class=language-shell&gt;&lt;span class=&quot;token assign-left variable&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;true
&lt;span class=&quot;token assign-left variable&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;false
&lt;span class=&quot;token variable&quot;&gt;$b&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;no short-circuit here&quot;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$a&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;no short-circuit here&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These strings won&#39;t be printed out, because Bash already knows that the result of the two expressions, just having evaluated &lt;code&gt;$b &amp;&amp;&lt;/code&gt; or &lt;code&gt;$a ||&lt;/code&gt;. In fact, &lt;code&gt;false &amp;&amp; [𝑥]&lt;/code&gt; evaluates to &lt;code&gt;false&lt;/code&gt; for every &lt;code&gt;𝑥&lt;/code&gt; and vice versa &lt;code&gt;true || [𝑥]&lt;/code&gt; evaluates to &lt;code&gt;true&lt;/code&gt; for every &lt;code&gt;𝑥&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Now, consider that every simple or advanced set of commands executed leaves a return value that is between 0 and 255 and that &lt;code&gt;0&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt; and everything else is &lt;code&gt;true&lt;/code&gt;. We can take advantage of the short-circuit feature as a compact branching devices, read &lt;code&gt;if-else&lt;/code&gt; construct. This two scripts are semantically equivalent:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; +x

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Number: &quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;read&lt;/span&gt; n

&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-lt&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;42&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Less than 42&quot;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Greater or equal to 42&quot;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;fi&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; +x

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Number: &quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;read&lt;/span&gt; n

&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-lt&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;42&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
    &lt;span class=&quot;token operator&quot;&gt;&amp;&amp;&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Less than 42&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
    &lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Greater or equal to 42&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;FYI: a lot of dynamically-typed languages are able to pull out this kind of technique, one over all JavaScript.&lt;/p&gt;</description>
      <pubDate>Mon, 11 Nov 2019 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/bash-tip-tricks/</guid>
    </item>
    <item>
      <title>Linux Day 2018</title>
      <link>https://ricma.co/posts/tech/linux/linux-day-2018/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linuxday logo 2018&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-day-2018/linuxday2018.webp&gt;&lt;/figure&gt;&lt;p&gt;Even this year, together with some organizative difficulties, the &lt;a href=http://www.linuxday.it&gt;Linux Day&lt;/a&gt; time has come. As every past few years, I was part of the staff team and I held some talk for the people coming by.&lt;/p&gt;&lt;p&gt;This year the general theme was &lt;em&gt;World Wild Web&lt;/em&gt;, so I thought of doing some presentation of what HTTPS actually is and why we should always try to use it and search for it. That small lock that appears on every browser is really tiny, but it does a lot of protection work on our behalf.&lt;/p&gt;&lt;p&gt;The usual local associations took their place in the event organization and hosting. &lt;a href=http://www.linuxvar.it/&gt;LinuxVar&lt;/a&gt;, &lt;a href=http://lifolab.org&gt;LIFO&lt;/a&gt; laboratory and &lt;a href=http://www.gl-como.it/&gt;GL-Como&lt;/a&gt; LUG joined their forces to bring some content to the partecipants. For the fourth year, the fair location was the &lt;a href=http://www.faberlab.org&gt;FaberLab&lt;/a&gt; room in Tradate.&lt;/p&gt;&lt;p&gt;Unfortunately, this year no showroom of pratical exibitions or workshops was there, but there were six talks in the whole afternoon. So, not bad actually.&lt;/p&gt;&lt;h1 id=my-own-talk&gt;My own talk&lt;/h1&gt;&lt;p&gt;The presentation slides are of course in Italian and you can view them below.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/linuxday/2018/s-in-https.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;p&gt;You can also download the presentation slide, in &lt;a href=https://ricma.co/files/linuxday/2018/s-in-https.odp&gt;ODP&lt;/a&gt; or in &lt;a href=https://ricma.co/files/linuxday/2018/s-in-https.pdf&gt;PDF format&lt;/a&gt;.&lt;/p&gt;&lt;h1 id=resources&gt;Resources&lt;/h1&gt;&lt;p&gt;If you want to see some photos of the event, you can find them on &lt;a href=https://social.gl-como.it/photos/gl-como&gt;GL-Como Friendica page&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Also, further information are on the deciated LinuxVar &lt;a href=https://www.linuxvar.it/linuxday-sabato-27-ottobre-2018/&gt;page&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 12 Nov 2018 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/linux/linux-day-2018/</guid>
    </item>
    <item>
      <title>Introduction to Machine Learning</title>
      <link>https://ricma.co/posts/talks/intro-machine-learning/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;perceptron diagram&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/talks/intro-machine-learning/perceptron.webp&gt;&lt;/figure&gt;&lt;p&gt;As I stated in some article before, in the LUG I use to attend, we give some talks to try to share as much knowledge as possible, over our current interests.&lt;/p&gt;&lt;p&gt;I always try to join these events, because they offer me a unique occasion to train my presentation skills and to write down some of the concepts I am currently looking into.&lt;/p&gt;&lt;p&gt;In this time period, I just finished a university lecture over some machine learning concepts. Not that I consider myself an expert in this field, but I feel confident enough to explain the basics to completely agnostic people.&lt;/p&gt;&lt;p&gt;So I dediced to give an introductory talk about this topic. The talk night took place the 21&lt;sup&gt;st&lt;/sup&gt; of March, 2018. The talk has been recorded on video (more info later).&lt;/p&gt;&lt;h1 id=presentation&gt;Presentation&lt;/h1&gt;&lt;p&gt;The presentation slides are of course in Italian and you can view them below.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/linuxvar/intro_machine_learning/intro_machine_learning.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;p&gt;You can also download the presentation slide, in &lt;a href=https://ricma.co/files/linuxvar/intro_machine_learning/intro_machine_learning.odp&gt;ODP format&lt;/a&gt; or in &lt;a href=https://ricma.co/files/linuxvar/intro_machine_learning/intro_machine_learning.pdf&gt;PDF format&lt;/a&gt;.&lt;/p&gt;&lt;h1 id=video&gt;Video&lt;/h1&gt;&lt;p&gt;The video recording of the night is available on YouTube, through the &lt;a href=https://www.youtube.com/channel/UCoYyCUclcvKVnvyfgla4I0g&gt;LinuxVar channel&lt;/a&gt;. (I know the caption title of the video is wrong, but the presentation is the right one)&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/ihQgyewHw9c&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Of course, if you have any questions, you can write me using one of the contact badges on the page aside.&lt;/p&gt;</description>
      <pubDate>Fri, 23 Mar 2018 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/intro-machine-learning/</guid>
    </item>
    <item>
      <title>Battle for the Net Neutrality</title>
      <link>https://ricma.co/posts/tech/events/net-neutrality/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;fight for the net neutrality banner&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/events/net-neutrality/net-neutrality.webp&gt;&lt;/figure&gt;&lt;p&gt;I know, I am European and this battle should not be my battle, but let&#39;s analyze things from another point of view.&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;fight for the net neutrality meme&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/events/net-neutrality/net-neutrality-archer.webp&gt;&lt;/figure&gt;&lt;p&gt;Internet is objectively America-centered, U.S.A. invented the Internet and, as such, a great, perceivable part of the internet is on the hands of the States. For this reason, Europe should take position on Net Neutrality matter, because even if it seems a very far concern, it is not, it will affect our lives too, the lives of the people on the other side of the ocean as well.&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;fight for the net neutrality meme&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/events/net-neutrality/net-neutrality-cat.webp&gt;&lt;/figure&gt;&lt;p&gt;As a fellow Internet user, wether you are a kid of the manager of a multinational society, you &lt;strong&gt;have to&lt;/strong&gt; take you position and defend the medium you are using.&lt;/p&gt;&lt;p&gt;I am not usually a person who shouts in real life, and neither I am on the internet, but for this time I will make an exception:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;SAVE THE INTERNET, DEFEND NETWORK NEUTRALITY, DO YOUR PART!&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Even if you don&#39;t have any influence power, you can still do you part, informing yourself and other on the matter. Here are some link that can get you started:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=https://www.battleforthenet.com/&gt;Battle for the Net&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://www.fightforthefuture.org/&gt;Fight for the Future&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You don&#39;t have time or you don&#39;t feel like reading something? Here are some video content that can get you instantly informed on you last chanche to save the Internet as you know it.&lt;/p&gt;&lt;p&gt;This one is only some seconds long, directly from Fight for the Future.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/LYq_k_1MS4I&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;This one, instead, is from the inventor of the World Wide Web, Sir &lt;a href=https://en.wikipedia.org/wiki/Tim_Berners-Lee&gt;Tim Berners-Lee&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/5Gh0NIQ3yd0&gt;&lt;/iframe&gt;&lt;/div&gt;</description>
      <pubDate>Thu, 23 Nov 2017 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/events/net-neutrality/</guid>
    </item>
    <item>
      <title>Codemotion Milan 2017</title>
      <link>https://ricma.co/posts/tech/events/codemotion-2017/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;codemotion logo&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/events/codemotion-2017/codemotion.webp&gt;&lt;/figure&gt;&lt;p&gt;Last saturday, I had the oportunity to visit this famous event which took place in Milan, in a new location called &lt;a href=https://milan2017.codemotionworld.com/location/&gt;BASE&lt;/a&gt;, 6000 sqm, that was the old offices of the Ansaldo.&lt;/p&gt;&lt;p&gt;This is publicized as the &quot;greatest technical conference of Europe, regarding software development&quot;. And, in my poor experience, it completely was. They programmed two days of conferences and two days of workshops. I attended only the last day of conference.&lt;/p&gt;&lt;p&gt;There, more than a hundred talks took place and all leader in the market companies were there, offering a job or simply selling their products.&lt;/p&gt;&lt;p&gt;Among this forest of advertisemente, there were also a lot of skilled presenters who showed the most interesting and up to date novelties of the technology word.&lt;/p&gt;&lt;p&gt;The passwords were &lt;em&gt;Faas&lt;/em&gt;, that is &lt;a href=https://en.wikipedia.org/wiki/Function_as_a_service&gt;Function as a service&lt;/a&gt;, &lt;em&gt;serverless&lt;/em&gt;, &lt;em&gt;microservices&lt;/em&gt; and &lt;em&gt;containers&lt;/em&gt;. Some of the content taught also parallell and distributed computing, big and realtime data and, ultimately, the &lt;a href=https://mesosphere.com/blog/smack-stack-new-lamp-stack/&gt;SMACK&lt;/a&gt; stack.&lt;/p&gt;&lt;p&gt;The most interesting talk, in my opinion, was the one about &lt;a href=https://en.wikipedia.org/wiki/Cascading_Style_Sheets&gt;CSS&lt;/a&gt;. I always hated CSS and it seemes like learning Arabic to me. This talk opened my eyes on its powers and the ability to complete supersede some functions of Javascript. This is very specific, but while I was listening to the presenter, my mind blew up for the magic he was showing us.&lt;/p&gt;&lt;p&gt;The presenter was &lt;a href=&quot;https://twitter.com/makhbeth?lang=en&quot;&gt;Davide Di Pumpo&lt;/a&gt; and the &lt;a href=https://www.slideshare.net/DavideDiPumpo/quella-sporca-dozzina-a-cascata&gt;presetation&lt;/a&gt; (in Italian) it is about twelve cheats in CSS.&lt;/p&gt;&lt;p&gt;If you want more information on the event, you can find them on their &lt;a href=https://milan2017.codemotionworld.com/&gt;site&lt;/a&gt;. Maybe next year we will meet there.&lt;/p&gt;&lt;p&gt;And, finally, a photo of my old laptop (which is slowly becoming a sticker plate).&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;old pc with codemotion logo&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/events/codemotion-2017/codemotion-pc.webp&gt;&lt;/figure&gt;</description>
      <pubDate>Wed, 15 Nov 2017 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/events/codemotion-2017/</guid>
    </item>
    <item>
      <title>Linux Day 2017</title>
      <link>https://ricma.co/posts/tech/linux/linux-day-2017/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linuxday logo 2017&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-day-2017/linuxday2017.webp&gt;&lt;/figure&gt;&lt;p&gt;The fourth saturady of october has come, which means it is time for &lt;a href=http://www.linuxday.it&gt;Linux Day&lt;/a&gt;. As always I and the group I am a member of organized the edition for the area of Varese, Lombardy.&lt;/p&gt;&lt;p&gt;We gave force to the usual collaboration with other local associations, such as us, that is &lt;a href=http://www.linuxvar.it&gt;LinuxVar&lt;/a&gt;, &lt;a href=http://lifolab.org&gt;LIFO&lt;/a&gt; laboratory and &lt;a href=http://www.gl-como.it/&gt;GL-Como&lt;/a&gt; LUG. For the third year the decision on the location fell on the &lt;a href=http://www.faberlab.org&gt;FaberLab&lt;/a&gt; of Tradate, a place very apt to organize this types of events, and home of DIY hobbyists who like to tinker with 3D printing.&lt;/p&gt;&lt;p&gt;As every year some talks and some exhibitions of various proofs of concept took place. The morning being reserved to presentations regarding topics close to the new generations, such as Internet security, decentralized social network sites and the powers of computer science and open source.&lt;/p&gt;&lt;h1 id=me&gt;Me&lt;/h1&gt;&lt;p&gt;This year I gave a simple talk about Instagram (and all other social network sites) dangers. You can find more info about the presentation &lt;a href=https://ricma.co/posts/talks/instagram-instaprivacy&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;h1 id=resources&gt;Resources&lt;/h1&gt;&lt;p&gt;If you want to see some photos (mainly of the necks of the public) of the event, you can find them on &lt;a href=https://social.gl-como.it/photos/gl-como&gt;GL-Como Friendica page&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;The resources used for quite all talks are available on the &lt;a href=https://www.linuxvar.it/linux-2017/&gt;LinuxVar site&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 28 Oct 2017 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/linux/linux-day-2017/</guid>
    </item>
    <item>
      <title>Instagram: #instaprivacy</title>
      <link>https://ricma.co/posts/talks/instagram-instaprivacy/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;instaprivacy talk logo&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/talks/instagram-instaprivacy/instagram.webp&gt;&lt;/figure&gt;&lt;p&gt;In occasion of the &lt;a href=https://ricma.co/posts/tech/linux/linux-day-2017&gt;Linux Day 2017&lt;/a&gt;, edition of the province of Varese, I had the opportunity to give a talk about privacy. The presentation should have been centered on speaking to young people.&lt;/p&gt;&lt;p&gt;Differently from previous years, I made something different, more philosofical and much less practical.&lt;/p&gt;&lt;p&gt;My main theme was Instagram, which is the most used social network platform by young people, but in any case I was eyeing every major social network platform. The aim was informing young people about the dangers of putting their whole life at everyones availability and ultimately telling them how it is possible for everyone able to exploit the information they donated &lt;em&gt;gratis&lt;/em&gt; online and all this at their expense.&lt;/p&gt;&lt;h1 id=presentation&gt;Presentation&lt;/h1&gt;&lt;p&gt;The presentation is in Italian and you can view it below.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/instaprivacy/index.html#1&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;You can also &lt;a href=https://ricma.co/files/linuxday/2017/instaprivacy/instaprivacy.zip&gt;download&lt;/a&gt; the presentation or &lt;a href=https://ricma.co/raw/instaprivacy/index.html&gt;watch it fullscreen&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Of course, if you have any questions, you can write me using one of the contact badges on the page aside.&lt;/p&gt;</description>
      <pubDate>Sat, 28 Oct 2017 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/instagram-instaprivacy/</guid>
    </item>
    <item>
      <title>Stack Overflow network analysis</title>
      <link>https://ricma.co/posts/tech/projects/stack-overflow/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;stack overflow logo&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/projects/stack-overflow/stack-overflow.webp&gt;&lt;/figure&gt;&lt;p&gt;As we all know, a programmer always needs help from another fellow programmer or sometimes just wants to reach easily the best implementation of an algorithm.&lt;/p&gt;&lt;p&gt;For this purpose, &lt;a href=https://stackoverflow.com&gt;Stack Overflow&lt;/a&gt; has been created.&lt;/p&gt;&lt;p&gt;Stack Overflow is part of the &lt;a href=https://stackexchange.com/&gt;Stack Exchange&lt;/a&gt; network and at the time of writing it counts 7.3 milion users, with more than 14 milions question asked and 22m of answers given (&lt;a href=&quot;https://stackexchange.com/sites?view=list#traffic&quot;&gt;more here&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;We present a simple ans standard analysis of the Stack Overflow constructed as follows:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;every &lt;strong&gt;node&lt;/strong&gt; is a &lt;strong&gt;user&lt;/strong&gt;;&lt;/li&gt;&lt;li&gt;every &lt;strong&gt;edge&lt;/strong&gt; answers to the question &lt;em&gt;has answered to&lt;/em&gt;;&lt;/li&gt;&lt;li&gt;an optional &lt;strong&gt;weight&lt;/strong&gt; has been given if a user has answered more than once to another user (but it was not used during the analysis).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Below, the notebook with the complete analysis:&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/stack-overflow/notebook.html&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;You can download it &lt;a href=https://ricma.co/raw/stack-overflow/notebook.html&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;A presentation of the result obtained can be viewed below (also [download it] (/files/uni/stack-overflow/presentation.pdf)).&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/uni/stack-overflow/presentation.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;</description>
      <pubDate>Mon, 12 Jun 2017 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/projects/stack-overflow/</guid>
    </item>
    <item>
      <title>Git in pratica</title>
      <link>https://ricma.co/posts/talks/git-in-pratica/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;git in pratica logo&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/talks/git-in-pratica/git-in-pratica.webp&gt;&lt;/figure&gt;&lt;p&gt;I already presented on this blog &lt;a href=https://git-scm.com/&gt;git&lt;/a&gt;, the SCM (&lt;strong&gt;S&lt;/strong&gt;oftware, &lt;strong&gt;C&lt;/strong&gt;onfiguration, &lt;strong&gt;M&lt;/strong&gt;anager) of choiche. Last time, I made a simple introdutory tutorial on the system, showing its potential, but I didn&#39;t dwell enough on the everyday use. I decided to organize another talk in which all day use and commands were the center of the conversation.&lt;/p&gt;&lt;h1 id=video-recap&gt;Video recap&lt;/h1&gt;&lt;p&gt;This time, I chose to record myself talking, instead of only providing presentation material. So, here it is, the video recap of the evening.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/h2t1opDnd38&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;h1 id=presentation&gt;Presentation&lt;/h1&gt;&lt;p&gt;The presentation being shown in the video is provided below.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/git-in-pratica/presentation.html#1&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Download the &lt;a href=https://ricma.co/files/linuxvar/git_in_pratica/git_in_pratica.zip&gt;presentation&lt;/a&gt; or &lt;a href=https://ricma.co/raw/git-in-pratica/presentation.html&gt;watch it fullscreen&lt;/a&gt;.&lt;/p&gt;&lt;h1 id=useful-information&gt;Useful information&lt;/h1&gt;&lt;p&gt;The shell used during the video stream is the &lt;a href=https://fishshell.com/&gt;fish shell&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you desire an informative prompt about the situation of the git repository in the current directory, you have a couple of viable options.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Bash &lt;ul&gt;&lt;li&gt;&lt;a href=https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh&gt;git-prompt.sh&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/magicmonty/bash-git-prompt&gt;bash-git-prompt&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Zsh &lt;ul&gt;&lt;li&gt;&lt;a href=https://github.com/olivierverdier/zsh-git-prompt&gt;zsh-git-prompt&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/robbyrussell/oh-my-zsh&gt;oh-my-zsh&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh&gt;git-prompt.sh&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Fish &lt;ul&gt;&lt;li&gt;&lt;a href=https://github.com/fish-shell/fish-shell/blob/master/share/functions/__fish_git_prompt.fish&gt;__fish_git_prompt.fish&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=https://github.com/oh-my-fish/oh-my-fish&gt;oh-my-fish&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If you want to have the alias &lt;code&gt;hist&lt;/code&gt;, in order to use the command &lt;code&gt;git hist&lt;/code&gt; as in the video, you should download the file &lt;a href=https://ricma.co/files/linuxvar/git_in_pratica/gitconfig&gt;gitconfig&lt;/a&gt; and copy it at &lt;code&gt;$HOME/.gitconfig&lt;/code&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 16 Feb 2017 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/git-in-pratica/</guid>
    </item>
    <item>
      <title>Linux Day 2016</title>
      <link>https://ricma.co/posts/tech/linux/linux-day-2016/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linuxday logo 2016&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-day-2016/linuxday2016.webp&gt;&lt;/figure&gt;&lt;p&gt;In this period of the year, the time has come for the &lt;a href=http://www.linuxday.it&gt;Linux Day&lt;/a&gt; for the area of Varese, Lombardy. This edition we, &lt;a href=http://www.linuxvar.it4&gt;LinuxVar&lt;/a&gt;, &lt;a href=http://lifolab.org&gt;LIFO&lt;/a&gt; laboratory and &lt;a href=http://www.gl-como.it/&gt;GL-Como&lt;/a&gt; LUGs, have decided to make it take place another time at the &lt;a href=http://www.faberlab.org&gt;FaberLab&lt;/a&gt; of Tradate, an interesting place where anyone can transform its ideas into a 3D printed reality.&lt;/p&gt;&lt;p&gt;As usual, some talks, workshop and projects took place. This year we decided that not only the school were to partecipate at this event, but also they were to be part of the protagonists. So some talks on Arduino by students for students were organized.&lt;/p&gt;&lt;p&gt;Further information can be found directly on the dedicated &lt;a href=https://www.linuxvar.it/linuxday-2016/&gt;LinuxDay 2016 page&lt;/a&gt; on the LinuxVar site.&lt;/p&gt;&lt;h1 id=linuxvar&gt;LinuxVar&lt;/h1&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linuxvar 0x10 cake&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-day-2016/linuxvar-0x10.webp&gt;&lt;/figure&gt;&lt;p&gt;This year was also the 16th anniversary of the informal foundation of the LinuxVar LUG and the 10th from the official declaration.&lt;/p&gt;&lt;h1 id=me&gt;Me&lt;/h1&gt;&lt;p&gt;I, personally, choose to build up a workshop on the GIMP, the GNU Image Manuplator Program. Further information on the can be found &lt;a href=https://www.gimp.org/&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;A more descrptive and detailed explanation of the workshop is available at this &lt;a href=https://ricma.co/posts/talks/intro-gimp&gt;page&lt;/a&gt;, complete with slides used to show it.&lt;/p&gt;&lt;p&gt;Some photos of the event can be, instead, downloaded &lt;a href=https://ricma.co/files/linuxday/2016/photos.zip&gt;here&lt;/a&gt;, on my file server.&lt;/p&gt;</description>
      <pubDate>Sat, 29 Oct 2016 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/linux/linux-day-2016/</guid>
    </item>
    <item>
      <title>Introduction to GIMP: GNU Image Manipulator Program</title>
      <link>https://ricma.co/posts/talks/intro-gimp/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;gimp logo&quot; class=rounded loading=lazy src=https://ricma.co/posts/talks/intro-gimp/gimp.webp&gt;&lt;/figure&gt;&lt;p&gt;Sometimes you just have to resize an image. Sometimes you want to edit a couple of images. Sometimes you have to do a complete overhaul of a ton of images.&lt;/p&gt;&lt;p&gt;Now, let me tell you the routine you have to follow; &lt;strong&gt;have&lt;/strong&gt; Windows™, go to your favorite graphic editor, Adobe, website and buy or &quot;buy&quot; a copy of your favourite image editor, Photoshop.&lt;/p&gt;&lt;p&gt;But, let&#39;s say that the PC you have at hand is not capable of Windows, it could have Linux or, eventually, Mac OS X. Or say that you don&#39;t own the necessary amount of gold coins to buy (and not &quot;buy&quot;) the upsaid software.&lt;/p&gt;&lt;p&gt;A simple, easy and straightforward solution is to search for another program. An example is GIMP, and to be honest it is &lt;strong&gt;the&lt;/strong&gt; example of a libre/open source solution. It can work on Windows, Linux and Mac OS X and can handle the majority of use cases of the upcited Photoshop.&lt;/p&gt;&lt;p&gt;For this purpose, I proposed a workshop where I show the basics of the GIMP, divided in fived practical use cases.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/intro-gimp/presentation.html#1&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;You can also view the presentation fullscreen &lt;a href=https://ricma.co/raw/intro-gimp/presentation.html&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you are interested, you can also download a &lt;a href=https://ricma.co/files/linuxday/2016/intro_gimp/introduzione_gimp.zip&gt;zip&lt;/a&gt; containing presentation and examples.&lt;/p&gt;</description>
      <pubDate>Sat, 22 Oct 2016 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/intro-gimp/</guid>
    </item>
    <item>
      <title>Install Apache Hadoop 2.7 (on *buntu 16.04)</title>
      <link>https://ricma.co/posts/tech/tutorials/hadoop-16/</link>
      <description>&lt;p&gt;If you are interested in Hadoop, read more &lt;a href=https://hadoop.apache.org&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For this tutorial, I&#39;ll use a VM with &lt;strong&gt;Ubuntu Server 16.04&lt;/strong&gt;, 64 bit version, relying on &lt;strong&gt;VirtualBox 5.1.4&lt;/strong&gt; for the virtualization.&lt;/p&gt;&lt;p&gt;The guest system setup is as follows:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;All 2 cores of my i5-6200U&lt;/li&gt;&lt;li&gt;4096 MB of RAM (although 1024 MB should be enough)&lt;/li&gt;&lt;li&gt;A dinamically allocated 10 GB VDI hard disk (5 GB are the least)&lt;/li&gt;&lt;li&gt;Ubuntu Server 16.04 x64 ISO file (but every *buntu flavour should be ok)&lt;/li&gt;&lt;/ul&gt;&lt;h1 id=notes&gt;Notes&lt;/h1&gt;&lt;p&gt;When you read a line like this:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;jdoe@farlands ~ $ &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I imply a &lt;code&gt;bash&lt;/code&gt; prompt &lt;strong&gt;without&lt;/strong&gt; root priviledges, where &lt;code&gt;jdoe&lt;/code&gt; is the username and &lt;code&gt;farlands&lt;/code&gt; is the hostname.&lt;/p&gt;&lt;p&gt;On the other hand, when the line is like this:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I imply a &lt;code&gt;bash&lt;/code&gt; prompt &lt;strong&gt;with&lt;/strong&gt; root priviledges&lt;/p&gt;&lt;p&gt;Ok, let&#39;s start: run the guest os installation with default values and let&#39;s jump to hadoop headaches.&lt;/p&gt;&lt;h1 id=update-the-guest-system&gt;Update the guest system&lt;/h1&gt;&lt;p&gt;Open up a terminal and fire this commands to update repositories and upgrade the emulated system.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; update
farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; upgrade &lt;span class=&quot;token parameter variable&quot;&gt;-y&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=java-8&gt;Java 8&lt;/h1&gt;&lt;p&gt;We&#39;re going to use a precompiled and prepackaged version of Oracle Java 8 in the &lt;a href=http://www.webupd8.org&gt;Webupd8&lt;/a&gt; repo, to avoid further difficulties.&lt;/p&gt;&lt;p&gt;Open up the usual terminal and input:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; purge openjdk*
farlands % add-apt-repository &lt;span class=&quot;token parameter variable&quot;&gt;-y&lt;/span&gt; ppa:webupd8team/java
farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; update
farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-y&lt;/span&gt; oracle-java8-installer&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can verify Java version by typing:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;java&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-version&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;java&lt;/span&gt; version &lt;span class=&quot;token string&quot;&gt;&quot;1.8.0_60&quot;&lt;/span&gt;
Java&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;TM&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; SE Runtime Environment &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;build &lt;span class=&quot;token number&quot;&gt;1.8&lt;/span&gt;.0_60-b27&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
Java HotSpot&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;TM&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;64&lt;/span&gt;-Bit Server VM &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;build &lt;span class=&quot;token number&quot;&gt;25.60&lt;/span&gt;-b23, mixed mode&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you read a similar output, you completed this step.&lt;/p&gt;&lt;p&gt;Next, we need to create the JAVA_HOME environmental variable, to give hadoop the capability to find java executables.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;export JAVA_HOME=/usr&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt; /etc/profile
farlands % &lt;span class=&quot;token builtin class-name&quot;&gt;source&lt;/span&gt; /etc/profile&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=disable-ipv6&gt;Disable IPv6&lt;/h1&gt;&lt;p&gt;Apache Hadoop supports only IPv4, so let&#39;s disable IPv6 in the kernel parameters.&lt;/p&gt;&lt;p&gt;Open the file &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % editor /etc/sysctl.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And append to the end:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token comment&quot;&gt;# Disable IPv6&lt;/span&gt;
net.ipv6.conf.all.disable_ipv6 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
net.ipv6.conf.default.disable_ipv6 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
net.ipv6.conf.lo.disable_ipv6 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then reboot:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;reboot&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=configure-ssh-keys&gt;Configure SSH keys&lt;/h1&gt;&lt;p&gt;We want to run our setup on a different general purpose user, so we will create a &lt;code&gt;hadoopuser&lt;/code&gt; user and a &lt;code&gt;hadoopgroup&lt;/code&gt; group.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % addgroup hadoopgroup
farlands % adduser &lt;span class=&quot;token parameter variable&quot;&gt;-ingroup&lt;/span&gt; hadoopgroup hadoopuser&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We need ssh access to our machine, so let&#39;s install and start an OpenSSH server.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt;
farlands % systemctl &lt;span class=&quot;token builtin class-name&quot;&gt;enable&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt;
farlands % systemctl start &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to setup passwordless ssh, by means of crypto keys. In first place, we change to the &lt;code&gt;hadoopuser&lt;/code&gt; account, then we create the key using RSA encryption and finally we authorize the key for the current user.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;su&lt;/span&gt; - hadoopuser
hadoopuser@farlands ~ $ ssh-keygen &lt;span class=&quot;token parameter variable&quot;&gt;-t&lt;/span&gt; rsa &lt;span class=&quot;token parameter variable&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;
hadoopuser@farlands ~ $ &lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; ~/.ssh/id_rsa.pub &lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt; ~/.ssh/authorized_keys
hadoopuser@farlands ~ $ &lt;span class=&quot;token function&quot;&gt;chmod&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;600&lt;/span&gt; ~/.ssh/authorized_keys
hadoopuser@farlands ~ $ ssh-copy-id &lt;span class=&quot;token parameter variable&quot;&gt;-i&lt;/span&gt; ~/.ssh/id_rsa.pub localhost
hadoopuser@farlands ~ $ &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; localhost&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If no password were asked on ssh login, you successfully configured passwordless ssh for user &lt;code&gt;hadoopuser&lt;/code&gt;.&lt;/p&gt;&lt;h1 id=install-hadoop&gt;Install Hadoop&lt;/h1&gt;&lt;p&gt;We are ready to install Hadoop. Unfortunately, it does not come prepackaged, but we have to extract and move it to &lt;code&gt;/usr/local&lt;/code&gt;.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;wget&lt;/span&gt; http://it.apache.contactlab.it/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz
farlands % &lt;span class=&quot;token function&quot;&gt;tar&lt;/span&gt; xzf hadoop-2.7.3.tar.gz
farlands % &lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; hadoop-2.7.3.tar.gz
farlands % &lt;span class=&quot;token function&quot;&gt;mv&lt;/span&gt; hadoop-2.7.3 /usr/local
farlands % &lt;span class=&quot;token function&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-sf&lt;/span&gt; /usr/local/hadoop-2.7.3/ /usr/local/hadoop
farlands % &lt;span class=&quot;token function&quot;&gt;chown&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-R&lt;/span&gt; hadoopuser:hadoopgroup /usr/local/hadoop-2.7.3/&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to configure some environmental variables, with the &lt;code&gt;hadoopuser&lt;/code&gt; account. Switch to that account and edit &lt;code&gt;~/.bashrc&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ editor ~/.bashrc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Append at the end:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token comment&quot;&gt;# Hadoop config&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_PREFIX&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/usr/local/hadoop
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/usr/local/hadoop
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_MAPRED_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_COMMON_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_HDFS_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;YARN_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_CONF_DIR&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;/etc/hadoop
&lt;span class=&quot;token comment&quot;&gt;# Native path&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_COMMON_LIB_NATIVE_DIR&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_PREFIX}&lt;/span&gt;/lib/native
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_OPTS&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;-Djava.library.path=&lt;span class=&quot;token variable&quot;&gt;$HADOOP_PREFIX&lt;/span&gt;/lib/native&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Java path&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;JAVA_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/usr&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# OS path&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;&lt;span class=&quot;token environment constant&quot;&gt;PATH&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token environment constant&quot;&gt;$PATH&lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$HADOOP_HOME&lt;/span&gt;/bin:&lt;span class=&quot;token variable&quot;&gt;$JAVA_PATH&lt;/span&gt;/bin:&lt;span class=&quot;token variable&quot;&gt;$HADOOP_HOME&lt;/span&gt;/sbin&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next, source &lt;code&gt;~/.bashrc&lt;/code&gt; to apply changes.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ &lt;span class=&quot;token builtin class-name&quot;&gt;source&lt;/span&gt; ~/.bashrc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to edit &lt;code&gt;/usr/local/hadoop/etc/hadoop/hadoop-env.sh&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % editor /usr/local/hadoop/etc/hadoop/hadoop-env.sh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And add this at the end:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;JAVA_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/usr&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=configure-hadoop&gt;Configure Hadoop&lt;/h1&gt;&lt;p&gt;Hadoop configuration is quite hard, because it has a lot of config files. We need to navigate to &lt;code&gt;/usr/local/hadoop/etc/hadoop&lt;/code&gt; and edit these files:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;core-site.xml&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;hdfs-site.xml&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;mapred-site.xml&lt;/code&gt; (needs to be copied from &lt;code&gt;mapred-site.xml.template&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;code&gt;yarn-site.xml&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;They all are XML files with a top-level &lt;code&gt;&amp;lt;configuration&gt;&lt;/code&gt; node. For clarity we report the configuration node only.&lt;/p&gt;&lt;h2 id=core-site-xml&gt;&lt;code&gt;core-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;fs.default.name&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;hdfs://localhost:9000&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=hdfs-site-xml&gt;&lt;code&gt;hdfs-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;dfs.replication&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;1&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;dfs.name.dir&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;file:/usr/local/hadoop/hadoopdata/hdfs/namenode&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;dfs.data.dir&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;file:/usr/local/hadoop/hadoopdata/hdfs/datanode&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=mapred-site-xml&gt;&lt;code&gt;mapred-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;mapreduce.framework.name&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;yarn&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=yarn-site-xml&gt;&lt;code&gt;yarn-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;yarn.nodemanager.aux-services&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;mapreduce_shuffle&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=format-namenode&gt;Format namenode&lt;/h2&gt;&lt;p&gt;Next, we need to format the namenode filesystem with the following command:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ hdf namenode &lt;span class=&quot;token parameter variable&quot;&gt;-format&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Search the output: if you can read a string like this:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;INFO common.Storage: Storage directory /usr/local/hadoop/hadoopdata/hdfs/namenode has been successfully formatted.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&#39;s done.&lt;/p&gt;&lt;h1 id=start-and-stop-services&gt;Start and stop services&lt;/h1&gt;&lt;p&gt;Now, the last thing to do is starting Hadoop services:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ start-dfs.sh
hadoopuser@farlands ~ $ start-yarn.sh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To check the status of the services use the &lt;code&gt;jps&lt;/code&gt; command:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ jps
&lt;span class=&quot;token number&quot;&gt;26899&lt;/span&gt; Jps
&lt;span class=&quot;token number&quot;&gt;26216&lt;/span&gt; SecondaryNameNode
&lt;span class=&quot;token number&quot;&gt;25912&lt;/span&gt; NameNode
&lt;span class=&quot;token number&quot;&gt;26041&lt;/span&gt; DataNode
&lt;span class=&quot;token number&quot;&gt;26378&lt;/span&gt; ResourceManager
&lt;span class=&quot;token number&quot;&gt;26494&lt;/span&gt; NodeManager&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To stop services, these are the commands:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ stop-dfs.sh
hadoopuser@farlands ~ $ stop-yarn.sh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Congratulations, you made it!&lt;/p&gt;</description>
      <pubDate>Tue, 27 Sep 2016 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/hadoop-16/</guid>
    </item>
    <item>
      <title>Introduction to Android programming</title>
      <link>https://ricma.co/posts/talks/intro-android/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;android logo&quot; class=rounded loading=lazy src=https://ricma.co/posts/talks/intro-android/android.webp&gt;&lt;/figure&gt;&lt;p&gt;A recently but estabilished new entry into the computer and technology world is mobile computing.&lt;/p&gt;&lt;p&gt;Having calculum resources, together with internet access and a plethora of software to use at hand is not only comfortable, but is becoming more and more essential to our everyday life.&lt;/p&gt;&lt;p&gt;The two major platform that have spread in this latest year are Apple&#39;s iOS and Google&#39;s Android. Being a Linux enthusiast, for me Android is the way to go.&lt;/p&gt;&lt;p&gt;Together with using this system I learned through the years to make some little and useful nice applications, or better called &quot;apps&quot;. Since I learned the lesson &quot;mobile programming is radically different from traditional programming&quot;, I decided to give a small talk to help whoever wanted to approach this world.&lt;/p&gt;&lt;p&gt;For the sake of completeness I put together three really simple, but extremely useful in the real case examples.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/intro-android/presentation.html#1&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;You can also view the talk fullscreen &lt;a href=https://ricma.co/raw/intro-android/presentation.html&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you are interested you can also download a &lt;a href=https://ricma.co/files/linuxvar/intro_android/introduzione_android.zip&gt;zip&lt;/a&gt; containing the full presentation.&lt;/p&gt;</description>
      <pubDate>Thu, 22 Sep 2016 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/intro-android/</guid>
    </item>
    <item>
      <title>Introduction to Python 3</title>
      <link>https://ricma.co/posts/talks/intro-python/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;python 3 logo&quot; class=rounded loading=lazy src=https://ricma.co/posts/talks/intro-python/python.webp&gt;&lt;/figure&gt;&lt;p&gt;A language that is increasingly becoming more and more famous and prominent, both as a scripting language and a scientifical tool, is &lt;a href=https://www.python.org/&gt;Python&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Python lets newcomers accomodate really quickly and easily. Discover it yourself!&lt;/p&gt;&lt;p&gt;During this talk, I&#39;ll provide a small introduction to basic concepts to become a real &lt;em&gt;pythonista&lt;/em&gt;.&lt;/p&gt;&lt;hr&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/intro-python/presentation.html#1&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;You can also watch the presentation fullscren &lt;a href=https://ricma.co/raw/intro-python/presentation.html&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you are interested you can download a &lt;a href=https://ricma.co/files/linuxvar/intro_python/introduzione_python.zip&gt;zip&lt;/a&gt; containing the full presentation.&lt;/p&gt;</description>
      <pubDate>Wed, 01 Jun 2016 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/intro-python/</guid>
    </item>
    <item>
      <title>Linux Presentation Day 2016</title>
      <link>https://ricma.co/posts/tech/linux/linux-presentation-day-2016/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linux presentation day logo 2016&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-presentation-day-2016/lpd-2016.webp&gt;&lt;/figure&gt;&lt;p&gt;A new (but not so revolutionary) event is born in Europe to advertise the use of Linux and the concept of Open Source and Free Software: the Linux Presentation Day. All European nations estabilished a day, the 30th of April, to organize some propaganda for the famouse operative system, I like the most.&lt;/p&gt;&lt;p&gt;My LUG, &lt;a href=http://linuxvar.it/&gt;LinuxVar&lt;/a&gt;, has decided to take an active part in this day, but in its own classic style.We decided to spend this day in a school, teaching to the students the power of open systems. We chose the &lt;a href=http://www.isiskeynes.it/&gt;I.S.I.S Keynes&lt;/a&gt; in &lt;a href=&quot;http://www.openstreetmap.org/#map=19/45.77349/8.82783&amp;layers=N&quot;&gt;Gazzada Schianno&lt;/a&gt;, Varese.&lt;/p&gt;&lt;p&gt;A group decided to present an acitivity based on &lt;a href=http://appinventor.mit.edu/explore/&gt;AppInventor&lt;/a&gt;, an MIT software which allows to develop Android applications in a &lt;a href=https://scratch.mit.edu/&gt;Scratch&lt;/a&gt; fashion, dealing with visual blocks for coding.&lt;/p&gt;&lt;p&gt;Me and my friend decided to give an introductory talk about Internet traffic sniffing, so we presented principal Linux networking tools together with &lt;code&gt;nmap&lt;/code&gt; and Wireshark. My friend centered his attention on a presentation over firewalls tassonomy and firewalls tasks.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/linuxday/2016p/analisi-rete.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;p&gt;A copy of the presentation on traffic sniffing is available to download &lt;a href=https://ricma.co/files/linuxday/2016p/analisi-rete.pdf&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sun, 01 May 2016 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/linux/linux-presentation-day-2016/</guid>
    </item>
    <item>
      <title>Young People and SNSs</title>
      <link>https://ricma.co/posts/talks/young-people-and-snss/</link>
      <description>&lt;p&gt;In an Internet reality populated by real &lt;a href=https://en.wikipedia.org/wiki/Virtuality_(philosophy)&gt;virtualities&lt;/a&gt;, in which young people is completely absorbed in everyday life too, it is becoming more and more fundamental to discuss and understand how young people (13-20) use these new technologies and how much understand of their possible dangers.&lt;/p&gt;&lt;p&gt;I ideated a small questionnaire to gather some data about what personal informations are usually provided to social network sites by young people and how they interact with this huge amount of data.&lt;/p&gt;&lt;p&gt;The questionnaire was aired on October 24, 2015 at the &lt;a href=http://linuxvar.it/content/linux-day-2015&gt;Linux Day 2015 of Varese&lt;/a&gt; in the &lt;a href=http://www.istitutosantelia.gov.it&gt;ISISS Antonio Sant&#39;Elia&lt;/a&gt;, an Italian high school, featuring the students as questionee.&lt;/p&gt;&lt;p&gt;I took the opportunity and displayed the results in a small presentation, where in the last slides I talked about Facebook T.O.S. (&lt;strong&gt;T&lt;/strong&gt;erms &lt;strong&gt;o&lt;/strong&gt;f &lt;strong&gt;S&lt;/strong&gt;ervice) as an example of social network site licence agreement.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; loading=lazy src=https://ricma.co/raw/young-people-and-snss#1&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;You cand view the presentation fullscreen &lt;a href=https://ricma.co/raw/young-people-and-snss&gt;here&lt;/a&gt; or download it right &lt;a href=https://ricma.co/files/linuxday/2015/questionario.zip&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;This, instead, is a chart of the results:&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;questionnary aggregations displayed as image&quot; class=rounded loading=lazy src=https://ricma.co/posts/talks/young-people-and-snss/questionnaire.webp&gt;&lt;/figure&gt;</description>
      <pubDate>Mon, 26 Oct 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/young-people-and-snss/</guid>
    </item>
    <item>
      <title>Linux Day 2015</title>
      <link>https://ricma.co/posts/tech/linux/linux-day-2015/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linuxday logo 2015&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-day-2015/linuxday2015.webp&gt;&lt;/figure&gt;&lt;p&gt;This year the &lt;a href=https://www.linuxvar.it/linux-2015/&gt;LUG I usually attend&lt;/a&gt; and another neighbour LUG, &lt;a href=http://www.gl-como.it/v2015/linux-day-2015/&gt;GL-Como&lt;/a&gt;, organized the 2015 edition of the &lt;a href=http://www.linuxday.it&gt;Linux Day&lt;/a&gt; at the &lt;a href=http://www.istitutosantelia.gov.it&gt;ISISS Sant&#39;Elia&lt;/a&gt; in Cantù, near Como.&lt;/p&gt;&lt;p&gt;We organized some talks and workshops, together with a questionnaire to make students see and try what the Linux and the open source communty is.&lt;/p&gt;&lt;p&gt;I helped with the &lt;a href=http://www.arduino.cc&gt;Arduino&lt;/a&gt; workshop and completely designed the questionnaire about &quot;&lt;em&gt;young people and the Internet&lt;/em&gt;&quot;, which the student have answered on an &lt;a href=http://www.ltsp.org&gt;LTSP&lt;/a&gt; (refer &lt;a href=https://ricma.co/posts/talks/ltsp&gt;here&lt;/a&gt; to some LTSP slides) post in a Linux adapted laboratory.&lt;/p&gt;&lt;p&gt;Furter and detailed information about presented questionnaire can be viewed &lt;a href=https://ricma.co/posts/talks/young-people-and-snss&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Some photos are to be admired &lt;a href=https://ricma.co/files/linuxday/2015/photos.zip&gt;here&lt;/a&gt; or &lt;a href=https://www.linuxvar.it/linux-2015/&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Fri, 23 Oct 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/linux/linux-day-2015/</guid>
    </item>
    <item>
      <title>Install Apache Hadoop 2.7 (on *buntu 14.04)</title>
      <link>https://ricma.co/posts/tech/tutorials/hadoop-15/</link>
      <description>&lt;p&gt;If you are interested in Hadoop, read more &lt;a href=https://hadoop.apache.org&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For this tutorial, I&#39;ll use a VM with &lt;strong&gt;Linux Mint 17.2 XFCE&lt;/strong&gt;, 64 bit version, relying on &lt;strong&gt;VirtualBox 5.0.6&lt;/strong&gt; for the virtualization. (Just to mention it, I&#39;m running Windows 10, 64 bit, because my Arch installation is currently broken)&lt;/p&gt;&lt;p&gt;The guest system setup is as follows:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;All 4 cores of my i7-4770k (but minimum is 2)&lt;/li&gt;&lt;li&gt;5120 MB of RAM (although 1024 MB should be enough)&lt;/li&gt;&lt;li&gt;A dinamically allocated 15 GB VDI hard disk (5 GB are the least)&lt;/li&gt;&lt;li&gt;Linux Mint 17.2 x64 DVD (but every *buntu flavour should be ok)&lt;/li&gt;&lt;/ul&gt;&lt;h1 id=notes&gt;Notes&lt;/h1&gt;&lt;p&gt;When you read a line like this:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;jdoe@farlands ~ $ &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I imply a &lt;code&gt;bash&lt;/code&gt; prompt &lt;strong&gt;without&lt;/strong&gt; root priviledges, where &lt;code&gt;jdoe&lt;/code&gt; is the username and &lt;code&gt;farlands&lt;/code&gt; is the hostname.&lt;/p&gt;&lt;p&gt;On the other hand, when the line is like this:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I imply a &lt;code&gt;bash&lt;/code&gt; prompt &lt;strong&gt;with&lt;/strong&gt; root priviledges&lt;/p&gt;&lt;p&gt;Ok, let&#39;s start: run the guest os installation with default values and let&#39;s jump to hadoop headaches.&lt;/p&gt;&lt;h1 id=update-the-guest-system&gt;Update the guest system&lt;/h1&gt;&lt;p&gt;Open up a terminal and fire this commands to update repositories and upgrade the emulated system.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; update
farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; upgrade &lt;span class=&quot;token parameter variable&quot;&gt;-y&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=java-8&gt;Java 8&lt;/h1&gt;&lt;p&gt;We&#39;re going to use a precompiled and prepackaged version of Oracle Java 8 in the &lt;a href=http://www.webupd8.org&gt;Webupd8&lt;/a&gt; repo, to avoid further difficulties.&lt;/p&gt;&lt;p&gt;Open up the usual terminal and input:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; purge openjdk*
farlands % add-apt-repository &lt;span class=&quot;token parameter variable&quot;&gt;-y&lt;/span&gt; ppa:webupd8team/java
farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; update
farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-y&lt;/span&gt; oracle-java8-installer&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can verify Java version by typing:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;java&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-version&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;java&lt;/span&gt; version &lt;span class=&quot;token string&quot;&gt;&quot;1.8.0_60&quot;&lt;/span&gt;
Java&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;TM&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; SE Runtime Environment &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;build &lt;span class=&quot;token number&quot;&gt;1.8&lt;/span&gt;.0_60-b27&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
Java HotSpot&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;TM&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;64&lt;/span&gt;-Bit Server VM &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;build &lt;span class=&quot;token number&quot;&gt;25.60&lt;/span&gt;-b23, mixed mode&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you read a similar output, you completed this step.&lt;/p&gt;&lt;p&gt;Next, we need to create the JAVA_HOME environmental variable, to give hadoop the capability to find java executables.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;export JAVA_HOME=/usr&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt; /etc/profile
farlands % &lt;span class=&quot;token builtin class-name&quot;&gt;source&lt;/span&gt; /etc/profile&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=disable-ipv6&gt;Disable IPv6&lt;/h1&gt;&lt;p&gt;Apache Hadoop supports only IPv4, so let&#39;s disable IPv6 in the kernel parameters.&lt;/p&gt;&lt;p&gt;Open the file &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % editor /etc/sysctl.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And append to the end:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token comment&quot;&gt;# Disable IPv6&lt;/span&gt;
net.ipv6.conf.all.disable_ipv6 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
net.ipv6.conf.default.disable_ipv6 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
net.ipv6.conf.lo.disable_ipv6 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=configure-ssh-keys&gt;Configure SSH keys&lt;/h1&gt;&lt;p&gt;We want to run our setup on a different general purpose user, so we will create a &lt;code&gt;hadoopuser&lt;/code&gt; user and a &lt;code&gt;hadoopgroup&lt;/code&gt; group.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % addgroup hadoopgroup
farlands % adduser &lt;span class=&quot;token parameter variable&quot;&gt;-ingroup&lt;/span&gt; hadoopgroup hadoopuser&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We need ssh access to our machine, so let&#39;s install and start an OpenSSH server.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; openssh-server
farlands % &lt;span class=&quot;token function&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; start
farlands % update-rc.d &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; defaults&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to setup passwordless ssh, by means of crypto keys. In first place, we change to the &lt;code&gt;hadoopuser&lt;/code&gt; account, then we create the key using RSA encryption and finally we authorize the key for the current user.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;su&lt;/span&gt; - hadoopuser
hadoopuser@farlands ~ $ ssh-keygen &lt;span class=&quot;token parameter variable&quot;&gt;-t&lt;/span&gt; rsa &lt;span class=&quot;token parameter variable&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;
hadoopuser@farlands ~ $ &lt;span class=&quot;token function&quot;&gt;cat&lt;/span&gt; ~/.ssh/id_rsa.pub &lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt; ~/.ssh/authorized_keys
hadoopuser@farlands ~ $ &lt;span class=&quot;token function&quot;&gt;chmod&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;600&lt;/span&gt; ~/.ssh/authorized_keys
hadoopuser@farlands ~ $ ssh-copy-id &lt;span class=&quot;token parameter variable&quot;&gt;-i&lt;/span&gt; ~/.ssh/id_rsa.pub localhost
hadoopuser@farlands ~ $ &lt;span class=&quot;token function&quot;&gt;ssh&lt;/span&gt; localhost&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If no password were asked on ssh login, you successfully configured passwordless ssh for user &lt;code&gt;hadoopuser&lt;/code&gt;.&lt;/p&gt;&lt;h1 id=install-hadoop&gt;Install Hadoop&lt;/h1&gt;&lt;p&gt;We are ready to install Hadoop. Unfortunately, it does not come prepackaged, but we have to extract and move it to &lt;code&gt;/usr/local&lt;/code&gt;.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % &lt;span class=&quot;token function&quot;&gt;wget&lt;/span&gt; http://mirrors.muzzy.it/apache/hadoop/common/hadoop-2.7.1/hadoop-2.7.1.tar.gz
farlands % &lt;span class=&quot;token function&quot;&gt;tar&lt;/span&gt; xzf hadoop-2.7.1.tar.gz
farlands % &lt;span class=&quot;token function&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-rf&lt;/span&gt; hadoop-2.7.1.tar.gz
farlands % &lt;span class=&quot;token function&quot;&gt;mv&lt;/span&gt; hadoop-2.7.1 /usr/local
farlands % &lt;span class=&quot;token function&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-sf&lt;/span&gt; /usr/local/hadoop-2.7.1/ /usr/local/hadoop
farlands % &lt;span class=&quot;token function&quot;&gt;chown&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-R&lt;/span&gt; hadoopuser:hadoopgroup /usr/local/hadoop-2.7.1/&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to configure some environmental variables, with the &lt;code&gt;hadoopuser&lt;/code&gt; account. Switch to that account and edit &lt;code&gt;~/.bashrc&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ editor ~/.bashrc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Append at the end:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token comment&quot;&gt;# Hadoop config&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_PREFIX&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/usr/local/hadoop
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/usr/local/hadoop
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_MAPRED_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_COMMON_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_HDFS_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;YARN_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_CONF_DIR&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_HOME}&lt;/span&gt;/etc/hadoop
&lt;span class=&quot;token comment&quot;&gt;# Native path&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_COMMON_LIB_NATIVE_DIR&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;${HADOOP_PREFIX}&lt;/span&gt;/lib/native
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;HADOOP_OPTS&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;-Djava.library.path=&lt;span class=&quot;token variable&quot;&gt;$HADOOP_PREFIX&lt;/span&gt;/lib/native&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Java path&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;JAVA_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/usr&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# OS path&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;&lt;span class=&quot;token environment constant&quot;&gt;PATH&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token environment constant&quot;&gt;$PATH&lt;/span&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$HADOOP_HOME&lt;/span&gt;/bin:&lt;span class=&quot;token variable&quot;&gt;$JAVA_PATH&lt;/span&gt;/bin:&lt;span class=&quot;token variable&quot;&gt;$HADOOP_HOME&lt;/span&gt;/sbin&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next, source &lt;code&gt;~/.bashrc&lt;/code&gt; to apply changes.&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ &lt;span class=&quot;token builtin class-name&quot;&gt;source&lt;/span&gt; ~/.bashrc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to edit &lt;code&gt;/usr/local/hadoop/etc/hadoop/hadoop-env.sh&lt;/code&gt;:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;farlands % editor /usr/local/hadoop/etc/hadoop/hadoop-env.sh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And add this at the end:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;JAVA_HOME&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/usr&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=configure-hadoop&gt;Configure Hadoop&lt;/h1&gt;&lt;p&gt;Hadoop configuration is quite hard, because it has a lot of config files. We need to navigate to &lt;code&gt;/usr/local/hadoop/etc/hadoop&lt;/code&gt; and edit these files:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;core-site.xml&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;hdfs-site.xml&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;mapred-site.xml&lt;/code&gt; (needs to be copied from &lt;code&gt;mapred-site.xml.template&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;code&gt;yarn-site.xml&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;They all are XML files with a top-level &lt;code&gt;&amp;lt;configuration&gt;&lt;/code&gt; node. For clarity we report the configuration node only.&lt;/p&gt;&lt;h2 id=core-site-xml&gt;&lt;code&gt;core-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;fs.default.name&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;hdfs://localhost:9000&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=hdfs-site-xml&gt;&lt;code&gt;hdfs-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;dfs.replication&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;1&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;dfs.name.dir&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;file:/usr/local/hadoop/hadoopdata/hdfs/namenode&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;dfs.data.dir&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;file:/usr/local/hadoop/hadoopdata/hdfs/datanode&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=mapred-site-xml&gt;&lt;code&gt;mapred-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;mapreduce.framework.name&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;yarn&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=yarn-site-xml&gt;&lt;code&gt;yarn-site.xml&lt;/code&gt;&lt;/h2&gt;&lt;pre class=language-xml&gt;&lt;code class=language-xml&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;yarn.nodemanager.aux-services&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;mapreduce_shuffle&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=format-namenode&gt;Format namenode&lt;/h2&gt;&lt;p&gt;Next, we need to format the namenode filesystem with the following command:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ hdfs namenode &lt;span class=&quot;token parameter variable&quot;&gt;-format&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Search the output: if you can read a string like this:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;INFO common.Storage: Storage directory /usr/local/hadoop/hadoopdata/hdfs/namenode has been successfully formatted.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&#39;s done.&lt;/p&gt;&lt;h1 id=start-and-stop-services&gt;Start and stop services&lt;/h1&gt;&lt;p&gt;Now, the last thing to do is starting Hadoop services:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ start-dfs.sh
hadoopuser@farlands ~ $ start-yarn.sh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To check the status of the services use the &lt;code&gt;jps&lt;/code&gt; command:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ jps
&lt;span class=&quot;token number&quot;&gt;26899&lt;/span&gt; Jps
&lt;span class=&quot;token number&quot;&gt;26216&lt;/span&gt; SecondaryNameNode
&lt;span class=&quot;token number&quot;&gt;25912&lt;/span&gt; NameNode
&lt;span class=&quot;token number&quot;&gt;26041&lt;/span&gt; DataNode
&lt;span class=&quot;token number&quot;&gt;26378&lt;/span&gt; ResourceManager
&lt;span class=&quot;token number&quot;&gt;26494&lt;/span&gt; NodeManager&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To stop services, these are the commands:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;hadoopuser@farlands ~ $ stop-dfs.sh
hadoopuser@farlands ~ $ stop-yarn.sh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Congratulations, you made it!&lt;/p&gt;</description>
      <pubDate>Tue, 20 Oct 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/hadoop-15/</guid>
    </item>
    <item>
      <title>Simple scene render in Blender</title>
      <link>https://ricma.co/posts/tech/projects/blender/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;blender logo&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/projects/blender/blender.webp&gt;&lt;/figure&gt;&lt;p&gt;Blender is a 3D modeling tool which became famouse after its supporting foundation, the &lt;a href=http://www.blender.org/foundation/&gt;Blender Foundation&lt;/a&gt;, produced some really neat &lt;a href=http://archive.blender.org/features-gallery/movies/index.html&gt;3D animated movies&lt;/a&gt;, the most famous being &lt;a href=http://www.bigbuckbunny.org&gt;Big Buck Bunny&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Originally it shipped with a very imprecise renderer, with no basis on physical laws and really, really inefficient. For this matter, it was seen more as a toy, than a wannabe professional tool.&lt;/p&gt;&lt;p&gt;Then the Cycles engine appeared and all changed. It was the first open source implmentation of a path tracer, ready to be modified to one&#39;s needs. Some companies saw its potential and backed the project with founds. Now the project is getting bigger and bigger and it is starting to be used in a professional environment. The bidirectional path tracer and the montecarlo extension are under development, so news are to be expected.&lt;/p&gt;&lt;p&gt;I made a little test render, with an Egyptian scene, to provide a sample of Cycles rendering engine powers. Here are the results (I know I am not very good at it, but I&#39;m still learning).&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;first render&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/projects/blender/blender-render1.webp&gt;&lt;/figure&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;second render&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/projects/blender/blender-render2.webp&gt;&lt;/figure&gt;&lt;p&gt;You can download the full resolution version of the &lt;a href=https://ricma.co/files/uni/blender/render-hi-1.webp&gt;first&lt;/a&gt; and &lt;a href=https://ricma.co/files/uni/blender/render-hi-2.webp&gt;second&lt;/a&gt; image, to use it as wallpaper or anything you like, but caution, every image is 8 MB and I serve the site on a slow connection...&lt;/p&gt;&lt;p&gt;My PC is only equipped with CPU rendering and, with a quality of 50 rays for pixel, render has completed in about 3 hours and 20 minutes. If you think you can do better here it is the &lt;a href=https://ricma.co/files/uni/blender/project.tar.gz&gt;blend file&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Fri, 25 Sep 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/projects/blender/</guid>
    </item>
    <item>
      <title>La Nuit Derniére a Parìs</title>
      <link>https://ricma.co/posts/movies/la-nuit-derniere-a-paris/</link>
      <description>&lt;p&gt;As my last exam for the Digital Communication degree I chose to produce a short film inspired by the work &quot;&lt;em&gt;Nighthakws&lt;/em&gt;&quot;, by &lt;a href=https://en.wikipedia.org/wiki/Edward_Hopper&gt;Edward Hopper&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you want to know more about Hopper&#39;s work check out &lt;a href=https://www.artsy.net/artist/edward-hopper&gt;his page&lt;/a&gt; on &lt;a href=https://www.artsy.net/about&gt;Artsy&lt;/a&gt;, a promising online art gallery.&lt;/p&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;nighthawks painting&quot; class=rounded loading=lazy src=https://ricma.co/posts/movies/la-nuit-derniere-a-paris/nighthawks.webp&gt;&lt;/figure&gt;&lt;p&gt;The story is about two mafia bosses (one being a female) and a cop protagonist who struggles to arrest them. In this journey, he will score some triumphs and suffer some defeats.&lt;/p&gt;&lt;p&gt;If you&#39;re interested, &lt;a href=https://ricma.co/files/uni/la-nuit-derniere-a-paris/la-nuit-derniere-a-paris_script.pdf&gt;here&lt;/a&gt; a copy of the script may be downloaded.&lt;/p&gt;&lt;p&gt;What remains to be said? Let&#39;s watch it.&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/3djXnzmdaAU&gt;&lt;/iframe&gt;&lt;/div&gt;</description>
      <pubDate>Sun, 20 Sep 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/movies/la-nuit-derniere-a-paris/</guid>
    </item>
    <item>
      <title>A codec evaluation test</title>
      <link>https://ricma.co/posts/tech/projects/codec-evaluation/</link>
      <description>&lt;p&gt;In 2015, we have reached a time where several efficient codecs for video compressing are available. Every one of them has its peculiarities as well as its drawbacks. Some it is more advanced than the other, such as in the case of H.265 and some belongs to a omnipresent past standard, which unfortunately is still much used: MPEG-2.&lt;/p&gt;&lt;p&gt;I elaborated a small comparison from the point of view of perceived quality. I chose to evaluate subjective quality, because it is what is sensed by users. An objective, sterile evaluation would have not given the same significant results.&lt;/p&gt;&lt;p&gt;I chose eight codecs, such as:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;MPEG-2&lt;/li&gt;&lt;li&gt;H.264&lt;/li&gt;&lt;li&gt;H.265&lt;/li&gt;&lt;li&gt;VP8&lt;/li&gt;&lt;li&gt;VP9&lt;/li&gt;&lt;li&gt;Theora&lt;/li&gt;&lt;li&gt;ProRes 422&lt;/li&gt;&lt;li&gt;Dirac&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To accomplish the example raw video compressione, I used the open source tool &lt;a href=http://ffmpeg.org&gt;ffmpeg&lt;/a&gt;. I produced two versions of compression: one optimized for standard quality and one which provides high quality.&lt;/p&gt;&lt;p&gt;Uncompressed test scenes are at a size of 1920x1080 pixels, with a framerate of 50 Hz. They are to be found on the &lt;a href=ftp://vqeg.its.bldrdoc.gov/HDTV/SVT_MultiFormat/1080p50_CgrLevels_SINC_FILTER_SVTdec05_/&gt;VQEG FTP&lt;/a&gt;, provided by the &lt;a href=http://www.its.bldrdoc.gov/vqeg/vqeg-home.aspx&gt;VQEG&lt;/a&gt;.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/uni/codec-evaluation/codec_evaluation-results.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;p&gt;Download the full article containing details and results of the evaluation &lt;a href=https://ricma.co/files/uni/codec-evaluation/codec_evaluation-results.pdf&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Sep 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/projects/codec-evaluation/</guid>
    </item>
    <item>
      <title>Introduction to Git</title>
      <link>https://ricma.co/posts/talks/git-introduction/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;git cvs logo&quot; class=rounded loading=lazy src=https://ricma.co/posts/talks/git-introduction/git.webp&gt;&lt;/figure&gt;&lt;p&gt;Git, THE content versioning system. Now it is a standard tool in the swiss army knife of every programmer in the world, worthy of this name. To the few, who are relatively new to programming and use other inefficient systems to share and catalogue their code, it is essential to fill the gap in their toolset.&lt;/p&gt;&lt;p&gt;Here I provided a (very) basic introduction to start using this wonderful, essential tool.&lt;/p&gt;&lt;p&gt;For the sake of opennes both a &lt;a href=https://ricma.co/files/linuxvar/intro_git/introduzione_git.odp&gt;ODP file&lt;/a&gt; and &lt;a href=https://ricma.co/files/linuxvar/intro_git/introduzione_git.pdf&gt;PDF file&lt;/a&gt; is available.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/linuxvar/intro_git/introduzione_git.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;</description>
      <pubDate>Mon, 18 May 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/git-introduction/</guid>
    </item>
    <item>
      <title>Trust &amp; Self-disclosure in online interactions (focusing on young people)</title>
      <link>https://ricma.co/posts/talks/trust-self-disclosure/</link>
      <description>&lt;p&gt;By Riccardo Macoratti and Stanislao Vezzosi&lt;/p&gt;&lt;h1 id=bibliography&gt;Bibliography&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Bryce, J. and Fraser, J. (2013) &quot;&lt;em&gt;The role of disclosure of personal information in the evaluation of risk and trust in young peoples&#39; online interactions&lt;/em&gt;&quot;, Computers in Human Behavior, 30(2014): 299-306.&lt;/li&gt;&lt;li&gt;Bryce, J. and Klang, M. (2009) &quot;&lt;em&gt;Young people, disclosure of personal information and online privacy: Control, choice and consequences&lt;/em&gt;&quot;, Information security technical report, 14(2009): 160–166.&lt;/li&gt;&lt;li&gt;Taddei, S. and Contena, B. (2012) &quot;&lt;em&gt;Privacy, trust and control: Which relationships with online self-disclosure?&lt;/em&gt;&quot;, Computers in Human Behavior, 29(2013): 821–826.&lt;/li&gt;&lt;/ul&gt;&lt;h1 id=sitography&gt;Sitography&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Wikipedia, &lt;a href=https://en.wikipedia.org/wiki/Trust_%28social_sciences%29&gt;Trust (social sciences)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Wiktionary, &lt;a href=https://en.wiktionary.org/wiki/trust&gt;Trust&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h1 id=slides&gt;Slides&lt;/h1&gt;&lt;p&gt;Slides are made with &lt;a href=https://prezi.com/&gt;Prezi&lt;/a&gt;, but PDF files are provided below the presentation.&lt;/p&gt;&lt;h2 id=introduction&gt;Introduction&lt;/h2&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; src=&quot;https://prezi.com/embed/xno44xarjdce/?bgcolor=ffffff&amp;amp;amp;lock_to_path=1&amp;amp;amp;autoplay=0&amp;amp;amp;autohide_ctrls=0#&quot; loading=lazy&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=https://ricma.co/files/uni/trust-self-disclosure/trust-self_disclosure-introduzione.pdf&gt;Download&lt;/a&gt;&lt;/p&gt;&lt;h2 id=young-people&gt;Young people&lt;/h2&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe class=&quot;absolute top-0 left-0 size-full&quot; src=&quot;https://prezi.com/embed/udsvkw2f68qb/?bgcolor=ffffff&amp;amp;amp;lock_to_path=1&amp;amp;amp;autoplay=0&amp;amp;amp;autohide_ctrls=0#&quot; loading=lazy&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=https://ricma.co/files/uni/trust-self-disclosure/trust-self_disclosure-giovani.pdf&gt;Download&lt;/a&gt;&lt;/p&gt;&lt;h1 id=questionary&gt;Questionary&lt;/h1&gt;&lt;p&gt;A summary for our questionary &quot;&lt;strong&gt;Do computer science students trust SNSs?&lt;/strong&gt;&quot; is available as &lt;a href=https://ricma.co/files/uni/trust-self-disclosure/trust_in_sns_questionary.pdf&gt;PDF&lt;/a&gt;.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/uni/trust-self-disclosure/trust_in_sns_questionary.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;</description>
      <pubDate>Sat, 02 May 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/trust-self-disclosure/</guid>
    </item>
    <item>
      <title>How do I used to run this site?</title>
      <link>https://ricma.co/posts/tech/server/</link>
      <description>&lt;blockquote&gt;&lt;p&gt;Note that now the site is served through &lt;a href=https://www.statichost.eu/&gt;statichost&lt;/a&gt;. I am still concerned about privacy, but my connection is not so stable connection anymore, so...&lt;/p&gt;&lt;/blockquote&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;raspberry pi 3 photo&quot; class=rounded loading=lazy src=https://ricma.co/posts/tech/server/rpi3.webp&gt;&lt;/figure&gt;&lt;p&gt;I have never been a fan of giving away all my informations and personally produced content to a service provider I don&#39;t completely know and trust. I had a bad experience, when my virtual server provider deleted all my files without my consent or any prior warning and, remembering that, I actually prefer to handle my own data by myself.&lt;/p&gt;&lt;p&gt;In order to do that, I need some sort of association from an hostname to my ISP provided dynamic IP. So I bought the domain you are seing on top, mainly because its provider offered a dynamic DNS service included. Before that, I used a third level free dynamic DNS service provided by the &lt;a href=http://linuxvar.it/content/dynamic-dns&gt;LUG&lt;/a&gt; (Linux User Group) I attend.&lt;/p&gt;&lt;p&gt;Alas the Internet connection in my country isn&#39;t that great, but I, personally speaking, cannot complain at all. I have an asymetric DSL 12 / 0.8 Mbps, quite enough for offering simple services such as HTTP and git. I connect to the Internet by means of a cheap router that supports high speed ethernet and a WLAN.&lt;/p&gt;&lt;p&gt;But the real star of this page is the server phisically providing this service, a &lt;a href=https://www.raspberrypi.org/products/raspberry-pi-3-model-b/&gt;Raspberry Pi 3&lt;/a&gt;, produced by &lt;a href=https://www.raspberrypi.org/&gt;Raspberry Foundation&lt;/a&gt;. It is an embedded, single board, but modestly high powered computer, backed by an &lt;a href=https://en.wikipedia.org/wiki/ARM_architecture#ARMv8-A&gt;ARMv8&lt;/a&gt; processor and 1 GB of RAM, running my beloved &lt;a href=https://www.archlinux.org/&gt;Arch Linux&lt;/a&gt;, ARM version.&lt;/p&gt;&lt;h1 id=software&gt;Software&lt;/h1&gt;&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;nginx logo&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/server/nginx.webp&gt;&lt;/figure&gt;&lt;p&gt;I chose &lt;a href=https://www.nginx.com/&gt;nginx&lt;/a&gt; as web server, because it is very light in terms of used resources and easy to configure, although I currently don&#39;t use any server side scripting engine, like PHP or Python. I plan to set up some Python FCGI in order to provide some small services.&lt;/p&gt;&lt;p&gt;The site is, therefore, static, but not completely handwritten. As stated in the footer at the bottom of every page, this site is generated with the excellent static content generator &lt;a href=http://getpelican.com/&gt;Pelican&lt;/a&gt;.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Ehm... Update, the site has now been ported to &lt;a href=https://gohugo.io&gt;Hugo&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;Uhm... Second update, the site has now been ported again to &lt;a href=https://www.11ty.dev&gt;Eleventy&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;</description>
      <pubDate>Wed, 22 Apr 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/server/</guid>
    </item>
    <item>
      <title>Some short films</title>
      <link>https://ricma.co/posts/movies/short-films/</link>
      <description>&lt;p&gt;Ok, I know, I know... My directing, editing and producing ability is not at its finest, although I&#39;m learning. It is not my field, though, so I do not expect to improve much.&lt;/p&gt;&lt;p&gt;I had to realize two clips for a university exam.&lt;/p&gt;&lt;p&gt;One using the stop motion technique:&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/AKndch7vk-E&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;And one using a chroma key footage:&lt;/p&gt;&lt;div class=&quot;relative h-0 overflow-hidden pt-7.5 pb-[56.2%]&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; class=&quot;absolute top-0 left-0 size-full&quot; title=&quot;YouTube video player&quot; allowfullscreen loading=lazy src=https://www.youtube-nocookie.com/embed/nhOYaf9BSEU&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Quite amatorial, right? Well, it&#39;s a start.&lt;/p&gt;</description>
      <pubDate>Sat, 18 Apr 2015 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/movies/short-films/</guid>
    </item>
    <item>
      <title>Wicd and Eduroam @ UNIMI</title>
      <link>https://ricma.co/posts/tech/tutorials/wicd-eduroam/</link>
      <description>&lt;p&gt;&lt;a href=http://wicd.sourceforge.net/&gt;Wicd&lt;/a&gt; is an awesome network configuration manager: no clutter, small footprint and very, very simple (in the UNIX/KISS way).&lt;/p&gt;&lt;p&gt;The only problem has come when I had to connect to my university network, powered by &lt;a href=http://www.servizi.garr.it/index.php/it/eduroam&gt;Eduroam&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;My institute has chosen to use WPA2 Enterprise with PEAP/MSCHAPV2 encryption.&lt;/p&gt;&lt;p&gt;To be able to connect with Wicd a configuration file, under path &lt;code&gt;/etc/wicd/encryption/templates&lt;/code&gt; shall be provided.&lt;/p&gt;&lt;p&gt;Go to that path and create a file (as root) named &lt;code&gt;eduroam-unimi&lt;/code&gt; with this content:&lt;/p&gt;&lt;pre class=language-sh&gt;&lt;code class=language-sh&gt;&lt;span class=&quot;token assign-left variable&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;Eduroam
&lt;span class=&quot;token assign-left variable&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;Riccardo Macoratti
&lt;span class=&quot;token assign-left variable&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1.1&lt;/span&gt;
require identity *Name password *Pass
protected password *Pass
-----
&lt;span class=&quot;token assign-left variable&quot;&gt;ctrl_interface&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;/var/run/wpa_supplicant
&lt;span class=&quot;token assign-left variable&quot;&gt;network&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token assign-left variable&quot;&gt;ssid&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$_ESSID&lt;/span&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;token assign-left variable&quot;&gt;scan_ssid&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$_SCAN&lt;/span&gt;
  &lt;span class=&quot;token assign-left variable&quot;&gt;key_mgmt&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;WPA-EAP
  &lt;span class=&quot;token assign-left variable&quot;&gt;eap&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;PEAP
  &lt;span class=&quot;token assign-left variable&quot;&gt;identity&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$_IDENTITY&lt;/span&gt;@studenti.unimi.it&quot;&lt;/span&gt;
  &lt;span class=&quot;token assign-left variable&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$_PASSWORD&lt;/span&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;token assign-left variable&quot;&gt;phase1&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;peaplabel=0&quot;&lt;/span&gt;
  &lt;span class=&quot;token assign-left variable&quot;&gt;phase2&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;auth=MSCHAPV2&quot;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then open a console and give the command:&lt;/p&gt;&lt;pre class=language-bash&gt;&lt;code class=language-bash&gt;$ &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;eduroam-unimi&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt; /etc/wicd/encryption/templates/active&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally open wicd-client, highlight the connection and press &lt;em&gt;Properties&lt;/em&gt;. Select &quot;Use encryption&quot; and from the box select &quot;Eduroam&quot;. Insert username in the form &lt;code&gt;name.surname&lt;/code&gt; and your webmail password. Press &lt;em&gt;OK&lt;/em&gt; and then &lt;em&gt;Connect&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Enjoy the Internet!&lt;/p&gt;</description>
      <pubDate>Sat, 20 Dec 2014 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/tutorials/wicd-eduroam/</guid>
    </item>
    <item>
      <title>Linux Day 2014</title>
      <link>https://ricma.co/posts/tech/linux/linux-day-2014/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;linuxday logo 2014&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/tech/linux/linux-day-2014/linuxday2014.webp&gt;&lt;/figure&gt;&lt;p&gt;This year too (2014) a &lt;a href=http://www.linuxday.it&gt;Linux Day&lt;/a&gt; edition for the Varese area has been organized by the &lt;a href=https://www.linuxvar.it/linuxday-sabato-25-ottobre-2014/&gt;LinuxVar&lt;/a&gt; and &lt;a href=http://www.gl-como.it/&gt;GL-Como&lt;/a&gt; LUG and the &lt;a href=http://lifolab.org&gt;LIFO&lt;/a&gt; laboratory at the &lt;a href=http://www.faberlab.org&gt;FaberLab&lt;/a&gt; of Tradate, an interesting place where you can build up your ideas, make 3D and ceramics printings and find someone who will teach you all these goodies.&lt;/p&gt;&lt;p&gt;As usual, some talks, workshop and projects took place. But this year there has been quite a substancial difference with respect to past editions, because for the first time the fair will be targeted exclusively to students.&lt;/p&gt;&lt;h1 id=me&gt;Me&lt;/h1&gt;&lt;p&gt;Personally I showed &lt;a href=http://www.ltsp.org&gt;LTSP&lt;/a&gt;, a server-thin client system for schools and organizations computer laboratories. We provided a small lab-like structure with three posts and an LTSP server.&lt;/p&gt;&lt;p&gt;A more descrptive and detailed explanation of this system is present at this &lt;a href=https://ricma.co/posts/talks/ltsp&gt;page&lt;/a&gt;, complete with slides used to show it.&lt;/p&gt;&lt;p&gt;Some photos of the event can be, instead, downloaded &lt;a href=https://ricma.co/files/linuxday/2014/photos.zip&gt;here&lt;/a&gt;, on my file server.&lt;/p&gt;</description>
      <pubDate>Thu, 30 Oct 2014 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/tech/linux/linux-day-2014/</guid>
    </item>
    <item>
      <title>LTSP: Linux Terminal Server Project</title>
      <link>https://ricma.co/posts/talks/ltsp/</link>
      <description>&lt;figure class=&quot;flex flex-col items-center&quot;&gt;&lt;img alt=&quot;ltsp logo&quot; class=&quot;bg-fg dark:bg-bg p-2.5 rounded&quot; src=https://ricma.co/posts/talks/ltsp/ltsp.webp&gt;&lt;/figure&gt;&lt;p&gt;&lt;a href=http://www.ltsp.org/&gt;LTSP&lt;/a&gt; is a server-client technology built in order to fulfill the computing needs of small officies and educational environments.&lt;/p&gt;&lt;p&gt;The typical system is a dedicated network in which the server is a powerful elaborator and the clients (known as &lt;strong&gt;thin clients&lt;/strong&gt;) are computers without rotative parts, such as a hard disk, with only a motherboard, a small amount RAM, a very modest CPU, GPU and I/O peripherals (monitor, keyboard and mouse).&lt;/p&gt;&lt;p&gt;The server provides computation power, network connection and a complete operative system, while clients only draw the graphics and handle I/O.&lt;/p&gt;&lt;p&gt;I made a quick and simple presentation of LTSP features, with a stress on how to build a LTSP system easily.&lt;/p&gt;&lt;div class=h-160&gt;&lt;object data=&quot;https://ricma.co/files/linuxday/2014/ltsp.pdf?#zoom=page-width&amp;pagemode=none&quot; class=size-full loading=lazy type=application/pdf&gt;&lt;div class=&quot;size-full flex flex-row justify-center items-center gap-2&quot;&gt;&lt;i class=&quot;ph ph-seal-warning&quot;&gt;&lt;/i&gt; Unable to display PDF file&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;p&gt;Slides can be downloaded &lt;a href=https://ricma.co/files/linuxday/2014/ltsp.pdf&gt;here&lt;/a&gt; in PDF format and &lt;a href=https://ricma.co/files/linuxday/2014/ltsp.odp&gt;here&lt;/a&gt; in ODP format.&lt;/p&gt;</description>
      <pubDate>Thu, 30 Oct 2014 00:00:00 GMT</pubDate>
      <dc:creator>Riccardo Macoratti</dc:creator>
      <guid>https://ricma.co/posts/talks/ltsp/</guid>
    </item>
  </channel>
</rss>