<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="/static/rss.xsl"?>
<!-- name="generator" content="blosxom/2.1.2+dev" -->
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:cc="http://web.resource.org/cc/"
     xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/" >
  <channel>
    <!-- RSS required -->
    <title>Blogging is futile   </title>
    <!-- <link>http://noone.org/blog</link> -->
    <description>Yet another Blosxom weblog from someone who promised himself to never start blogging - since blogging is futile.</description>

    <!-- RSS optional -->
    <pubDate>Thu, 20 Jun 2013 06:24:58 +0200</pubDate>
    <lastBuildDate>Thu, 20 Jun 2013 06:24:58 +0200</lastBuildDate>
    <copyright>&amp;copy; 2005-2008 by Axel Beckert. Content licensed under the Creative Commons NC SA 2.0 DE License. Some rights reserved.</copyright>
    <language>en</language>
    <managingEditor>abe+blog@deuxchevaux.org (Axel Beckert)</managingEditor>
    <webMaster>abe+blog@deuxchevaux.org (Axel Beckert)</webMaster>
    <generator>blosxom/2.1.2+dev</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>42</ttl>
    <image>
        <url>http://noone.org/static/XTaran1.3t.png</url>
        <title>Hackergotchi: Axel "XTaran" Beckert</title>
        <link>http://noone.org/blog</link>
        <width>102</width>
        <height>104</height>
    </image>

    <!-- Dublin Core -->
<!--
    <dc:publisher>Axel Beckert (abe+blog@deuxchevaux.org)</dc:publisher>
    <dc:rights>&copy; 2005-2008 by Axel Beckert. Content licensed under the Creative Commons NC SA 2.0 DE License. Some rights reserved.</dc:rights>
    <dc:language>de</dc:language>
    <dc:language>en</dc:language>
    <dc:title>Blogging is futile   </dc:title>
    <dc:subject>Rants and brain dumps about Debian, the Web, old Hardware, old Citroëns and the daily life of an ETHZ system administrator</dc:subject>
    <dc:description>Yet another Blosxom weblog from someone who promised himself to never start blogging - since blogging is futile.</dc:description>
-->

    <!-- Others -->
    <admin:generatorAgent rdf:resource="http://blosxom.sourceforge.net/" />
    <admin:errorReportsTo rdf:resource="mailto:abe+blog@deuxchevaux.org" />
    <cc:license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/de/">http://creativecommons.org/licenses/by-nc-sa/2.0/de/</cc:license>

  <item>
    <title>Rendering Markdown, Asciidoc and Friends automatically while Editing</title>
    <slash:department>also-small-tools-can-make-people-happy</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/Rendering%2520Markdown%252C%2520Asciidoc%2520and%2520Friends%2520automatically%2520while%2520Editing.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/Rendering%2520Markdown%252C%2520Asciidoc%2520and%2520Friends%2520automatically%2520while%2520Editing.html</guid>
    <pubDate>Sun, 10 Mar 2013 15:41:58 +0100</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
Partially because of &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot; class=&quot;ext&quot;&gt;Markdown&lt;/a&gt; being &lt;a href=&quot;http://github.com/&quot; class=&quot;ext&quot;&gt;Github&lt;/a&gt;&amp;#8217;s markup format of choice,
I enjoy writing documents in simple markup formats more and more.

&lt;/p&gt;&lt;p&gt;

There&amp;#8217;s though one common annoyance with these formats compared to
writing plain &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt;&amp;#8230;

&lt;/p&gt;&lt;h4&gt;The Annoyance&lt;/h4&gt;&lt;p&gt;

They need to be rendered (i.e. more or less compiled) before you can
view your outpourings rendered, e.g. in the web browser. So the
workflow usually is:

&lt;/p&gt;&lt;ol&gt;

&lt;li&gt;Saving the current file in your favourite editor&lt;/li&gt;
&lt;li&gt;Switch to terminal with commandline&lt;/li&gt;
&lt;li&gt;Cursor up, Enter&lt;/li&gt;
&lt;li&gt;Switch to your favourite web browser&lt;/li&gt;
&lt;li&gt;Hit the reload button&lt;/li&gt;

&lt;/ol&gt;&lt;h4&gt;Using a Specialized Editor with Live Preview&lt;/h4&gt;&lt;p&gt;

One choice would be to use a specific editor with live rendering. The
one I know in &lt;a href=&quot;http://www.debian.org/&quot; class=&quot;ext&quot;&gt;Debian&lt;/a&gt; (from &lt;a href=&quot;http://www.debian.org/News/weekly/2010/11/#6&quot; class=&quot;ext&quot;&gt;Wheezy&lt;/a&gt; on) is &lt;a class=&quot;ext&quot;
href=&quot;http://sourceforge.net/p/retext/home/ReText/&quot; &gt;ReText&lt;/a&gt;
(Debian package &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/retext&quot;&gt;retext&lt;/a&gt;). It supports Markdown and
&lt;a href=&quot;http://docutils.sourceforge.net/rst.html&quot; class=&quot;ext&quot;&gt;reStructuredText&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

But as with most simple &lt;acronym title=&quot;Graphical User Interface&quot;&gt;GUI&lt;/acronym&gt; editors, I miss there many of the advanced
editing commands possible with &lt;a href=&quot;http://www.emacswiki.org/&quot; class=&quot;ext&quot;&gt;Emacs&lt;/a&gt;.

&lt;/p&gt;&lt;h4&gt;Using Emacs&amp;#8217; Markdown Mode&lt;/h4&gt;&lt;p&gt;

Then there is the &lt;a class=&quot;ext&quot;
href=&quot;http://www.emacswiki.org/emacs/MarkdownMode&quot; &gt;Markdown Mode&lt;/a&gt;
for Emacs (part of Debian&amp;#8217;s &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/emacs-goodies-el&quot;&gt;emacs-goodies-el&lt;/a&gt; package), where
you can get a &amp;#8220;preview&amp;#8221; by pressing &lt;code&gt;C-c C-c p&lt;/code&gt;. But for
some reason this takes several seconds, opens a new buffer
&lt;em&gt;and&lt;/em&gt; window with the rendered &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; code and then starts
(hardcoded) &lt;a href=&quot;http://www.mozilla.org/products/firefox/&quot; class=&quot;ext&quot;&gt;Firefox&lt;/a&gt; (which is not &lt;a href=&quot;http://conkeror.org/&quot;
class=&quot;uni&quot; &gt;my preferred web browser&lt;/a&gt;). And if you do that a
second time without closing Firefox first, it won&amp;#8217;t just reload the
file but will open a new tab. You might think that just hitting reload
should suffice. But no, the new tab has a different file name, so
reload doesn&amp;#8217;t help. Additionally it may not use &lt;a class=&quot;ext&quot;
href=&quot;http://www.johnmacfarlane.net/pandoc/&quot; &gt;my preferred Markdown
implementation&lt;/a&gt;. Meh.

&lt;/p&gt;&lt;p&gt;

Well, I probably could fix all those issues with Markdown Mode, it&amp;#8217;s
only Emacs Lisp. Heck, the called command is even configurable. But
fixing at least four issues to fix one workflow annoyance? Maybe some
other time, but not as long there are other nice choices&amp;#8230;

