tag:blogger.com,1999:blog-71760936434548461572024-03-08T14:43:58.155+01:00Bites of my LifeIt's just random stuff, but it's my stuff.Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-7176093643454846157.post-77808733266716198692020-03-26T17:06:00.000+01:002020-03-26T17:06:29.170+01:00A simple tutorial of screen commandIf you work with IoT devices, most of the time you'll communicate with those devices using COM ports. In Mac OS you have a tool integrated in the operating system in order to communicate with them, this tool is called <code>screen</code>.<br />
<div>In order to know which port is using your device, just type in terminal this line:</div><div><pre class="prettyprint lang-sh"><code>ls /dev</code></pre></div><div>This will list all possible devices, just found the device you need to communicate with. To communicate with the device type:</div><div><pre class="prettyprint lang-sh"><code>screen /dev/tty* BAUD_RATE</code></pre></div><div>where * is your device and BAUD_RATE is the baud rate used for your device.</div><div>And that's all, you have a simple serial connection opened with your device. If you want to finalize or close that serial terminal, just type:</div><div><pre class="prettyprint lang-sh"><code>CTRL+a</code></pre></div><div>followed by</div><div><pre class="prettyprint lang-sh"><code>k</code></pre></div>This will ask you to close the screen session, just answer <code>Y</code> or <code>N</code>. If you want to detach the console without closing it, press <code>d</code> instead of <code>k</code>.<br />
<div>And to reconnect to the serial terminal:</div><div><pre class="prettyprint lang-sh"><code>screen -r</code></pre></div><div>For more information visit its <a href="https://www.gnu.org/software/screen/manual/screen.html" target="_blank">on-line manual</a> and this <a href="https://linoxide.com/linux-command/15-examples-screen-command-linux-terminal/" target="_blank">cheatsheet from linoxide</a>.</div>Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-69011700834101254792019-08-24T12:56:00.000+02:002019-08-24T12:56:50.030+02:00Giving a second life to EM95XTwo years ago I bought an EM95X, a TV Box powered by Android to convert my TV into a Smart TV. It worked correctly the first few months, but the problem came with the EM95X when I found that there were no updates for the software, and somehow it became deprecated. So I unplugged from the TV and I left it in a drawer, until I discovered <a href="https://coreelec.org/" target="_blank">CoreELEC</a> and I tried how it works on my device. And I can say it works pretty well.<br />
<br />
The installation is quite easy, just download the image, write it into a SD card and copy the file <code>gxl_p212_2g.dtb</code> inside the folder <code>device_trees</code> into the root folder with the name <code>dtb.img</code>.<br />
<br />
When you have it running, connect to the device via ssh using:<br />
<pre class="prettyprint lang-sh"><code>user: root
password: coreelec</code></pre>And type <code>installtointernal</code> in order to install CoreELEC in the internal system. You will need to do this twice, because the first time you'll see a message telling you the memory is corrupted.<br />
<br />
Now it's time to make the remote control working again. Create a file <code>rc_maps.cfg</code> inside <code>/storage/.config/</code> with this information:<br />
<br />
<pre class="prettyprint lang-sh"><code>meson-ir * em95x</code></pre><br />
And download <a href="https://gist.githubusercontent.com/rnicolas/7c2c2874374d95632a778da945533292/raw/2ba608335e5355c16cc0a57bb28b4fa7c7d95b0b/em95x" target="_blank">this file</a> and put it on <code>/storage/.config/rc_keymaps/</code>, you can do it by just copying the command below.<br />
<br />
<pre class="prettyprint lang-sh"><code>wget https://gist.githubusercontent.com/rnicolas/7c2c2874374d95632a778da945533292/raw/2ba608335e5355c16cc0a57bb28b4fa7c7d95b0b/em95x -P /storage/.config/rc_keymaps/</code></pre><br />
The file downloaded is used by the system in order to understand the signals send by the remote control. If you want to change any behave of the buttons in the remote control, you must change it here.<br />
<br />
Finally, type <code>ir-keytable -a /storage/.config/rc_maps.cfg -s rc0</code> and reboot the device, your remote control will work again.Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-29132554035723086052019-01-17T17:00:00.002+01:002019-01-18T12:43:23.822+01:00New section on the blog: VideosThis section is just a way to share some films, short movies and TV shows that are legally available on the internet and I find them interesting. Some maybe are very typical, some other maybe aren't.<br />
<br />
The link of any film will be posted here directly, short films will be posted individually and added in a playlist (if they are available on Youtube or Vimeo or some similar service) and TV shows will be linked using playlists; because I couldn't understand a TV show with just one episode, if that happens, I would consider it as a documentary.<br />
<br />
<a href="https://www.auroraproject.eu/p/videos.html">Go to Videos section</a>. Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-77992880241962420562018-12-12T13:21:00.000+01:002018-12-12T17:12:44.330+01:00Configuring external storage of ZoteroIn a previous post I talked about Zotero as an alternative of Mendeley. This today's post is about configuring Zotero to store your articles on Google Drive, OneDrive, etc. in order to extend the limitation of 300MB and extend it to 5Gb or more (depending on the cloud that you are using).<br />
<br />
In my case, I use OneDrive to store this kind of data because it's a cloud that I barely use, and you can even use WebDAV protocol to synchronize your libraries between different computers using OneDrive. But today I will not talk about using OneDrive as WebDAV.<br />
<br />
Well, in order to use OneDrive (or whatever cloud) as an external storage, the first thing you need is to have the client of that software installed. When you have your cloud client installed, you can create a folder inside your cloud, mine is <i>Research Papers</i>, this folder will be used to store all linked papers of Zotero.<br />
<br />
The second thing you need to do is to go to <i>Zotero Preferences -> Advanced Tab -> Files and Folders</i>; here you need to change <i>Base Path</i> on <i>Linked Attachment Base Directory</i> to your path to OneDrive.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUrGtnhr3VuN52iXK0avsDsOe-axrkQOwL4JWyZEQeGlYJvmMcwgjoolAXFYw1Y1mIpvuh73dscg4P-YkYQgN5ab8pR44gAKAfagXwqv24D1YeTEfcOLKeOoJU7gDlLou4B86E23BgaIyS/s1600/Captura+de+Pantalla+2018-12-12+a+les+11.23.39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1142" data-original-width="1276" height="286" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUrGtnhr3VuN52iXK0avsDsOe-axrkQOwL4JWyZEQeGlYJvmMcwgjoolAXFYw1Y1mIpvuh73dscg4P-YkYQgN5ab8pR44gAKAfagXwqv24D1YeTEfcOLKeOoJU7gDlLou4B86E23BgaIyS/s320/Captura+de+Pantalla+2018-12-12+a+les+11.23.39.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Doing this, you'll say to your Zotero installation that it needs to use relative paths instead of absolute paths, so, when one reference is added in one of your computers, the link to the document won't be broken when it will be added into the other computers.<br />
<br />
The third thing you need to do is to go to <i>Tools</i> -> <i>ZotFile Preferences</i> and change <i>Location of Files</i> to <i>Custom Location</i>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfcFSHz-WF47Fszw2-Meah2lp6tcNNJQj2dSSO6OigEfv_05FurtfMSrjVnFzjF24HEQ1NJI6Msyv5790kN42oigk-yAGuYDTMRAcmzv6ifzZPbM1D7_FlXmmnuPYi9u_m0wJSnYzOwkBh/s1600/Captura+de+Pantalla+2018-12-12+a+les+11.28.48.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1346" data-original-width="1202" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfcFSHz-WF47Fszw2-Meah2lp6tcNNJQj2dSSO6OigEfv_05FurtfMSrjVnFzjF24HEQ1NJI6Msyv5790kN42oigk-yAGuYDTMRAcmzv6ifzZPbM1D7_FlXmmnuPYi9u_m0wJSnYzOwkBh/s320/Captura+de+Pantalla+2018-12-12+a+les+11.28.48.png" width="285" /></a></div>
<br />
Doing this, all your attached documents will be stored on your cloud. I also strongly recommend to check <i>Use subfolder defined by</i>. Your documents will be stored in a more logical way.<br />
<br />
Finally, in <i>Zotero</i> -> <i>Preferences</i> -> <i>Synchronize</i> you must add your account here, but Files Synchronization must be left unchecked because synchronization will be in charge of your cloud provider.Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-84352433197684969032018-12-11T18:00:00.001+01:002018-12-12T13:22:53.798+01:00Zotero: An alternative to MendeleyLast year I started a Doctorate Programme, one of my daily tools is Mendeley, an extremely useful tool to manage my library and create references to the articles that I read. But this tool has a handicap, it's not open source. So, I've started a search in order to find a new tool able to do exactly the same that I'm doing with Mendeley, but being open source; after a quick search on Google, I've found Zotero: a tool that has the same behavior as Mendeley, but open source; and it runs on MS Windows, Mac OS and GNU/Linux!<br />
<br />
To install Zotero (on a Mac), you can use it brew, with the following command:<br />
<br />
<pre class="prettyprint lang-bash"><code>brew cask install zotero</code></pre>
<br />
After Zotero is installed, we can run it for the first time, it will ask to install Firefox add-on, as well as Microsoft Word or/and Libreoffice add-ons, we accept it and the initial setup of Zotero is done. t's more than reasonable to register to Zotero, because then you'll be able to synchronize your research database between your computers. Storing references is free and unlimited, but storing PDFs is limited to 300MB in the free plan.<br />
<br />
But, if we want a more enjoyable experience, we should install Zotfile and Zutilo plugins. These two plugins extend the functionality of Zotero in a magical way.<br />
<br />
Zotfile is great because it stores the documents using a folder structure of YY/MM (year/month); instead of the random generated name folder that creates Zotero itself. The second great thing is that you can store the attached documents outside Zotero Folder, so it opens the possibility of using a Google Drive, Dropbox, etc. in order to save your documents and to avoid the restriction of 300MB of cloud using the free plan.<br />
<br />
Zutilo is the useful component because it adds these functionalities (to cite some of them) to Zotero:<br />
<ul>
<li>Copy, paste, and remove sets of tags</li>
<li>Select and right-click to relate several items</li>
<li>Copy items to the clipboard in several formats</li>
<li>Keyboard shortcuts for editing items and focusing and hiding different elements of the Zotero user interface</li>
<li>Right-click to save link or document as an attachment to currently selected item (only for Zotero as a Firefox addon)</li>
</ul>
Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-24037729900017298542018-09-06T14:00:00.000+02:002018-09-06T14:00:10.782+02:00It's time to take action, it's time to protect your internet<div class="mt-3 md:w-2/3 lg:w-1/2">
On July 5, 2018, the plenary session of the European Parliament voted on the <a class="highlight" href="https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:52016PC0593&from=EN">reform of copyright in the digital internal market</a>.
These two articles (11th and 13th), as proposed, would have paved the way for
comprehensive censorship of the Internet. For this reason we have
created a fortunately very successful petition, which, thanks to the
personal invitation of MEP Julia Reda, we were able to present to MEPs
immediately before the vote, together with the at that time 736,000
signatures. The untiring efforts of our Members and the enormous number
of signatures enabled us to make Members aware of the considerable risk
of this reform and thus prevent it from being adopted in plenary.
</div>
<div class="mt-3 md:w-2/3 lg:w-1/2">
The reform proposal on copyright (especially Articles 11 and 13) was rejected by 318 (53%) to 278 (47%)!
</div>
<div class="mt-3 md:w-2/3 lg:w-1/2">
However, the threat has not yet completely disappeared! The
rejection in plenary simply means that the reform proposal will have to
be revised and resubmitted. We expect another vote on a revised version
in September</div>
<div class="mt-3 md:w-2/3 lg:w-1/2">
<br /></div>
<div class="mt-3 md:w-2/3 lg:w-1/2">
Now, it's time to take action and protect your internet as you know. It's time to <a href="https://saveyourinternet.eu/" target="_blank">contact your MEP</a>!</div>
Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-29542819576514104042018-06-17T17:59:00.003+02:002018-07-12T10:51:37.033+02:00Installing LaTeX on MacOS - A brief guide into LaTeX (Part I)LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as <a href="https://www.latex-project.org/lppl/">free software</a>.<br />
<br />
If you want to create and edit documents in Mac, you'll need to install and editor and a compiler; I'm currently using TeXworks, it's not the most fancy editor, but gets the job done. You can install it just using brew, with the following order:<br />
<br />
<pre class="prettyprint lang-bash"><code>brew cask install texworks</code></pre>
<br />
You will also need a compiler, this is the software that does all the work under the hood and is needed for TeXworks in order to compile documents. I use MacTeX, and this software is directly dectected by TeXworks, so you'll no need further configuration. You can install it in the same way:<br />
<br />
<pre class="prettyprint lang-sh"><code>brew cask install mactex-no-gui</code></pre>
Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-50450245320592578452018-06-05T13:00:00.002+02:002018-06-17T18:15:12.678+02:00Bibliography on LaTeX - A brief guide into LaTeX (Part II)This post (and the related ones) is more intended to help me when I'm using LaTeX than anything else, the references here couldn't be accurated or the best solution when you're writing in LaTeX because I'm a newbie in this system.<br />
<br />
My working environment:<br />
- Operating System: MS Windows 7 Professional 64 bits<br />
- LaTeX Environment: TexWorks<br />
- LaTeX Compiler: pdfLaTeX<br />
<br />
The procedure to create a bibliography is as follows:<br />
<br />
Create a file with .bib extension. For example <span style="font-family: "Courier New", Courier, monospace;">references.bib</span>. This file will contain all references that you are using in your article, book, etc. and save it in the same level where you have your .tex document.<br />
<br />
To generate the documentation you must issue the following:<br />
- Compile .tex file with pdfLaTeX<br />
- Compile .tex file with BibTeX<br />
- Compile .tex file with pdfLaTeX<br />
- Compile .tex file with pdfLaTeX<br />
<br />
It's not a mistake compiling two times after BibTeX, because the first time is for generating the references on the document, and the second time is for putting the number of reference where the documents are cited.<br />
<br />
In your .tex document, the syntax is the following <span style="font-family: "Courier New", Courier, monospace;">\cite{label}</span> where label is the first parameter inside the reference.Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-13792774429918083672017-07-28T22:45:00.003+02:002018-03-26T19:20:08.930+02:00Homebrew: Just a quick hack to update your apps automatically<a href="https://brew.sh/">Homebrew</a> is a fantastic package manager for MacOS, you can install it with this command in terminal:<br />
<br />
<pre><code>/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"</code></pre><br />
And that's all to get it in your system. But I don't want explain what's homebrew in this post, I just want to share a way to update the already installed packages by brew on your MacOS. You only need these two steps:<br />
<br />
<pre><code>brew update</code></pre><pre><code>brew cask outdated | xargs brew cask reinstall</code></pre><br />
And that's all. Brew will update your outdated packages.Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-60104152797373457122016-12-09T00:34:00.003+01:002018-03-26T19:39:10.297+02:00Mostrant codi a BloggerUn dels mals de cap que he tingut a l'hora de configurar Blogger és que no sabia com fer-m'ho per mostrar codi incrustat a la pantalla, altres vegades he fet servir els gists de Github i segurament ho tornaré a fer servir en un futur, però per una edició ràpida i posar quatre línies de codi m'he tornat molt boig. Al final la solució que he trobat ha sigut la següent:<br />
<br />
1.- Obrir l'editor d'HTML de la plantilla i cercar l'etiqueta <span style="font-family: "courier new" , "courier" , monospace;"></head></span><br />
, i just abans hi he afegit les següents línies:<br />
<pre class="prettyprint lang-html"><code><script src="//cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<link href='//jmblog.github.io/color-themes-for-google-code-prettify/themes/atelier-heath-light.css' rel='stylesheet' type='text/css'/></code></pre>2.- Desar, i ja he acabat.<br />
<br />
I això és tot, ara per fer mostrar codi només cal fer servir les etiquetes:<br />
<pre class="prettyprint lang-html"><code><pre class="prettyprint lang-xxx"><code>el teu codi en llenguatge xxx aquí</code></pre></code></pre><br />
<br />
<br />
Referències:<br />
<a href="http://hanxue-it.blogspot.com/2016/06/customize-blogger-template-css-code-highlighting-technical-blogging.html">Customizing Blogger for a Technical Blog</a>Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-65133023603614307292016-12-08T23:27:00.001+01:002018-03-26T19:36:48.885+02:00Eliminant l'auto "Read More"Després d'instal·lar el tema Limelight a Blogger, m'he adonat que les entrades eren horrorosament retallades i formatades, a més a més que t'afegia un auto "Read More" que quedava bastant malament. Ho he eliminat/solucionat fent el següent, he buscat al codi de l'estil les següents línies:<br />
<br />
<pre class="prettyprint lang-html"><code><b:if cond="data:blog.pageType != &quot;static_page&quot;">
<b:if cond="data:blog.pageType != &quot;item&quot;">
</b:if></b:if>
<div expr:id="&quot;summary&quot; + data:post.id">
<data:post .body=""></data:post></div>
<script type="text/javascript">createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
<b:if cond="data:blog.pageType == &quot;item&quot;"><data:post .body=""></data:post></b:if>
<b:if cond="data:blog.pageType == &quot;static_page&quot;"><data:post .body=""></data:post></b:if>
</code></pre><br />
I les he modificat per la següent línia: <br />
<br />
<pre class="prettyprint lang-html"><code><data:post .body/></code></pre><br />
Just a sota d'aquesta modificació, encara hi ha aquestes línies, les he esborrat i punt:<br />
<br />
<pre class="prettyprint lang-html"><code><b:if cond="data:blog.pageType != &quot;static_page&quot;">
<b:if cond="data:blog.pageType != &quot;item&quot;">
</b:if></b:if>
<div style="float: right; margin-top: 10px; padding-right: 10px;">
<a class="morer" expr:href="data:post.url" href="https://www.blogger.com/null">Read More</a></div></code></pre><br />
He desat tota la feina realitzada i ha quedat com jo volia que quedés.<br />
<br />
<br />
<br />
Referències:<br />
<a href="http://newbloggerthemes.com/blog/remove-blogger-auto-read-more/">How to Remove Blogger Auto Read More</a>Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0tag:blogger.com,1999:blog-7176093643454846157.post-7835368543982959342016-12-08T22:59:00.002+01:002016-12-08T23:20:50.955+01:00Hola, de nou!<div style="text-align: justify;">
Hola!</div>
<br />
Realment no sé com has acabat aquí, abans tenia un blog apuntant a aquest mateix domini, però per aquelles coses de la vida va petar ben petat i no he pogut recuperar res (hi tenia coses dels darrers 3-4 anys, encara que hi publicava més aviat poc). Total, que he refet el blog i a començar de nou s'ha dit.<br />
<br />
Que gaudeixis!<br />
<br />
<a name='more'></a>Roger N. Alegrethttp://www.blogger.com/profile/12634685308986361597noreply@blogger.com0