<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Daniele &#x27;eriol&#x27; Tricoli Website</title>
    <link rel="self" type="application/atom+xml" href="https://mornie.org/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://mornie.org"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-01-01T20:03:55+01:00</updated>
    <id>https://mornie.org/atom.xml</id>
    <entry xml:lang="en">
        <title>Moving to Proton Mail</title>
        <published>2025-01-01T20:03:55+01:00</published>
        <updated>2025-01-01T20:03:55+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/moving-to-proton-mail/"/>
        <id>https://mornie.org/blog/moving-to-proton-mail/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/moving-to-proton-mail/">&lt;p&gt;After &lt;a href=&quot;https:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;libero-smtp-pain&#x2F;&quot;&gt;almost 20 years&lt;&#x2F;a&gt;, I decided to stop
self-hosting my emails and I moved to Proton Mail.&lt;&#x2F;p&gt;
&lt;p&gt;I did the switch 2 days ago and it went very smooth. To import my emails, I
just used their import mechanism over IMAP.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-the-switch&quot;&gt;Why the switch?&lt;&#x2F;h2&gt;
&lt;p&gt;Although my server was technically configured optimally, I started experiencing
deliverability issues. The subtle thing is that you unconsciously start to not
rely on emails and use them less.&lt;&#x2F;p&gt;
&lt;p&gt;And I wanted to use emails more, as in the past.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;future-stuff&quot;&gt;Future stuff&lt;&#x2F;h2&gt;
&lt;p&gt;I plan to self-host at home an instance of dovecot to have a copy of my whole
email archive. I have to figure out if
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;emersion&#x2F;hydroxide&quot;&gt;hydroxide&lt;&#x2F;a&gt;, an open-source ProtonMail
bridge, can be used for this use case.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Default Apps 2024</title>
        <published>2024-12-29T13:10:00+01:00</published>
        <updated>2024-12-29T13:10:00+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/default-apps-2024/"/>
        <id>https://mornie.org/blog/default-apps-2024/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/default-apps-2024/">&lt;p&gt;Just discovered on &lt;a href=&quot;https:&#x2F;&#x2F;micro.webology.dev&#x2F;2024&#x2F;12&#x2F;19&#x2F;default-apps.html&quot;&gt;Jeff Triplett&#x27;s blog&lt;&#x2F;a&gt;
this  “Apps I’ve been using regularly this year.”&lt;&#x2F;p&gt;
&lt;p&gt;Here is mine:&lt;&#x2F;p&gt;
&lt;p&gt;🌐 Browser: &lt;a href=&quot;https:&#x2F;&#x2F;mozilla.org&#x2F;firefox&quot;&gt;Firefox&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;www.chromium.org&#x2F;Home&#x2F;&quot;&gt;Chromium&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🔍 Search: &lt;a href=&quot;https:&#x2F;&#x2F;duckduckgo.com&quot;&gt;DuckDuckGo&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;📝 Notes: &lt;a href=&quot;https:&#x2F;&#x2F;logseq.com&quot;&gt;Logseq&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;📁 Cloud File Storage: &lt;a href=&quot;https:&#x2F;&#x2F;nextcloud.com&#x2F;&quot;&gt;Nextcloud&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;syncthing.net&quot;&gt;Syncthing&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;💬 Chat: &lt;a href=&quot;https:&#x2F;&#x2F;telegram.org&quot;&gt;Telegram&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;www.whatsapp.com&#x2F;&quot;&gt;WhatsApp&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;discord.com&quot;&gt;Discord&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;📆 Calendar: &lt;a href=&quot;https:&#x2F;&#x2F;apps.nextcloud.com&#x2F;apps&#x2F;calendar&quot;&gt;Nextcloud Calendar&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🎵 Music: &lt;a href=&quot;https:&#x2F;&#x2F;spotify.com&quot;&gt;Spotify&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🎤 Podcasts: &lt;a href=&quot;https:&#x2F;&#x2F;antennapod.org&quot;&gt;AntennaPod&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🔐 Password Management: &lt;a href=&quot;https:&#x2F;&#x2F;www.gopass.pw&#x2F;&quot;&gt;gopass&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;bitwarden.com&quot;&gt;Bitwarden&lt;&#x2F;a&gt; (selfhosted using &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dani-garcia&#x2F;vaultwarden&quot;&gt;vaultwarden&lt;&#x2F;a&gt;)&lt;&#x2F;p&gt;
&lt;p&gt;🧑‍💻 Code Editor: &lt;a href=&quot;https:&#x2F;&#x2F;neovim.io&quot;&gt;Neovim&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🗃️ Version Control: &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&quot;&gt;git&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🐚 Terminal: &lt;a href=&quot;https:&#x2F;&#x2F;konsole.kde.org&quot;&gt;Konsole&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;alacritty.org&quot;&gt;Alacritty&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;✈️ VPN: &lt;a href=&quot;https:&#x2F;&#x2F;tailscale.com&quot;&gt;Tailscale&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🔖 Bookmarks: &lt;a href=&quot;https:&#x2F;&#x2F;linkding.link&quot;&gt;linkding&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;📨 Mail Client: &lt;a href=&quot;https:&#x2F;&#x2F;www.thunderbird.net&quot;&gt;Thunderbird&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;📮 Mail Server: &lt;a href=&quot;https:&#x2F;&#x2F;www.postfix.org&quot;&gt;Postfix&lt;&#x2F;a&gt; + &lt;a href=&quot;https:&#x2F;&#x2F;www.dovecot.org&quot;&gt;Dovecot&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;🤖 Containers: &lt;a href=&quot;https:&#x2F;&#x2F;podman.io&quot;&gt;Podman&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A monthly calendar to fight procrastination</title>
        <published>2023-05-21T00:23:40+02:00</published>
        <updated>2023-05-21T00:23:40+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/a-monthly-calendar-to-fight-procrastination/"/>
        <id>https://mornie.org/blog/a-monthly-calendar-to-fight-procrastination/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/a-monthly-calendar-to-fight-procrastination/">&lt;p&gt;After reading &lt;a href=&quot;https:&#x2F;&#x2F;dynomight.net&#x2F;procrastination&#x2F;&quot;&gt;Taxonomy of procrastination&lt;&#x2F;a&gt;
by &lt;a href=&quot;https:&#x2F;&#x2F;dynomight.net&#x2F;about&#x2F;&quot;&gt;dynomight&lt;&#x2F;a&gt; I wanted to try the calendar
technique described in &lt;a href=&quot;https:&#x2F;&#x2F;dynomight.net&#x2F;procrastination&#x2F;#lets-consider-the-standard-tricks&quot;&gt;Let’s consider the standard tricks&lt;&#x2F;a&gt;
part:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Put a big calendar on the wall. On days you do the thing, draw a smiley face. On days you fail, write “FAIL”.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;I already have a calendar in the room I use most, but it hangs on the wall
opposite my desk and since it&#x27;s small I barely see it. &lt;em&gt;Too easy to ignore.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I wanted something really simple to print and I started searching... but I was
not able to find anything that suited my needs.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;latex-to-the-rescue&quot;&gt;LaTeX to the rescue&lt;&#x2F;h2&gt;
&lt;p&gt;I decided to write something myself with the following requirements:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;minimal;&lt;&#x2F;li&gt;
&lt;li&gt;must be very easy to generate the calendar for a specific month;&lt;&#x2F;li&gt;
&lt;li&gt;fast to build.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;(The last point because, well, I&#x27;m trying to reduce procrastination!)&lt;&#x2F;p&gt;
&lt;p&gt;With the requirements in mind, LaTeX was my default choice. The code is really
simple and is here: &lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;monthly-calendar&quot;&gt;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;monthly-calendar&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;You just need to add a &lt;code&gt;data.txt&lt;&#x2F;code&gt; file in the root of the repository with the
desired title and the combination year-month and compile the document.&lt;&#x2F;p&gt;
&lt;p&gt;For example with the following &lt;code&gt;data.txt&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;That nasty thing I want make in May 2023
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;2023-05
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;you will get:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;monthly-calendar&#x2F;media&#x2F;branch&#x2F;main&#x2F;screenshot.png&quot; alt=&quot;Screenshot of the generated calendar using the data file above: title is on top, days are surrounded by black squares.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;but-i-procrastinated-to-fight-procrastination&quot;&gt;But I procrastinated to fight procrastination&lt;&#x2F;h2&gt;
&lt;p&gt;Yes... and it&#x27;s fine for me because the calendar method is working and I&#x27;m happy
with the results.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Using headscale for your home networks</title>
        <published>2022-08-30T06:23:43+02:00</published>
        <updated>2022-08-30T06:23:43+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/using-headscale-for-your-home-networks/"/>
        <id>https://mornie.org/blog/using-headscale-for-your-home-networks/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/using-headscale-for-your-home-networks/">&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;tailscale.com&#x2F;&quot;&gt;Tailscale&lt;&#x2F;a&gt; is a software defined mesh virtual private
network (VPN) on top of &lt;a href=&quot;https:&#x2F;&#x2F;www.wireguard.com&#x2F;&quot;&gt;WireGuard&lt;&#x2F;a&gt;.
It&#x27;s all open source except the control server (and GUI clients for proprietary
OS).&lt;&#x2F;p&gt;
&lt;p&gt;I don&#x27;t care about GUI clients but the control server manages key distribution
and I don&#x27;t like to have an external entity with all this power on my machines.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;headscale-to-the-rescue&quot;&gt;headscale to the rescue&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;juanfont&#x2F;headscale&quot;&gt;headscale&lt;&#x2F;a&gt; is an open source,
self-hosted implementation of the Tailscale control server.
I deployed it writing and then using
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;ansible-collection-kit&#x2F;src&#x2F;branch&#x2F;main&#x2F;roles&#x2F;headscale&quot;&gt;this ansible role&lt;&#x2F;a&gt;
with Nginx as &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;juanfont&#x2F;headscale&#x2F;wiki&#x2F;nginx-configuration&quot;&gt;reverse proxy&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I have something like this:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;hosts&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;my-server
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;vars&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;headscale_base_domain&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;headscale.example.org
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;headscale_listen_addr&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;127.0.0.1:8080
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;roles&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.headscale
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you want install my ansible collection you can follow the instructions
provided &lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;ansible-collection-kit#installation&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Deploy Syncthing on a Synology DS416 with DSM 7</title>
        <published>2021-10-23T01:44:05+02:00</published>
        <updated>2021-10-23T01:44:05+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/deploy-syncthing-on-a-synology-ds416-with-dsm-7/"/>
        <id>https://mornie.org/blog/deploy-syncthing-on-a-synology-ds416-with-dsm-7/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/deploy-syncthing-on-a-synology-ds416-with-dsm-7/">&lt;p&gt;After updating my NAS, a Synology DS416, to DSM 7 I decided to deploy