&lt;/p&gt;&lt;h4&gt;Using inotifywait to Render on Write&lt;/h4&gt;&lt;p&gt;

So everytime you save the currently edited file, you immediately want
to rerender the same &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; file from it. This can be easily automated
by using &lt;a href=&quot;https://en.wikipedia.org/wiki/Inotify&quot; class=&quot;wiki&quot;
&gt;Linux&amp;#8217; inotify kernel subsystem&lt;/a&gt; which notices changes to the
filesystem, and reports those to applications which ask for it.

&lt;/p&gt;&lt;p&gt;

One such tool is &lt;code&gt;inotifywait&lt;/code&gt; which can either output all
or just specific events, or just exit if the first requested event
occurs. With the latter it&amp;#8217;s easy to write a while loop on the
commandline which regenerates a file after every write access. I use
either &lt;a href=&quot;http://www.johnmacfarlane.net/pandoc/&quot; class=&quot;ext&quot;&gt;Pandoc&lt;/a&gt; or &lt;a href=&quot;http://asciidoc.org/&quot; class=&quot;ext&quot;&gt;Asciidoc&lt;/a&gt; for that since both generate full &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; pages
including header and footer, but you can use that also with Markdown
to render just the &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; body. Most browsers render it correctly
anyway:

&lt;/p&gt;&lt;pre&gt;
while inotifywait -q -e modify index.md; do pandoc -s -f markdown -t html -o index.html index.md; done
while inotifywait -q -e modify index.txt; do asciidoc index.txt; done
while inotifywait -q -e modify index.md; do markdown index.md &gt; index.html; done
&lt;/pre&gt;&lt;p&gt;

This solution is even editor- and build-system-agnostic (But not
operating-system-agnostic.)

&lt;/p&gt;&lt;p&gt;

inotifywait is part of &lt;a
href=&quot;https://github.com/rvoicilas/inotify-tools/wiki&quot; class=&quot;ext&quot;
&gt;inotify-tools&lt;/a&gt;, a useful set of commandline tools to interface
with inotify. They&amp;#8217;re packaged in Debian as &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/inotify-tools&quot;&gt;inotify-tools&lt;/a&gt;,
too.

&lt;/p&gt;&lt;h4&gt;Using mdpress for Markdown plus &lt;a href=&quot;http://bartaz.github.com/impress.js/&quot; class=&quot;ext&quot;&gt;Impress.js&lt;/a&gt; based Slides&lt;/h4&gt;&lt;p&gt;

The &lt;a href=&quot;http://www.ruby-lang.org/en/&quot; class=&quot;ext&quot;&gt;ruby&lt;/a&gt;-written &lt;a href=&quot;http://documentup.com/egonschiele/mdpress/&quot;
class=&quot;ext&quot; &gt;mdpress&lt;/a&gt; is a special case of the previous case. It&amp;#8217;s
a commandline tool to convert Markdown into Impress.js based slide
shows and it has an option named &lt;code&gt;--automatic&lt;/code&gt; which causes
it to keep running and automatically update the presentation as soon
as changes are made to the Markdown file.

&lt;/p&gt;&lt;p&gt;

