<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Shell on iMil.net</title>
    <link>http://imil.net/blog/tags/shell/</link>
    <description>Recent content in Shell on iMil.net</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 13 Apr 2020 10:51:21 +0200</lastBuildDate>
    <atom:link href="http://imil.net/blog/tags/shell/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Alpine, tmux and UTF-8</title>
      <link>http://imil.net/blog/posts/2020/alpine_tmux_and_utf-8/</link>
      <pubDate>Mon, 13 Apr 2020 10:51:21 +0200</pubDate>
      <guid>http://imil.net/blog/posts/2020/alpine_tmux_and_utf-8/</guid>
      <description>&lt;p&gt;A quicky in case anybody has the same issue. I use &lt;a href=&#34;https://en.wikipedia.org/wiki/Pine_(email_client)&#34;&gt;pine&lt;/a&gt; / &lt;a href=&#34;https://en.wikipedia.org/wiki/Alpine_(email_client)&#34;&gt;alpine&lt;/a&gt; as a mail client since my firsts steps on the UNIX/Linux world, it always served me well.&lt;br&gt;&#xA;Nevertheless, since a couple of weeks, I had this weird behavior where the mail content pager would not display accents (éàü&amp;hellip;) while the mail list would! Worse, this inconsistent behavior only happened in &lt;code&gt;tmux&lt;/code&gt;.&lt;br&gt;&#xA;I suspected something involving &lt;code&gt;locales&lt;/code&gt; but no, everything was fine on this side.&lt;br&gt;&#xA;So it turns out &lt;code&gt;alpine&lt;/code&gt;&amp;rsquo;s mail content pager doesn&amp;rsquo;t know how to cope with a value of &lt;code&gt;screen-256color&lt;/code&gt; in the &lt;code&gt;TERM&lt;/code&gt; variable. Changing it to &lt;code&gt;xterm-256color&lt;/code&gt; fixed accents display.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Push Motion Image Capture to Telegram</title>
      <link>http://imil.net/blog/posts/2020/push-motion-image-capture-to-telegram/</link>
      <pubDate>Sun, 29 Mar 2020 16:37:40 +0200</pubDate>
      <guid>http://imil.net/blog/posts/2020/push-motion-image-capture-to-telegram/</guid>
      <description>&lt;p&gt;I use the fantastic &lt;a href=&#34;https://motion-project.github.io/&#34;&gt;motion project&lt;/a&gt; to monitor my apartment activity when I&amp;rsquo;m not home (not happening until God knows when these days&amp;hellip;). I wanted it to warn me when there&amp;rsquo;s movement more interactively than with a basic email. &lt;a href=&#34;https://telegram.org/&#34;&gt;Telegram&lt;/a&gt; and its &lt;a href=&#34;https://core.telegram.org/api&#34;&gt;very well documented bot API&lt;/a&gt; is really perfect for this task, so I came up with the following &lt;code&gt;motion&lt;/code&gt; configuration:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-ini&#34; data-lang=&#34;ini&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;on_picture_save /bin/sh /home/imil/bin/on_picture_save.sh %f&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and more importantly, the following script:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/sh&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;. &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;HOME&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;/.tg&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ffile&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;HOME&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;/tmp/motion_capture&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;f&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;1%?????????&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mplayer &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;HOME&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;/Music/42899__freqman__canon-dos-d30-no-focus.wav&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; -e &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;ffile&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;cat $ffile&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$f&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; exit &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;curl -X POST &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://api.telegram.org/bot&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;TELEGRAM_TOKEN&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/sendPhoto&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt; -F chat_id&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;CHATID&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt; -F photo&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;@&lt;/span&gt;$1&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;echo $f &amp;gt; $ffile&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;the &lt;code&gt;~/.tg&lt;/code&gt; file has the following content:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Migrating from Hexo to Hugo</title>
      <link>http://imil.net/blog/posts/2020/migrating-to-hugo/</link>
      <pubDate>Thu, 19 Mar 2020 07:57:05 +0100</pubDate>
      <guid>http://imil.net/blog/posts/2020/migrating-to-hugo/</guid>
      <description>&lt;p&gt;Brand new &lt;a href=&#34;https://imil.net&#34;&gt;iMil.net&lt;/a&gt;!&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve wanted to switch from &lt;a href=&#34;https://hexo.io/&#34;&gt;hexo&lt;/a&gt; to &lt;a href=&#34;https://gohugo.io/&#34;&gt;hugo&lt;/a&gt; for quite a long time for various reasons, one of them being I love &lt;em&gt;golang&lt;/em&gt; and, well, let&amp;rsquo;s just say I don&amp;rsquo;t like &lt;em&gt;javascript / node&lt;/em&gt; much. Also, &lt;a href=&#34;https://gohugo.io/&#34;&gt;hugo&lt;/a&gt; documentation is pretty well done, &lt;a href=&#34;https://twitter.com/spf13&#34;&gt;its author&lt;/a&gt; is a well known figure in the &lt;em&gt;golang&lt;/em&gt; community, and last but not least, I find the overall workflow more simple and consistent.&lt;/p&gt;&#xA;&lt;p&gt;I delayed the migration because I wrongly thought articles &lt;a href=&#34;https://gohugo.io/content-management/front-matter&#34;&gt;front-matter&lt;/a&gt; modifications would be painful, but it turns out it was pretty much straightforward:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Monitor network health with somebar</title>
      <link>http://imil.net/blog/posts/2019/monitor-network-health-with-somebar/</link>
      <pubDate>Sun, 22 Dec 2019 07:16:16 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2019/monitor-network-health-with-somebar/</guid>
      <description>&lt;p&gt;I knew about a &lt;em&gt;MacOS&lt;/em&gt; task bar plugin called &lt;a href=&#34;https://github.com/tonsky/AnyBar&#34;&gt;Anybar&lt;/a&gt;, which basically draws an icon on the task bar to which you can send behaviors with a simple &lt;code&gt;nc&lt;/code&gt; command. Naturally, someone cloned it for our beloved Free Unices environments, and it&amp;rsquo;s called &lt;a href=&#34;https://github.com/limpbrains/somebar&#34;&gt;somebar&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I am sometimes in places with weak network, and I like to see at a glance how is my connection doing, &lt;a href=&#34;https://github.com/limpbrains/somebar&#34;&gt;somebar&lt;/a&gt; seemed the perfect tool for the task.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tricking bash HISTTIMEFORMAT</title>
      <link>http://imil.net/blog/posts/2017/tricking-bash-histtimeformat/</link>
      <pubDate>Sun, 30 Apr 2017 14:51:22 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2017/tricking-bash-histtimeformat/</guid>
      <description>&lt;p&gt;While trying to find a clean method to remove line numbers from the &lt;code&gt;history&lt;/code&gt; command, I found an interesting trick by using the &lt;code&gt;HISTTIMEFORMAT&lt;/code&gt; environment variable. Here&amp;rsquo;s what &lt;code&gt;bash&lt;/code&gt;&amp;rsquo;s &lt;code&gt;man&lt;/code&gt; says:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       HISTTIMEFORMAT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              If  this  variable  is  set and not null, its value is used as a&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              format string &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; strftime&lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;3&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; to print the time stamp associated&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              with  each  history  entry displayed by the history builtin.  If&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              this variable is set, time stamps are  written  to  the  history&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              file  so they may be preserved across shell sessions.  This uses&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              the history comment character  to  distinguish  timestamps  from&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              other history lines.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But it turns out you can actually put pretty much anything in there, and for example, an &lt;code&gt;ANSI&lt;/code&gt; escape sequence that does a line feed and erases the current line:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Extract data-bits from your Jenkins jobs</title>
      <link>http://imil.net/blog/posts/2017/extract-data-bits-from-your-jenkins-jobs/</link>
      <pubDate>Sun, 26 Mar 2017 10:44:50 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2017/extract-data-bits-from-your-jenkins-jobs/</guid>
      <description>&lt;p&gt;Another quicky.&lt;/p&gt;&#xA;&lt;p&gt;I read &lt;a href=&#34;http://mlawire.blogspot.com.es/2009/07/alias-for-quickly-encodingdecoding-html.html&#34;&gt;here&lt;/a&gt; that cool trick to convert &lt;em&gt;HTML entities&lt;/em&gt; to plain text:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;alias htmldecode&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;perl -MHTML::Entities -pe &amp;#39;decode_entities(\$_)&amp;#39;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In a &lt;em&gt;Debian&lt;/em&gt; based system, this suppose to &lt;code&gt;apt-get install libhtml-parser-perl&lt;/code&gt;.&#xA;Why bother you may ask? Well because the (awful) &lt;a href=&#34;https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI&#34;&gt;Jenkins-cli&lt;/a&gt; outputs text areas content in encoded &lt;em&gt;HTML entities&lt;/em&gt;, and for example I like the idea of being able to test a standalone &lt;em&gt;packer&lt;/em&gt; template that&amp;rsquo;s failing.&lt;/p&gt;&#xA;&lt;p&gt;Finally, here&amp;rsquo;s the full usecase:&lt;/p&gt;</description>
    </item>
    <item>
      <title>sysutils/shelldap dans les bacs</title>
      <link>http://imil.net/blog/posts/2011/sysutilsshelldap-dans-les-bacs/</link>
      <pubDate>Fri, 04 Feb 2011 00:00:49 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2011/sysutilsshelldap-dans-les-bacs/</guid>
      <description>&lt;p&gt;Connaissez-vous &lt;a href=&#34;http://projects.martini.nu/shelldap&#34;&gt;shelldap&lt;/a&gt; ? Cet outil absolument indispendable est L&amp;rsquo;Outil que j&amp;rsquo;attendais depuis des années. Saoulé que j&amp;rsquo;étais de la machine-à-coredumps &lt;code&gt;gq&lt;/code&gt; et de l&amp;rsquo;usine à gaz &lt;code&gt;lat&lt;/code&gt;, j&amp;rsquo;implorais les Dieux du code de faire apparaître quelque part sur l&amp;rsquo;internet convivial un outil &lt;strong&gt;pratique&lt;/strong&gt; pour éditer des bases LDAP, possiblement en console, fou optimiste que je suis.&lt;/p&gt;&#xA;&lt;p&gt;Et bien cet outil existe. Et il est énorme. Comme son nom l&amp;rsquo;indique, il s&amp;rsquo;agit effectivement d&amp;rsquo;un shell-like destiné à la consultation et l&amp;rsquo;administration de bases LDAP, avec la completion s&amp;rsquo;il vous plait.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Regexp du soir, espoir</title>
      <link>http://imil.net/blog/posts/2008/regexp-du-soir-espoir/</link>
      <pubDate>Fri, 05 Dec 2008 01:06:17 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2008/regexp-du-soir-espoir/</guid>
      <description>&lt;p&gt;Dans ma &lt;a href=&#34;http://beastiebox.sourceforge.net/&#34;&gt;tentative de conquete du monde&lt;/a&gt;, je suis confronté à un problème auquel je n&amp;rsquo;avais pas immédiatement pensé. En effet, une foule d&amp;rsquo;outils partagent sans vergogne certains noms de fonction (usage(), help(), error()&amp;hellip;) et de variables globales. Cet ennuyeux constat aboutit evidemment à des problèmes de &lt;em&gt;linkage&lt;/em&gt; et faisait lamentablement foirer la compilation de mon &lt;a href=&#34;http://beastiebox.cvs.sourceforge.net/viewvc/beastiebox/beastiebox/&#34;&gt;BeastieBox&lt;/a&gt; cheri.&lt;/p&gt;&#xA;&lt;p&gt;Une solution evidente était de renommer ces fonctions et leurs appels. mais&amp;hellip;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Flemme quoi.&lt;/p&gt;</description>
    </item>
    <item>
      <title>merde, j&#39;ai pas de backup...</title>
      <link>http://imil.net/blog/posts/2007/merde-jai-pas-de-backup/</link>
      <pubDate>Sat, 24 Mar 2007 16:28:15 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2007/merde-jai-pas-de-backup/</guid>
      <description>&lt;p&gt;Combien de fois cette phrase a retenti dans vos esprits imprudents ? dans mon esprit imprudent à moi, plein.&#xA;Alors, comme je viens de toper un &lt;a href=&#34;http://www.kimsufi.com/&#34;&gt;kimloli&lt;/a&gt; sur les conseils de mon bouquetin favori, je me suis dit que, pour une fois, j&amp;rsquo;y collerais bien une procedure de backup propre.&lt;/p&gt;&#xA;&lt;p&gt;J&amp;rsquo;ai déjà parlé et probablement pasté ici même un petit script gentil qui, grâce au couple &lt;em&gt;rsync / rsyncd&lt;/em&gt;, permettait de rendre cette opération relativement rapide assez simplement. J&amp;rsquo;y ai apporté quelques modifs et enrobé le tout d&amp;rsquo;un chouillat de sécu. Un chouillat j&amp;rsquo;ai dit, trépigne pas spoty.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
