<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/"
     xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Tyler Cipriani: pages tagged ansi</title>
<link>https://tylercipriani.com/tags/ansi/</link>
<atom:link href="https://tylercipriani.com/tags/ansi/index.rss" rel="self" type="application/rss+xml"/>

<description>Tyler Cipriani</description>
<generator>ikiwiki</generator>
<pubDate>Sat, 01 Jul 2017 00:49:09 +0000</pubDate>
<item>
	<title>Create a Baller/Useful MOTD with ANSI Art</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/05/22/creating-baller-useful-motd-ascii-art/</guid>

	<link>https://tylercipriani.com/blog/2014/05/22/creating-baller-useful-motd-ascii-art/</link>

	<dc:creator>Tyler Cipriani</dc:creator>



	<category>ansi</category>

	<category>computing</category>

	<category>shell</category>


	<pubDate>Thu, 22 May 2014 00:00:00 +0000</pubDate>
	<dcterms:modified>2017-07-01T00:49:09Z</dcterms:modified>


	<description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: 2017-01-08&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.rzegocki.pl/&quot;&gt;Igor Rzegocki&lt;/a&gt; has a project that uses the same technique outlined here to make some incredible ready-made &lt;a href=&quot;https://github.com/ajgon/street-fighter-motd&quot;&gt;Street FIghter MotDs&lt;/a&gt; – it is really cool, and if you are interested in abusing ansi escape sequences to make MotDs you should check it out :)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