mdpress is not yet in Debian, but &lt;a class=&quot;ext&quot;
href=&quot;http://bugs.debian.org/692864&quot; &gt;there&amp;#8217;s an &lt;acronym title=&quot;intend to package&quot;&gt;ITP&lt;/acronym&gt; for it&lt;/a&gt; and
Impress.js itself recently entered Debian as &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/libjs-impress&quot;&gt;libjs-impress&lt;/a&gt;.
Nevertheless, two dependencies (&lt;a
href=&quot;http://bugs.debian.org/693819&quot; class=&quot;ext&quot; &gt;highlight.js,
&lt;acronym title=&quot;intend to package&quot;&gt;ITP&lt;/acronym&gt;&amp;#8216;ed&lt;/a&gt;, &lt;a class=&quot;ext&quot; href=&quot;http://bugs.debian.org/623914&quot;
&gt;ruby-launchy, &lt;acronym title=&quot;intend to package&quot;&gt;ITP&lt;/acronym&gt;&amp;#8216;ed&lt;/a&gt;) are still missing in Debian.</description>
    <comments>http://noone.org/blog/English/Computer/Shell/Rendering%2520Markdown%252C%2520Asciidoc%2520and%2520Friends%2520automatically%2520while%2520Editing.futile#comments</comments>
    <slash:comments>4</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/Asciidoc">Asciidoc</category>
<category domain="http://noone.org/blog/tags/Emacs">Emacs</category>
<category domain="http://noone.org/blog/tags/emacs%2Dgoodies%2Del">emacs-goodies-el</category>
<category domain="http://noone.org/blog/tags/GitHub">GitHub</category>
<category domain="http://noone.org/blog/tags/HTML">HTML</category>
<category domain="http://noone.org/blog/tags/Impress.js">Impress.js</category>
<category domain="http://noone.org/blog/tags/inotify">inotify</category>
<category domain="http://noone.org/blog/tags/inotify%2Dtools">inotify-tools</category>
<category domain="http://noone.org/blog/tags/inotifywait">inotifywait</category>
<category domain="http://noone.org/blog/tags/ITP">ITP</category>
<category domain="http://noone.org/blog/tags/Major%2DMode">Major-Mode</category>
<category domain="http://noone.org/blog/tags/Markdown">Markdown</category>
<category domain="http://noone.org/blog/tags/mdpress">mdpress</category>
<category domain="http://noone.org/blog/tags/oneliner">oneliner</category>
<category domain="http://noone.org/blog/tags/Pandoc">Pandoc</category>
<category domain="http://noone.org/blog/tags/reST">reST</category>
<category domain="http://noone.org/blog/tags/ReText">ReText</category>
<category domain="http://noone.org/blog/tags/Ruby">Ruby</category>
<category domain="http://noone.org/blog/tags/slides">slides</category>
<category domain="http://noone.org/blog/tags/Wheezy">Wheezy</category>

  </item>
  <item>
    <title>Tools for CLI Road Warriors: Remote Shells</title>
    <slash:department>OTR-not-only-means-Off-The-Record</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/Remote%2520Shells.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/Remote%2520Shells.html</guid>
    <pubDate>Wed, 11 Apr 2012 19:44:30 +0200</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
Most of my private online life happens on netbooks and besides the web
browser, &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; is my most used program &amp;mdash; especially on netbooks.
Accordingly I also have hosts on the net to which I connect via &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;.
My most used program there is &lt;a href=&quot;http://www.gnu.org/software/screen/&quot; class=&quot;ext&quot;&gt;&lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt; Screen&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

So yes, for things like e-mail, &lt;acronym title=&quot;Internet Relay Chat&quot;&gt;IRC&lt;/acronym&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Jabber&quot; class=&quot;wiki&quot;&gt;Jabber&lt;/a&gt; I connect to a running
screen session on some host with a permanent internet connection. On
those hosts there is usually one &lt;a href=&quot;http://www.gnu.org/&quot; class=&quot;ext&quot; title=&quot;GNU&apos;s not Unix&quot;&gt;&lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt;&lt;/a&gt; Screen instance running
permanently with either &lt;a href=&quot;http://www.mutt.org/&quot; class=&quot;ext&quot;&gt;mutt&lt;/a&gt; or &lt;a href=&quot;http://irssi.org/&quot; class=&quot;ext&quot;&gt;irssi&lt;/a&gt; (which is also my Jabber client
via a &lt;a href=&quot;http://www.bitlbee.org/&quot; class=&quot;ext&quot;&gt;Bitlbee&lt;/a&gt; gateway).

&lt;/p&gt;&lt;p&gt;

But there are some other less well-known tools which I regard as
useful in such a setup. The following two tools can both be seen as
&lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; for special occassions.

&lt;/p&gt;&lt;h4&gt;auto&lt;!-- --&gt;ssh&lt;/h4&gt;&lt;p&gt;

I already &lt;a
href=&quot;http://noone.org/blog/English/Computer/Shell/Perfect%20Team:%20autossh%20and%20GNU%20Screen.futile&quot;
&gt;blogged about autossh&lt;/a&gt;, even &lt;a
href=&quot;http://noone.org/blog/English/Computer/Shell/autossh%20vs%20TCP%20resetter.futile&quot;
&gt;twice&lt;/a&gt;, so I&amp;#8217;ll just recap the most important features here:

&lt;/p&gt;&lt;p&gt;

&lt;a href=&quot;http://www.harding.motd.ca/autossh/&quot; class=&quot;ext&quot;&gt;autossh&lt;/a&gt; is a wrapper around &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; which regularily checks via two
tunnels connect to each other on the remote side if the connection is
still alive, and if not, it kills the ssh and starts a new one with
the same parameters (i.e. tunnels, port forwardings, commands to call,
etc.).

&lt;/p&gt;&lt;p&gt;

It&amp;#8217;s quite obvious that this is perfect to be combined with screen&amp;#8217;s
&lt;code&gt;-R&lt;/code&gt; and &lt;code&gt;-d&lt;/code&gt; options.

&lt;/p&gt;&lt;p&gt;

I use autossh so often that I even &lt;a
href=&quot;http://bugs.debian.org/605423&quot; class=&quot;ext&quot; &gt;adopted&lt;/a&gt; its
&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/autossh&quot;&gt;Debian package&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

&lt;/p&gt;&lt;h4&gt;mosh&lt;/h4&gt;&lt;p&gt;

Since last week there&amp;#8217;s a new kid in town&lt;code&gt;^W&lt;/code&gt;&lt;a href=&quot;http://www.debian.org/&quot; class=&quot;ext&quot;&gt;Debian&lt;/a&gt;
Unstable: &lt;a href=&quot;http://mosh.mit.edu/&quot; class=&quot;ext&quot;&gt;mosh&lt;/a&gt; targets
the same problems as autossh (unreliable networks, roaming, suspending
the computer, etc.) just with a completely different approach which
partially even obsoletes the usage of &lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt; Screen or tmux:

&lt;/p&gt;&lt;p&gt;

While mosh uses plain &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; for authentication, authorization and key
exchange the final connection is an AES-128 encrypted UDP connection
on a random port and is independent of the client&amp;#8217;s &lt;acronym title=&quot;Internet Protocol&quot;&gt;IP&lt;/acronym&gt; address.

&lt;/p&gt;&lt;p&gt;

This allows mosh to have the following advantages: The connection
stays even if you&amp;#8217;re switching networks or suspending your netbook. So
if you&amp;#8217;re just running a single text-mode application you don&amp;#8217;t even
need &lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt; Screen or tmux. (You still do if you want the terminal
multiplexing feature of &lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt; Screen or tmux.)

&lt;/p&gt;&lt;p&gt;

Another nice feature, especially on unreliable &lt;acronym title=&quot;Wireless Local Area Network&quot;&gt;WLAN&lt;/acronym&gt; connections or
laggy &lt;acronym title=&quot;Global System for Mobile Communications&quot;&gt;GSM&lt;/acronym&gt; or &lt;acronym title=&quot;Universal Mobile Telecommunications System; Unvermutete Mehreinnahme zur Tilgung von Staatsschulden (Hans Eichel)&quot;&gt;UMTS&lt;/acronym&gt; connections is mosh&amp;#8217;s output prediction based on its
input (i.e. what is typed). Per line it tries to guess which server
reaction a key press would cause and if it detects a lagging
connection, it shows the predicted result underlined until it gets the
real result from the server. This eases writing mails in a remote mutt
or chatting in a remote irssi, especially if you noticed that you made
a typo, but can&amp;#8217;t remember how many backspaces you would have to type
to fix it.

&lt;/p&gt;&lt;p&gt;

Mosh needs to be installed on both, client and server, but the server
is only activated via &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;, so it has no port open unless a connection
is started. And despite that (in Debian) &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/mosh&quot;&gt;mosh is
currently just available in Unstable&lt;/a&gt;, the package builds fine on
&lt;a href=&quot;http://www.debian.org/releases/squeeze/&quot; class=&quot;ext&quot;&gt;Squeeze&lt;/a&gt;, too. There&amp;#8217;s also an &lt;a class=&quot;ext&quot;
href=&quot;https://launchpad.net/~keithw/+archive/mosh&quot; &gt;&lt;acronym title=&quot;Personal Package Archive&quot;&gt;PPA&lt;/acronym&gt; for Ubuntu&lt;/a&gt;
and of course you can also get the source code, e.g. as &lt;a href=&quot;http://git-scm.com/&quot; class=&quot;ext&quot;&gt;git&lt;/a&gt; checkout
from &lt;a href=&quot;http://github.com/&quot; class=&quot;ext&quot;&gt;GitHub&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

mosh is still &lt;a href=&quot;https://github.com/keithw/mosh/commits/master&quot;
class=&quot;ext&quot; &gt;under heavy development and new features and bug fixes
get added nearly every day&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;&lt;small&gt;

Thanks to &lt;a href=&quot;http://spang.cc/&quot; class=&quot;ext&quot; &gt;Christine Spang&lt;/a&gt;
for sponsoring and mentoring Keith&amp;#8217;s mosh package in Debian.

&lt;/small&gt;&lt;/p&gt;&lt;p&gt;

&lt;b&gt;Update:&lt;/b&gt; I gave a &lt;a class=&quot;uni&quot;
href=&quot;https://easterhegg.ch/lecture-ssh-ber-unzuverlssige-leitungen-lag-roaming-gsm-wackelige-wlans-und-hibernation&quot;
&gt;lightning talk about Mosh and AutoSSH in German at Easterhegg
2012&lt;/a&gt;. The &lt;a
href=&quot;http://noone.org/talks/ssh-tricks/ssh-tricks-eh12.html&quot;
&gt;slides&lt;/a&gt; are available online.</description>
    <comments>http://noone.org/blog/English/Computer/Shell/Remote%2520Shells.futile#comments</comments>
    <slash:comments>1</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/autossh">autossh</category>
<category domain="http://noone.org/blog/tags/Bitlbee">Bitlbee</category>
<category domain="http://noone.org/blog/tags/Debian">Debian</category>
<category domain="http://noone.org/blog/tags/GitHub">GitHub</category>
<category domain="http://noone.org/blog/tags/GNU%20Screen">GNU Screen</category>
<category domain="http://noone.org/blog/tags/IRC">IRC</category>
<category domain="http://noone.org/blog/tags/irssi">irssi</category>
<category domain="http://noone.org/blog/tags/Jabber">Jabber</category>
<category domain="http://noone.org/blog/tags/mosh">mosh</category>
<category domain="http://noone.org/blog/tags/mutt">mutt</category>
<category domain="http://noone.org/blog/tags/PPA">PPA</category>
<category domain="http://noone.org/blog/tags/Squeeze">Squeeze</category>
<category domain="http://noone.org/blog/tags/ssh">ssh</category>
<category domain="http://noone.org/blog/tags/SSH">SSH</category>
<category domain="http://noone.org/blog/tags/Testing">Testing</category>
<category domain="http://noone.org/blog/tags/Ubuntu">Ubuntu</category>
<category domain="http://noone.org/blog/tags/Unstable">Unstable</category>

  </item>
  <item>
    <title>Tools for CLI Road Warriors: Hidden Terminals</title>
    <slash:department>Terminals-where-you-don't-expect-them</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/Hidden%2520Terminals.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/Hidden%2520Terminals.html</guid>
    <pubDate>Wed, 04 Apr 2012 00:57:48 +0200</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
Some networks have no connection to the outside except that they allow
surfing through an &lt;acronym title=&quot;Hot Tits Transport Pr0nocol (Ulrich Schwarz)&quot;&gt;HTTP&lt;/acronym&gt;(S) proxy. Sometimes you are happy and the
HTTPS port (443) is unrestricted. The following server-side tools
allow you to exploit these weaknesses and get you a shell on your
server.

&lt;/p&gt;&lt;h4&gt;sslh&lt;/h4&gt;&lt;p&gt;

&lt;a href=&quot;http://www.rutschle.net/tech/sslh.shtml&quot; class=&quot;ext&quot;
&gt;sslh&lt;/a&gt; is an &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;/SSL multiplexor. If a client connects to sslh, it
checks if the clients speaks the &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; or the SSL protocol and then
passes the connection to the according real port of SSL or some SSL
enabled service, e.g. an HTTPS, &lt;a href=&quot;http://openvpn.net/&quot; class=&quot;ext&quot;&gt;OpenVPN&lt;/a&gt;, &lt;a class=&quot;ext&quot;
href=&quot;http://www.tinc-vpn.org/&quot; &gt;Tinc&lt;/a&gt; or &lt;acronym title=&quot;Extensible Messaging and Presence Protocol&quot;&gt;XMPP&lt;/acronym&gt; server. That way
it&amp;#8217;s possible to connect to one of these services &lt;em&gt;and&lt;/em&gt; &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; on
the same port.

&lt;/p&gt;&lt;p&gt;

The usual scenario where this daemon is useful are firewalls which
block &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;, force &lt;acronym title=&quot;Hot Tits Transport Pr0nocol (Ulrich Schwarz)&quot;&gt;HTTP&lt;/acronym&gt; to go through a proxy, but allow HTTPS
connections without restriction. In that case you let sslh listen on
the HTTPS port (443) and to move the real HTTPS server (e.g. &lt;a href=&quot;http://httpd.apache.org/&quot; class=&quot;ext&quot;&gt;Apache&lt;/a&gt;)
to listen on either a different port number (e.g. 442, 444 or 8443) or
on another &lt;acronym title=&quot;Internet Protocol&quot;&gt;IP&lt;/acronym&gt; address, e.g. on localhost, port 443.

&lt;/p&gt;&lt;p&gt;

On an &lt;a href=&quot;http://www.debian.org/&quot; class=&quot;ext&quot;&gt;Debian&lt;/a&gt; or &lt;a href=&quot;http://www.ubuntu.com/&quot; class=&quot;ext&quot;&gt;Ubuntu&lt;/a&gt; based Apache HTTPS server, you just have to do
the following to run Apache on port 442 and sslh on port 443 instead:

&lt;/p&gt;&lt;ol&gt;

&lt;li&gt;&lt;code&gt;apt-get install sslh&lt;/code&gt; as root.&lt;/li&gt;

&lt;li&gt;Edit &lt;code class=&quot;file&quot;&gt;/etc/default/sslh&lt;/code&gt;, change
&lt;code&gt;RUN=no&lt;/code&gt; to &lt;code&gt;RUN=yes&lt;/code&gt; and &lt;code&gt;--ssl
127.0.0.1:443&lt;/code&gt; to &lt;code&gt;--ssl 127.0.0.1:442&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Edit &lt;code class=&quot;file&quot;&gt;/etc/apache2/ports.conf&lt;/code&gt; and all
files in &lt;code class=&quot;file&quot;&gt;/etc/apache2/sites-available/&lt;/code&gt; which
contain a reference to port 443 (which is only &lt;code
class=&quot;file&quot;&gt;/etc/apache2/sites-available/default-ssl.conf&lt;/code&gt; in
the default configuration) and change all occurrences of
&lt;code&gt;443&lt;/code&gt; to &lt;code&gt;442&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;&lt;code class=&quot;command&quot;&gt;service apache2 restart&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;command&quot;&gt;service sslh start&lt;/code&gt;&lt;/li&gt;

&lt;/ol&gt;&lt;p&gt;

Now you should be able to ssh to your server on port 443 (&lt;code
class=&quot;command&quot; &gt;ssh -p 443 your.server.example.org&lt;/code&gt;) while
still being able to surf to
&lt;code&gt;https://your.server.example.org/&lt;/code&gt;.

&lt;/p&gt;&lt;p&gt;

sslh works as threaded or as preforking daemon, or via inetd. It also
honors tcpwrapper configurations for sshd in &lt;code
class=&quot;file&quot;&gt;/etc/hosts.allow&lt;/code&gt; and &lt;code
class=&quot;file&quot;&gt;/etc/hosts.deny&lt;/code&gt;.

&lt;/p&gt;&lt;p&gt;

sslh is available as port or package at least in &lt;a href=&quot;http://www.gentoo.org/&quot; class=&quot;ext&quot;&gt;Gentoo&lt;/a&gt;, in &lt;a href=&quot;http://www.freebsd.org/&quot; class=&quot;ext&quot;&gt;FreeBSD&lt;/a&gt;,
&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/sslh&quot;&gt;in Debian&lt;/a&gt; and &lt;a href=&quot;http://packages.ubuntu.com/sslh&quot;
class=&quot;ext&quot; &gt;in Ubuntu&lt;/a&gt;.

&lt;/p&gt;&lt;h4&gt;AjaxTerm&lt;/h4&gt;&lt;p&gt;

A completely different approach takes &lt;a class=&quot;ext&quot;
href=&quot;http://antony.lesuisse.org/software/ajaxterm/&quot; &gt;AjaxTerm&lt;/a&gt;. It
provides a terminal inside a web browser with login and ssh being its
server-side backend.

&lt;/p&gt;&lt;p&gt;

Properly safe-guarded by HTTPS plus maybe &lt;acronym title=&quot;Hot Tits Transport Pr0nocol (Ulrich Schwarz)&quot;&gt;HTTP&lt;/acronym&gt; based authentication
this can be an interesting emergency alternative to the more common
&amp;mdash; but also more often blocked &amp;mdash; remote login mechanisms.

&lt;/p&gt;&lt;p&gt;

AjaxTerm is available as package at least &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/ajaxterm&quot;&gt;in Debian&lt;/a&gt;
and &lt;a class=&quot;ext&quot; href=&quot;http://packages.ubuntu.com/ajaxterm&quot; &gt;in
Ubuntu&lt;/a&gt;.

&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;small&gt;

Happily I never were forced to use either of them myself. :-)

&lt;/small&gt;</description>
    <comments>http://noone.org/blog/English/Computer/Shell/Hidden%2520Terminals.futile#comments</comments>
    <slash:comments>5</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/AJAX">AJAX</category>
<category domain="http://noone.org/blog/tags/AjaxTerm">AjaxTerm</category>
<category domain="http://noone.org/blog/tags/Apache">Apache</category>
<category domain="http://noone.org/blog/tags/Debian">Debian</category>
<category domain="http://noone.org/blog/tags/HTTPS">HTTPS</category>
<category domain="http://noone.org/blog/tags/libwrap">libwrap</category>
<category domain="http://noone.org/blog/tags/OpenVPN">OpenVPN</category>
<category domain="http://noone.org/blog/tags/SSH">SSH</category>
<category domain="http://noone.org/blog/tags/SSL">SSL</category>
<category domain="http://noone.org/blog/tags/sslh">sslh</category>
<category domain="http://noone.org/blog/tags/tcpd">tcpd</category>
<category domain="http://noone.org/blog/tags/tcpwrapper">tcpwrapper</category>
<category domain="http://noone.org/blog/tags/Ubuntu">Ubuntu</category>
<category domain="http://noone.org/blog/tags/XMPP">XMPP</category>

  </item>
  <item>
    <title>Tools for CLI Road Warriors: Tunnels</title>
    <slash:department>I'll-Tunnel-My-Way-Home</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/Tunneling.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/Tunneling.html</guid>
    <pubDate>Thu, 22 Mar 2012 19:49:10 +0100</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
Sometime the network you&amp;#8217;re connected to is either untrusted (e.g.
wireless) or castrated in some way. In both cases you want a tunnel to
your trusted home base.

