Jekyll2021-06-02T15:19:53+00:00http://libremente.eu/feed.xmlLibreMenteLibre blog... for a mente Libera!Typos in Articles2018-05-07T09:38:00+00:002018-05-07T09:38:00+00:00http://libremente.eu/2018/05/07/typos<p>The first thing I do in the morning is checking <a href="https://ansa.it">ANSA</a>, which
is one of the most important Italian news agencies.
What I like about such agency is the format of the news: I think it provides
a reasonable amount of information in a decent amount of display space. A good
compromise.</p>
<p>However, <em>every morning</em>, I spot typos somewhere in the text. I am shocked
about this since, in 2018, it looks a bit strange to me how something can go
live on a news website, ranked as the 4th most followed brand in Italy by
<a href="https://reutersinstitute.politics.ox.ac.uk/sites/default/files/Digital%20News%20Report%202017%20web_0.pdf?utm_source=Direct">Reuters</a>,
with so many typos.</p>
<p>I should dig further in order to understand how this can possibly happen.
I guess there is no revision time since they want the exclusivity of the
articles but what happens with the embedded checker? I believe they use
an online form to insert posts. As such, I think it is reasonable to guess that
their CMS has an internal checker in
place since most WYSIWYG editors, also the free ones, have it nowadays.
Seeing the amount of publications, I believe there is not a third
party reviewing the article if not all the easy-to-spot errors should not
appear in the live version.
So let’s imagine a typical workflow:</p>
<ul>
<li>the reporter quickly writes the article using his office automation tool.</li>
<li>He/She logs in the CMS and copy/pastes it in the form.</li>
<li>Push send. Ta-daaan, it’s live.</li>
</ul>
<p>This would mean that a double check should be in place.
Now, if two checks are not enough, is there a way to prevent this from
happening again? Should the CMS stop and ask for a review of each error
in an <em>aspell</em> fashion? Should
it change color of the text or put a big red box behind it?
It’s 2018 folks, everyone is talking about AI, robotics and so on but we still have to read bad
formatted articles full of bugs. I think this can be <strong>easily</strong>
avoided.</p>
<p>However, do people really care about this problem or it’s just me?
Personally, when I see such trivial typos in articles I immediately think the
credibility of the whole journal is undermined. But, again, maybe it’s just my
way of seeing things.</p>
<p>PS: this article goes through an
<code class="language-plaintext highlighter-rouge">aspell --lang=en check</code> process before being pushed. If you can still spot
mistakes, please excuse
me and let me know (after all, I am not a news agency, I should be allowed to
make mistakes) :).</p>surFThe first thing I do in the morning is checking ANSA, which is one of the most important Italian news agencies. What I like about such agency is the format of the news: I think it provides a reasonable amount of information in a decent amount of display space. A good compromise.New Year’s Code Resolution2018-01-06T10:38:00+00:002018-01-06T10:38:00+00:00http://libremente.eu/2018/01/06/new-year-code-resolution<p>Yet another post on new year’s resolutions.
Actually I am writing it just to keep track of my achievements and see what
happens in the following months.</p>
<p>So here it is…</p>
<ul>
<li><strong>Refactor</strong> my development setup. Standing desk, new monitors, new keyboard,
new laptop are ready to shine.</li>
<li><strong>Publish</strong> all the code I developed locally. It’s a lot of code which may be
useful for the community. I want to find some spare time to refactor it, fill it
with documentation and make it as easy as possible to quickly see it in
action.</li>
<li><strong>Speed up</strong> the development cycle. Many times I find myself working with people
who don’t know what a VM is (don’t even think about <code class="language-plaintext highlighter-rouge">vagrant</code> or <code class="language-plaintext highlighter-rouge">docker</code>)
and I believe that seeing code written in the local <code class="language-plaintext highlighter-rouge">/var/www/</code> in 2018 is an
avoidable
pain. So my resolution here is to stress the use of some sort of
‘‘container’’ which makes it possible to ship faster and collaborate
painlessly being
able to reproduce the same environment.</li>
<li><strong>Learn</strong> TDD and Dynamic Programming. This is something I started to study many
times but I never tried in a real world use case. I believe in it, and I think
it may be a good deal to foster it more.</li>
<li><strong>Contribute</strong> to FOSS projects more. Which translates in polishing and pushing
some patches I’ve already done for a set of programs locally and in finding more
interesting projects to contribute to.</li>
<li><strong>Donate</strong> to FOSS projects. I will continue to do it as much as possible.</li>
<li><strong>Read</strong> more. My next buy will be the latest release of ‘‘Two Scoops of Django’’.</li>
</ul>
<p>Let’s see what I can do in this 2018! :)</p>surFYet another post on new year’s resolutions. Actually I am writing it just to keep track of my achievements and see what happens in the following months.How to handle Open edX XBlocks localization2017-12-06T00:00:00+00:002017-12-06T00:00:00+00:00http://libremente.eu/2017/12/06/edx-translation<p>Open edX is the platform which powers MOOC websites like
<a href="http://edx.org">edx.org</a>, <a href="https://lagunita.stanford.edu">Stanford’s Lagunita</a>
and many other MOOC providers worldwide.
Since it has been released with a FOSS license, its adoption has wildly
increased and right now millions of users worldwide are using such a platform
for their online courses.
As such, the possibility to translate the interface should be a top priority
but, unfortunately, not all the components have such a functionality out of the
box. In fact, the platform’s external modules, also called <code class="language-plaintext highlighter-rouge">XBlocks</code>, are
difficult to translate and this article is meant to depict all the possible
ways to approach such a task.</p>
<p>Localization is handled pretty well in the <em>edx-platform</em>: there are dedicated
tools
to handle all the <a href="https://github.com/edx/i18n-tools">translation
processes</a> and teams on Transifex
which help
translating the interfaces and the contents <a href="https://www.transifex.com/open-edx/edx-platform/">[you may join them
here]</a>.</p>
<p>However, for what concerns the external modules which can be integrated in the
platform, called <a href="https://open.edx.org/xblocks">XBlocks</a>, there are still
issues to be faced and there
are ongoing efforts by the edX engineers in order to solve them.
The existing integrated translation solution is not working at the moment of writing
(if you are lucky you may see the bug <a href="https://openedx.atlassian.net/browse/WL-230">here</a>).</p>
<p>Some XBlocks are correctly translated like, e.g., <a href="https://github.com/edx/edx-ora2">ORA2</a> or edX Proctoring.
However, they are just isolated cases and, unfortunately, not all the XBlocks
developers follow the translations guidelines.</p>
<p>In order to understand the nature of this problem it is necessary to understand
what is the nature of an XBlock inside the Open edX structure. At the moment of
writing, XBlocks are not <em>Django Apps</em> but they can be seen as standalone
modules.
In
fact, XBlocks should be coded in an independent way with respect to the
edx-platform and it could also be possible to run them as standalone. Originally
called XModules, XBlocks should use standard Python and Mako template engine
exactly for the up-cited purpose.
Furthermore, for
development purposes, it is possible to use a standalone software development
kit which does not require a running instance of Open edX installed (<a href="https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/getting_started/setup_sdk.html">see
here</a>)
and makes it handy to develop new functionalities.
This means that the developers have to follow some strict guidelines regarding
the implementation of such blocks like, e.g., the templating engine used, and this
is causing some issues with the interoperability with the existing localization
engine.</p>
<p>For the sake of this quick guide, let’s first of all analyze the way Django handles
translations.
First of all, all the message files containing the translations in a given language,
characterized by the <code class="language-plaintext highlighter-rouge">.po</code> extensions, are compiled into the machine readable
<code class="language-plaintext highlighter-rouge">.mo</code> binary files.
This usually in Django is done by using the</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>django-admin makemessages -a
</code></pre></div></div>
<p>but in Open edX there are several other ways to do this, i.e. using the
i18n suite mentioned before.
Afterwards, these message files have to be seen by Django in order to be
correctly applied.
The order of the search is the following:</p>
<ol>
<li>the directories listed in <code class="language-plaintext highlighter-rouge">LOCALE_PATHS</code> have the highest precedence, with
the ones appearing first having higher precedence than the ones appearing
later.</li>
<li>Then, it looks for and uses if it exists a locale directory in each of the
installed apps listed in <code class="language-plaintext highlighter-rouge">INSTALLED_APPS</code>. The ones appearing first have
higher precedence than the ones appearing later.</li>
<li>Finally, the Django-provided base translation in <code class="language-plaintext highlighter-rouge">django/conf/locale</code> is used
as a fallback.</li>
</ol>
<p>So, analyzing the list we can see how number 2. is not our case since declaring
an XBlock as a Django App is not a best practice. I have tried this and it
works without problems but many developers advised me that it’s not an
encouraged
practice, even if a UI Architect at edX told me that it’s not
a problem (check out the thread
<a href="https://groups.google.com/forum/#!topic/openedx-translation/cLR5tZI5oqQ">here</a>).
However, it seems that in the futures XBlocks will be proper Django apps and
this can be seen in this OEP
<a href="https://open-edx-proposals.readthedocs.io/en/latest/oep-0012.html#refactor-xblocks-to-be-based-upon-django">here</a>.</p>
<p>Also, point number 3. is not so straightforward since it would mean that for
each new XBlock installed we ought to move the translation files to that
specific django folder, to create a new <code class="language-plaintext highlighter-rouge">.po</code> file and finally a <code class="language-plaintext highlighter-rouge">.mo</code> one. Not very handy.</p>
<p>Solution number 1. might a good pick since, by explicitly telling Django
where to look at, it should be able to pick the new translations.</p>
<p>I tried to implement the different solutions and they are all depicted in <a href="https://github.com/libremente/edx-platform/commit/22292d5e26207eeb772778990e2f28196581030f">this
commit</a>.</p>
<p>The following piece of code adds solution number 1. to the <code class="language-plaintext highlighter-rouge">lms/startup.py</code>
file which is invoked during startup.</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">enable_locale_discovery</span><span class="p">():</span>
<span class="s">"""
Enables Django to see and apply the translations in the XBlocks
After retrying all the xblocks currently installed, it checks whether a
`translations` folder exists and adds it to the LOCALE_PATHS list.
"""</span>
<span class="kn">import</span> <span class="nn">inspect</span><span class="p">,</span> <span class="n">os</span>
<span class="kn">from</span> <span class="nn">xblock.core</span> <span class="kn">import</span> <span class="n">XBlock</span>
<span class="c1"># Folder name where the XBlocks' translations are located
</span> <span class="n">locale_folder</span> <span class="o">=</span> <span class="s">'translations'</span>
<span class="c1"># Retry list of loaded XBlocks
</span> <span class="n">xblocks_list</span> <span class="o">=</span> <span class="n">XBlock</span><span class="p">.</span><span class="n">load_classes</span><span class="p">()</span>
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">class_</span> <span class="ow">in</span> <span class="n">xblocks_list</span><span class="p">:</span>
<span class="c1"># For each XBlock, get the absolute path of the compiled file
</span> <span class="n">xblock_install_path</span> <span class="o">=</span> <span class="n">inspect</span><span class="p">.</span><span class="n">getfile</span><span class="p">(</span><span class="n">class_</span><span class="p">)</span>
<span class="c1"># Paths have a recurrent form:
</span> <span class="c1"># `/edx/app/edxapp/<install_path>/<xblock>/<xblock>/xblock.pyc`
</span> <span class="c1"># Strip first '/edx/app/edxapp/' and last 'xblock.pyc' from the path
</span> <span class="n">stripped_path</span> <span class="o">=</span> <span class="n">xblock_install_path</span><span class="p">.</span><span class="n">split</span><span class="p">(</span><span class="s">'/edx/app/edxapp/'</span><span class="p">,</span><span class="mi">1</span><span class="p">)[</span><span class="mi">1</span><span class="p">].</span><span class="n">rsplit</span><span class="p">(</span><span class="s">'/'</span><span class="p">,</span><span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="c1"># Build path using ENV_ROOT
</span> <span class="n">translated_url</span> <span class="o">=</span> <span class="n">settings</span><span class="p">.</span><span class="n">ENV_ROOT</span> <span class="o">/</span> <span class="n">stripped_path</span> <span class="o">/</span> <span class="n">locale_folder</span>
<span class="c1"># Check if the folder exists and if it is not empty
</span> <span class="k">if</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">path</span><span class="p">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">translated_url</span><span class="p">)</span> <span class="ow">and</span> <span class="n">os</span><span class="p">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">translated_url</span><span class="p">)):</span>
<span class="c1"># Check for unicity and then add to LOCALE_PATHS
</span> <span class="k">if</span><span class="p">(</span><span class="n">translated_url</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">settings</span><span class="p">.</span><span class="n">LOCALE_PATHS</span><span class="p">):</span>
<span class="n">settings</span><span class="p">.</span><span class="n">LOCALE_PATHS</span> <span class="o">=</span> <span class="p">(</span> <span class="n">translated_url</span> <span class="p">,</span> <span class="p">)</span> <span class="o">+</span> <span class="n">settings</span><span class="p">.</span><span class="n">LOCALE_PATHS</span>
</code></pre></div></div>
<p>So in the way depicted above it is possible to add each XBlock’s translation
folder to the <code class="language-plaintext highlighter-rouge">LOCALE_PATHS</code> read by Django and the translations are applied
consequently.</p>
<p>Another solutions implemented by <a href="https://github.com/felipemontoya"><em>Felipe
Montoya</em></a> implies the definition and the
usage of an extra Django app called <code class="language-plaintext highlighter-rouge">django-xblock-i18n</code>. This app basically
defines a new service which has to be loaded inside the context of the XBlock
and then it can be used. Furthermore, the <code class="language-plaintext highlighter-rouge">xblock_i18n</code> tag has to be added at
the top of the template tag to be used. For more extended info check the repo
I forked which contains some more information about how to use the app in the
README file <a href="https://github.com/libremente/django-xblock-i18n">here</a>.</p>
<p>The possibility of merging the <code class="language-plaintext highlighter-rouge">.po</code> files together is always possible even if
it is highly unrecommended due to all the possible problems that may occur
especially during upload - i.e. all the work would be lost after each upgrade.
However, what follows is the procedure to accomplish such a task.
For each XBlock to be localized, apply the following passages:</p>
<ul>
<li>
<p>extract the strings to be localized from all the files like, e.g., <code class="language-plaintext highlighter-rouge">.py</code> and
<code class="language-plaintext highlighter-rouge">.js</code> ones. For <code class="language-plaintext highlighter-rouge">python</code>:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>find <span class="nb">.</span> <span class="nt">-name</span> <span class="s2">"*.py"</span> | xargs xgettext <span class="nt">--language</span><span class="o">=</span>python <span class="nt">--add-comments</span><span class="o">=</span><span class="s2">"Translators:"</span>
</code></pre></div> </div>
<p>For <code class="language-plaintext highlighter-rouge">javascript</code>:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>find <span class="nb">.</span> <span class="nt">-name</span> <span class="s2">"*.js"</span> <span class="nt">-o</span> <span class="nt">-path</span> ./public/js/vendor <span class="nt">-prune</span> <span class="nt">-a</span> <span class="nt">-type</span> f | xargs xgettext <span class="nt">--language</span><span class="o">=</span>javascript
<span class="nt">--from-code</span><span class="o">=</span>utf-8 <span class="nt">--add-comments</span><span class="o">=</span><span class="s2">"Translators:"</span>
</code></pre></div> </div>
<p>Note that each command generates a <code class="language-plaintext highlighter-rouge">message.po</code> file, so after running the
first time make sure to <code class="language-plaintext highlighter-rouge">mv</code> the file to another name.</p>
<p>NB: there is the possibility of adding <code class="language-plaintext highlighter-rouge">--join-existing</code> to the second
command but, at the moment of writing, it is not working on my machine.
That should help appending the
second output to the first <code class="language-plaintext highlighter-rouge">message.po</code> file.</p>
<p>Anyway, Django expects to have a <code class="language-plaintext highlighter-rouge">django.{po,mo}</code> file in its locale
directory which means that those <code class="language-plaintext highlighter-rouge">messages.{po,mo}</code> files have to be renamed.</p>
<p>For our case, all the strings extracted from <code class="language-plaintext highlighter-rouge">python</code> should exist in the
<code class="language-plaintext highlighter-rouge">django.po</code> file, whilst the ones related to <code class="language-plaintext highlighter-rouge">javascript</code> should be inserted
inside the <code class="language-plaintext highlighter-rouge">djangojs.po</code> file.</p>
<p>To check if <code class="language-plaintext highlighter-rouge">django.po</code> is correct, you can run <code class="language-plaintext highlighter-rouge">msgfmt</code> to build
a <code class="language-plaintext highlighter-rouge">django.mo</code> file:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>msgfmt django.po <span class="nt">-o</span> django.mo
</code></pre></div> </div>
<p>If everything is correct, the resulting <code class="language-plaintext highlighter-rouge">django.mo</code> file has to be move
to the final directory:
<code class="language-plaintext highlighter-rouge">translations/<lang_code>/LC_MESSAGES/django.mo</code>.
Same for the <code class="language-plaintext highlighter-rouge">djangojs.{po,mo}</code> files.</p>
</li>
<li>
<p>Now that the <code class="language-plaintext highlighter-rouge">.po</code> file is generated, it is necessary to attach it to the
platform’s one located in <code class="language-plaintext highlighter-rouge">/conf/lang/<lang_code>/django.po</code>. When merging
the two files, make sure that there are no conflicting strings (strings which
are present in both files). If there are, remove the ones present in the new
<code class="language-plaintext highlighter-rouge">django.po</code> file and leave the originals intact. Once the merge is finished,
it is possible to run the command to generate the new <code class="language-plaintext highlighter-rouge">django.mo</code> file as
before:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>msgfmt conf/locale/<lang_code>/LC_MESSAGES/django.po <span class="nt">-o</span> translations/<lang_code>/LC_MESSAGES/django.mo
</code></pre></div> </div>
</li>
</ul>
<p>From now on, Django will read from those files and apply the translations
globally. However, as cited above, this is <strong>not recommended</strong> for obvious
reasons.</p>
<p>So, in order to conclude, we have explored the various paths that Django checks
to spot the <code class="language-plaintext highlighter-rouge">.mo</code> files containing the translations to apply.
Three solutions have been proposed, which are more of a <em>workaround</em> than real
solutions but they may work while waiting for the official solution.
Solution number 1. is what I consider being the best one since it’s not as
<em>invasive</em> as the others: solution number 2. adds a Django App to the system
whilst 3. is a big mess since it basically implies that all the translation
will be merged in a big centralized file which, after an update or a change,
will be changed and will lose the mods.</p>
<p>Let me know what you think and if what I wrote may be deemed acceptable.</p>
<p>That’s all folks! :)</p>surFOpen edX is the platform which powers MOOC websites like edx.org, Stanford’s Lagunita and many other MOOC providers worldwide. Since it has been released with a FOSS license, its adoption has wildly increased and right now millions of users worldwide are using such a platform for their online courses. As such, the possibility to translate the interface should be a top priority but, unfortunately, not all the components have such a functionality out of the box. In fact, the platform’s external modules, also called XBlocks, are difficult to translate and this article is meant to depict all the possible ways to approach such a task.Introducing BOOC!2016-09-01T10:38:00+00:002016-09-01T10:38:00+00:00http://libremente.eu/2016/09/01/intro-booc<p>What is a <em>MOOC</em>?</p>
<p>MOOC stands for Massive Open Online Courses, one of the latest trends in the
world of eLearning. What does that mean?
Basically the following:</p>
<ul>
<li>Massive: both the platform (and the contents) are designed in order to scale
from few users to several thousands, all accessing at the same time.</li>
<li>Open: free for all, just tune in and get your class without paying any fee!</li>
<li>Online: it lives over the Internet!</li>
<li>Courseware: the contents are materials specifically designed in order to be
delivered in an online class.</li>
</ul>
<p>Now, do you see any flaws in this?</p>
<p>Unfortunately I see some, especially regarding the third dot: what if the
<em>connection</em> does not exist?</p>
<p>Many educational institution over the Italian territory still do not have
a proper Internet connection and this makes the availability of web tools
completely useless since they cannot be accessed from the place where education
is created. Is there a way to solve this? Clearly, providing a decent Internet
access to the people that truly need it should be at the top of the
government’s to-do list but what should we do in the meanwhile?</p>
<p>With this post I would like to introduce <strong><em>BOOC</em></strong>, which is the <strong><em>Box</em></strong> for <strong><em>Open</em></strong>,
<strong><em>Offline</em></strong>, <strong><em>Courseware</em></strong> distribution.</p>
<p>From the name it may be possible to understand what this is all about but both
the hardware and the software will be illustrated as soon as possible on this
platform. Stay tuned!</p>surFWhat is a MOOC?Apollo source code2016-07-14T00:00:00+00:002016-07-14T00:00:00+00:00http://libremente.eu/2016/07/14/apollo-code<p>The Apollo 11 code has been released on
<a href="https://github.com/chrislgarry/Apollo-11">Github</a>.
It’s a lot of assembly, I had some fun trying to understand some procedures.
It’s also cool to see some of the comments inserted like the following:</p>
<pre><code class="language-assembly">ELFCHK TC SMODECHK # ** CHARLEY, COME IN HERE
</code></pre>
<p>hackers… they are all alike! :)</p>surFThe Apollo 11 code has been released on Github. It’s a lot of assembly, I had some fun trying to understand some procedures. It’s also cool to see some of the comments inserted like the following:#Tip of the day: forensic!2016-07-13T00:00:00+00:002016-07-13T00:00:00+00:00http://libremente.eu/2016/07/13/forensic<p>Today a friend of mine appeared at my place screaming</p>
<blockquote>
<p>I’ve lost all my thesis!!! Please help me!</p>
</blockquote>
<p>so, fresh after finishing my last <a href="http://studyitin.ee/c3s">International Summer
School</a> in Digital
Forensic and Cyber Security, I immediately started to draw an attack plan.</p>
<p>What happened?
He was working on his shining OpenOffice 4.<em>something</em> while suddenly a blackout
hit the house and his PC stopped working.
When he rebooted he found the file, tried to recover using the OO tool but
nothing, he lost his entire thesis (<em>why people still write the thesis on OO??
Go learn <a href="https://it.wikipedia.org/wiki/LaTeX">LaTeX</a> please!!!</em>)</p>
<p>Where to start?</p>
<p>I had:</p>
<ul>
<li>complete access to the machine (it was switched off).</li>
<li>no encryption on disks.</li>
</ul>
<p>Without an appropriate tool for working on the hard disk with write block I had
to go back to the roots, attach with a SATA connector the HDD and <code class="language-plaintext highlighter-rouge">dd</code> from my
Debian box.</p>
<p>But, in the meanwhile, he told me that another friend <em>previously</em> had tried to
use a <em>Windows</em> tool but he had a I/O error and could not finish the job.
Strange, isn’t it?
The guy probably worked <code class="language-plaintext highlighter-rouge">live</code> on the mounted partition, which is something I have
learnt to avoid as much as possible, but let’s see if this could somehow have damaged
the system or not.</p>
<p><code class="language-plaintext highlighter-rouge">dd</code> worked but yeah, at 3,2GB there was a read-error that fortunately the program
managed to skip itself. How?</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">dd </span><span class="k">if</span><span class="o">=</span>/dev/sdax <span class="nv">bs</span><span class="o">=</span>4K <span class="nv">conv</span><span class="o">=</span><span class="nb">sync</span>,noerror | <span class="nb">tee </span>mybigfile.img | <span class="nb">md5sum</span> <span class="o">></span> mybigfile.md5
</code></pre></div></div>
<p>Using the <code class="language-plaintext highlighter-rouge">noerror</code>, <code class="language-plaintext highlighter-rouge">dd</code> managed to continue after hitting the I/O error.</p>
<p>Now that the image is created and I verified the md5 sum, the game starts.</p>
<p>Which tools to use?</p>
<p>I am quite familiar with both <code class="language-plaintext highlighter-rouge">foremost</code> and <code class="language-plaintext highlighter-rouge">scalpel</code>.
Despite the scarcity of documentation available online (maybe recovering files
is not a common hobby?) I could manage to use those programs pretty well.</p>
<p><code class="language-plaintext highlighter-rouge">scalpel</code> is based on the first one and it required a little bit of tweaking in
order to make it work the way I wanted. It is necessary to specify in the
config file the files we need to look for. So, I need to scan for <code class="language-plaintext highlighter-rouge">odt</code> files,
how should I do it?
The configuration file, located in <code class="language-plaintext highlighter-rouge">/etc/scalpel/scalpel.conf</code> did not contain any info
about odt, so looking on the
<a href="https://ubuntuforums.org/showthread.php?t=1378119">net</a> I found this line to add</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>odt y 20000000 PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.textPK META-INF/manifest.xmlPK???????????????
</code></pre></div></div>
<p>which worked flawlessly!</p>
<p>So the next command was:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>scalpel mybigfile.img <span class="nt">-b</span> <span class="nt">-o</span> /scalpel_recovered_files/
</code></pre></div></div>
<p>Some of the results were ok, others were false positives.
I tried to <code class="language-plaintext highlighter-rouge">grep -l</code> to get some info from the files in the folders but I was
not lucky enough to find the complete version of the file I was looking for.</p>
<p>So, why not trying with <code class="language-plaintext highlighter-rouge">foremost</code>?</p>
<p>This program differs from the one described before mainly because it is
possible via command line to specify which extensions we are targeting. The
<code class="language-plaintext highlighter-rouge">odt</code> extension does not exist <em>BUT</em> it is possible to search for <code class="language-plaintext highlighter-rouge">zip</code>.</p>
<p>So the command</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>foremost <span class="nt">-v</span> <span class="nt">-T</span> <span class="nt">-t</span> zip <span class="nt">-i</span> mybigfile.img <span class="nt">-o</span> /foremost_recovered_files/
</code></pre></div></div>
<p>automagically created the following structure in the output folder:</p>
<ul>
<li>zip</li>
<li>xlsx</li>
<li>sxi</li>
<li>sxc</li>
<li>sx</li>
<li>pptx</li>
<li>jar</li>
<li>docx</li>
<li>odt</li>
<li>audit.txt</li>
</ul>
<p>Pretty cool, isn’t it?</p>
<p>So no extra tweaking to the configuration files is necessary in order to look
for odt!</p>
<p>By the way, if you want, by inserting the following string you could actually
look for <code class="language-plaintext highlighter-rouge">odt</code> as explained <a href="http://www.cfitaly.net/it/carvingodt">here</a>:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>odt n 12500000 \x50\x4b\x03\x04
</code></pre></div></div>
<p>To be continued…</p>surFToday a friend of mine appeared at my place screamingIceweasel - The end of an era.2016-05-26T00:00:00+00:002016-05-26T00:00:00+00:00http://libremente.eu/2016/05/26/end-of-an-era<p>Today, while upgrading my Debian box, I discovered something was wrong. Actually this is an interesting output:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Selezionato il pacchetto firefox-esr-l10n-it non precedentemente selezionato.
Preparativi per estrarre .../firefox-esr-l10n-it_45.1.1esr-1_all.deb...
Estrazione di firefox-esr-l10n-it (45.1.1esr-1)...
Preparativi per estrarre .../iceweasel-l10n-it_1%3a45.1.1esr-1_all.deb...
Estrazione di iceweasel-l10n-it (1:45.1.1esr-1) su (1:44.0.2-1)...
Preparativi per estrarre .../iceweasel_45.1.1esr-1_all.deb...
Estrazione di iceweasel (45.1.1esr-1) su (44.0.2-1)...
Selezionato il pacchetto firefox-esr non precedentemente selezionato.
Preparativi per estrarre .../firefox-esr_45.1.1esr-1+b1_amd64.deb...
Viene aggiunto "deviazione di /usr/bin/firefox in /usr/bin/firefox.real da firefox-esr"
Estrazione di firefox-esr (45.1.1esr-1+b1)...
</code></pre></div></div>
<p>So you may imagine how something came up to my mind… what is going on??
It really looks like I am loosing some <a href="https://lwn.net/Articles/676799/">conversations</a> which you may check out.</p>
<p>Goodbye my fellow IceWeasel, you were a good friend! But no worries, GNU IceCat is still there! :)</p>surFToday, while upgrading my Debian box, I discovered something was wrong. Actually this is an interesting output:The funniest bug ever :)2015-09-09T10:38:00+00:002015-09-09T10:38:00+00:00http://libremente.eu/2015/09/09/funny-bug<p>This is definitely today’s funniest (and probably biggest!) bug on the net!</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">Address</span> <span class="n">from</span><span class="p">;</span>
<span class="kt">uint32_t</span> <span class="n">max_size_buf</span> <span class="o">=</span> <span class="mi">320</span><span class="p">;</span>
<span class="kt">uint32_t</span> <span class="n">flags</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">while</span> <span class="p">((</span><span class="n">packet</span> <span class="o">=</span> <span class="n">socket</span><span class="o">-></span><span class="n">RecvFrom</span> <span class="p">(</span><span class="n">max_size_bug</span><span class="p">,</span> <span class="n">flags</span><span class="p">,</span> <span class="n">from</span><span class="p">)))</span>
</code></pre></div></div>
<p>Luckily it was easy to spot :)</p>surFThis is definitely today’s funniest (and probably biggest!) bug on the net!