<feedxmlns="http://www.w3.org/2005/Atom"><title>balkian.com</title><linkhref="http://balkian.com/"rel="alternate"></link><linkhref="http://balkian.com/feeds/all.atom.xml"rel="self"></link><id>http://balkian.com/</id><updated>2016-02-03T20:00:00+01:00</updated><entry><title>Arch Linux Fixes</title><linkhref="http://balkian.com/arch-linux-fixes.html"rel="alternate"></link><updated>2016-02-03T20:00:00+01:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2016-02-03:arch-linux-fixes.html</id><summarytype="html"><div class="section" id="black-screen-and-lightdm-doesn-t-unlock">
<h2>Black screen and LightDM doesn't unlock</h2>
<p>Add this to your <cite>/etc/lightdm/lightdm.conf</cite> file:</p>
</summary><categoryterm="emacs"></category><categoryterm="productivity"></category><categoryterm="editor"></category><categoryterm="org"></category></entry><entry><title>Sharing dotfiles</title><linkhref="http://balkian.com/sharing-dotfiles.html"rel="alternate"></link><updated>2015-04-10T17:47:00+02:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2015-04-10:sharing-dotfiles.html</id><summarytype="html"><p>Today'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.</p>
<p>As part of moving to emacs, I starting using the incredibly useful <a class="reference external" href="https://github.com/defunkt/gist.el">gh.el</a>.
When you first use it, the extension saves either your password or an OAuth token in your .gitconfig file.
This is cool and convenient, unless you <a class="reference external" href="https://github.com/balkian/dotfiles">happen to be publishing your .gitconfig file in a public repo</a>.</p>
<p>So, how can you still share your gitconfig without sharing your password/token with the rest of the world?
Since Git 1.7.0, you can <a class="reference external" href="http://stackoverflow.com/questions/1557183/is-it-possible-to-include-a-file-in-your-gitconfig">include other files in your gitconfig</a>.</p>
token = &quot;&lt; Your secret token &gt;&quot;
</pre></div>
</td></tr></table></summary><categoryterm="github"></category><categoryterm="git"></category><categoryterm="dotfiles"></category></entry><entry><title>Zotero</title><linkhref="http://balkian.com/zotero.html"rel="alternate"></link><updated>2014-12-09T12:12:12+01:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2014-12-09:zotero.html</id><summarytype="html"><p><a class="reference external" href="https://www.zotero.org/">Zotero</a> is an Open Source tool that lets
<li><a class="reference external" href="https://github.com/ajlyon/zandy">Zandy</a> - Android Open Source
client</li>
</ul>
</div>
</summary><categoryterm="zotero"></category><categoryterm="webdav"></category><categoryterm="nginx"></category><categoryterm="apache"></category></entry><entry><title>Proxies with Apache and python</title><linkhref="http://balkian.com/proxies-with-apache-and-python.html"rel="alternate"></link><updated>2014-10-09T10:00:00+02:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2014-10-09:proxies-with-apache-and-python.html</id><summarytype="html"><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>
</td></tr></table><p><strong>Important</strong>: <em>SCRIPT_NAME</em> and the end of <em>ProxyPass</em> URL <strong>MUST BE
THE SAME</strong>. Otherwise, Gunicorn will fail miserably.</p>
<span class="na">file</span><span class="o">=</span><span class="s">/tmp/myapp.sock ; path to your socket file</span>
<span class="na">serverurl</span><span class="o">=</span><span class="s">unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket</span>
</summary><categoryterm="python"></category><categoryterm="apache"></category><categoryterm="proxy"></category><categoryterm="gunicorn"></category><categoryterm="uwsgi"></category></entry><entry><title>Publishing on PyPi</title><linkhref="http://balkian.com/publishing-on-pypi.html"rel="alternate"></link><updated>2014-09-27T10:00:00+02:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2014-09-27:publishing-on-pypi.html</id><summarytype="html"><p>Developing a python module and publishing it on Github is cool, but most
13</pre></div></td><td class="code"><div class="highlight"><pre><span class="err">[distutils]</span><span class="c1"># this tells distutils what package indexes you can push to</span>
</td></tr></table><p>As you can see, you need to register both in the <a class="reference external" href="https://pypi.python.org/pypi?%3Aaction=register_form">main pypi
<span class="n">packages</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;mypackage&#39;</span><span class="p">],</span><span class="c1"># this must be the same as the name above</span>
<span class="n">version</span><span class="o">=</span><span class="s1">&#39;{ version }&#39;</span><span class="p">,</span>
<span class="n">keywords</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;websockets&#39;</span><span class="p">,</span><span class="s1">&#39;display&#39;</span><span class="p">,</span><span class="s1">&#39;d3&#39;</span><span class="p">],</span><span class="c1"># list of keywords that represent your package</span>
2</pre></div></td><td class="code"><div class="highlight"><pre>git tag <span class="o">{</span>version<span class="o">}</span> -m <span class="s2">&quot;{ Description of this tag/version}&quot;</span>
</summary><categoryterm="github"></category><categoryterm="python"></category><categoryterm="pypi"></category></entry><entry><title>Updating EuroLoveMap</title><linkhref="http://balkian.com/updating-eurolovemap.html"rel="alternate"></link><updated>2014-03-27T14:00:00+01:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2014-03-27:updating-eurolovemap.html</id><summarytype="html"><p>As part of the <a class="reference external" href="http://www.opener-project.org/2013/07/18/opener-hackathon-in-amsterdam/">OpeNER
hackathon</a>
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 &quot;overall feeling&quot; of each
country about each topic. Then, we used some fancy JavaScript to make
sense out of the raw information.</p>
<p>It didn't go too bad, it turns out <a class="reference external" href="http://eurosentiment.eu/wp-content/uploads/2013/07/BOLv9qnCIAAJEek.jpg">we
won</a>.</p>
<p>Now, it was time for a face-lift. I used this opportunity to play with
new technologies and improve it:</p>
<ul class="simple">
<li>Using Flask, this time using python 3.3 and Bootstrap 3.0</li>
<p>To test the contact section of the site, I wanted to populate it with
fake data. <a class="reference external" href="https://github.com/joke2k/faker">Fake-Factory</a> is an
amazing library that can generate fake data of almost any kind: emails,
association names, acronyms... It even lets you localise the results
(get Spanish names, for instance) and generate factories for certain
classes (à la Django).</p>
<p>But I also wanted pictures, enter <a class="reference external" href="http://lorempixel.com/">Lorem
Pixel</a>. With its API you can generate
pictures of almost any size, for different topics (e.g. nightlife,
people) and with a custom text. You can even use an index, so it will
always show the same picture.</p>
<p>For instance, the picture below is served through Lorem Pixel.</p>
<div class="figure">
<img alt="This picture is generated with LoremIpsum" src="http://lorempixel.com/400/200/nightlife/" />
</div>
<p>By the way, if you only want cat pictures, take a look at
<a class="reference external" href="http://placekitten.com/">Placekitten</a>. And for NSFW text, there's
the <a class="reference external" href="http://slipsum.com/">Samuel L. Jackson Ipsum</a></p>
</div>
</summary><categoryterm="javascript"></category><categoryterm="python"></category><categoryterm="heroku"></category></entry><entry><title>Remove git files with globbing</title><linkhref="http://balkian.com/remove-git-files-with-globbing.html"rel="alternate"></link><updated>2013-08-22T23:14:00+02:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2013-08-22:remove-git-files-with-globbing.html</id><summarytype="html"><p>A simple trick. If you want to remove all the '.swp' files from a git
</td></tr></table></summary><categoryterm="git"></category></entry><entry><title>Creating my web</title><linkhref="http://balkian.com/creating-my-web.html"rel="alternate"></link><updated>2013-08-22T14:14:22+02:00</updated><author><name>J. Fernando Sánchez</name></author><id>tag:balkian.com,2013-08-22:creating-my-web.html</id><summarytype="html"><p>Finally, I've 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,
<a class="reference external" href="http://jekyllrb.com">Jekyll</a> will automatically generate static
pages for my posts every time I commit anything new to this repository.</p>
<p>But Jekyll can be used independently, so if I ever choose to host the
site myself, I can do it quite easily. Another thing that I liked about
this approach is that the generated html files can be used in the
future, and I will not need Jekyll to serve it. Jekyll is really simple
and most of the things are written in plain html. That means that
everything could be easily reused if I ever choose to change to another
blogging framework (e.g. pelical). But, for the time being, I like the
fact that Github takes care of the compilation as well, so I can simply
modify or add files through the web interface should I need to.</p>
<p>I hadn't played with HTML and CSS for a while now, so I also wanted to
use this site as a playground. At some point, I realised I was doing
mostly everything in plain HTML and CSS, and decided to keep it like
that for as long as possible. As of this writing, I haven't included any
Javascript code in the page. Probably I will use some to add my
<a class="reference external" href="http://gist.github.com/balkian">gists</a> and
<a class="reference external" href="http://github.com/balkian">repositories</a>, but we will see about
that.</p>
<p>I think the code speaks for itself, so you can check out <a class="reference external" href="http://github.com/balkian/balkian.github.com">my repository