&lt;/p&gt;&lt;p&gt;

Following I&amp;#8217;ll show you three completely different tunneling tools
which may helpful while travelling.

&lt;/p&gt;&lt;h4&gt;sshuttle&lt;/h4&gt;&lt;p&gt;

&lt;a href=&quot;https://github.com/apenwarr/sshuttle/&quot; class=&quot;ext&quot;
&gt;sshuttle&lt;/a&gt; is a tool somewhere in between of automatic port forward
and VPN. It tunnels arbitrary TCP connections and &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; through an &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;
tunnel without requiring root access on the remote end of the &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;
connection.

&lt;/p&gt;&lt;p&gt;

So it&amp;#8217;s perfect for redirecting most of your traffic through an &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt;
tunnel to your favourite &lt;acronym title=&quot;Secure Shell&quot;&gt;SSH&lt;/acronym&gt; server, e.g. to ensure your local privacy
when you are online via a public, unencrypted &lt;acronym title=&quot;Wireless Local Area Network&quot;&gt;WLAN&lt;/acronym&gt; (i.e. easy to sniff
for everyone).

&lt;/p&gt;&lt;p&gt;

It runs on &lt;a href=&quot;http://www.kernel.org/&quot; class=&quot;ext&quot;&gt;Linux&lt;/a&gt; and MacOS X and only needs a &lt;a href=&quot;http://www.python.org/&quot; class=&quot;ext&quot;&gt;Python&lt;/a&gt; interpreter on
the remote side. Requires root access (usually via sudo) on the client
side, though.