&lt;a href=&quot;https:&#x2F;&#x2F;syncthing.net&#x2F;&quot;&gt;Syncthing&lt;&#x2F;a&gt; on it. Synology supports containers in its
latest NAS but not in DS416 and the suggested way to deploy is to use docker.&lt;&#x2F;p&gt;
&lt;p&gt;There is an alternative fortunately since the NAS uses an
&lt;code&gt;ARMv7 Processor rev 4 (v7l)&lt;&#x2F;code&gt; and Syncthing is written in Go, it&#x27;s
really easy to cross-compile from source and just copy the binary into the NAS.&lt;&#x2F;p&gt;
&lt;p&gt;If you don&#x27;t want to compile it you will find binaries here:
&lt;a href=&quot;https:&#x2F;&#x2F;syncthing.net&#x2F;downloads&#x2F;&quot;&gt;https:&#x2F;&#x2F;syncthing.net&#x2F;downloads&#x2F;&lt;&#x2F;a&gt;.
Download the ARM binary and you are ready to go.&lt;&#x2F;p&gt;
&lt;p&gt;In the NAS I created a dedicated user for syncthing, copied the binary on a
specific path and, since DSM 7 uses systemd, I added the following unit inside
&lt;code&gt;&#x2F;etc&#x2F;systemd&#x2F;system&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;[Unit]
&lt;&#x2F;span&gt;&lt;span&gt;Description=Syncthing continuous file synchronization
&lt;&#x2F;span&gt;&lt;span&gt;After=network.target
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;[Service]
&lt;&#x2F;span&gt;&lt;span&gt;User=&amp;lt;the user you created for syncthing&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;ExecStart=&#x2F;path&#x2F;to&#x2F;syncthing serve --no-browser --no-restart --logflags=0
&lt;&#x2F;span&gt;&lt;span&gt;Restart=on-failure
&lt;&#x2F;span&gt;&lt;span&gt;RestartSec=1
&lt;&#x2F;span&gt;&lt;span&gt;SuccessExitStatus=3 4
&lt;&#x2F;span&gt;&lt;span&gt;RestartForceExitStatus=3 4
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;[Install]
&lt;&#x2F;span&gt;&lt;span&gt;WantedBy=multi-user.target
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Please mind to substitute &lt;code&gt;&amp;lt;the user you created for syncthing&amp;gt;&lt;&#x2F;code&gt; with the actual
user you created and &lt;code&gt;&#x2F;path&#x2F;to&#x2F;syncthing&lt;&#x2F;code&gt; with the actual path syncthing is in.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Look at your EU Digital COVID Certificate</title>
        <published>2021-07-04T21:36:14+02:00</published>
        <updated>2021-07-04T21:36:14+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/look-at-your-eu-digital-covid-certificate/"/>
        <id>https://mornie.org/blog/look-at-your-eu-digital-covid-certificate/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/look-at-your-eu-digital-covid-certificate/">&lt;p&gt;I wanted to look at my EU Digital COVID Certificate&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; that just arrived the