&lt;img src=&quot;https://tylercipriani-files.s3.amazonaws.com/zangief_motd.png&quot; alt=&quot;Zangief MOtD&quot; /&gt;&lt;figcaption&gt;Zangief MOtD&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Everyone universally agrees that most &lt;a href=&quot;http://linux.die.net/man/5/motd&quot;&gt;Message of the Days (MOTDs)&lt;/a&gt; are stupid and suck. By the end of reading this post, your mind grapes should be swollen with the knowledge of how to make an MOTD that isn’t stupid and, some would say, &lt;em&gt;doesn’t&lt;/em&gt; suck.&lt;/p&gt;
&lt;section id=&quot;prerequisites&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;Prerequisites &lt;a href=&quot;https://tylercipriani.com/tags/ansi/#prerequisites&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Imagemagick&lt;/li&gt;
&lt;li&gt;OpenJDK&lt;/li&gt;
&lt;li&gt;coreutils&lt;/li&gt;
&lt;li&gt;perl&lt;/li&gt;
&lt;li&gt;git&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This should have you covered:&lt;/p&gt;
&lt;div class=&quot;sourceCode&quot; id=&quot;cb1&quot;&gt;&lt;pre class=&quot;sourceCode bash&quot;&gt;&lt;code class=&quot;sourceCode bash&quot;&gt;&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-1&quot; title=&quot;1&quot;&gt;$ &lt;span class=&quot;fu&quot;&gt;sudo&lt;/span&gt; apt-get install imagemagick openjdk-6-jdk coreutils perl git&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id=&quot;creating-the-util-say-file&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;Creating the Util-say file &lt;a href=&quot;https://tylercipriani.com/tags/ansi/#creating-the-util-say-file&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I use &lt;a href=&quot;https://github.com/maandree/util-say&quot;&gt;Util-Say&lt;/a&gt; to create motd messages. I started out using &lt;a href=&quot;https://github.com/rossy2401/img2xterm&quot;&gt;img2xterm&lt;/a&gt;, but I’ve found I get better results with Util-Say.&lt;/p&gt;
&lt;div class=&quot;sourceCode&quot; id=&quot;cb2&quot;&gt;&lt;pre class=&quot;sourceCode bash&quot;&gt;&lt;code class=&quot;sourceCode bash&quot;&gt;&lt;a class=&quot;sourceLine&quot; id=&quot;cb2-1&quot; title=&quot;1&quot;&gt;$ &lt;span class=&quot;fu&quot;&gt;git&lt;/span&gt; clone https://github.com/maandree/util-say&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb2-2&quot; title=&quot;2&quot;&gt;$ &lt;span class=&quot;bu&quot;&gt;cd&lt;/span&gt; util-say&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb2-3&quot; title=&quot;3&quot;&gt;$ &lt;span class=&quot;ex&quot;&gt;./img2ponysay&lt;/span&gt; -- yourimg.png &lt;span class=&quot;op&quot;&gt;&amp;gt;&lt;/span&gt; yourimg.txt&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also try &lt;code&gt;./img2ponysay -2 -- youimg.png &amp;gt; yourimg.txt&lt;/code&gt; but I’ve never had good results with that&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;motd-ifying&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;MOTD-ifying &lt;a href=&quot;https://tylercipriani.com/tags/ansi/#motd-ifying&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;figure&gt;
&lt;img src=&quot;https://tylercipriani-files.s3.amazonaws.com/mammoth_motd.png&quot; alt=&quot;Mammoth Motd&quot; /&gt;&lt;figcaption&gt;Mammoth Motd&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;On CentOS and Debian, I usually just throw the ponysay file directly into &lt;code&gt;/etc/motd&lt;/code&gt; and maybe add on some other useful info:&lt;/p&gt;
&lt;div class=&quot;sourceCode&quot; id=&quot;cb3&quot;&gt;&lt;pre class=&quot;sourceCode bash&quot;&gt;&lt;code class=&quot;sourceCode bash&quot;&gt;&lt;a class=&quot;sourceLine&quot; id=&quot;cb3-1&quot; title=&quot;1&quot;&gt;$ &lt;span class=&quot;fu&quot;&gt;sudo&lt;/span&gt; cat yourimg.txt &lt;span class=&quot;op&quot;&gt;&amp;gt;&lt;/span&gt; /etc/motd&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb3-2&quot; title=&quot;2&quot;&gt;$ &lt;span class=&quot;fu&quot;&gt;sudo&lt;/span&gt; figlet &lt;span class=&quot;st&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;va&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;fu&quot;&gt;hostname&lt;/span&gt;&lt;span class=&quot;va&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;st&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;op&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/motd&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb3-3&quot; title=&quot;3&quot;&gt;$ &lt;span class=&quot;fu&quot;&gt;sudo&lt;/span&gt; printf &lt;span class=&quot;st&quot;&gt;&amp;quot;Public IP: &lt;/span&gt;&lt;span class=&quot;va&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;ex&quot;&gt;dig&lt;/span&gt; +short myip.opendns.com @resolver1.opendns.com&lt;span class=&quot;va&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;st&quot;&gt;\n&amp;quot;&lt;/span&gt; &lt;span class=&quot;op&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/motd&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;On Ubuntu Boxes (since they use &lt;a href=&quot;https://wiki.ubuntu.com/UpdateMotd&quot;&gt;update-motd(1)&lt;/a&gt;), I do pretty much the same thing except I just make a bash script in &lt;code&gt;/etc/update-motd.d/25-baller-motd&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;sourceCode&quot; id=&quot;cb4&quot;&gt;&lt;pre class=&quot;sourceCode numberSource bash numberLines&quot;&gt;&lt;code class=&quot;sourceCode bash&quot;&gt;&lt;a class=&quot;sourceLine&quot; id=&quot;cb4-1&quot; title=&quot;1&quot;&gt;&lt;span class=&quot;co&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb4-2&quot; title=&quot;2&quot;&gt;&lt;span class=&quot;fu&quot;&gt;cat&lt;/span&gt; yourimg.txt&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb4-3&quot; title=&quot;3&quot;&gt;&lt;span class=&quot;ex&quot;&gt;figlet&lt;/span&gt; &lt;span class=&quot;st&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;va&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;fu&quot;&gt;hostname&lt;/span&gt;&lt;span class=&quot;va&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;st&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb4-4&quot; title=&quot;4&quot;&gt;&lt;span class=&quot;bu&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;st&quot;&gt;&amp;quot;Public IP: &lt;/span&gt;&lt;span class=&quot;va&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;ex&quot;&gt;dig&lt;/span&gt; +short myip.opendns.com @resolver1.opendns.com&lt;span class=&quot;va&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;st&quot;&gt;\n&amp;quot;&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb4-5&quot; title=&quot;5&quot;&gt;&lt;span class=&quot;bu&quot;&gt;command&lt;/span&gt; -v fortune &lt;span class=&quot;op&quot;&gt;&amp;amp;&amp;gt;&lt;/span&gt; /dev/null &lt;span class=&quot;kw&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;ex&quot;&gt;fortune&lt;/span&gt;&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There are likely better articles on creating a &lt;em&gt;useful&lt;/em&gt; MOTD, (&lt;a href=&quot;http://www.mewbies.com/how_to_customize_your_console_login_message_tutorial.htm&quot;&gt;here&lt;/a&gt;’s one that looks kinda cool) but there are exactly none-better articles on creating MOTDs that are so flossy!&lt;/p&gt;
&lt;/section&gt;
</description>


	<comments>//tylercipriani.com/blog/2014/05/22/creating-baller-useful-motd-ascii-art/#comments</comments>

</item>

</channel>
</rss>