&lt;/p&gt;&lt;p&gt;

It&amp;#8217;s currently available at least &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/sshuttle&quot;&gt;in Debian Unstable
and Testing (Wheezy)&lt;/a&gt; as well as in &lt;a class=&quot;ext&quot;
href=&quot;http://packages.ubuntu.com/sshuttle&quot; &gt;Ubuntu since 11.04 Natty&lt;/a&gt;.

&lt;/p&gt;&lt;h4&gt;Miredo&lt;/h4&gt;&lt;p&gt;

&lt;a href=&quot;http://www.remlab.net/miredo/&quot; class=&quot;ext&quot; &gt;Miredo&lt;/a&gt; is an
free and open-source implementation of Microsoft&amp;#8217;s NAT-traversing
Teredo IPv6 tunneling protocol for at least Linux, &lt;a href=&quot;http://www.freebsd.org/&quot; class=&quot;ext&quot;&gt;FreeBSD&lt;/a&gt;, &lt;a href=&quot;http://www.netbsd.org/&quot; class=&quot;ext&quot;&gt;NetBSD&lt;/a&gt; and
MacOS X.

&lt;/p&gt;&lt;p&gt;

Miredo includes not only a Teredo client but also a Teredo server
implementation. The developer of Miredo also runs a public Miredo
server, so you don&amp;#8217;t even need to install a server somewhere. If you
run &lt;a href=&quot;http://www.debian.org/&quot; class=&quot;ext&quot;&gt;Debian&lt;/a&gt; or &lt;a href=&quot;http://www.ubuntu.com/&quot; class=&quot;ext&quot;&gt;Ubuntu&lt;/a&gt; you just need to do &lt;code&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/miredo&quot;&gt;apt-get
install miredo&lt;/a&gt;&lt;/code&gt; as root and you have IPv6 connectivity. It&amp;#8217;s
that easy.

&lt;/p&gt;&lt;p&gt;

So it&amp;#8217;s perfect to get a dynamic IPv6 tunnel for your laptop or mobile
phone independently where you are and without the need to register any
IPv6 tunnel or configure the Miredo client.

&lt;/p&gt;&lt;p&gt;

I usually use Miredo on my netbooks to be able to access my boxes at
home (which are behind an IPv4 NAT router which is also an SixXS IPv6
tunnel endpoint) from whereever I am.

&lt;/p&gt;&lt;h4&gt;iodine&lt;/h4&gt;&lt;p&gt;

&lt;a href=&quot;http://code.kryo.se/iodine/&quot; class=&quot;ext&quot; &gt;iodine&lt;/a&gt; is
likely the most undermining tool in this set. It tunnels IPv4 over
&lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt;, allowing you to make arbitrary network connections if you are on
a network where nothing but &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; requests is allowed (i.e. only &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt;
packets reach the internet).

&lt;/p&gt;&lt;p&gt;

This is often the case on wireless LANs with landing page. They
redirect all web traffic to the landing page. But the network&amp;#8217;s
routers try to avoid poisoning the client&amp;#8217;s &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; cache with different
&lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; replies as they would get after the user is logged in. So &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt;
packets usually pass even the local network&amp;#8217;s &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; servers unchanged,
just TCP and other UDP packets are redirected until logging in.

&lt;/p&gt;&lt;p&gt;

With an iodine tunnel, it is possible get a network connection to the
outside on such a network anyway. On startup iodine tries to
automatically find the best parameters (MTU, request type, etc.) for
the current environmenent. However that may fail if any &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; server in
between imposes &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt; request rate limits.

&lt;/p&gt;&lt;p&gt;