other day, so after looking at the
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ehn-dcc-development&#x2F;hcert-spec&quot;&gt;specification&lt;&#x2F;a&gt; I wrote a
simple decoder that ignore the signing part (I was only interested to look at
the data itself) and print the relevant data.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;code&quot;&gt;Code&lt;&#x2F;h2&gt;
&lt;p&gt;The code is at &lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;eudccdec&quot;&gt;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;eudccdec&lt;&#x2F;a&gt;
and is licensed under the GPLv3 license. Since it&#x27;s written in
&lt;a href=&quot;https:&#x2F;&#x2F;www.rust-lang.org&#x2F;&quot;&gt;rust&lt;&#x2F;a&gt; you can install &lt;code&gt;cargo&lt;&#x2F;code&gt;, and then:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;cargo install --branch main --git https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;eudccdec
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;&#x2F;h2&gt;
&lt;p&gt;Using the Italian test data, &lt;code&gt;curl&lt;&#x2F;code&gt; and &lt;code&gt;zbarimg&lt;&#x2F;code&gt;&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;curl -sL https:&#x2F;&#x2F;github.com&#x2F;eu-digital-green-certificates&#x2F;dgc-testdata&#x2F;raw&#x2F;main&#x2F;IT&#x2F;png&#x2F;1.png | \
&lt;&#x2F;span&gt;&lt;span&gt;  zbarimg --quiet --raw - | eudccdec
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;you will get:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;Certificate {
&lt;&#x2F;span&gt;&lt;span&gt;    ver: &amp;quot;1.0.0&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    nam: Name {
&lt;&#x2F;span&gt;&lt;span&gt;        fn_: &amp;quot;Di Caprio&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        fnt: &amp;quot;DI&amp;lt;CAPRIO&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        gn: &amp;quot;Marilù Teresa&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        gnt: &amp;quot;MARILU&amp;lt;TERESA&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    },
&lt;&#x2F;span&gt;&lt;span&gt;    dob: &amp;quot;1977-06-16&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    v: [
&lt;&#x2F;span&gt;&lt;span&gt;        VaccineRecord {
&lt;&#x2F;span&gt;&lt;span&gt;            tg: &amp;quot;840539006&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            vp: &amp;quot;1119349007&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            mp: &amp;quot;EU&#x2F;1&#x2F;20&#x2F;1528&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            ma: &amp;quot;ORG-100030215&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            dn: 2,
&lt;&#x2F;span&gt;&lt;span&gt;            sd: 2,
&lt;&#x2F;span&gt;&lt;span&gt;            dt: &amp;quot;2021-04-10&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            co: &amp;quot;IT&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            is: &amp;quot;IT&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            ci: &amp;quot;01ITE7300E1AB2A84C719004F103DCB1F70A#6&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        },
&lt;&#x2F;span&gt;&lt;span&gt;    ],
&lt;&#x2F;span&gt;&lt;span&gt;    r: [],
&lt;&#x2F;span&gt;&lt;span&gt;    t: [],
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To know what the fields mean look at the JSON schema specifications for EU
Digital COVID Certificates available
&lt;a href=&quot;https:&#x2F;&#x2F;ec.europa.eu&#x2F;health&#x2F;sites&#x2F;default&#x2F;files&#x2F;ehealth&#x2F;docs&#x2F;covid-certificate_json_specification_en.pdf&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;They are called also Green Pass.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;2&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;2&lt;&#x2F;sup&gt;
&lt;p&gt;On a Debian based system use &lt;code&gt;sudo apt install curl zbar-tools&lt;&#x2F;code&gt; to install
them.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>kioku: a simple and customizable memory game</title>
        <published>2021-05-22T23:51:04+02:00</published>
        <updated>2021-05-22T23:51:04+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/kioku-a-simple-and-customizable-memory-game/"/>
        <id>https://mornie.org/blog/kioku-a-simple-and-customizable-memory-game/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/kioku-a-simple-and-customizable-memory-game/">&lt;p&gt;Unfortunately one of the parents of a friend of mine was diagnosed with
Alzheimer. The good news is that it&#x27;s still at the first stage so keeping the
brain active will help a lot.&lt;&#x2F;p&gt;
&lt;p&gt;The classic memory game with covered cards can be useful, but I thought that
it could be more pleasant with cards showing something close to affections,
for example photos or drawings of what you care about.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;welcome-kioku&quot;&gt;Welcome kioku&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;kioku&lt;&#x2F;strong&gt; (記憶) — it means memory in Japanese — it&#x27;s a memory game where you
can create your own levels released under the GPL3 license.
I had to make it run also on Android so I used Python with the
&lt;a href=&quot;https:&#x2F;&#x2F;kivy.org&#x2F;&quot;&gt;kivy framework&lt;&#x2F;a&gt; to support both Linux and Android.&lt;&#x2F;p&gt;
&lt;p&gt;Here a screenshot of the game screen on Linux playing a custom level made with
photo of cats&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;:
&lt;img src=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku&#x2F;raw&#x2F;branch&#x2F;main&#x2F;extra&#x2F;screenshot_game_linux.png&quot; alt=&quot;The game screen of kioku on Linux playing a level with cats&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;code&quot;&gt;Code&lt;&#x2F;h2&gt;
&lt;p&gt;The code is at &lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku&quot;&gt;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku&lt;&#x2F;a&gt;
and the README cover already topics like &lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku#installation&quot;&gt;build and install&lt;&#x2F;a&gt;,
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku#create-a-new-level&quot;&gt;level creation&lt;&#x2F;a&gt; and
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku#load-a-level&quot;&gt;level load&lt;&#x2F;a&gt;, so I&#x27;m not
repeating them here.&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;The used photos are released under Creative Commons licenses, see the details
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;kioku#gallery&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Designing a storytelling dice</title>
        <published>2021-05-04T03:31:58+02:00</published>
        <updated>2021-05-04T03:31:58+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/designing-a-storytelling-dice/"/>
        <id>https://mornie.org/blog/designing-a-storytelling-dice/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/designing-a-storytelling-dice/">&lt;p&gt;Some months ago while talking about 3D printing with a friend of mine
(hi Agata!) she suggested me that I could design and print a storytelling dice
as one of my first 3D projects because it&#x27;s quite easy to do, and post pandemic
it would be fun to play with friends.&lt;&#x2F;p&gt;
&lt;p&gt;So I looked at a CAD I could use, as someone who never used a CAD before, and
discovered &lt;a href=&quot;https:&#x2F;&#x2F;solvespace.com&#x2F;index.pl&quot;&gt;solvespace&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;In a couple of hours I made the dice and the first face, but then I stopped
working on it since I had to setup my new VPS. Last Friday I took some time to
complete it:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;storytelling-dice&#x2F;media&#x2F;tag&#x2F;v1&#x2F;dice.png&quot; alt=&quot;image storytelling dice made using solvespace&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I printed it using white PLA:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;storytelling-dice&#x2F;raw&#x2F;tag&#x2F;v1&#x2F;01.jpg&quot; alt=&quot;photo of the printed dice showing house, shoe and monster faces&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Unfortunately my printer made the house face (the one laid on the printer bed) a
bit more sticking out, I will try to print using supports next time rotating the
dice to make it lay on an edge.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;storytelling-dice&#x2F;raw&#x2F;tag&#x2F;v1&#x2F;02.jpg&quot; alt=&quot;photo of the printed dice showing pacifier, shoe and pinwheel faces&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The dice is released under CC BY-NC-SA 4.0 and you can find all the files
(included the STL ready to be printed) in the
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;storytelling-dice&quot;&gt;repository&lt;&#x2F;a&gt; of the project.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Gitea with pandoc</title>
        <published>2021-04-27T17:09:07+02:00</published>
        <updated>2021-04-27T17:09:07+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/gitea-with-pandoc/"/>
        <id>https://mornie.org/blog/gitea-with-pandoc/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/gitea-with-pandoc/">&lt;p&gt;Some days ago I wrote about &lt;a href=&quot;https:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;use-a-custom-template-for-rst2html-with-gitea&#x2F;&quot;&gt;using rst2html with gitea&lt;&#x2F;a&gt;.
Unfortunately I noticed that HTML anchors were broken and other nuisances.
A friend of mine (thanks tosky!) told me that they are using
&lt;a href=&quot;https:&#x2F;&#x2F;pandoc.org&#x2F;&quot;&gt;pandoc&lt;&#x2F;a&gt; on the &lt;a href=&quot;https:&#x2F;&#x2F;opendev.org&#x2F;&quot;&gt;opendev&lt;&#x2F;a&gt;&#x27;s gitea
instance, so I did the same in my custom docker&#x2F;podman image:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;dockerfile&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-dockerfile &quot;&gt;&lt;code class=&quot;language-dockerfile&quot; data-lang=&quot;dockerfile&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;FROM&lt;&#x2F;span&gt;&lt;span&gt; alpine:3.13 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;as &lt;&#x2F;span&gt;&lt;span&gt;builder
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;ENV &lt;&#x2F;span&gt;&lt;span&gt;PANDOC_VERSION 2.13
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;ENV &lt;&#x2F;span&gt;&lt;span&gt;PANDOC_TARBALL_SHA256SUM 7404aa88a6eb9fbb99d9803b80170a3a546f51959230cc529c66a2ce6b950d4c
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;RUN &lt;&#x2F;span&gt;&lt;span&gt;apk --no-cache add tar
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;WORKDIR &lt;&#x2F;span&gt;&lt;span&gt;&#x2F;opt
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;ADD &lt;&#x2F;span&gt;&lt;span&gt;https:&#x2F;&#x2F;github.com&#x2F;jgm&#x2F;pandoc&#x2F;releases&#x2F;download&#x2F;${PANDOC_VERSION}&#x2F;pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz pandoc.tar.gz
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;RUN &lt;&#x2F;span&gt;&lt;span&gt;sha256sum pandoc.tar.gz | grep -q ${PANDOC_TARBALL_SHA256SUM} &amp;amp;&amp;amp; \
&lt;&#x2F;span&gt;&lt;span&gt;    tar xvzf pandoc.tar.gz --strip-components 1
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;FROM&lt;&#x2F;span&gt;&lt;span&gt; gitea&#x2F;gitea:1.14.1
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;COPY&lt;&#x2F;span&gt;&lt;span&gt; --from=builder &#x2F;opt&#x2F;bin&#x2F;pandoc &#x2F;usr&#x2F;local&#x2F;bin&#x2F;pandoc
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;EXPOSE &lt;&#x2F;span&gt;&lt;span&gt;3000
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;My gitea&#x27;s &lt;code&gt;app.ini&lt;&#x2F;code&gt; section related to reStructuredText is now:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ini&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-ini &quot;&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;[markup.restructuredtext]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;ENABLED         &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;true
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;FILE_EXTENSIONS &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= .&lt;&#x2F;span&gt;&lt;span&gt;rst
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;RENDER_COMMAND  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;&#x2F;usr&#x2F;local&#x2F;bin&#x2F;pandoc -f rst&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;IS_INPUT_FILE   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;false
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Use a custom template for rst2html with gitea</title>
        <published>2021-04-17T02:18:05+02:00</published>
        <updated>2021-04-17T02:18:05+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/use-a-custom-template-for-rst2html-with-gitea/"/>
        <id>https://mornie.org/blog/use-a-custom-template-for-rst2html-with-gitea/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/use-a-custom-template-for-rst2html-with-gitea/">&lt;p&gt;The other day I noticed that on my self hosted instance of
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&quot;&gt;gitea&lt;&#x2F;a&gt; reStructuredText files was not properly
rendered: &lt;code&gt;&amp;lt;html&amp;gt;&lt;&#x2F;code&gt; and &#x27;&lt;&#x2F;html&gt;&#x27; tags were popping out to the rendered text.&lt;&#x2F;p&gt;
&lt;p&gt;To solve the issue I decided to write a custom template for &lt;code&gt;rst2html&lt;&#x2F;code&gt; to get
only the body part:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;%(body_pre_docinfo)s
&lt;&#x2F;span&gt;&lt;span&gt;%(docinfo)s
&lt;&#x2F;span&gt;&lt;span&gt;%(body)s
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then I just updated my gitea&#x27;s &lt;code&gt;app.ini&lt;&#x2F;code&gt; section related to reStructuredText:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ini&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-ini &quot;&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;[markup.restructuredtext]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;ENABLED         &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;true
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;FILE_EXTENSIONS &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= .&lt;&#x2F;span&gt;&lt;span&gt;rst
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;RENDER_COMMAND  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;rst2html.py --template=&#x2F;usr&#x2F;share&#x2F;docutils&#x2F;writers&#x2F;htmlbody&#x2F;template.txt&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;IS_INPUT_FILE   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;false
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;where &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;docutils&#x2F;writers&#x2F;htmlbody&#x2F;template.txt&lt;&#x2F;code&gt; is the absolute path
of the custom template showed above.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My first minutes on personal servers</title>
        <published>2021-02-13T16:21:45+01:00</published>
        <updated>2021-02-13T16:21:45+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/my-first-minutes-personal-servers/"/>
        <id>https://mornie.org/blog/my-first-minutes-personal-servers/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/my-first-minutes-personal-servers/">&lt;p&gt;Almost a year ago I decided to migrate to a new VPS provider but I wanted to
reduce the effort required to setup and maintain it.&lt;&#x2F;p&gt;
&lt;p&gt;I started to learn and use ansible and I developed a personal &lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;ansible-collection-kit&quot;&gt;collection of
roles&lt;&#x2F;a&gt;. Since ansible 2.10
you don&#x27;t need to use &lt;a href=&quot;https:&#x2F;&#x2F;galaxy.ansible.com&#x2F;&quot;&gt;Ansible Galaxy&lt;&#x2F;a&gt;, you can
just install it from git: this is great because I&#x27;m trying to stop using
services that can&#x27;t be self-hosted and Ansible Galaxy need a Github account to
login.&lt;&#x2F;p&gt;
&lt;p&gt;To install my collection I just add the following stanza into
&lt;code&gt;requirements.yml&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span&gt;---
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;collections&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;  - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;ansible-collection-kit
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;git
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;version&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0.2.5
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;and then:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;shell&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-shell &quot;&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span&gt;ansible-galaxy collection install -f -r requirements.yml
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I use the &lt;code&gt;-f&lt;&#x2F;code&gt; to handle the upgrade of the collection since it&#x27;s easier to
just recall the command from history, but from ansible-base 2.11 &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ansible&#x2F;ansible&#x2F;issues&#x2F;65699&quot;&gt;it will not
be required anymore&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;security-is-hard&quot;&gt;Security is hard&lt;&#x2F;h2&gt;
&lt;p&gt;A little but &lt;strong&gt;important&lt;&#x2F;strong&gt; digression before continuing. I used the word
&lt;strong&gt;personal&lt;&#x2F;strong&gt; on purpose on the title of this post. It&#x27;s not to say that on a
personal server&#x2F;service you can have a lower standard regarding security.
It&#x27;s to say that security is built around the applications that the system
support and context. For example, on my personal VPS I&#x27;m the &lt;strong&gt;only&lt;&#x2F;strong&gt; user.
This is a &lt;strong&gt;huge&lt;&#x2F;strong&gt; assumption and simplify a lot of things like accountability.&lt;&#x2F;p&gt;
&lt;p&gt;Keep in mind this if you want to use my collection.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-i-bootstrap-a-new-server&quot;&gt;How I bootstrap a new server&lt;&#x2F;h2&gt;
&lt;p&gt;I have the following playbook &lt;code&gt;server-bootstrap.yml&lt;&#x2F;code&gt; with the common part:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span&gt;---
&lt;&#x2F;span&gt;&lt;span&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;bootstrap operations for a new server
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;hosts&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;{{ hostlist | default(&amp;#39;bootstrapable&amp;#39;) }}&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;roles&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.common
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.hostname
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.admin
&lt;&#x2F;span&gt;&lt;span&gt;    - {&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;role&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.nftables&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;when&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;not is_docker_used&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;    - {&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;role&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.iptables&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;when&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;is_docker_used&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.sshd
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;eriol.kit.fail2ban
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I keep all the servers in a &lt;code&gt;bootstrapable&lt;&#x2F;code&gt; group so I can just execute
&lt;code&gt;server-bootstrap.yml&lt;&#x2F;code&gt; playbook, but if I want a specific playbook for a server
I do:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span&gt;---
&lt;&#x2F;span&gt;&lt;span&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;import the common server part
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;vars&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;hostlist&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;example.org
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import_playbook&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;server-bootstrap.yml
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;stuff for example.org
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;hosts&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;example.org
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;roles&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# YOUR ROLES HERE
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This way I don&#x27;t have to write down the common part. All the variables are
inside the inventory split between groups variables and specific hosts
variables to make the playbooks generic.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Resume blogging</title>
        <published>2021-02-08T00:39:38+01:00</published>
        <updated>2021-02-08T00:39:38+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/resume-blogging/"/>
        <id>https://mornie.org/blog/resume-blogging/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/resume-blogging/">&lt;p&gt;Almost &lt;a href=&quot;https:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;from-django-to-hugo&#x2F;&quot;&gt;five years ago&lt;&#x2F;a&gt; was the last time I wrote
something here. If I look back I can identify several reasons, but astonishingly
the main cause was about me thinking about the need to write always something
useful.&lt;&#x2F;p&gt;
&lt;p&gt;Then I was lucky to read this inspiring post by Jeremy Friesen:
&lt;a href=&quot;https:&#x2F;&#x2F;takeonrules.com&#x2F;2021&#x2F;02&#x2F;02&#x2F;happy-10th-birthday-take-on-rules&#x2F;&quot;&gt;Happy 10th Birthday Take on Rules&lt;&#x2F;a&gt;. I suggest you to read the whole post, but
I want to quote a couple of phrases that impressed me more:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t keep a schedule, nor publish at peak hours. Instead, I release what I write when I’m done with it.&lt;&#x2F;p&gt;
&lt;p&gt;[...]&lt;&#x2F;p&gt;
&lt;p&gt;So I ripped out the analytics, and chose to write according to my current mood and interests.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;As I wrote on the fediverse:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;I never used a proper tool for analytics, but I had the idea that one have
to write something useful for others, but now, as you
say, I will just «write according to my current mood and interests».
&lt;em&gt;I will always try to write something useful, but it won&#x27;t be the goal.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This will be the new commitment, so a sort of no commitment at all.
I was already working on the site itself, but without the words of Jeremy
Friesen and also the words of support of &lt;a href=&quot;https:&#x2F;&#x2F;alexschroeder.ch&#x2F;&quot;&gt;Alex
Schroeder&lt;&#x2F;a&gt; this post would come later.&lt;&#x2F;p&gt;
&lt;p&gt;I want to thanks both of them!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;from-hugo-to-zola&quot;&gt;From Hugo to Zola&lt;&#x2F;h2&gt;
&lt;p&gt;If you are wondering why I switched, I&#x27;m sorry to disappoint you: no, it&#x27;s not
a matter of rust vs go. In fact at first, around a week ago, when I moved this
site to a new VM I was still using &lt;a href=&quot;https:&#x2F;&#x2F;gohugo.io&#x2F;&quot;&gt;hugo&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Then I wanted to change the style of the site and no, I really dislike the
templating part of hugo. Please read carefully the following words:
&lt;em&gt;it&#x27;s me that doesn&#x27;t like it&lt;&#x2F;em&gt;. If you enjoy it, I&#x27;m happy for you! I still
wanted to use a fast generator so I looked at what rust had to offer.
&lt;a href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;&quot;&gt;Zola&lt;&#x2F;a&gt; seemed the most complete so I tried it and I
was happy with the result. The switch was extremely simple and fast I must
confess.
Zola doesn&#x27;t have a command to create new content, but I don&#x27;t miss it.
I simply added the following snippet to my vim configuration:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;snippet zolan &amp;quot;Create a new zola entry&amp;quot; b
&lt;&#x2F;span&gt;&lt;span&gt;+++
&lt;&#x2F;span&gt;&lt;span&gt;draft = true
&lt;&#x2F;span&gt;&lt;span&gt;date = `date --rfc-3339=seconds`
&lt;&#x2F;span&gt;&lt;span&gt;title = &amp;quot;$1&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;[taxonomies]
&lt;&#x2F;span&gt;&lt;span&gt;tags = [&amp;quot;$2&amp;quot;]
&lt;&#x2F;span&gt;&lt;span&gt;+++
&lt;&#x2F;span&gt;&lt;span&gt;$0
&lt;&#x2F;span&gt;&lt;span&gt;endsnippet
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;automate-all-the-things&quot;&gt;Automate all the things&lt;&#x2F;h2&gt;
&lt;p&gt;To reduce the friction on my blogging workflow (but also because it was fun to
setup) I&#x27;m using a self hosted instance of the CI&#x2F;CD service called
&lt;a href=&quot;https:&#x2F;&#x2F;www.drone.io&#x2F;&quot;&gt;drone&lt;&#x2F;a&gt;. This means that to publish this post, I only
need my editor and git.&lt;&#x2F;p&gt;
&lt;p&gt;But I will talk about it another time.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>From Django to Hugo</title>
        <published>2015-04-01T02:24:16+02:00</published>
        <updated>2015-04-01T02:24:16+02:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/from-django-to-hugo/"/>
        <id>https://mornie.org/blog/from-django-to-hugo/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/from-django-to-hugo/">&lt;p&gt;About eight years ago I &lt;a href=&quot;https:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;my-blog-django&#x2F;&quot;&gt;wrote my own blog&lt;&#x2F;a&gt;
(and my website) using &lt;a href=&quot;http:&#x2F;&#x2F;www.djangoproject.com&#x2F;&quot;&gt;Django&lt;&#x2F;a&gt;. It was time to
change so I completely rewrote it with &lt;a href=&quot;http:&#x2F;&#x2F;gohugo.io&#x2F;&quot;&gt;Hugo&lt;&#x2F;a&gt;, a static
website engine made by &lt;a href=&quot;http:&#x2F;&#x2F;spf13.com&quot;&gt;spf13&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-going-static&quot;&gt;Why going static?&lt;&#x2F;h2&gt;
&lt;p&gt;I use this site mainly to write about stuff I think interesting and when I have
to write I want to use &lt;a href=&quot;http:&#x2F;&#x2F;www.vim.org&#x2F;&quot;&gt;Vim&lt;&#x2F;a&gt;. So while Django is a
wonderful framework, it was not the right choice for this site. In fact, I wrote
less and less...&lt;&#x2F;p&gt;
&lt;p&gt;I know, I could use &lt;a href=&quot;http:&#x2F;&#x2F;www.django-rest-framework.org&#x2F;&quot;&gt;Django REST framework&lt;&#x2F;a&gt;
with a Vim plugin, but a markdown file for each post is easier! :)&lt;&#x2F;p&gt;
&lt;p&gt;You can find the code of the site on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;eriol&#x2F;mornie.org&quot;&gt;GitHub&lt;&#x2F;a&gt;
and &lt;a href=&quot;https:&#x2F;&#x2F;gitlab.com&#x2F;eriol&#x2F;mornie.org&quot;&gt;GitLab&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;git&quot;&gt;Git?&lt;&#x2F;h2&gt;
&lt;p&gt;It&#x27;s clear by now who won the DVCS war, so I started to use git and I will
migrate my repositories soon (I already started the migration). My plan is to
keep my code both on &lt;a href=&quot;https:&#x2F;&#x2F;bitbucket.org&#x2F;eriol&quot;&gt;Bitbucket&lt;&#x2F;a&gt;,
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;eriol&quot;&gt;GitHub&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;gitlab.com&#x2F;u&#x2F;eriol&quot;&gt;GitLab&lt;&#x2F;a&gt;:
since git is distributed, I will use it in the proper way.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;still-a-work-in-progress&quot;&gt;Still a Work In Progress&lt;&#x2F;h2&gt;
&lt;p&gt;No, this site is not completed yet, even an about page is missing! I
will add more content on my spare time, so stay tuned! :)&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to load an image from memory in Kivy</title>
        <published>2013-11-06T19:55:04+01:00</published>
        <updated>2013-11-06T19:55:04+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/how-load-image-memory-kivy/"/>
        <id>https://mornie.org/blog/how-load-image-memory-kivy/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/how-load-image-memory-kivy/">&lt;p&gt;Sometime you may have the need to load an image already in memory instead of
use one of the several ways &lt;a href=&quot;https:&#x2F;&#x2F;kivy.org&#x2F;&quot;&gt;Kivy&lt;&#x2F;a&gt; provides to load images.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;kivy_memory_image.png&quot; alt=&quot;kivy memory image&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I had this need for a project of mine so I came up with the following code (I
was inspired by &lt;a href=&quot;https:&#x2F;&#x2F;groups.google.com&#x2F;forum&#x2F;#!topic&#x2F;kivy-users&#x2F;l-3FJ2mA3qI&quot;&gt;this thread&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env python
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# encoding: utf-8
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# kivy_memory_image.py
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# How to load an image from memory in Kivy
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# http:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;2013&#x2F;11&#x2F;06&#x2F;how-load-image-memory-kivy&#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# Copyright (c) 2013, Daniele Tricoli 
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# All rights reserved.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;#
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# License: BSD-3
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;StringIO
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;matplotlib.backends.backend_agg &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;FigureCanvasAgg
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;matplotlib.figure &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;Figure
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;numpy &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;as &lt;&#x2F;span&gt;&lt;span&gt;np
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;kivy.app &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;App
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;kivy.core.image.img_pygame &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;ImageLoaderPygame
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;kivy.properties &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;ObjectProperty
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;kivy.uix.image &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;Image
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;cardioid&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;start&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;stop&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;A rotated cardioid.&amp;quot;&amp;quot;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    theta &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;np.arange(start, stop, step)
&lt;&#x2F;span&gt;&lt;span&gt;    r &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span&gt;np.sin(theta)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;theta, r
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;polar_plot&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;theta&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;r&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;rmax&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;Draw a polat plot.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;    :returns: matplotlib.Figure
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    fig &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;Figure(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;facecolor&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;white&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    ax &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;fig.add_subplot(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;111&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;polar&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;frameon&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    ax.grid(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    ax.set_xticklabels([])
&lt;&#x2F;span&gt;&lt;span&gt;    ax.set_yticklabels([])
&lt;&#x2F;span&gt;&lt;span&gt;    ax.plot(theta, r, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;color&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;g&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;linewidth&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    ax.set_rmax(rmax)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;fig
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;fig2png&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;fig&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;Convert a matplotlib.Figure to PNG image.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;    :returns: PNG image bytes
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    data &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;StringIO.StringIO()
&lt;&#x2F;span&gt;&lt;span&gt;    canvas &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;FigureCanvasAgg(fig)
&lt;&#x2F;span&gt;&lt;span&gt;    canvas.print_png(data)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;data.getvalue()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;MemoryImage&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;Image&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;Display an image already loaded in memory.&amp;quot;&amp;quot;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    memory_data &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;ObjectProperty(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;None&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;memory_data&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;**&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;kwargs&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;super&lt;&#x2F;span&gt;&lt;span&gt;(MemoryImage, self).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;**&lt;&#x2F;span&gt;&lt;span&gt;kwargs)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.memory_data &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;memory_data
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;on_memory_data&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;Load image from memory.&amp;quot;&amp;quot;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;        data &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;StringIO.StringIO(self.memory_data)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;with &lt;&#x2F;span&gt;&lt;span&gt;self.canvas:
&lt;&#x2F;span&gt;&lt;span&gt;            self.texture &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;ImageLoaderPygame(data).texture
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;TestApp&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;App&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;build&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;MemoryImage(self.options[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;image&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;__name__ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;__main__&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    theta, r &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;cardioid(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;8.0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0.01&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    image &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;fig2png(polar_plot(theta, r, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2.5&lt;&#x2F;span&gt;&lt;span&gt;))
&lt;&#x2F;span&gt;&lt;span&gt;    TestApp(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;image&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;image).run()
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;cardioid&lt;&#x2F;code&gt;, &lt;code&gt;polar_plot&lt;&#x2F;code&gt; and &lt;code&gt;fig2png&lt;&#x2F;code&gt; are simply support functions to simulate
an image already loaded in memory. My actual use case is different: I have
images as BLOB inside a SQLite database (just like I described
&lt;a href=&quot;https:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;storing-binary-data-in-sqlite&#x2F;&quot;&gt;years ago&lt;&#x2F;a&gt;). The real work is
done by &lt;code&gt;MemoryImage&lt;&#x2F;code&gt;&#x27;s &lt;code&gt;on_memory_data&lt;&#x2F;code&gt; method, taking advantage of Kivy
automatic property binding.&lt;&#x2F;p&gt;
&lt;p&gt;You can download the whole example from here:
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;misc&#x2F;raw&#x2F;branch&#x2F;main&#x2F;blog&#x2F;kivy_memory_image.py&quot;&gt;kivy_memory_image.py&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to fix CKEditor 4 default theme in Django admin</title>
        <published>2012-12-22T16:22:54+01:00</published>
        <updated>2012-12-22T16:22:54+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/how-fix-ckeditor-4-default-theme-django-admin/"/>
        <id>https://mornie.org/blog/how-fix-ckeditor-4-default-theme-django-admin/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/how-fix-ckeditor-4-default-theme-django-admin/">&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;ckeditor.com&#x2F;&quot;&gt;CKEditor&lt;&#x2F;a&gt; 4 default theme, &lt;a href=&quot;https:&#x2F;&#x2F;ckeditor.com&#x2F;cke4&#x2F;addon&#x2F;moono&quot;&gt;mOOno&lt;&#x2F;a&gt;,
is very nice and has a good set of features:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;neutral design that fits all situations;&lt;&#x2F;li&gt;
&lt;li&gt;optimized for accessibility, using &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;WAI-ARIA&quot;&gt;WAI-ARIA&lt;&#x2F;a&gt;
standards for contrast;&lt;&#x2F;li&gt;
&lt;li&gt;supports the UI color feature;&lt;&#x2F;li&gt;
&lt;li&gt;supports High Contrast.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;But inside Django admin there is a little layout problem:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;moono-without-fix.png&quot; alt=&quot;image of moono without fix&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;To fix this issue you may use the following css snippet:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;css&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-css &quot;&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;div&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;.cke_chrome &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;width&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;100&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;%&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;padding&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;!important&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;clear&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;both&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The result is this:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;moono-with-fix.png&quot; alt=&quot;image of moono with fix&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>django-c5filemanager 0.1 released!</title>
        <published>2010-12-01T22:00:41+01:00</published>
        <updated>2010-12-01T22:00:41+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/django-c5filemanager-01-released/"/>
        <id>https://mornie.org/blog/django-c5filemanager-01-released/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/django-c5filemanager-01-released/">&lt;p&gt;The first public release of &lt;a href=&quot;&#x2F;projects&#x2F;django-c5filemanager&#x2F;&quot;&gt;django-c5filemanager&lt;&#x2F;a&gt;
is out! :)&lt;&#x2F;p&gt;
&lt;p&gt;django-c5filemanager is a connector for the Core Five Filemanager and provides
an easy way to add the filemanager to your Django project.&lt;&#x2F;p&gt;
&lt;p&gt;For more information &lt;a href=&quot;http:&#x2F;&#x2F;docs.mornie.org&#x2F;django-c5filemanager&#x2F;&quot;&gt;browse online documentation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to mail me to report bugs and request features.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bye bye Subversion!</title>
        <published>2010-11-18T18:24:24+01:00</published>
        <updated>2010-11-18T18:24:24+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/bye-bye-subversion/"/>
        <id>https://mornie.org/blog/bye-bye-subversion/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/bye-bye-subversion/">&lt;p&gt;I have just turned off my SVN server as all my projects has been migrated to
&lt;a href=&quot;http:&#x2F;&#x2F;mercurial.selenic.com&#x2F;&quot;&gt;Mercurial&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The address of my new HG server is: &lt;a href=&quot;http:&#x2F;&#x2F;hg.mornie.org&#x2F;&quot;&gt;hg.mornie.org&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>pyth in Debian NEW Queue</title>
        <published>2010-10-21T13:24:38+01:00</published>
        <updated>2010-10-21T13:24:38+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/pyth-debian-new-queue/"/>
        <id>https://mornie.org/blog/pyth-debian-new-queue/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/pyth-debian-new-queue/">&lt;p&gt;Thanks to &lt;a href=&quot;https:&#x2F;&#x2F;qa.debian.org&#x2F;developer.php?login=piotr&quot;&gt;Piotr Ożarowski&lt;&#x2F;a&gt; my first Debian package
is in the &lt;a href=&quot;https:&#x2F;&#x2F;ftp-master.debian.org&#x2F;new&#x2F;&quot;&gt;NEW Queue&lt;&#x2F;a&gt;! :)&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Update 2010-11-08:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;packages.qa.debian.org&#x2F;p&#x2F;pyth&#x2F;news&#x2F;20101108T220249Z.html&quot;&gt;It&#x27;s in&lt;&#x2F;a&gt;! :)&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Still alive :D</title>
        <published>2009-11-11T02:52:16+01:00</published>
        <updated>2009-11-11T02:52:16+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/still-alive/"/>
        <id>https://mornie.org/blog/still-alive/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/still-alive/">&lt;p&gt;Yes, I&#x27;m still alive. I worked hard and life was too much busy to write
something in the meanwhile. :(&lt;&#x2F;p&gt;
&lt;p&gt;Fast news:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;I  wrote again my blog engine during upgrade of this site to django 1.1.1:
now is more comfortable!&lt;&#x2F;li&gt;
&lt;li&gt;I have just update my old entry about &lt;a href=&quot;https:&#x2F;&#x2F;mornie.org&#x2F;blog&#x2F;playing-with-ctypes-and-libcaca&#x2F;&quot;&gt;python and libcaca&lt;&#x2F;a&gt;;&lt;&#x2F;li&gt;
&lt;li&gt;I will return to work on &lt;a href=&quot;http:&#x2F;&#x2F;www.netsukuku.org&#x2F;&quot;&gt;netsukuku&lt;&#x2F;a&gt; soon!&lt;&#x2F;li&gt;
&lt;li&gt;I joined the &lt;a href=&quot;http:&#x2F;&#x2F;eurobot.dmi.unict.it&#x2F;&quot;&gt;DMI Eurobot&lt;&#x2F;a&gt; team. :)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Stay tuned!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A GPL Snowman</title>
        <published>2008-03-30T03:08:16+01:00</published>
        <updated>2008-03-30T03:08:16+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/gpl-snowman/"/>
        <id>https://mornie.org/blog/gpl-snowman/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/gpl-snowman/">&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;farm3.static.flickr.com&#x2F;2286&#x2F;2371828545_e072c91734.jpg&quot; alt=&quot;GPL Snowman&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Penguins are &lt;em&gt;everywhere&lt;&#x2F;em&gt;! :D&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Python 3.0a2 Released!</title>
        <published>2007-12-08T03:10:16+01:00</published>
        <updated>2007-12-08T03:10:16+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/python-30a2-released/"/>
        <id>https://mornie.org/blog/python-30a2-released/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/python-30a2-released/">&lt;p&gt;The &lt;a href=&quot;http:&#x2F;&#x2F;python.org&#x2F;download&#x2F;releases&#x2F;3.0&#x2F;&quot;&gt;second alpha&lt;&#x2F;a&gt; release is out!&lt;&#x2F;p&gt;
&lt;p&gt;Python 3000 is getting real, real fast! :D&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to fly? import antigravity</title>
        <published>2007-12-06T16:39:32+01:00</published>
        <updated>2007-12-06T16:39:32+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/how-fly-import-antigravity/"/>
        <id>https://mornie.org/blog/how-fly-import-antigravity/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/how-fly-import-antigravity/">&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;xkcd.com&#x2F;353&#x2F;&quot;&gt;xkcd&lt;&#x2F;a&gt; &lt;strong&gt;is&lt;&#x2F;strong&gt; great!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Python 3.0a1 Released!</title>
        <published>2007-09-01T00:12:03+01:00</published>
        <updated>2007-09-01T00:12:03+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/python-30a1-released/"/>
        <id>https://mornie.org/blog/python-30a1-released/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/python-30a1-released/">&lt;p&gt;Yes, the first alpha release is &lt;a href=&quot;https:&#x2F;&#x2F;python.org&#x2F;download&#x2F;releases&#x2F;3.0&#x2F;&quot;&gt;out&lt;&#x2F;a&gt;! :D&lt;&#x2F;p&gt;
&lt;p&gt;Congratulations to all python developers for this release!!!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Generating Maze using Python</title>
        <published>2007-08-02T03:11:49+01:00</published>
        <updated>2007-08-02T03:11:49+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/generating-maze-using-python/"/>
        <id>https://mornie.org/blog/generating-maze-using-python/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/generating-maze-using-python/">&lt;p&gt;Do you like mazes?&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#272822;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;eriol@mornie:~$ python maze.py
&lt;&#x2F;span&gt;&lt;span&gt;+--+--+--+--+--+--+--+--+--+--+
&lt;&#x2F;span&gt;&lt;span&gt;|  |           |        |     |
&lt;&#x2F;span&gt;&lt;span&gt;+  +  +  +--+  +  +--+  +  +  +
&lt;&#x2F;span&gt;&lt;span&gt;|  |  |  |     |     |     |  |
&lt;&#x2F;span&gt;&lt;span&gt;+  +  +  +--+--+--+  +--+--+  +
&lt;&#x2F;span&gt;&lt;span&gt;|  |  |     |        |     |  |
&lt;&#x2F;span&gt;&lt;span&gt;+  +  +--+  +  +--+--+  +  +  +
&lt;&#x2F;span&gt;&lt;span&gt;|  |  |  |              |  |  |
&lt;&#x2F;span&gt;&lt;span&gt;+  +  +  +--+--+--+--+--+--+  +
&lt;&#x2F;span&gt;&lt;span&gt;|  |     |     |              |
&lt;&#x2F;span&gt;&lt;span&gt;+  +--+--+  +  +  +--+--+--+  +
&lt;&#x2F;span&gt;&lt;span&gt;|           |     |           |
&lt;&#x2F;span&gt;&lt;span&gt;+--+--+--+--+--+--+--+--+--+--+
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After reading this &lt;a href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20071212193445&#x2F;http:&#x2F;&#x2F;www.mazeworks.com&#x2F;mazegen&#x2F;mazetut&#x2F;&quot;&gt;good&lt;&#x2F;a&gt; article, I decided to wrote some code to
generate perfect maze. :D&lt;&#x2F;p&gt;
&lt;p&gt;The result is here:
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;misc&#x2F;src&#x2F;branch&#x2F;main&#x2F;maze.py&quot;&gt;maze.py&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;As you can see, &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Depth-first_search&quot;&gt;Depth-First Search&lt;&#x2F;a&gt;
is not a complex algorithm:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;create&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    cell_stack &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[]
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;self.visited_cells &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span&gt;self.total_cells:
&lt;&#x2F;span&gt;&lt;span&gt;        neighbors &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;self.find_neighbors_with_walls(self.current_cell)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;neighbors:
&lt;&#x2F;span&gt;&lt;span&gt;            new_cell &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;random.choice(neighbors)
&lt;&#x2F;span&gt;&lt;span&gt;            self.current_cell.destroy_wall(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;cell&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;new_cell)
&lt;&#x2F;span&gt;&lt;span&gt;            cell_stack.append(self.current_cell)
&lt;&#x2F;span&gt;&lt;span&gt;            self.current_cell &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;new_cell
&lt;&#x2F;span&gt;&lt;span&gt;            self.visited_cells &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;else&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            self.current_cell &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;cell_stack.pop()
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My phone number!</title>
        <published>2007-07-31T16:57:25+01:00</published>
        <updated>2007-07-31T16:57:25+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/my-phone-number/"/>
        <id>https://mornie.org/blog/my-phone-number/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/my-phone-number/">&lt;p&gt;It was almost &lt;strong&gt;green&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;myphonenumber.png&quot; alt=&quot;my phone number&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;:D&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>PyCon It</title>
        <published>2007-05-19T17:46:58+01:00</published>
        <updated>2007-05-19T17:46:58+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/pycon-it/"/>
        <id>https://mornie.org/blog/pycon-it/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/pycon-it/">&lt;p&gt;The first &lt;a href=&quot;https:&#x2F;&#x2F;pycon.it&#x2F;&quot;&gt;Python Conference&lt;&#x2F;a&gt; in Italy will be held in
&lt;strong&gt;Florence&lt;&#x2F;strong&gt; on &lt;strong&gt;June&lt;&#x2F;strong&gt;, the &lt;strong&gt;9th&lt;&#x2F;strong&gt; and &lt;strong&gt;10th&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you &lt;em&gt;&lt;strong&gt;love&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt; Python, you can&#x27;t miss it! :)&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>RSS Feeds a Go-Go!</title>
        <published>2007-05-06T08:36:25+01:00</published>
        <updated>2007-05-06T08:36:25+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/rss-feeds-go-go/"/>
        <id>https://mornie.org/blog/rss-feeds-go-go/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/rss-feeds-go-go/">&lt;p&gt;Finally I had the time to add &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;RSS&quot;&gt;RSS feeds&lt;&#x2F;a&gt;! I
hope you enjoy them. :)&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;m not going to show some code because the documentation of &lt;a href=&quot;https:&#x2F;&#x2F;www.djangoproject.com&#x2F;documentation&#x2F;syndication_feeds&#x2F;&quot;&gt;Django&#x27;s
syndication feed framework&lt;&#x2F;a&gt; is very good!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A reminder using GTK shaped window</title>
        <published>2007-04-26T00:34:12+01:00</published>
        <updated>2007-04-26T00:34:12+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/reminder-using-gtk-shaped-window/"/>
        <id>https://mornie.org/blog/reminder-using-gtk-shaped-window/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/reminder-using-gtk-shaped-window/">&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;catania.linux.it&#x2F;&quot;&gt;GNU&#x2F;Linux User Group Catania&lt;&#x2F;a&gt; meets the last
thursday of every month. Usually a reminder is sent to mailing list by someone,
but the other day a friend of mine started a «reminder contest».&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;I could not miss it! :)&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I wanted something unusual to set the timer, so I decided to use the &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Heaviside_step_function&quot;&gt;Heaviside
step function&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;u&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;t&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;t &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;else&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Obviously not a single unit step! :)&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;setTimer&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;t&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;u(t) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0.5 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span&gt;u(t&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;TOTAL_HOURS&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0.25 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span&gt;u(t&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;TOTAL_HOURS&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In this manner the reminder is more dynamic: I use the return value to change
the display&#x27;s frequency.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s time to write the GUI part!&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;A shaped window is simply a pixmap where the background pixels are
transparent.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;An image is worth a thousand words.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;preminder.png&quot; alt=&quot;preminder 100% screenshot&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Yes, the &lt;strong&gt;pizza&lt;&#x2F;strong&gt; is our window :)&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;PReminder&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        self.window &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;gtk.Window(gtk.WINDOW_POPUP)
&lt;&#x2F;span&gt;&lt;span&gt;        self.window.set_events(
&lt;&#x2F;span&gt;&lt;span&gt;            self.window.get_events() &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;| &lt;&#x2F;span&gt;&lt;span&gt;gtk.gdk.BUTTON_PRESS_MASK)
&lt;&#x2F;span&gt;&lt;span&gt;        self.window.connect(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;button_press_event&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, self.hide)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# [...]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Using &lt;code&gt;gtk.WINDOW_POPUP&lt;&#x2F;code&gt; makes the window a popup so it will not have a
titlebar. In addiction, the &lt;code&gt;button_press_event&lt;&#x2F;code&gt; signal is attached to
&lt;code&gt;self.hide&lt;&#x2F;code&gt; callback to hide the reminder:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;hide&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        self.window.hide()
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;self.timerShow:
&lt;&#x2F;span&gt;&lt;span&gt;            gobject.source_remove(self.timerShow)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To masks out everything except for the image we have to use
&lt;a href=&quot;http:&#x2F;&#x2F;www.pygtk.org&#x2F;docs&#x2F;pygtk&#x2F;class-gdkwindow.html#method-gdkwindow--shape-combine-mask&quot;&gt;gtk.gdk.Window.shape_combine_mask&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;self.window.shape_combine_mask(self.mask, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;preminder2.png&quot; alt=&quot;preminder 60% screenshot&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Changing the window itself as the time for the appointment approaches, can be
useful.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;draw&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        w &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;self.width, self.pangolayout.get_pixel_size()[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;        offset &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;max&lt;&#x2F;span&gt;&lt;span&gt;(w) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;min&lt;&#x2F;span&gt;&lt;span&gt;(w)) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&#x2F; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;self.width &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span&gt;self.pangolayout.get_pixel_size()[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]:
&lt;&#x2F;span&gt;&lt;span&gt;            offset &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= -&lt;&#x2F;span&gt;&lt;span&gt;offset
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.mask.draw_rectangle(self.bmgc,
&lt;&#x2F;span&gt;&lt;span&gt;                                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;                                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;                                self.pieces &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span&gt;self.pixelpiece,
&lt;&#x2F;span&gt;&lt;span&gt;                                self.height)
&lt;&#x2F;span&gt;&lt;span&gt;        textwidth &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;self.pangolayout.get_pixel_size()[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;        self.pixmap.draw_layout(self.bgc,
&lt;&#x2F;span&gt;&lt;span&gt;                                &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(offset),
&lt;&#x2F;span&gt;&lt;span&gt;                                &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(self.height &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&#x2F; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2.&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;                                self.pangolayout)
&lt;&#x2F;span&gt;&lt;span&gt;        self.mask.draw_layout(self.wmgc,
&lt;&#x2F;span&gt;&lt;span&gt;                            &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(offset),
&lt;&#x2F;span&gt;&lt;span&gt;                            &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(self.height &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&#x2F; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2.&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;                            self.pangolayout)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.image &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;gtk.Image()
&lt;&#x2F;span&gt;&lt;span&gt;        self.image.set_from_pixmap(self.pixmap, self.mask)
&lt;&#x2F;span&gt;&lt;span&gt;        self.image.show()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.window.shape_combine_mask(self.mask, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We have to change only the mask to obtain the desired effect.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;preminder3.png&quot; alt=&quot;preminder 30% screenshot&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Checking for last thursday of every month can be done in few line of code using
&lt;a href=&quot;http:&#x2F;&#x2F;labix.org&#x2F;python-dateutil&quot;&gt;dateutil&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;    lastThursday &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;rrule.rrule(rrule.MONTHLY,
&lt;&#x2F;span&gt;&lt;span&gt;                                &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;byweekday&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;rrule.TH(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;                                &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;count&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;].date()
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The complete checking method:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;check&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        today &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;datetime.today()
&lt;&#x2F;span&gt;&lt;span&gt;        lastThursday &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;rrule.rrule(rrule.MONTHLY,
&lt;&#x2F;span&gt;&lt;span&gt;                                    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;byweekday&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;rrule.TH(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;                                    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;count&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;].date()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;today.date() &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span&gt;lastThursday:
&lt;&#x2F;span&gt;&lt;span&gt;            now &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;today.time()
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;START_CHECK_HOUR &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt;= &lt;&#x2F;span&gt;&lt;span&gt;now &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt;= &lt;&#x2F;span&gt;&lt;span&gt;FINISH_CHECK_HOUR:
&lt;&#x2F;span&gt;&lt;span&gt;                timerModulator &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;setTimer(now.hour &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span&gt;START_CHECK_HOUR.hour)
&lt;&#x2F;span&gt;&lt;span&gt;                timer &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(timerModulator &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;60 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;60 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1000&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;                self.setText(DIPLAYING_TEXT)
&lt;&#x2F;span&gt;&lt;span&gt;                self.setPiece(now.hour &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span&gt;START_CHECK_HOUR.hour)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;                self.show()
&lt;&#x2F;span&gt;&lt;span&gt;                self.timerShow &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;gobject.timeout_add(AUTO_HIDE_AFTER &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1000&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;                                                        self.hide)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;else&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            timer &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;CHECK_TIMER &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1000
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.timerID &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;gobject.timeout_add(timer, self.check)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can download the complete source code here:
&lt;a href=&quot;&#x2F;media&#x2F;blog&#x2F;preminder-0.1.zip&quot;&gt;preminder-0.1.zip&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Debian GNU&#x2F;Linux 4.0 released</title>
        <published>2007-04-08T15:40:03+01:00</published>
        <updated>2007-04-08T15:40:03+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/debian-gnulinux-40-released/"/>
        <id>https://mornie.org/blog/debian-gnulinux-40-released/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/debian-gnulinux-40-released/">&lt;p&gt;From the &lt;a href=&quot;http:&#x2F;&#x2F;www.debian.org&#x2F;News&#x2F;2007&#x2F;20070408&quot;&gt;news&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Debian Project is pleased to announce the official release of Debian
GNU&#x2F;Linux version 4.0, codenamed etch, after 21 months of constant
development.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Oh, yeah!!! :D&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Playing with ctypes and libcaca</title>
        <published>2007-03-25T16:30:29+01:00</published>
        <updated>2007-03-25T16:30:29+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/playing-with-ctypes-and-libcaca/"/>
        <id>https://mornie.org/blog/playing-with-ctypes-and-libcaca/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/playing-with-ctypes-and-libcaca/">&lt;p&gt;&lt;a href=&quot;http:&#x2F;&#x2F;docs.python.org&#x2F;dev&#x2F;lib&#x2F;module-ctypes.html&quot;&gt;ctypes&lt;&#x2F;a&gt; is a foreign
function interface for Python. It allows to call functions in dlls&#x2F;shared
libraries and access and manipulate C data types in Python: you can use it to
wrap libraries in pure Python. It is included in Python 2.5 standard library.&lt;&#x2F;p&gt;
&lt;p&gt;I want to code a funny example using it, so I will show how to make a snake
game using libcaca.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;http:&#x2F;&#x2F;libcaca.zoy.org&#x2F;&quot;&gt;libcaca&lt;&#x2F;a&gt; is an ascii art library like
&lt;a href=&quot;http:&#x2F;&#x2F;aa-project.sourceforge.net&#x2F;aalib&#x2F;&quot;&gt;AAlib&lt;&#x2F;a&gt;, but it has some cool
features:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Unicode support;&lt;&#x2F;li&gt;
&lt;li&gt;2048 colours;&lt;&#x2F;li&gt;
&lt;li&gt;dithering of colour images;&lt;&#x2F;li&gt;
&lt;li&gt;advanced text canvas operations (blitting, rotations).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;blog&#x2F;snake.py.png&quot; alt=&quot;snake.py screenshot&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Update 2009&#x2F;10&#x2F;11:&lt;&#x2F;strong&gt; libcaca API changed so this entry in now obsolete but
snake.py example works: you can read the source to get in touch with the new
API.&lt;&#x2F;p&gt;
&lt;p&gt;First of all we have to load libcaca, I use Linux so I will call &lt;code&gt;libcaca.so.0&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;ctypes &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;as &lt;&#x2F;span&gt;&lt;span&gt;C
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;lcaca &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;C.cdll.LoadLibrary(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;libcaca.so.0&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now you can access libcaca&#x27;s functions from Python. :)&lt;&#x2F;p&gt;
&lt;p&gt;Create canvas and display for our snake is very easy:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;cv &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;lcaca.cucul_create_canvas(CANVAS_WIDTH, CANVAS_HEIGHT)
&lt;&#x2F;span&gt;&lt;span&gt;dp &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;lcaca.caca_create_display(cv)
&lt;&#x2F;span&gt;&lt;span&gt;lcaca.caca_set_display_title(dp, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;snake.py - playing with ctypes and libcaca&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To get events from keyboard call &lt;a href=&quot;http:&#x2F;&#x2F;caca.zoy.org&#x2F;manual&#x2F;group__caca__event.html#g98e74dedbe1629c0fc9460761696e050&quot;&gt;caca_get_event&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;lcaca.caca_get_event(dp, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x0001&lt;&#x2F;span&gt;&lt;span&gt;, C.byref(event), &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Where &lt;code&gt;event&lt;&#x2F;code&gt; is a &lt;a href=&quot;http:&#x2F;&#x2F;libcaca.zoy.org&#x2F;manual&#x2F;structcaca__event.html&quot;&gt;caca_event&lt;&#x2F;a&gt;
structure. We need it because if not null, it will be filled with information
about the event received.&lt;&#x2F;p&gt;
&lt;p&gt;How define &lt;code&gt;event&lt;&#x2F;code&gt;? Simply like that:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;MOUSE&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;C.Structure&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    _fields_ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;x&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;y&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;button&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint)]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;RESIZE&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;C.Structure&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    _fields_ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;w&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;h&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint)]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;KEY&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;C.Structure&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    _fields_ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;ch&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;utf32&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_ulong),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;utf8&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_char_p &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;8&lt;&#x2F;span&gt;&lt;span&gt;)]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;ev&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;C.Union&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    _fields_ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;type&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, C.c_uint),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;mouse&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, MOUSE),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;resize&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, RESIZE),
&lt;&#x2F;span&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;key&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, KEY)]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;event &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;ev()
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now we can code the snake class:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;Snake&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;object&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;center_point&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;length&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.head &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;center_point
&lt;&#x2F;span&gt;&lt;span&gt;        self.body &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;y &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;xrange&lt;&#x2F;span&gt;&lt;span&gt;(self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;length &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;            self.body.append((self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;], y))
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;move&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;direction&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        phead &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;tuple&lt;&#x2F;span&gt;&lt;span&gt;(self.head)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;direction &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;UP&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;direction &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;DOWN&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;direction &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;LEFT&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;direction &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;RIGHT&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        self.body &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[phead] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;self.body[:&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;grow&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        self.body &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+= &lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;tuple&lt;&#x2F;span&gt;&lt;span&gt;(self.head)] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;* &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;draw&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;global &lt;&#x2F;span&gt;&lt;span&gt;cv
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.cucul_set_color_ansi(cv, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x05&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x00&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;p &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;self.body:
&lt;&#x2F;span&gt;&lt;span&gt;            lcaca.cucul_put_char(cv, p[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;], p[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;], &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;ord&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;o&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;))
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.cucul_set_color_ansi(cv, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x02&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x00&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.cucul_put_char(cv, self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;], self.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;], &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;ord&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;@&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;))
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.caca_refresh_display(dp)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And the target class:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;color:#a6e22e;&quot;&gt;Target&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration:underline;font-style:italic;color:#a6e22e;&quot;&gt;object&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        self.total &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;random&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;width&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;height&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        self.x &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(random.uniform(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, width))
&lt;&#x2F;span&gt;&lt;span&gt;        self.y &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span&gt;(random.uniform(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, height))
&lt;&#x2F;span&gt;&lt;span&gt;        self.value &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;random.choice(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;range&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;))
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;sum&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        self.total &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;+= &lt;&#x2F;span&gt;&lt;span&gt;self.value
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;draw&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;global &lt;&#x2F;span&gt;&lt;span&gt;cv
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.cucul_set_color_ansi(cv, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x03&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x00&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.cucul_put_char(cv, self.x, self.y, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;ord&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;(self.value)))
&lt;&#x2F;span&gt;&lt;span&gt;        lcaca.caca_refresh_display(dp)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We are ready for the mainloop! ;)&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;lcaca.caca_get_event(dp, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0x0001&lt;&#x2F;span&gt;&lt;span&gt;, C.byref(event), &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;event.key.utf32 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;113&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;# &amp;#39;q&amp;#39; pressed
&lt;&#x2F;span&gt;&lt;span&gt;            sys.exit()
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;event.key.utf32 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span&gt;UP:
&lt;&#x2F;span&gt;&lt;span&gt;            d &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;UP&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;event.key.utf32 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span&gt;DOWN:
&lt;&#x2F;span&gt;&lt;span&gt;            d &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;DOWN&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;event.key.utf32 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span&gt;LEFT:
&lt;&#x2F;span&gt;&lt;span&gt;            d &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;LEFT&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span&gt;event.key.utf32 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span&gt;RIGHT:
&lt;&#x2F;span&gt;&lt;span&gt;            d &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;RIGHT&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;try&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;        s.move(d)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;except &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;NameError&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;pass
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;tuple&lt;&#x2F;span&gt;&lt;span&gt;(s.head) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;s.body[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;:] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;or
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;not &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span&gt;s.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span&gt;CANVAS_WIDTH &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;or
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;not &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span&gt;s.head[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;&amp;lt; &lt;&#x2F;span&gt;&lt;span&gt;CANVAS_HEIGHT &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;Game Over!&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;Total score:&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, t.total
&lt;&#x2F;span&gt;&lt;span&gt;        sys.exit()
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;elif &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;tuple&lt;&#x2F;span&gt;&lt;span&gt;(s.head) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span&gt;(t.x, t.y):
&lt;&#x2F;span&gt;&lt;span&gt;        t.sum()
&lt;&#x2F;span&gt;&lt;span&gt;        t.random(CANVAS_WIDTH &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, CANVAS_HEIGHT &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        s.grow()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    lcaca.cucul_clear_canvas(cv)
&lt;&#x2F;span&gt;&lt;span&gt;    draw_border()
&lt;&#x2F;span&gt;&lt;span&gt;    s.draw()
&lt;&#x2F;span&gt;&lt;span&gt;    t.draw()
&lt;&#x2F;span&gt;&lt;span&gt;    time.sleep(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0.1&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The complete example is here:
&lt;a href=&quot;https:&#x2F;&#x2F;noa.mornie.org&#x2F;eriol&#x2F;misc&#x2F;src&#x2F;branch&#x2F;main&#x2F;snake.py&quot;&gt;snake.py&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Update 2007&#x2F;10&#x2F;20:&lt;&#x2F;strong&gt; &lt;a href=&quot;http:&#x2F;&#x2F;sam.zoy.org&#x2F;&quot;&gt;Sam Hocevar&lt;&#x2F;a&gt; pointed me about
importance of checking caca_get_event&#x27;s return value, otherwise from time to
time invalid keys are read. Thank you, Sam!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My blog with Django!</title>
        <published>2007-03-08T05:10:33+01:00</published>
        <updated>2007-03-08T05:10:33+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/my-blog-django/"/>
        <id>https://mornie.org/blog/my-blog-django/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/my-blog-django/">&lt;p&gt;At the end I made it!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.djangoproject.com&#x2F;&quot;&gt;Django&lt;&#x2F;a&gt; is great! You can build your own blog
in few minutes! :)&lt;&#x2F;p&gt;
&lt;p&gt;Many thanks to Sal Zeta for his help with this site&#x27;s design!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Storing binary data in SQLite</title>
        <published>2007-01-10T16:06:10+01:00</published>
        <updated>2007-01-10T16:06:10+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/storing-binary-data-in-sqlite/"/>
        <id>https://mornie.org/blog/storing-binary-data-in-sqlite/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/storing-binary-data-in-sqlite/">&lt;p&gt;Storing images into a database is not common, usually you store only the file
name, but sometimes it can be useful. Think you must log the position of several
objects on a map. You can store the map and the logs in different files, but if
your users have to share map and logs and they are not geek people, it can be a
serious problem.&lt;&#x2F;p&gt;
&lt;p&gt;Remember that, of course, store files into a database makes the storage space
more expensive. However, if you have to store one or few files it&#x27;s not a big
problem. :-)&lt;&#x2F;p&gt;
&lt;p&gt;Consider the following database schema:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sql&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-sql &quot;&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;CREATE TABLE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt; (
&lt;&#x2F;span&gt;&lt;span&gt;    name &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;varchar&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;20&lt;&#x2F;span&gt;&lt;span&gt;) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;NOT &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;NULL &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;PRIMARY KEY&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    image_file blob &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;NOT &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;NULL
&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;CREATE TABLE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;logs&lt;&#x2F;span&gt;&lt;span&gt; (
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#75715e;&quot;&gt;-- &amp;lt;your logs schema here&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s start to code:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;Image
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;StringIO
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;pysqlite2 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;dbapi2 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;as &lt;&#x2F;span&gt;&lt;span&gt;sqlite
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Storing an image into the database is very simple:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;storeInDatabase&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;cur&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;image_name&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;data&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    cur.execute(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;INSERT INTO&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt; map (name, image_file) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;values&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt; (?, ?)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;                (image_name, sqlite.Binary(data))
&lt;&#x2F;span&gt;&lt;span&gt;    )
&lt;&#x2F;span&gt;&lt;span&gt;    con.commit()
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;N.B. As said by &lt;a href=&quot;http:&#x2F;&#x2F;effbot.org&#x2F;zone&#x2F;sqlite-blob.htm&quot;&gt;Fredrik Lundh&lt;&#x2F;a&gt;, SQLite
&amp;lt;3.0 has a limitation of 1 MB for each row of data, and the database uses NUL
bytes to separate columns in the storage.&lt;&#x2F;p&gt;
&lt;p&gt;Retrieve the previously image stored is simple too:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;font-style:italic;color:#f92672;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#a6e22e;&quot;&gt;retrieveFromDatabase&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;cur&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;image&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    cur.execute(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;SELECT&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt; image_file &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;FROM&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt; map &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;WHERE&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt; name &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt; ?&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, (image,))
&lt;&#x2F;span&gt;&lt;span&gt;    img &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;cur.fetchone()[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ae81ff;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;StringIO.StringIO(img)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I use StringIO.StringIO because &lt;code&gt;cur.fetchone()[0]&lt;&#x2F;code&gt; returns a buffer-object and
I want a file-object instead. ;)&lt;&#x2F;p&gt;
&lt;p&gt;You can test with:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;__name__ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;== &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;__main__&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    IMAGE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;Surf.jpg&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    i &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#66d9ef;&quot;&gt;open&lt;&#x2F;span&gt;&lt;span&gt;(IMAGE, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;rb&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    idata &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;i.read()
&lt;&#x2F;span&gt;&lt;span&gt;    i.close()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    con &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;sqlite.connect(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;blob.db&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    cur &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;con.cursor()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;try&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;        storeInDatabase(cur, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;image_name&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;IMAGE, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#fd971f;&quot;&gt;data&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;idata)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;except &lt;&#x2F;span&gt;&lt;span&gt;sqlite.IntegrityError:
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span style=&quot;color:#e6db74;&quot;&gt;&amp;#39;You have stored this map already&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    img &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f92672;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;retrieveFromDatabase(cur, IMAGE)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    cur.close()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    Image.open(img).show()
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The whole example is here: &lt;a href=&quot;&#x2F;media&#x2F;blog&#x2F;blobexample.py&quot;&gt;blobexample.py&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Libero SMTP pain :(</title>
        <published>2006-12-28T03:06:00+01:00</published>
        <updated>2006-12-28T03:06:00+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/libero-smtp-pain/"/>
        <id>https://mornie.org/blog/libero-smtp-pain/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/libero-smtp-pain/">&lt;p&gt;Since few days the SMTP server of my &lt;a href=&quot;http:&#x2F;&#x2F;internet.libero.it&#x2F;&quot;&gt;ISP&lt;&#x2F;a&gt; has
problems. When I post in several mailing lists I get this message: RCPT address
has non-existant domain. So now I&#x27;m using exim4 from my laptop when I get that
error, but I hope to get a VPS soon to solve the problem&#x27;s root. ;)&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;&#x2F;strong&gt; The SMTP of my provider sends only if it finds a MX record in the
addressee&#x27;s domain. I searched a little and I discovered that
&lt;a href=&quot;http:&#x2F;&#x2F;www.ietf.org&#x2F;rfc&#x2F;rfc974.txt&quot;&gt;RFC 974&lt;&#x2F;a&gt; says:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;It is possible that the list of MXs in the response to the query will be
empty. This is a special case. If the list is empty, mailers should treat
it as if it contained one RR, an MX RR with a preference value of 0, and a
host name of REMOTE. (I.e., REMOTE is its only MX). In addition, the mailer
should do no further processing on the list, but should attempt to deliver
the message to REMOTE. The idea here is that if a domain fails to advertise
any information about a particular name we will give it the benefit of the
doubt and attempt delivery.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;So I hope to get, as soon as possible, a VPS to setup and use a SMTP server
that follows the RFC!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Python in a Nutshell</title>
        <published>2006-12-19T00:33:59+01:00</published>
        <updated>2006-12-19T00:33:59+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/python-nutshell/"/>
        <id>https://mornie.org/blog/python-nutshell/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/python-nutshell/">&lt;p&gt;Today, when I arrived at home I saw a package on the table in the living room:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;media&#x2F;python_in_a_nutshell_2edition.jpg&quot; alt=&quot;Python in a Nutshell cover&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;My first purchase on Amazon! :)&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My new pet ;)</title>
        <published>2006-12-18T01:06:21+01:00</published>
        <updated>2006-12-18T01:06:21+01:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mornie.org/blog/my-new-pet/"/>
        <id>https://mornie.org/blog/my-new-pet/</id>
        
        <content type="html" xml:base="https://mornie.org/blog/my-new-pet/">&lt;p&gt;Oh, yes I started to log my rants :D&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
