Balkian's site / Recent content on Balkian's site Hugo -- gohugo.io en-us This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Sun, 06 Jan 2019 10:00:00 +0000 Controlling Zigbee devices with MQTT /post/2019-01-06-zigbee2mqtt/ Sun, 06 Jan 2019 10:00:00 +0000 /post/2019-01-06-zigbee2mqtt/ This is a short tutorial on connecting a zigbee device (an Aqara cube) to an MQTT server, so you can control your zigbee devices from the network. If you&rsquo;re anything like me, you&rsquo;re probably a sucker for IoT devices. For a long time, I&rsquo;ve been using WiFi-enabled lights, and Amazon dash buttons to control them. About /about/ Fri, 24 Feb 2017 00:00:00 +0000 /about/ Hi! My name is Fernando. I&rsquo;m a researcher and developer from Madrid, Spain. about ul { position: relative; width: 900px; margin: 0 auto; } #about li { line-height:1.5em; border-bottom:1px solid #DDD; float:left; display:inline; width: 33.333%; } #about i { /*background-color: #ffd700;*/ /*padding: 5px;*/ /*border-radius: 10px;*/ } .icons { text-align: center; color: #333; /* text-shadow: 2px 2px #FFD700; */ } . Progress bars in python /post/2016-09-28-tqdm/ Wed, 28 Sep 2016 18:47:00 +0000 /post/2016-09-28-tqdm/ tqdm is a nice way to add progress bars in the command line or in a jupyter notebook. 1 2 3 4 5 from tqdm import tqdm import time for i in tqdm(range(100)): time.sleep(1) Sharing dotfiles /post/2015-04-10-github-dotfiles/ Fri, 10 Apr 2015 17:47:00 +0000 /post/2015-04-10-github-dotfiles/ Today&rsquo;s post is half a quick note, half public shaming. In other words, it is a reminder to be very careful with OAuth tokens and passwords. As part of moving to emacs, I starting using the incredibly useful gh.el. When you first use it, the extension saves either your password or an OAuth token in your . Zotero /post/2014-12-09-zotero/ Tue, 09 Dec 2014 12:12:12 +0000 /post/2014-12-09-zotero/ Zotero is an Open Source tool that lets you organise your bibliography, syncing it with the cloud. Unlike other alternatives such as Mendeley, Zotero can upload the attachments and data to a private cloud via WebDav. If you use nginx as your web server, know that even though it provides partial support for webdav, Zotero needs more than that. Proxies with Apache and python /post/2014-10-09-proxies/ Thu, 09 Oct 2014 10:00:00 +0000 /post/2014-10-09-proxies/ <p>This is a quick note on proxying a local python application (e.g. flask) to a subdirectory in Apache. This assumes that the file wsgi.py contains a WSGI application with the name <em>application</em>. Hence, wsgi:application.</p> <h2 id="gunicorn">Gunicorn</h2> <div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"> <table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;"> <pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-apache" data-lang="apache"><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7c7c79">1 </span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7c7c79">2 </span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7c7c79">3 </span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7c7c79">4 </span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7c7c79">5 </span></code></pre></td> <td style="vertical-align:top;padding:0;margin:0;border:0;"> <pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-apache" data-lang="apache"><span style="color:#f92672">&lt;Location</span> <span style="color:#e6db74">/myapp/</span><span style="color:#f92672">&gt;</span> ProxyPass http://127.0.0.1:8888/myapp/ ProxyPassReverse http://127.0.0.1:8888/myapp/ RequestHeader set SCRIPT_NAME <span style="color:#e6db74">&#34;/myapp/&#34;</span> <span style="color:#f92672">&lt;/Location&gt;</span></code></pre></td></tr></table> </div> </div> Publishing on PyPi /post/2014-09-23-publishing-to-pypi/ Sat, 27 Sep 2014 10:00:00 +0000 /post/2014-09-23-publishing-to-pypi/ Developing a python module and publishing it on Github is cool, but most of the times you want others to download and use it easily. That is the role of PyPi, the python package repository. In this post I show you how to publish your package in less than 10 minutes. Updating EuroLoveMap /post/2014-03-27-updating-eurolovemap/ Thu, 27 Mar 2014 14:00:00 +0000 /post/2014-03-27-updating-eurolovemap/ As part of the OpeNER hackathon we decided to build a prototype that would allow us to compare how different countries feel about several topics. We used the OpeNER pipeline to get the sentiment from a set of newspaper articles we gathered from media in several languages. Then we aggregated those articles by category and country (using the source of the article or the language it was written in), obtaining the &ldquo;overall feeling&rdquo; of each country about each topic. Remove git files with globbing /post/2013-08-22-remove-git-files-with-globbing/ Thu, 22 Aug 2013 23:14:00 +0000 /post/2013-08-22-remove-git-files-with-globbing/ A simple trick. If you want to remove all the &lsquo;.swp&rsquo; files from a git repository, just use: 1 git rm --cached &#39;**.swp&#39; Creating my web /post/2013-08-17-creating-my-web/ Thu, 22 Aug 2013 14:14:22 +0000 /post/2013-08-17-creating-my-web/ I&rsquo;ve finally decided to set up a decent personal page. I have settled for github-pages because I like the idea of keeping my site in a repository and having someone else host and deploy it for me. The site will be really simple, mostly static files. Thanks to Github, Jekyll will automatically generate static pages for my posts every time I commit anything new to this repository. Emacs /cheatsheet/emacs/ Mon, 01 Jan 0001 00:00:00 +0000 /cheatsheet/emacs/ <h1 id="show-plain-text-version">Show plain text version</h1> Index of projects /project/ Mon, 01 Jan 0001 00:00:00 +0000 /project/ Ongoing Projects Onyx: an ontology for emotion analysis that includes concepts from W3C's provenance. Marl: I updated this ontology, originally created by Adam Westerski, to make it compatible with the W3C's provenance ontology. Past Projects Hermes: one of my first projects, developed together with David Pérez as the special custom assignment in one of our courses. Index of projects /projects/ Mon, 01 Jan 0001 00:00:00 +0000 /projects/ Ongoing Projects Onyx: an ontology for emotion analysis that includes concepts from W3C&rsquo;s provenance. Marl: I updated this ontology, originally created by Adam Westerski, to make it compatible with the W3C&rsquo;s provenance ontology. Past Projects Hermes: one of my first projects, developed together with David Pérez as the special custom assignment in one of our courses. Linux /cheatsheet/linux/ Mon, 01 Jan 0001 00:00:00 +0000 /cheatsheet/linux/ Black screen and LightDM doesn&rsquo;t unlock Add this to your /etc/lightdm/lightdm.conf file: [LightDM] logind-check-graphical=true Python /cheatsheet/python/ Mon, 01 Jan 0001 00:00:00 +0000 /cheatsheet/python/ Interesting libraries TQDM From tqdm&rsquo;s github repository: tqdm means &ldquo;progress&rdquo; in Arabic (taqadum, تقدّم) and an abbreviation for &ldquo;I love you so much&rdquo; in Spanish (te quiero demasiado). Raspberry Pi /cheatsheet/rpi/ Mon, 01 Jan 0001 00:00:00 +0000 /cheatsheet/rpi/ HDMI flickering Avoid HDMI flickering/intermittent blanking on RPI with a 1400x1050 VGA monitor. 1 2 3 4 5 hdmi_drive=2 hdmi_group=2 hdmi_mode=42 disable_overscan=1 config_hdmi_boost=7 To-Do /todo/ Mon, 01 Jan 0001 00:00:00 +0000 /todo/ Things To Do This is intended as my public &ldquo;todo.txt&rdquo;. Both to keep it accessible and to feel ashamed of the many things I leave undone: PhD Write my first workshop paper as main author Write my first journal paper Become a doctor! Technical Write a NodeJS App.