To be able to start such a tunnel you need to set up an iodine daemon
somewhere on the internet. Choose a server which is not already a &lt;acronym title=&quot;Domain Name Service&quot;&gt;DNS&lt;/acronym&gt;
server.

&lt;/p&gt;&lt;p&gt;

iodine is available in many distributions, e.g. &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/iodine&quot;&gt;in
Debian&lt;/a&gt; and &lt;a href=&quot;http://packages.ubuntu.com/iodine&quot; class=&quot;ext&quot;
&gt;in Ubuntu&lt;/a&gt;.</description>
    <comments>http://noone.org/blog/English/Computer/Shell/Tunneling.futile#comments</comments>
    <slash:comments>0</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/autossh">autossh</category>
<category domain="http://noone.org/blog/tags/Debian">Debian</category>
<category domain="http://noone.org/blog/tags/GitHub">GitHub</category>
<category domain="http://noone.org/blog/tags/iodine">iodine</category>
<category domain="http://noone.org/blog/tags/IPv6">IPv6</category>
<category domain="http://noone.org/blog/tags/Miredo">Miredo</category>
<category domain="http://noone.org/blog/tags/NAT">NAT</category>
<category domain="http://noone.org/blog/tags/Python">Python</category>
<category domain="http://noone.org/blog/tags/Squeeze">Squeeze</category>
<category domain="http://noone.org/blog/tags/SSH">SSH</category>
<category domain="http://noone.org/blog/tags/sshuttle">sshuttle</category>
<category domain="http://noone.org/blog/tags/Testing">Testing</category>
<category domain="http://noone.org/blog/tags/Ubuntu">Ubuntu</category>
<category domain="http://noone.org/blog/tags/Unstable">Unstable</category>
<category domain="http://noone.org/blog/tags/VPN">VPN</category>

  </item>
  <item>
    <title>Happy Birthday GNU Screen!</title>
    <slash:department>State-of-the-Screen</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/Happy%2520Birthday%2520GNU%2520Screen%2521.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/Happy%2520Birthday%2520GNU%2520Screen%2521.html</guid>
    <pubDate>Tue, 20 Mar 2012 23:46:50 +0100</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
According to &lt;a class=&quot;ext&quot;
href=&quot;https://groups.google.com/group/net.sources/browse_thread/thread/e55f5059d2329d36&quot;
&gt;this Usenet posting&lt;/a&gt;, &lt;a href=&quot;http://www.gnu.org/software/screen/&quot; class=&quot;ext&quot;&gt;&lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt; Screen&lt;/a&gt; became 25 years old today. (Found
&lt;a class=&quot;ext&quot; href=&quot;https://blog.fefe.de/?ts=b1967b1e&quot; &gt;via Fefe&lt;/a&gt;.)

&lt;/p&gt;&lt;p&gt;

And no, &lt;a href=&quot;http://git.savannah.gnu.org/cgit/screen.git/&quot;
class=&quot;ext&quot; &gt;it&amp;#8217;s not dead&lt;/a&gt;. In contrary, the reaction on the
mailing list to bug fixes &lt;em&gt;with patches&lt;/em&gt; is usually
impressingly prompt. :-)

&lt;/p&gt;&lt;p&gt;

I took this occassion and &lt;a class=&quot;uni&quot;
href=&quot;http://packages.qa.debian.org/s/screen/news/20120320T223354Z.html&quot;
&gt;uploaded a current git snapshot of &lt;acronym title=&quot;GNU&apos;s not Unix&quot;&gt;GNU&lt;/acronym&gt; Screen to Debian
Experimental&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

Bug #&lt;a href=&quot;http://bugs.debian.org/644788&quot; class=&quot;ext&quot;&gt;644788&lt;/a&gt; (screen 4.1.0 can&amp;#8217;t attach to a running or
detached screen 4.0.3 session) is still an issue with that snapshot,
but gladly &lt;a class=&quot;ext&quot;
href=&quot;https://lists.gnu.org/archive/html/screen-devel/2012-02/msg00004.html&quot;
&gt;upstream seems to work on a solution&lt;/a&gt; for it. There&amp;#8217;s even talk
about a 4.1.0 beta release soon &amp;mdash; although that hasn&amp;#8217;t happened
yet.

&lt;/p&gt;&lt;p&gt;

Have fun!</description>
    <comments>http://noone.org/blog/English/Computer/Shell/Happy%2520Birthday%2520GNU%2520Screen%2521.futile#comments</comments>
    <slash:comments>1</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/anniversary">anniversary</category>
<category domain="http://noone.org/blog/tags/birthday">birthday</category>
<category domain="http://noone.org/blog/tags/Debian">Debian</category>
<category domain="http://noone.org/blog/tags/Experimental">Experimental</category>
<category domain="http://noone.org/blog/tags/Git">Git</category>
<category domain="http://noone.org/blog/tags/GNU">GNU</category>
<category domain="http://noone.org/blog/tags/GNU%20Screen">GNU Screen</category>
<category domain="http://noone.org/blog/tags/screen">screen</category>
<category domain="http://noone.org/blog/tags/snapshot">snapshot</category>
<category domain="http://noone.org/blog/tags/upload">upload</category>

  </item>
  <item>
    <title>grep everything</title>
    <slash:department>*grep*</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/grep%2520everything.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/grep%2520everything.html</guid>
    <pubDate>Mon, 14 Nov 2011 09:43:53 +0100</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
During the &lt;a href=&quot;http://www.openrheinruhr.de/&quot; class=&quot;ext&quot;&gt;OpenRheinRuhr&lt;/a&gt; I noticed that a friend of mine didn&amp;#8217;t know
about &lt;code&gt;zgrep&lt;/code&gt; and friends. So I told him what other grep
variations I know and he told me about some grep variations I didn&amp;#8217;t
know about.

&lt;/p&gt;&lt;p&gt;

So here&amp;#8217;s our collection of grep wrappers, derivatives and variations.
First I&amp;#8217;ll list programs which search for text in different file
formats:

