<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>command line interface &#8211; Greg Laden&#039;s Blog</title>
	<atom:link href="https://gregladen.com/blog/tag/command-line-interface/feed/" rel="self" type="application/rss+xml" />
	<link>https://gregladen.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jan 2011 21:34:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.8</generator>

<image>
	<url>https://i0.wp.com/gregladen.com/blog/wp-content/uploads/2017/10/Greg_Ladens_Blog_Favicon_black_GLb.png?fit=32%2C32&#038;ssl=1</url>
	<title>command line interface &#8211; Greg Laden&#039;s Blog</title>
	<link>https://gregladen.com/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">77525483</site>	<item>
		<title>Command line unit conversion</title>
		<link>https://gregladen.com/blog/2011/01/18/command-line-unit-conversion/</link>
					<comments>https://gregladen.com/blog/2011/01/18/command-line-unit-conversion/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Tue, 18 Jan 2011 21:34:10 +0000</pubDate>
				<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2011/01/18/command-line-unit-conversion/</guid>

					<description><![CDATA[The Linux command &#8216;units&#8217; may or may not be installed on your system. If not, if you use synaptic or apt, type (at the prompt) sudo apt-get install units or equiviliant for other distributions. Then type in the word &#8220;units&#8221; and play around. Here are a few sample outputs: The program is a little clunky. &#8230; <a href="https://gregladen.com/blog/2011/01/18/command-line-unit-conversion/" class="more-link">Continue reading <span class="screen-reader-text">Command line unit conversion</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>The Linux command &#8216;units&#8217; may or may not be installed on your system.  If not, if you use synaptic or apt, type (at the prompt)</p>
<p>sudo apt-get install units</p>
<p>or equiviliant for other distributions.  Then type in the word &#8220;units&#8221; and play around.  Here are a few sample outputs:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-89547af38f3e53e357d45983aaf95b6c-units_eg.jpg?w=604" alt="i-89547af38f3e53e357d45983aaf95b6c-units_eg.jpg" data-recalc-dims="1" /></p>
<p>The program is a little clunky.  You have to know the specific codes for each type of measurement, though &#8216;units&#8217; will figure out what you mean sometimes.  To exit, type ctrl-D.  There is a way to use this utility in a script. That and other details are found in the <a href="http://www.gnu.org/software/units/manual/units.html">manual</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2011/01/18/command-line-unit-conversion/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">24710</post-id>	</item>
		<item>
		<title>Hacking a Google Calendar CLI Tool</title>
		<link>https://gregladen.com/blog/2010/10/19/hacking-a-google-calendar-cli/</link>
					<comments>https://gregladen.com/blog/2010/10/19/hacking-a-google-calendar-cli/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Tue, 19 Oct 2010 15:08:23 +0000</pubDate>
				<category><![CDATA[command line interface]]></category>
		<category><![CDATA[gcalcli]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pim]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2010/10/19/hacking-a-google-calendar-cli/</guid>

					<description><![CDATA[I wrote earlier of the very useful command line utility called gcalcli (short for GoogleCALendarCommandLineInterface). Click here to read that post. One of the options is called &#8220;agenda&#8221; which spits out, by default, the next five days of calendar entries. If you would prefer a different range of time than five days, then you can &#8230; <a href="https://gregladen.com/blog/2010/10/19/hacking-a-google-calendar-cli/" class="more-link">Continue reading <span class="screen-reader-text">Hacking a Google Calendar CLI Tool</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I wrote earlier of the very useful command line utility called gcalcli (short for GoogleCALendarCommandLineInterface).  <a href="http://scienceblogs.com/gregladen/2010/10/using_google_calendar_from_the.php">Click here to read that post.</a>  One of the options is called &#8220;agenda&#8221; which spits out, by default, the next five days of calendar entries.  If you would prefer a different range of time than five days, then you can specify two dates and the utility will give you that set of entries.</p>
<p>But I find that to be a bit of a pain, typing in the dates to start and end the list, when I generally want a quick and dirty &#8220;next several days.&#8221; That, I suppose, is why there is a default of five days.  But five days is not a good default.  If it is Wednesday, I want to see what I&#8217;ve got on my calendar for the rest of the current week, as well as what is on my calendar for ALL of next week.  For me, a better default would be 14 days.  With 14 days, you always get a full look at the present week and the next week, plus, sometimes, a bit after that.</p>
<p>One can imagine writing a bash script that figures out what day it is, and then adds enough days that you get an agenda for the remainder of the present week plus all of the next week, but no more days than that. Such a script could make use of bash&#8217;s ability to manage and manipulate dates as they occur in our periodic system, with 24 hours in a day, 7 days in a week, work days being a subset of five of those days, etc. etc.</p>
<p>One could also imagine writing a bash script to poke one&#8217;s eyes out with hot soldering irons.</p>
<p>A simpler solution is this:<br />
<span id="more-8929"></span><br />
Pick a number of days that you like, and add that to the current day, and use those two parameters to invoke the agenda command, and put all that in a script.  The problem with this is still figuring out the second day.  How do you add, say, 14 days to the present day?  If the date utility in bash gives us something like 10/19/10, how do you add 14 to that?  19 plus 14 is 33.  There is no day 33.  So you&#8217;d have to increment the month.  So the month would become 11.  One could use a modulo function if available, but some months are 30 days long, some 31 days long, and one is sometimes 28 days long but sometimes 29 days long.  And then, what if you wanted fourteen days starting on December 20th?  Then, the month goes back to 1, and the year is incremented.  Holy crap!</p>
<p>Software like spreadsheets and other financial applications do date math.  It is interesting to note that such applications didn&#8217;t originally do date math, and when they first did it, they did it poorly, and for years (and as far as I know this is ongoing) major screw ups in spreadsheet code often have to do with date math.  Date math, as a matter of fact, is the bane of computers and those who work with them.  (Remember the year 2000 fiasco?)</p>
<p>But there is a way to do this easily, and this is in fact the way that most date math is probably done at some level in spreadsheets and other apps.  Convert everything into the number of seconds since some arbitrary historical moment in time.  This is a bit like how radiocarbon dating works. When you see a date like &#8220;1,000 years before present&#8221; that year is 950 AD, because &#8220;Present&#8221; = 1950.</p>
<p>For this purpose, Linux uses Unix Time, also known as Posix time.  In this system, time started at midnight ZULU time in the morning of January 1st, 1970.  Everything before that is prehistory.  Approximately one and a quarter billion seconds have passed since then.</p>
<p>So the solution is easy:  Convert the present time to Unix time.  Then, add the number of seconds that is 14 days into the future (1209600 seconds) to that number to obtain the second time.  Then, since gcalcli does not read Linux time (shame on the coders! shame on the coders!) convert the Unix time back to esoteric time (with the slashes) and feed that to the gcalcli command.  I originally did this as a one liner but I&#8217;ve since parsed it out into individual lines and put it in a bash script I call &#8220;agenda.&#8221;  Here it is:</p>
<p><code><br />
#/bin/bash</p>
<p>nownum=<code>date +%s</code><br />
thennum=$((nownum+1209600))<br />
now=<code>date --date=@$nownum +%D</code><br />
then=<code>date --date=@$thennum +%D</code><br />
echo Agenda for $now through $then<br />
gcalcli --nc agenda $now $then</p>
<p></code></p>
<p>Let&#8217;s break it down.</p>
<p>First, the shebang line, and this may vary across systems:</p>
<p><code></p>
<p>#/bin/bash</p>
<p></code></p>
<p>Then we make some numbers.  nownum is the current date in Unix format, using the &#8220;date&#8221; command and specifying a &#8220;format&#8221; code of %s, which is seconds since the start of the Unixverse.  Then, 14 days of seconds are added to this to make a second Unix time number:</p>
<p><code></p>
<p>nownum=<code>date +%s</code><br />
thennum=$((nownum+1209600))</p>
<p></code></p>
<p>Then, these two values, &#8220;nownum&#8221; and &#8220;thennum&#8221; are converted, using the esoteric &#8211;date switch of the date command, into strings &#8220;now&#8221; and &#8220;then&#8221; which are in standard date format:</p>
<p><code></p>
<p>now=<code>date --date=@$nownum +%D</code><br />
then=<code>date --date=@$thennum +%D</code></p>
<p></code></p>
<p>These two numbers are then printed out as part of a sentence reminding the user what today&#8217;s date is and what the end of the 14 day period is:</p>
<p><code></p>
<p>echo Agenda for $now through $then</p>
<p></code></p>
<p>And finally, gcalcli is invoked using $now and $then as parameters to the agenda subcommand.  I also threw in &#8211;nc which suppresses color coding.</p>
<p><code></p>
<p>gcalcli --nc agenda $now $then</p>
<p></code></p>
<p>The reason I suppress color coding is so I can do this at the command line</p>
<p>agenda > ~/agenda.txt<br />
alpine-> (c)ompose -> amanda -> ctrl-r -> ~/Desktop/agenda.txt -> ctrl-X -> Y</p>
<p>that slams the current agenda into a text file, opens a mail program, composes a message to Amanda, slams the contents of the agenda file into the email and sends it off.</p>
<p>Hey, wait, what am I doing? I should add a line that creates agenda.txt every time I request the agenda from Google.</p>
<p>tapity-tap-tap tappity-tap</p>
<p>Done.</p>
<p><code></p>
<p>#/bin/bash</p>
<p>nownum=<code>date +%s</code><br />
thennum=$((nownum+1209600))<br />
now=<code>date --date=@$nownum +%D</code><br />
then=<code>date --date=@$thennum +%D</code><br />
echo Agenda for $now through $then<br />
gcalcli --nc agenda $now $then > ~/Desktop/agenda.txt<br />
cat ~/Desktop/agenda.txt<br />
</code></p>
<p>This post is part of the cli series. <a href="http://scienceblogs.com/gregladen/command_line_interface_cli/">The full list is here.</a></p>
<p>If you found this post useful, please consider using the social networking tools below to spread it around!  Thank you</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2010/10/19/hacking-a-google-calendar-cli/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8929</post-id>	</item>
		<item>
		<title>Using Google Calendar from the Linux Command Line</title>
		<link>https://gregladen.com/blog/2010/10/08/using-google-calendar-from-the/</link>
					<comments>https://gregladen.com/blog/2010/10/08/using-google-calendar-from-the/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Fri, 08 Oct 2010 10:05:04 +0000</pubDate>
				<category><![CDATA[Alpine email]]></category>
		<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2010/10/08/using-google-calendar-from-the/</guid>

					<description><![CDATA[Computer-based calendars are very useful, and the Google Calendar is probably one of the more widely used personal calendars other than scheduling programs such as MS Outlook and Groupwise (both of which are broken). But, webby gooey applications can be rather bothersome because they tend to take up a lot of screen real estate and &#8230; <a href="https://gregladen.com/blog/2010/10/08/using-google-calendar-from-the/" class="more-link">Continue reading <span class="screen-reader-text">Using Google Calendar from the Linux Command Line</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Computer-based calendars are very useful, and the Google Calendar is probably one of the more widely used personal calendars other than scheduling programs such as MS Outlook and Groupwise (both of which are broken).  But, webby gooey applications can be rather bothersome because they tend to take up a lot of screen real estate and other resources, and on smaller screens such as a laptop can be rendered virtually useless by all that added functionality built into the web browser itself as well as the calendar page.  It is quite possible that on your laptop, your Google Calendar may look something like this:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-db80841539964342991966740f989f08-01-gcalcli.jpg?w=604" alt="i-db80841539964342991966740f989f08-01-gcalcli.jpg" data-recalc-dims="1" /></p>
<p>Not very useful.<br />
<span id="more-8888"></span></p>
<div style="text-align: center;"><em>~ This post is one of a series on the topic of Command Line Interface applications in Linux. <a href="http://scienceblogs.com/gregladen/command_line_interface_cli/"> Click here to see a list of all of the related posts.</a>~</em></div>
<p>It is a little easier if you use Google Calendar&#8217;s &#8220;agenda view&#8221; which simply lists, in chronological order, the upcoming appointments, so days on which you have nothing scheduled do not take up space.  Like this:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-2835438fcb35ba824f9bbf28ab03a215-02_gcalcli.jpg?w=604" alt="i-2835438fcb35ba824f9bbf28ab03a215-02_gcalcli.jpg" data-recalc-dims="1" /></p>
<p>But that still kind of sucks, since the vast majority of information on that screen has little to do with the information you are looking for.  As long as a command line interface is available, which it is, wouldn&#8217;t it be nice to have a quick and dirty command that you could type in to retrieve your calendar, perhaps manipulate it, and even get a simple text-based agenda view that one can actually see?</p>
<p>There is, and it&#8217;s called gcalcli.  When I type &#8220;gcalcli&#8221; into a command line with the argument &#8220;agenda&#8221;, I get this:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-96d93409adbe61ac802b5ba8011bd75d-03_gcal.cli.jpg?w=604" alt="i-96d93409adbe61ac802b5ba8011bd75d-03_gcal.cli.jpg" data-recalc-dims="1" /></p>
<p>With relatively little configuration, gcalcli knows where to go and get my calendar information.  The program has lots of options, most of which are used to select among the various calendars you have access to or to configure the output. When I typed in:</p>
<p><code>gcalcli list</code></p>
<p>the program outputs a list of four calendars that I have access to.  I knew about the first two of them already.  The third is a calendar called &#8220;US Holidays&#8221; which I imagine comes along with Google Calendar.  The fourth is that of an organization I belong to, though I had forgotten about the calendar.</p>
<p>One option tells the &#8220;agenda&#8221; command to include all the details within the calendar and not just the date/time and name of event.  The calendars can be searched (but for whole words only).  Another command outputs a week&#8217;s calendar in a nice formatted arrangement:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-1b13e74a1dbc623f24e567e2f4ad3390-04_gcalcli.jpg?w=604" alt="i-1b13e74a1dbc623f24e567e2f4ad3390-04_gcalcli.jpg" data-recalc-dims="1" /></p>
<p>And, yet another outputs an entire month. Unfortunately, when I tried that I got an error and some gobbly-code.</p>
<p>It is possible to add single appointments using the command &#8220;quick&#8221;:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-109c6079e38979f55bb77632994a9b43-05_gcalcli.jpg?w=604" alt="i-109c6079e38979f55bb77632994a9b43-05_gcalcli.jpg" data-recalc-dims="1" /></p>
<p>There is also a way to execute a command if an event is to occur within a certain amount of time.  This might be run on start up of a particular terminal or integrated with a chron job, to develop your own personal way of annoying yourself into getting your stuff done.</p>
<p>There are lots of other options.  You can read more about it <a href="http://code.google.com/p/gcalcli/">here</a>, and if you are using Debian/Ubuntu, you can install the software in synaptic (search for gcalcli) or by simply typing the magic words:</p>
<p><code>sudo apt-get install gcalcli</code></p>
<p>This application firmly sits in the Class II cli App category, which I&#8217;ve discussed before.  This is where you want a GUI version and a cli version of the same app, in this case, accessing the same database.  Different circumstances demand different approaches.  Learning two or three commands with gcalcli will augment your Google Calendar experience and make you look really cool at the coffee shop.  But there will still be times when the web-based GUI interface makes the most sense.</p>
<p>Furthermore, and I&#8217;m sure you already know this, you can easily define and save an alias for &#8220;gcalcli agenda&#8221; (or any other combination of frequently used commands and options) so you would type only, say &#8220;agenda&#8221; or &#8220;appointments&#8221; or whatever to get the output you need on a regular basis.</p>
<p>Here&#8217;s another little trick in case you want to totally geek out.  If you are using alpine for your email (I&#8217;ll discuss this great app later) you can type in ctrl-_ and call emacs as your secondary editor.  From within emacs, select some irrelevant text (that step may not be necessary) and type ctrl-u to cause the output of the next command to replace that text.  Then type shift-alt-| (the vertical bar thingie), which allows you to enter a shell command.  Then, type in</p>
<p><code>gcalcli --nc agenda</code></p>
<p>The &#8211;nc strips the output of its color coding control codes, which are messy when they are not spewed onto a terminal.  The selected text will be replaced with your agenda in nice, text form.  Save, exit, and you&#8217;re back in alpine with your email to your significant other who just asked you &#8220;Are you available Wednesday night to go pick up the new car seat?&#8221; or whatever.</p>
<p>Obviously once you&#8217;ve done that a few times and perhaps refined the exact procedure, you&#8217;d make these commands into a macro so little more than a stern look and the flip of a single finger will insert your current agenda into whatever email you are currently writing.  How cool is that?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2010/10/08/using-google-calendar-from-the/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8888</post-id>	</item>
		<item>
		<title>Whither the weather? Linux CLI solutions</title>
		<link>https://gregladen.com/blog/2010/10/07/whither-the-weather-linux-cli/</link>
					<comments>https://gregladen.com/blog/2010/10/07/whither-the-weather-linux-cli/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Thu, 07 Oct 2010 11:03:49 +0000</pubDate>
				<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2010/10/07/whither-the-weather-linux-cli/</guid>

					<description><![CDATA[The command line is a great place to get weather information. Here, I discuss one cli-app for current conditions and forecasts, in the larger context of why you would ever want to use the command line anyway. There are several ways to use your computer to check the weather. One is to use the Nakob &#8230; <a href="https://gregladen.com/blog/2010/10/07/whither-the-weather-linux-cli/" class="more-link">Continue reading <span class="screen-reader-text">Whither the weather? Linux CLI solutions</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><a href="http://scienceblogs.com/gregladen/2010/10/being_a_console_geek_in_linux.php">The command line is a great place to get weather information.</a>  Here, I discuss one cli-app for current conditions and forecasts, in the larger context of why you would ever want to use the command line anyway.<br />
<span id="more-8775"></span><br />
There are several ways to use your computer to check the weather.  One is to use the Nakob Weather Rock method. Suspend the computer using a rope from a tripod of sticks.  If the computer is swaying, that means it is windy.  If the computer is wet, that means it is raining.  And so on.  Like this:<br />
<img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-b0a90f9dc37a589c3a59cdd10e2ba665-weather_cli_00.jpg?w=604" alt="i-b0a90f9dc37a589c3a59cdd10e2ba665-weather_cli_00.jpg" data-recalc-dims="1" /></p>
<p>That is a very amusing way to tell the weather, but it is not convenient because your computer is now tied up and you can&#8217;t use it for anything else.</p>
<p>Another way is to attach a dohickie to a toolbar or a part of your desktop that is constantly contacting some weather service.  The dohickie will change its physical appearance with the weather, it may have the temperature written on it, and perhaps if you click it a web site from a weather service opens in some nearby browser window.  This is not convenient if you happen to not be connected to the Internet and the dohickie either makes an embarrassing public fuss about it, or worse, does so much dicking around in the background trying to get connected that your computer&#8217;s performance is affected.</p>
<p>A modification of this method is to have a Google applet on your Google home page, or some other applet or similar mini-program on some other portal. This has the same problem as the dohickie but more dramatically so, as every time the page loads or refreshes there is negotiation and messing around just to keep the weather widget up to date, and there is a good chance you will not look at it (or even care about it) most of the time.  Thus, your computer is doing resource hogging stuff and ignoring you needlessly while you are busy ignoring it, which is not ideal.</p>
<p>Most people, on considering the above methods, will simply tell you this: &#8220;Just bring up The Weather Channel&#8221; or &#8220;The Weather Underground&#8221; or even just Google and see the weather there.  Its simple. But actually, they&#8217;d be mostly wrong.</p>
<p>Yes, it is simple to open up the web page of a weather service, and if you want to see radar and other stuff, this is a great way to go.  But if you just want current conditions and a quick forecast, it may not be.</p>
<p>When  I open up a weather web site on my laptop, I get this:</p>
<p><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-c983430a3ba9dd197637f16aa2cae1a8-weather_cli_01.jpg?w=604" alt="i-c983430a3ba9dd197637f16aa2cae1a8-weather_cli_01.jpg" data-recalc-dims="1" /></p>
<p>Notice that the weather is not visible on this page, even though I&#8217;ve got my laptop maximally configured to provide real estate to any app that opens on it.  To see the weather I have to scroll down.  Way down. Here is a view of the entire page except the very bottom, showing you where the actual current conditions and quick and dirty forecast is located:<br />
<img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-501af201d56bd0158822ab5f07a8865f-weather_cli_02.jpg?w=604" alt="i-501af201d56bd0158822ab5f07a8865f-weather_cli_02.jpg" data-recalc-dims="1" /></p>
<p>I&#8217;ve circled the tiny little part of the massive webpage loaded to get the weather that shows the actual weather conditions and immediate forecast.  Even this area, though, is kind of spread out and unnecessarily iconographic when you look at it up close:<br />
<img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-d4d1dde9fda953611e302c19815c2051-weather_cli_03.jpg?w=604" alt="i-d4d1dde9fda953611e302c19815c2051-weather_cli_03.jpg" data-recalc-dims="1" /></p>
<p>That&#8217;s pretty useful, but getting here required opening a browser, clicking a bookmark or typing in a search term or URL, and scrolling around a bit.  Not a lot of work, but not zero work either.  In other words, when in a moment I show you a command line version of how to get the current conditions and immediate forecast, whatever effort it took to get there is not to be compared to zero effort, but rather, to the actual effort a web browsing client and web page requires.  (Many people forget that because they are so used to it.)</p>
<p>Speaking of which, what happens if we <em>do</em> use a command line method for getting at the weather?  Suppose I am already at the command line and I want to know the weather.  What do I do?  I type &#8220;weather&#8221; at the command prompt.  I&#8217;ve previously configured the software to assume that if I don&#8217;t say otherwise, it should give me the weather locally with a forecast.  I get this:<br />
<img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-12ac5169bd34e1810be26815351fa7db-weather_cli_04.jpg?w=604" alt="i-12ac5169bd34e1810be26815351fa7db-weather_cli_04.jpg" data-recalc-dims="1" /><br />
I can also have the weather up north at the cabin by typing in &#8220;weather cabin&#8221; &#8230; this gives me the temperature and other current conditions at the small air strip a few miles from the cabin, and the forecast for a large town an hour away or so, which is the closest NOAA forecast location.</p>
<p>I can have this information with less detail (like, no headers or indentation) or more detail, for anywhere in the US.  If I was searching around for weather info for places I normally don&#8217;t go, it would probably be easier to mess around with the web site of some weather service, such as <a href="http://www.weather.com/weather/today/Bognor+Regis+United+Kingdom+UKXX1105?from=enhsearch_didyoumean">The Weather Channel</a>.  But for finding out the current conditions and immediate forecast for basic day to day use,  the command line is faster,  easier, has fewer problems, and is more convenient.</p>
<p>This (the app, &#8216;weather&#8217;) is a great example of what I call a Class II command line application. In my system, a Class I application is one that is simply done better, almost all the time, on the command line.  A Class III command line application is one that is usually not done as conveniently on the command line as with a GUI, but is sometimes necessary and thus worth knowing about even if you don&#8217;t internalize the methods.  This probably includes a lot of network configuration work, for example.  The network GUI apps in Linux are OK but not powerful, but the command line roolz.  A Class IV command line application is one that is hardly ever needed and is almost always inconvenient.  Browsing the web from the command line is possible but is almost never recommended (thought here are a lot of cool webby things you can do with command line, just not reading blogs and stuff).</p>
<p>But the weather application, as a Class II app, is one that is really useful and really cool, but that has a GUI version (the various web sites on the Internet) that is potentially really useful and cool as well.  Which approach &#8230; cli vs. GUI &#8230; one would ideally use would depend on the immediate needs of the user and other factors that are hard to predict in advance. For Class II apps, it is probably a good idea to learn both the cli and GUI version.   Other examples include text editing and RSS feed reading, but (to me) most importantly, email.  Try using a console-based app like <a href="http://scienceblogs.com/gregladen/technology/alpine_email/">alpine</a> for reading your email for a few weeks and you will become very annoyed at web-based and GUI client-based methods, even if they do have the occasional advantages.  Yes, when it comes to searching through emails you may find the GUI apps better because their paradigm is more similar to what you are accustom to.</p>
<p>More details on the app &#8220;weather&#8217; can be found <a href="http://fungi.yuggoth.org/weather/">here</a>.  The way it works is to tap into a NOAA maintained directory structure of weather information organized in state/city folders and by the four digit location code used by aviators (related to but not exactly the same as &#8220;airport codes&#8221;).</p>
<p>Install it using your package manager or, if you are Debian-cli savvy, sudo apt-get install weather.  Then, use man weather and man weatherrc to read about the program and its configuration files.</p>
<p>Next in the series: <a href="http://scienceblogs.com/gregladen/2010/10/using_google_calendar_from_the.php">Using Google Calendar from the Linux Command Line</a></p>
<p>If you find this useful, please consider posting it on facebook, stumbling it, redditing it, etc., using the handy dandy buttons below!  Thanks.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2010/10/07/whither-the-weather-linux-cli/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8775</post-id>	</item>
		<item>
		<title>Being a console geek in Linux</title>
		<link>https://gregladen.com/blog/2010/10/05/being-a-console-geek-in-linux/</link>
					<comments>https://gregladen.com/blog/2010/10/05/being-a-console-geek-in-linux/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Tue, 05 Oct 2010 16:54:12 +0000</pubDate>
				<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2010/10/05/being-a-console-geek-in-linux/</guid>

					<description><![CDATA[This is the first in a series about using the &#8220;command line&#8221; in Linux. It is also about knowing when to use a gui instead. But before going into any of that we need to understand what is meant by a &#8220;command line&#8221; application. You&#8217;ll find that as we explore that idea, a lot of &#8230; <a href="https://gregladen.com/blog/2010/10/05/being-a-console-geek-in-linux/" class="more-link">Continue reading <span class="screen-reader-text">Being a console geek in Linux</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This is the first in <a href="http://scienceblogs.com/gregladen/command_line_interface_cli/">a series about using the &#8220;command line&#8221; in Linux</a>.  It is also about knowing when to use a gui instead.  But before going into any of that we need to understand what is meant by a &#8220;command line&#8221; application.  You&#8217;ll find that as we explore that idea, a lot of things that are not really true &#8216;cli&#8217; (command line interface) apps arguably count as cli, including menu driven console based apps and even gui apps. This will be controversial.<br />
<span id="more-8873"></span><br />
Let&#8217;s start with some basic definitions.  If anyone has any problems with any of the following just let me know.  Consider this a first draft subject to revision!</p>
<dt>Console/Virtual Console/Virtual Terminal</dt>
<dd>The term &#8220;console&#8221; and the term &#8220;terminal&#8221; can be thought of as equivalent.</p>
<p>This is a computer interface that uses the command line prompt at which the user types commands, and no graphical capabilities beyond those able to put characters on the screen.  Calling this a &#8220;<em>virtual</em> console&#8221; is misleading and the reasons for the use of the word &#8220;virtual&#8221; are unimportant.  This is the real thing.  This is what happens when you turn on your *xnix based computer and no graphical interface comes up and instead you&#8217;ve got a black screen with a prompt waiting for you to do something.  In Linux, you can <em>usually</em> get to a &#8220;virtual console&#8221; by typing Alt-Ctrl F1 (You&#8217;ll have to sign on as a user on your multi-user Linux system).  Alt-Ctrl F1 through F6 will usually get you to a series of different virtual consoles, and Alt-Ctrl F7 will get you back to your GUI desktop.  I&#8217;m not prone to using the Virtual Console at all.  The quality of the character display is not as good as the quality of modern GUI-based interfaces, given the ability of computer screens to have high resolution and finely tuned fonts.  It simply looks better and works better to use the windows, even when using the command line.  There are other reasons as well.  But, it is a good idea to be familiar with the virtual console because sometimes that is all you&#8217;ve got.</p>
<p>The good news: Think of the virtual console as the Linux equivalent of the spinning smiley face on a Mac or the Blue Screen of Death on Windows.  Except you can do stuff on it.  When you have a virtual console, you have the ability to command your computer (Hey, they don&#8217;t call it the &#8220;command line&#8221; for nothing!)</p>
<p>Below is a photograph of a virtual console, running Linux.   </dd>
<div style="text-align: center;">
<img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-6558fa9d9e41948970321e7273552ea3-console.jpg?w=604" alt="i-6558fa9d9e41948970321e7273552ea3-console.jpg" data-recalc-dims="1" /></div>
<dt>Terminal Emulator (e.g. xterm)</dt>
<dd>If a &#8220;virtual console&#8221; is an actual console (and it is, trust me) then a &#8220;terminal emulator&#8221; such as &#8220;xterm&#8221; emulates a console.  (Yes, that makes it a &#8220;virtual console&#8221; but let&#8217;s not go there just now&#8230;)</p>
<p>A terminal emulator runs inside a window which, in turn, is managed by a window management system such as &#8220;x&#8221; and probably further managed by a &#8220;desktop&#8221; (like gnome or kde). Those details are unimportant.  The point is that everything that can happen inside a virtual console can also happen inside a terminal emulator, but the terminal emulator, being in a window, can be resized, moved around, etc. and otherwise be more usefully employed.  Perhaps most importantly an emulator can, if it&#8217;s a good one, be adjusted with respect to font size and appearance more easily than a virtual terminal (which may be very limited in this way). You can also cut and paste from and to emulators.</p>
<p>In the screenshot below, a number of terminals are open on a GUI desktop (gnome, in this case) all doing different, interesting things. </dd>
<p><a href="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-6b64f39e47567bd0218e4487f8c265ab-cli_apps.jpg"><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-dc3a33f3c6ba65bf390b578cd6325b13-cli_apps-thumb-500x208-56575.jpg?w=604" alt="i-dc3a33f3c6ba65bf390b578cd6325b13-cli_apps-thumb-500x208-56575.jpg" data-recalc-dims="1" /></a></p>
<dt>cli (Command Line Interface)</dt>
<dd>One would think that a &#8220;command line interface&#8221; is just the interface you get when you use a terminal.  That is sort of true, but not really. Technically, you are using a cli when you get the software to do stuff by typing at the console.  If you have a menu-driven (character based) program that allows you to use either the arrow keys on your keyboard, or in some cases, a mouse, that is not a cli because you are not tap-tap-tapping on the text part of the keyboard.</p>
<p>In <a href="http://www.youtube.com/watch?v=Hh3C0vyyttk">this clip</a>, Scotty uses a cli-like interface within a gui to make some wtf.  In German.</p>
<p>Even though many will classify a program or utility as a &#8220;cli&#8221; only if one uses exclusively keyboard commands, I would say that using the &#8220;command line&#8221; or the &#8220;console&#8221; or the &#8220;terminal&#8221; in ways that include non-pure cli methods counts as &#8220;command line&#8221; interfacing.  In fact, I would go beyond this (and we&#8217;ll come back to this below):  an application that allows and especially encourages and perhaps even requires tappity-tap to do most or all things, even if he application is presented in a gui, is close enough to cli that I include such apps in the cli/console family.  I&#8217;m speaking, of course, of a handful of programs such as S (the statistical program), certain math software, and emacs.</dd>
<dt>GUI (Graphical User Interface)</dt>
<dd>A graphical user interface is a system that facilitates the interface between user and computer using visual graphic capabilities of a computer together with a mouse (the mouse may be optional to the user but is always designed into the GUI).  Most apps are displayed in one or more windows which have standard resizing and moving capacities, and various aspects of the interface are typically controlled across the system by configu&#8230; wait, wait, hold on a second here!  Why am I explaining to you what a GUI is?  You already totally know this, let&#8217;s get on with it.</p>
<p>For now, suffice it to say that when we say &#8220;GUI&#8221; we don&#8217;t mean a menu driven cli.  Also, GUI is in all caps by tradition.  cli is not, I suppose because on the command line, we avoid upper case letters.  </dd>
<dt>GAK (Getting All Keyboardy)</dt>
<dd>GAK is a philosophy more than an interface technology.  GAK is simply the practice of avoiding the mouse and sticking to the keyboard when possible, which may involve learning and using &#8220;keybindings&#8221; that move around a cursor or do other things and it may involve using typed command input instead of menu-mouse selection methods.  There are some pieces of scientific software that just beneath the surface run on commands, and the menu is just a way of getting at the commands. In some of this software, you can expose a command prompt and use that instead of the menus.  In most software, even a web browser like Firefox, you can <a href="http://scienceblogs.com/gregladen/2009/06/how_to_be_more_keyboardy_updat.php">learn to be more keyboardy</a> and thus probably save yourself some time and impress your friends.</p>
<p>The real point of much of this discussion is not GUI vs cli, but rather, how to GAK.  Seriously. </dd>
<p><strong><em>The following definitions link the above concepts to actual applications, utilities, and stuff.</em></strong></p>
<dt>Shell Command</dt>
<dd>A shell command is a single word followed by optional parameters, switches, options, etc. that one enters at the cli in order for a thing to happen.  Shell commands are often thought of as being of certain types depending on their relationship to the kernel of the operating system, but that is really not important.  In the old days there was a handful of &#8220;system commands&#8221; or &#8220;shell commands&#8221; and an additional set of commands one would enter on the command line to get some result.  At some levels this is a meaningful distinction, but for the modern cli-savvy end user it is not.  So, I will violate the sensibilities of a lot of people when I say this, but ls, convert, cal, and screen are all shell commands.  Sorry if that offends you.  (Feel free to vent in the comments, maybe you can change my mind.)</p>
<p>A special and interesting class of shell commands are the &#8220;one liners&#8221; which are more complicated than the usual command and often involve more than one single command strung together.  Many shell commands are system maintenance related, such as: &#8220;sudo apt-get install wtf&#8221; which would install the program &#8220;wtf&#8221; on your computer after you enter your password.  Some are actual programs that are not system related but are so simple that a single command entered at the keyboard is sufficient.  For example, &#8220;wtf is wtf&#8221; is a single line that runs the program &#8220;wtf&#8221; which returns definitions for acronyms.</p>
<p>In my efforts to GAK, I&#8217;ve collected a handful of simple cli commands, and with an xterm open on one of my workspaces I can alt-ctrl-arrow key to a blank prompt at any time and find out what my Google calendar has for me today, what historical events are coming up, the definition of a word from a dictionary, an acronym, the weather conditions at the cabin or the forecast for the next few days, or how much storage space I have left on my hard drive.  </dd>
<dt>cli App</dt>
<dd>A cli application is bigger than a one line command, but does not use additional interface techniques other than the command line.  Something like the statistical package &#8216;r&#8217; or gnuplot qualifies as a cli app because there is no menu and everything is GAK-ed out to the nth degree.  </dd>
<dt>Menu Driven Console App (TUI)</dt>
<dd>Sometimes called a Text (or Terminal) User Interface, this is either a special case of a cli app or a different beast depending on how pure you want to be about what the cli is.  I consider these to be apps that use the console to present what is essentially a graphical interface that is made up of ascii codes.  Midnight Commander (mc on your console) is an example &#8230;. it is a file manager program, and in fact, is one of the first apps to get even slightly gooey and demonstrate the utility of non-linear non-command line utilities (it was originally called &#8220;Norton Commander&#8221;).  One way to think of these apps is in relation to their command line counterpart.  So, ls vs mc is one such comparison. To see the processes running on your computer, you can use ps (type &#8220;ps aux&#8221; to see a list of everything running). This shell command can be used to grep your processes with the ultimate goal, for instance, of killing them.  (Only the bad ones, of course).  But to get a more interactive form of the same information, we have &#8220;top&#8221; &#8212; if you type &#8216;top&#8217; into your console, you get an interactive character based application with a primitive menu.</p>
<p>Some menu based programs can be made to work with a mouse, some not, but that is not very GAK.</dd>
<dt>Tom Clancy Popout</dt>
<dd>This is a special case of console app or shell command.  I&#8217;ve placed an illustration below.  This is where you are going tappity-tap on the command line and this causes a graphical thingie to come flying out and appear on the screen.  Perhaps this will be a satellite image of a terrorist training camp in North Africa. The guy standing next to you says &#8220;Zoom in on that hut&#8221; and you go &#8220;tappity-tap-tap-tappity-tap&#8221; and squares appear around the hut and cause the hut to get bigger and bigger.  Then the guy standing next to you says &#8220;That&#8217;s the one&#8230;  It&#8217;s a go. GO GO GO!&#8221; and a bunch of guys jump out of helicopters and &#8230;. well, you get the point.</p>
<p>Tom Clancy popout apps are far too infrequent.  There needs to be a lot more of them.</dd>
<p>
<a href="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-ecd003fa906ba2dbc2289ee9f2e33d28-clanceymode.jpg"><img decoding="async" src="https://i0.wp.com/scienceblogs.com/gregladen/wp-content/blogs.dir/472/files/2012/04/i-63ff2fc362d80bf4256a5fcff30b841f-clanceymode-thumb-500x208-56578.jpg?w=604" alt="i-63ff2fc362d80bf4256a5fcff30b841f-clanceymode-thumb-500x208-56578.jpg" data-recalc-dims="1" /></a></p>
<dt>GUI cli-terminal-like GAKy app</dt>
<p>This is the type of application that may or may not make full use of the GUI but that uses primarily keyboard commands to operate.  Even though emacs now has a menu that can be operated by a mouse and toolbars with buttons on them, no one ever uses them, and most emacs activity is done by using the keyboard.  Think of it this way:  A person who has only ever used emacs on a &#8220;virtual console&#8221; or within an xterm can switch to the GUI version of the program and never change a thing, other than being annoyed at the screen real estate being taken up by the button bar.  There are not many apps like this, and there should be more.  Nonetheless having the definition handy is important because one of the most important apps a GAKy cli-ist is likely to use is the GUI cli-terminal-like GAKy text editor.</p>
<p>Now that we have some basic terms defined, let&#8217;s look at software that might be usefully run on the command line.</p>
<p>I. X marks the spot.</p>
<p>The first rule in using console based software on a modern Linux computer is this: Run the console in X (the windows server, along with a desktop such as Gnome or KDE or whatever), with the consoles running as an emulated terminal as opposed to a real terminal.  Real terminals are available to you from within gnome or KDE by typing Alt-Ctrl F1 through F7 or so.  Chances are your &#8220;x&#8221; (gnome, KDE) is on the console that exists at Alt-Cgrol F7.  But that is not how you should run your console programs because you lose nothing by running emulated terminals under X, and you get the following advantages:</p>
<p>1) You can adjust how it all looks a lot better than you can with actual consoles;<br />
2) You can integrate activities between programs more easily;<br />
3) There are some things you can&#8217;t do in a console, despite what certain fanatics may claim. Try browsing the web with lynx or wget for a while. You&#8217;ll be back.</p>
<p>II. Make use of desktops and other hierarchical constructs.</p>
<p>Instead of having different virtual consoles with different things going on, you can get the same effect &#8230; which, on your laptop means having a full screen console &#8230; by using multiple desktops. Most users are pretty happy with the usual default of four desktops. If you want to do a lot of cool console stuff, consider making yourself eight desktops.  This does not mean you won&#8217;t be running windows (and tabs within windows) but it will give you the opportunity to make full use of the mindblowing potential complexity available on your linux box.  Think about it.  You have:</p>
<p>1) Desktops (aka &#8220;workspaces&#8221;)<br />
1.1) Consoles or browser windows<br />
1.1.1) Tabs in browser windows, and if you have the right emulator, in consoles<br />
1.1.1.1) Screen or other methods of spawning processses within consoles.</p>
<p>Deep. Hierarchically speaking, anyway.</p>
<p>III.  Use certain console apps as X apps anyway</p>
<p>Even though you will be using console applications for many purposes, consider using emacs in X as your processor. If you use gnome, use the provided file manager simply because its integration to the system is so powerful that you will lose functionality if you don&#8217;t.  The same is probably true for KDE</p>
<p>IV.  Focus on using these apps</p>
<p>1) Despite what I say above, have at least one quick and dirty console based text editor and use it for one or two limited purposes, mainly for browsing and doing limited editing on specific, selected files. There is no real reason to do this other than that it will look cool.</p>
<p>2) Alpine or another text based email app.  Console based email apps can be annoying now and then.  GUI email apps are annoying at all times.  Be annoyed less.</p>
<p>3) Calendar and scheduling apps, including one that gives you access to Google Calendar.</p>
<p>4) A console based calculator.</p>
<p>5) The package manager for your distribution in cli form.</p>
<p>6) Image processing software such as Imagemagick.</p>
<p>Some functionality is better addressed by cli apps.  Some functionality is better addressed by GUI apps.  Other functionality is best addressed either way, depending, in which case you may find knowing both is a good idea.</p>
<p>When I look at the GUI version of Google Calendar, I become disoriented and confused by the way it is displayed, and the way it scrolls or fails to scroll.  There is an &#8220;agenda&#8221; view, but that requires messing around with views.  If I want to know what is going on over the next couple of days, I use a cli that spits out an agenda.  I can spit that out and send it to my wife in an email very easily.  Yet, when I want to make, and otherwise muck around with, appointments, the web based GUI is better.</p>
<p>I could say similar things about email and other applications as well.</p>
<p>Over the next few days I&#8217;ll be discussing various specific cli/console or GAK applications.</p>
<p>Next:  <a href="http://scienceblogs.com/gregladen/2010/10/whither_the_weather_linux_cli.php">Whither the weather? Linux CLI solutions</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2010/10/05/being-a-console-geek-in-linux/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8873</post-id>	</item>
		<item>
		<title>Running Alpine in Function Key Mode</title>
		<link>https://gregladen.com/blog/2009/10/22/running-alpine-in-function-key/</link>
					<comments>https://gregladen.com/blog/2009/10/22/running-alpine-in-function-key/#respond</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Thu, 22 Oct 2009 11:36:25 +0000</pubDate>
				<category><![CDATA[Alpine email]]></category>
		<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2009/10/22/running-alpine-in-function-key/</guid>

					<description><![CDATA[By now I assume you&#8217;ve experimented with Alpine, as a character-based email client. Well, I have another tip for you. I have been using alpine almost exclusively for a few weeks now. I switch to Evolution now and then because it is easier to gather groups of emails and move them to storage folders, etc. &#8230; <a href="https://gregladen.com/blog/2009/10/22/running-alpine-in-function-key/" class="more-link">Continue reading <span class="screen-reader-text">Running Alpine in Function Key Mode</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>By now I assume you&#8217;ve experimented with Alpine, as a character-based email client.  Well, I have another tip for you.<br />
<span id="more-6777"></span><br />
I have been using alpine almost exclusively for a few weeks now.  I switch to Evolution now and then because it is easier to gather groups of emails and move them to storage folders, etc. in a fully GUI program, but for the most part, if you have been communicating with me via email at all over the last few weeks, you have to imagine me on this end looking at a terminal window, using a character based program, mouse-free, typing rather than clicking.</p>
<p><a href="http://scienceblogs.com/gregladen/alpine_email/">I&#8217;ve provided a few technical tips and tricks for alpine,</a> and here&#8217;s another one.  In Linux, if you startup alpine like this:</p>
<p><code>alpine -k</code></p>
<p>you get the function key version.  This replaces the control keys with function keys, and the help system reflects this change very nicely.  I&#8217;m going to consider using it on my desktop in the Blog Cave, because that has an Avant Stellar keyboard with a set of function keys on the left side.  I&#8217;m currently using these keys for something else (well, some of them) but I can play around with the old wordperfect model of having a truly extended almost-touch typing keyboard and see how that goes.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2009/10/22/running-alpine-in-function-key/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6777</post-id>	</item>
		<item>
		<title>Do you want the alpine email client to remember your passwords?</title>
		<link>https://gregladen.com/blog/2009/10/08/do-you-want-the-alpine-email-c/</link>
					<comments>https://gregladen.com/blog/2009/10/08/do-you-want-the-alpine-email-c/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 12:25:53 +0000</pubDate>
				<category><![CDATA[Alpine email]]></category>
		<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2009/10/08/do-you-want-the-alpine-email-c/</guid>

					<description><![CDATA[By default, the text-based email client &#8216;alpine&#8217; requests a password the first time, per session, that it is requested a password from any email services it checks. For the duration of that session, it remembers the password, but forgets it if you quit alpine so you have to enter it again later. From a security &#8230; <a href="https://gregladen.com/blog/2009/10/08/do-you-want-the-alpine-email-c/" class="more-link">Continue reading <span class="screen-reader-text">Do you want the alpine email client to remember your passwords?</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>By default, the text-based email client &#8216;alpine&#8217; requests a password the first time, per session, that it is requested a password from any email services it checks.  For the duration of that session, it remembers the password, but forgets it if you quit alpine so you have to enter it again later. From a security point of view, that is probably a good thing, but most people do like to have their email client remember the password between sessions.<br />
<span id="more-6610"></span><br />
The way this works in alpine seems a little obscure at first, but actually makes a lot of sense.  Alpine checks for a file in which passwords should be stored, and if it is there, it behaves differently.</p>
<p>If the file exists, and alpine is asked for a password, then it checks that file for the password. If it is not there it asks you for the password, and then, after you&#8217;ve entered it, alpine asks you if you want to save that password in the file.  If you say yes, then you are in business.</p>
<p>This has two important implications for you.  One:  If you want alpine to remember passwords, just create the file and it will happen.  Two: If you have trouble at some later time with some kind of operation and you think that the part about asking for the password is screwing you up, delete the file and restart the program (you&#8217;ll have to know the password, of course, for when you are prompted for it later).</p>
<p>How do you create the file?  Using the bash command &#8216;touch&#8217; should do.  But what file do you need to create?  Well, that depends.  The file alpine uses is determined at compile time.  At present, it seems that the current version of alpine is using a file called &#8216;.pine-passfile&#8217; (note the dot at the beginning of the file &#8230; this is a hidden file) and this file should be in your home directory.</p>
<p>So, to make this work:</p>
<p>1) Quit alpine</p>
<p>2) In a termnial, type:</p>
<p><code>touch .pine-passfile</code></p>
<p>3) Restart alpine, check for email and send email, and when asked for a password, enter it and respond &#8220;yes&#8221; to the prompt asking you if you want to save the password.</p>
<p>4) Give your mouse a little piece of cheese so it does not feel lonely.</p>
<p>For more information about alpine <STRONG><a href="http://scienceblogs.com/gregladen/alpine_email/">click here</a></STRONG>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2009/10/08/do-you-want-the-alpine-email-c/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6610</post-id>	</item>
		<item>
		<title>alpine email software: the better way to opening links</title>
		<link>https://gregladen.com/blog/2009/10/05/alpine-email-software-the-bett/</link>
					<comments>https://gregladen.com/blog/2009/10/05/alpine-email-software-the-bett/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Mon, 05 Oct 2009 15:52:40 +0000</pubDate>
				<category><![CDATA[alpine]]></category>
		<category><![CDATA[Alpine email]]></category>
		<category><![CDATA[command line interface]]></category>
		<category><![CDATA[email client]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2009/10/05/alpine-email-software-the-bett/</guid>

					<description><![CDATA[For today&#8217;s Linux Hint: How to pick which browser will open when you pick a link while using apine in Ubuntu. Sometimes there is a URL in an email that you want to visit. In a GUI email brower, you click on it with the mouse. In apine you navigate to the link with the &#8230; <a href="https://gregladen.com/blog/2009/10/05/alpine-email-software-the-bett/" class="more-link">Continue reading <span class="screen-reader-text">alpine email software: the better way to opening links</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>For today&#8217;s Linux Hint:  How to pick which browser will open when you pick a link while using apine in Ubuntu.<br />
<span id="more-6605"></span><br />
Sometimes there is a URL in an email that you want to visit.  In a GUI email brower, you click on it with the mouse.  In apine you navigate to the link with the usual navigation keys (but the first link will already be selected for you) and hit enter to open the link.</p>
<p>The default that alpine comes with, at least on my machine, seems to be the Epiphany browser  I have no idea why.  And when it goes there, it opens the browser and freezes the alpine screen, so I have to close the browser to go back to the email.</p>
<p>How quaint.</p>
<p>What I want it to do, of course is to open a tab in the most recently touched instance of Firefox, and not freeze the browser.  This way I can navigate quickly through the links and open the ones I want to see as rapidly and efficiently as possible, each in a new tab.</p>
<p>To make this work, you need to do two things.  First, navigate to the option for url-viewer in alpine. Second, enter the full path to the firefox browser.  You can&#8217;t just enter &#8220;firefox&#8221; because &#8230; well, it won&#8217;t work for some reason that escapes me.</p>
<p>Navigate to the url-path by starting at the main menu, going to setup [S], then Configure [C], then ctrl-W to search and put in &#8216;url-v&#8217; as the shortest string that will get you where you are going right away.</p>
<p>Then hit enter, and type in:</p>
<p>/usr/bin/firefox</p>
<p>Then reach over to your mouse and give it a little pet so it does not feel lonely, then hit enter and accept the value, Exit setup [E], confirm exit [Y] and go back to reading your email.</p>
<p>So, in short,</p>
<p>MSC ctrl-W url-v[ENTER]/usr/bin/firefox[ENTER]EY</p>
<p>(the MSCWE and Y need not be in upper case, it is just convention to show them that way)</p>
<p>Now, url&#8217;s will open in firefox, in the last used window, in a new tab.</p>
<p>Now, if you are more of a geek today than you were yesterday, you&#8217;d set your URL reader to lynx.  If you do that, Lynx will open as a process in the same terminal window alpine is using (though this behavor can be altered by entering switches in the url-viewer option section, most likely) so you will need to quit [Q] lynx to get back to alpine.  Try it, it&#8217;s a trip.  Lynx is a bitch.</p>
<p>How, if tomorrow you find yourself waking up as even more of a geek than you did today, use a shell script using wget and some perl one liners to convert the url contents into a well behaved text file that you then process using sed.</p>
<p>Tame Teh Internet!</p>
<p>For more information about alpine <STRONG><a href="http://scienceblogs.com/gregladen/alpine_email/">click here</a></STRONG>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2009/10/05/alpine-email-software-the-bett/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6605</post-id>	</item>
		<item>
		<title>How to get alpine to spell check your email</title>
		<link>https://gregladen.com/blog/2009/10/04/how-to-get-alpine-to-spell-che/</link>
					<comments>https://gregladen.com/blog/2009/10/04/how-to-get-alpine-to-spell-che/#comments</comments>
		
		<dc:creator><![CDATA[Greg Laden]]></dc:creator>
		<pubDate>Sun, 04 Oct 2009 00:24:59 +0000</pubDate>
				<category><![CDATA[Alpine email]]></category>
		<category><![CDATA[command line interface]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://scienceblogs.com/gregladen/2009/10/04/how-to-get-alpine-to-spell-che/</guid>

					<description><![CDATA[If you are using alpine as your email client, you may find that hitting ctrl-T to invoke a spell checker does not work, in alpine 1.0 as installed in Ubuntu. It is easy to fix. I looked around for the answer to this question, but it is a bit esoteric so there is very little, &#8230; <a href="https://gregladen.com/blog/2009/10/04/how-to-get-alpine-to-spell-che/" class="more-link">Continue reading <span class="screen-reader-text">How to get alpine to spell check your email</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>If you are using alpine as your email client, you may find that hitting ctrl-T to invoke a spell checker does not work, in alpine 1.0 as installed in Ubuntu.  It is easy to fix.<br />
<span id="more-27256"></span><br />
I looked around for the answer to this question, but it is a bit esoteric so there is very little, and what there is stands mainly as examples of the down side of community support.  People state that the spell checker is not working, and others answer with various bits of advice that do not work at all because they are nothing other than vague guesses that do not address the problem.</p>
<p>It is possible, even probable, that other distros install alpine in a manner that functions correctly, and this may be a bug in the Ubuntu distribution, but I&#8217;m not sure.  In any event, this is what you can try to fix it:</p>
<p>From within alpine, be at or go to the main menue</p>
<p>go to setup (S)<br />
go to configure (C)</p>
<p>search for &#8220;spell&#8221; using ctrl-W (hit ctrol-w then type in &#8220;spell&#8221; without the quotes and hit enter)</p>
<p>You will arrive at the option &#8220;Spell Check Before Sending&#8221; &#8230; check that if you like, up to you.</p>
<p>Hit ctrl-W again and accept the default (&#8220;spell&#8221;)</p>
<p>You should now be at the option &#8220;Speller&#8221; which probably has no value set.</p>
<p>Hit enter to allow entry of a value, and type in:</p>
<p>aspell -c</p>
<p>This assumes you have aspell installed, which, if yo ure using Ubuntu you do.  Note that the tricky part here is the &#8216;-c&#8217; option.  This causes alpine to invoke aspell in the &#8220;check spelling&#8221; mode.</p>
<p>If that does not work, complain in the comments below and someone will figure it out for you.  Maybe.</p>
<p>For more information about alpine <STRONG><a href="http://scienceblogs.com/gregladen/alpine_email/">click here</a></STRONG>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gregladen.com/blog/2009/10/04/how-to-get-alpine-to-spell-che/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">27256</post-id>	</item>
	</channel>
</rss>