&lt;/p&gt;&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;&gt;
&lt;tr&gt;&lt;th&gt;grep through what&lt;/th&gt;&lt;th&gt;Fixed Strings&lt;/th&gt;&lt;th&gt;Wildcards / Basic RegExps&lt;/th&gt;&lt;th&gt;Extended RegExps&lt;/th&gt;&lt;th&gt;&lt;a href=&quot;http://www.debian.org/&quot; class=&quot;ext&quot;&gt;Debian&lt;/a&gt; package&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;uncompressed text files&lt;/td&gt;&lt;td&gt;fgrep&lt;/td&gt;&lt;td&gt;grep&lt;/td&gt;&lt;td&gt;egrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/grep&quot;&gt;grep&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;gzip-compressed text files&lt;/td&gt;&lt;td&gt;zfgrep&lt;/td&gt;&lt;td&gt;zgrep&lt;/td&gt;&lt;td&gt;zegrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/zutils&quot;&gt;zutils&lt;/a&gt;, &lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/gzip&quot;&gt;gzip&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;bzip2-compressed text files&lt;/td&gt;&lt;td&gt;bzfgrep&lt;/td&gt;&lt;td&gt;bzgrep&lt;/td&gt;&lt;td&gt;bzegrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/bzip2&quot;&gt;bzip2&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;xz-compressed text files&lt;/td&gt;&lt;td&gt;xzfgrep&lt;/td&gt;&lt;td&gt;xzgrep&lt;/td&gt;&lt;td&gt;xzegrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/xz-utils&quot;&gt;xz-utils&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;uncompressed text files in installed Debian packages&lt;/td&gt;&lt;td&gt;dfgrep&lt;/td&gt;&lt;td&gt;dgrep&lt;/td&gt;&lt;td&gt;degrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/debian-goodies&quot;&gt;debian-goodies&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;gzip-compressed text files in installed Debian packages&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;dzgrep&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/debian-goodies&quot;&gt;debian-goodies&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;PDF documents&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;pdfgrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/pdfgrep&quot;&gt;pdfgrep&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;POD texts&lt;/td&gt;&lt;td&gt;podgrep&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/pmtools&quot;&gt;pmtools&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;E-Mail folder (mbox, MH, Maildir)&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;mboxgrep -G&lt;/td&gt;&lt;td&gt;mboxgrep -E&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/mboxgrep&quot;&gt;mboxgrep&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Patches&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;grepdiff&lt;/td&gt;&lt;td&gt;grepdiff -E&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/patchutils&quot;&gt;patchutils&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Process list&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;pgrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/procps&quot;&gt;procps&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/Gnumeric&quot;&gt;Gnumeric&lt;/a&gt; spreadsheets&lt;/td&gt;&lt;td&gt;ssgrep -F&lt;/td&gt;&lt;td&gt;ssgrep&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/gnumeric&quot;&gt;gnumeric&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Files in ZIP archives&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;zipgrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/unzip&quot;&gt;unzip&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ID3 tags in MP3s&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;taggrepper&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/taggrepper&quot;&gt;taggrepper&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Network packets&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;ngrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/ngrep&quot;&gt;ngrep&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tar archives&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;targrep / ptargrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/perl&quot;&gt;perl&lt;/a&gt; (Experimental only for now)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;

And then there are also greps for special patterns on more or less
normal files:

&lt;p&gt;&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;&gt;
&lt;tr&gt;&lt;th&gt;grep for what&lt;/th&gt;&lt;th&gt;uncompressed files&lt;/th&gt;&lt;th&gt;compressed files&lt;/th&gt;&lt;th&gt;Debian package&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;PCRE (&lt;a href=&quot;http://www.perl.com/&quot; class=&quot;ext&quot;&gt;Perl&lt;/a&gt; Compatible Regular Expression)&lt;/td&gt;&lt;td&gt;pcregrep (see also the &lt;code&gt;grep -P&lt;/code&gt; option)&lt;/td&gt;&lt;td&gt;zpcregrep&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/pcregrep&quot;&gt;pcregrep&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;acronym title=&quot;Internet Protocol&quot;&gt;IP&lt;/acronym&gt; Address in a given CIDR range&lt;/td&gt;&lt;td&gt;grepcidr&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/grepcidr&quot;&gt;grepcidr&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;XPath expression&lt;/td&gt;&lt;td&gt;xml_grep&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/xml-twig-tools&quot;&gt;xml-twig-tools&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;

One question is though still unanswered for us: Is there some kind of
meta-grep which chooses per file the right grep from above by looking
at the MIME type of the according files, similar to &lt;a class=&quot;ext&quot;
href=&quot;http://portland.freedesktop.org/xdg-utils-1.0/xdg-open.html&quot;
&gt;xdg-open&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

Other tools which have grep in their name, but are too special to
properly fit into the above lists:

&lt;/p&gt;&lt;ul&gt;

&lt;li&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/ext3grep&quot;&gt;ext3grep&lt;/a&gt;: Tool to help recover deleted files on ext3
filesystems&lt;/li&gt;

&lt;li&gt;&lt;a class=&quot;ext&quot; href=&quot;http://packages.debian.org/xautomation&quot;&gt;xautomation&lt;/a&gt;: Includes a tool named &lt;code&gt;visgrep&lt;/code&gt;
to grep for subimages inside other images.&lt;/li&gt;

&lt;/ul&gt;&lt;p&gt;

Includes contributions by &lt;a href=&quot;http://www.efho.de/&quot; class=&quot;ext&quot;
&gt;Frank Hofmann&lt;/a&gt; and Faidon Liambotis.</description>
    <comments>http://noone.org/blog/English/Computer/Shell/grep%2520everything.futile#comments</comments>
    <slash:comments>6</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/.deb">.deb</category>
<category domain="http://noone.org/blog/tags/bzip2">bzip2</category>
<category domain="http://noone.org/blog/tags/CIDR">CIDR</category>
<category domain="http://noone.org/blog/tags/compression">compression</category>
<category domain="http://noone.org/blog/tags/Debian">Debian</category>
<category domain="http://noone.org/blog/tags/debian%2Dgoodies">debian-goodies</category>
<category domain="http://noone.org/blog/tags/E%2DMail">E-Mail</category>
<category domain="http://noone.org/blog/tags/efho">efho</category>
<category domain="http://noone.org/blog/tags/ext3grep">ext3grep</category>
<category domain="http://noone.org/blog/tags/Gnumeric">Gnumeric</category>
<category domain="http://noone.org/blog/tags/grep">grep</category>
<category domain="http://noone.org/blog/tags/grepcidr">grepcidr</category>
<category domain="http://noone.org/blog/tags/gzip">gzip</category>
<category domain="http://noone.org/blog/tags/ID3">ID3</category>
<category domain="http://noone.org/blog/tags/list">list</category>
<category domain="http://noone.org/blog/tags/Maildir">Maildir</category>
<category domain="http://noone.org/blog/tags/mbox">mbox</category>
<category domain="http://noone.org/blog/tags/mboxgrep">mboxgrep</category>
<category domain="http://noone.org/blog/tags/mh">mh</category>
<category domain="http://noone.org/blog/tags/MP3">MP3</category>
<category domain="http://noone.org/blog/tags/ngrep">ngrep</category>
<category domain="http://noone.org/blog/tags/packages">packages</category>
<category domain="http://noone.org/blog/tags/patches">patches</category>
<category domain="http://noone.org/blog/tags/PCRE">PCRE</category>
<category domain="http://noone.org/blog/tags/PDF">PDF</category>
<category domain="http://noone.org/blog/tags/pdfgrep">pdfgrep</category>
<category domain="http://noone.org/blog/tags/Perl">Perl</category>
<category domain="http://noone.org/blog/tags/pmtools">pmtools</category>
<category domain="http://noone.org/blog/tags/POD">POD</category>
<category domain="http://noone.org/blog/tags/podgrep">podgrep</category>
<category domain="http://noone.org/blog/tags/procps">procps</category>
<category domain="http://noone.org/blog/tags/taggrepper">taggrepper</category>
<category domain="http://noone.org/blog/tags/TWIG">TWIG</category>
<category domain="http://noone.org/blog/tags/unzip">unzip</category>
<category domain="http://noone.org/blog/tags/visgrep">visgrep</category>
<category domain="http://noone.org/blog/tags/xautomation">xautomation</category>
<category domain="http://noone.org/blog/tags/XDG">XDG</category>
<category domain="http://noone.org/blog/tags/XML">XML</category>
<category domain="http://noone.org/blog/tags/xz">xz</category>
<category domain="http://noone.org/blog/tags/xz%2Dutils">xz-utils</category>
<category domain="http://noone.org/blog/tags/zip">zip</category>
<category domain="http://noone.org/blog/tags/zutils">zutils</category>

  </item>
  <item>
    <title>Emacs Macros: Repeat on Steroids</title>
    <slash:department>.-for-Emacsen</slash:department>
    <slash:section>English &amp;raquo; Computer &amp;raquo; Shell</slash:section>
    <link>http://noone.org/blog/English/Computer/Shell/Emacs%2520Macros:%2520Repeat%2520on%2520Steroids.html</link>
    <guid isPermaLink="true">http://noone.org/blog/English/Computer/Shell/Emacs%2520Macros:%2520Repeat%2520on%2520Steroids.html</guid>
    <pubDate>Thu, 22 Sep 2011 16:06:49 +0200</pubDate>
    <author>abe+blog@deuxchevaux.org (Axel Beckert)</author>
    <description>
vi users have their &lt;code&gt;.&lt;/code&gt; (dot) redo command for repeating
the last command. The article &lt;a class=&quot;ext&quot;
href=&quot;http://www.masteringemacs.org/articles/2011/07/15/repeating-commands-emacs/&quot;
&gt;Repeating Commands in Emacs&lt;/a&gt; in Mickey Petersen&amp;#8217;s &lt;a href=&quot;http://en.wikipedia.org/wiki/Weblog&quot; class=&quot;wiki&quot; title=&quot;What is a blog/weblog?&quot;&gt;blog&lt;/a&gt; &lt;a class=&quot;ext&quot;
href=&quot;http://www.masteringemacs.org/&quot; &gt;Mastering Emacs&lt;/a&gt; explained
&lt;a href=&quot;http://www.emacswiki.org/&quot; class=&quot;ext&quot;&gt;Emacs&lt;/a&gt;&amp;#8217; equivalent for that, namely the command &lt;code&gt;repeat&lt;/code&gt;, by
default bound to &lt;code&gt;C-x z&lt;/code&gt;.

&lt;/p&gt;&lt;p&gt;

I though seldomly use it as I mostly have to repeat a chain of
commands. What I use are so called &lt;a class=&quot;wiki&quot;
href=&quot;http://www.emacswiki.org/emacs/KeyboardMacros&quot; &gt;Keyboard
Macros&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

For example for the &lt;a class=&quot;ext&quot;
href=&quot;https://httpd.apache.org/security/CVE-2011-3192.txt&quot;
&gt;CVE-2011-3192 vulnerability in Apache&lt;/a&gt; I added a line like
&lt;code&gt;Include /etc/apache2/sites-common/CVE-2011-3192.conf&lt;/code&gt; to
all VirtualHosts.

&lt;/p&gt;&lt;p&gt;

So I started Emacs with all the relevant files: &lt;code&gt;grep
CVE-2011-3192 -l /etc/apache2/sites-available/*[^~] | xargs emacs
&amp;&lt;/code&gt;

&lt;/p&gt;&lt;p&gt;

To remove those &amp;#8220;Include&amp;#8221; lines again &lt;code&gt;M-x flush-lines&lt;/code&gt; is
probably the easiest way in Emacs. So for every file I had to call
flush-lines with always the same parameter, save the buffer and then
close the file or &amp;mdash; in Emacsish &amp;mdash; &amp;#8220;kill&amp;#8221; the buffer.

&lt;/p&gt;&lt;p&gt;

So while working on the first file I recorded my doing as a keyboard
macro:

&lt;/p&gt;&lt;dl&gt;

&lt;dt&gt;&lt;code&gt;C-x (&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Start recording&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;M-x flush-lines&amp;lt;Enter&amp;gt;CVE-2011-3192&amp;lt;Enter&amp;gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;flush all lines which contain the string &amp;#8220;CVE-2011-3192&amp;#8221;&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;C-x C-s&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;save the current buffer&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;C-x C-k&amp;lt;Enter&amp;gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;kill the current buffer, i.e. close the file&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;C-x )&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Stop recording&lt;/dd&gt;

&lt;/dl&gt;&lt;p&gt;

Then I just had to call the saved macro with &lt;code&gt;C-x e&lt;/code&gt;. It
flushed all lines, saved the changes and switched to the next
remaining file by closing the current file with three key-strokes. And
to make it even easier, from the second occasion on I only had to
press &lt;code&gt;e&lt;/code&gt; to call the macro directly again. So I just
pressed &lt;code&gt;e&lt;/code&gt; for a bunch of time and had all files edited.
(In this case I used &lt;code&gt;&lt;a href=&quot;http://git-scm.com/&quot; class=&quot;ext&quot;&gt;git&lt;/a&gt; diff&lt;/code&gt; afterwards to check that I
didn&amp;#8217;t wreck anything by half-automating my editing. :-)

&lt;/p&gt;&lt;p&gt;

Of course there are other ways to do this, too, e.g. use
&lt;code&gt;sed&lt;/code&gt; or so, but I still think it&amp;#8217;s a neat example for
showing the power of keyboard macros in Emacs. More things you can do
with Emacs Keyboard Macros are described in the EmacsWiki entry &lt;a
href=&quot;http://www.emacswiki.org/emacs/KeyboardMacros&quot; class=&quot;wiki&quot;
&gt;Keyboard Macros&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

And if you still miss vi&amp;#8217;s &lt;code&gt;.&lt;/code&gt; command in Emacs, you can
use the &lt;a href=&quot;http://wyrick.org/source/elisp/dot-mode/&quot; class=&quot;ext&quot;
&gt;dot-mode&lt;/a&gt;, an Emacs mode currently maintained by Robert Wyrick
which more or less automatically defines keyboard macros and lets you
call them with &lt;code&gt;C-.&lt;/code&gt;.</description>
    <comments>http://noone.org/blog/English/Computer/Shell/Emacs%2520Macros:%2520Repeat%2520on%2520Steroids.futile#comments</comments>
    <slash:comments>3</slash:comments>
    <dc:language>en</dc:language>
    <category domain="http://noone.org/blog/tags/Apache">Apache</category>
<category domain="http://noone.org/blog/tags/CLI">CLI</category>
<category domain="http://noone.org/blog/tags/CVE">CVE</category>
<category domain="http://noone.org/blog/tags/CVE%2D2011%2D3192">CVE-2011-3192</category>
<category domain="http://noone.org/blog/tags/dot%2Dmode">dot-mode</category>
<category domain="http://noone.org/blog/tags/Emacs">Emacs</category>
<category domain="http://noone.org/blog/tags/EmacsWiki">EmacsWiki</category>
<category domain="http://noone.org/blog/tags/git">git</category>
<category domain="http://noone.org/blog/tags/macro">macro</category>
<category domain="http://noone.org/blog/tags/Other%20Blogs">Other Blogs</category>
<category domain="http://noone.org/blog/tags/redo">redo</category>
<category domain="http://noone.org/blog/tags/repeat">repeat</category>
<category domain="http://noone.org/blog/tags/vi">vi</category>
<category domain="http://noone.org/blog/tags/xargs">xargs</category>

  </item>
    <link>http://noone.org/blog/English/Computer/Shell</link>
  </channel>
</rss>
