<?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/"
	>

<channel>
	<title>Digital Combine</title>
	<atom:link href="https://www.digitalcombine.ca/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.digitalcombine.ca</link>
	<description></description>
	<lastBuildDate>Wed, 12 Jan 2022 03:04:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.digitalcombine.ca/wp-content/uploads/2019/11/cropped-Site-Logo-3-32x32.png</url>
	<title>Digital Combine</title>
	<link>https://www.digitalcombine.ca</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Updates to Cutlet</title>
		<link>https://www.digitalcombine.ca/2022/01/11/updates-to-cutlet/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Tue, 11 Jan 2022 02:02:00 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[cutlet]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[software]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=762</guid>

					<description><![CDATA[There&#8217;s been a number of new commits that have been pushed on the development branch. It has been some time since I&#8217;ve worked on this project so it&#8217;s most definitely time to get back onto it. One area that is seriously lacking is documentation but getting this up to date opened an unexpected can of… <span class="read-more"><a href="https://www.digitalcombine.ca/2022/01/11/updates-to-cutlet/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p> There&#8217;s been a number of new commits that have been pushed on the development branch. It has been some time since I&#8217;ve worked on this project so it&#8217;s most definitely time to get back onto it. One area that is seriously lacking is documentation but getting this up to date opened an unexpected can of worms&#x2026; </p>
<p> As I started documenting all the APIs and libraries, finalizing what they are to become, I also started updating the test suites to make sure everything worked as advertised. I expected to find a few bugs here and there but got way more than I expected. Even the test framework was broken. So two major parts had to get reworked. </p>
<p> First and the most extensive, was the stack frames. These were initially developed in an adhoc way, especially the block frame. Things were quite messy. All the classes got cleaned up, simplified and now seem to be quite solid. </p>
<p> Secondly the memory management was made thread safe. This has taken a couple of tries and is now passing all the existing tests. </p>
<p> There&#8217;s still a lot of work to do. The core should be solid enough now to get it documented and finalize the API. </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Local Chat 1.6.2 Released</title>
		<link>https://www.digitalcombine.ca/2021/11/12/local-chat-1-6-2-released/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Fri, 12 Nov 2021 14:21:00 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[localchat]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=757</guid>

					<description><![CDATA[This was supposed to be the announcement for the 1.6 release but unfortunately as soon as it was released a nasty bug that only allowed one user to connect reared its ugly head. So a couple of hot-fix minor releases came out quickly afterwards. The 1.6 release is mostly feature updates to the lchat client.… <span class="read-more"><a href="https://www.digitalcombine.ca/2021/11/12/local-chat-1-6-2-released/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p> This was supposed to be the announcement for the 1.6 release but unfortunately as soon as it was released a nasty bug that only allowed one user to connect reared its ugly head. So a couple of hot-fix minor releases came out quickly afterwards. </p>
<p> The 1.6 release is mostly feature updates to the lchat client. These features include: </p>
<ul class="org-ul">
<li>Multi-threaded client. This removes and reduces polling between the server socket and keyboard input making the interface more responsive.</li>
<li>An internal chat history buffer. The Control-P key binding switches the input to history mode allowing the user to scroll through previously sent messages.</li>
<li>Basic auto-completion. While typing a message hitting the TAB key will attempt to complete what it can or give a suggestion for completion if it can&#8217;t find a unique value.</li>
</ul>
<p> So how did this bug slip through. With this being a simple project I had to make things more difficult for myself. The socket implementation is done as a C++ stream buffer allowing C++ streams to be used for communications. This has been a big learning lesson of the short comings of the stream API in C++. It can be made to work but jumping through a number of hoops. </p>
<p> With these lessons learned am I going to rewrite the socket interface? Na. My next mission is to get a test suite going for this project. Because it&#8217;s such a simple project and awkward to test I didn&#8217;t really think it was needed. With this last bug it shows testing is always a good idea. </p>
<p> The home page for the project can be found <a href="https://www.digitalcombine.ca/projects/local-chat/">here</a>. </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Local Chat 1.5.5 Released</title>
		<link>https://www.digitalcombine.ca/2021/05/26/local-chat-1-5-5-released/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Wed, 26 May 2021 12:56:43 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=738</guid>

					<description><![CDATA[I&#8217;ve been doing a lot of clean up behind the scenes and got behind on several things. I never got around to announcing a proper release for 1.5.4 and now I&#8217;m releasing 1.5.5. There&#8217;s not a lot to note with these releases with the exception that CTRL-R now manually redraws the chat client. This should… <span class="read-more"><a href="https://www.digitalcombine.ca/2021/05/26/local-chat-1-5-5-released/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p>
I&#8217;ve been doing a lot of clean up behind the scenes and got behind on several things. I never got around to announcing a proper release for 1.5.4 and now I&#8217;m releasing 1.5.5. There&#8217;s not a lot to note with these releases with the exception that <code>CTRL-R</code> now manually redraws the chat client.
</p>
<p>
This should also be the last of the 1.5 version releases. Development has started on the new features for version 1.6.
</p>
<p>
There&#8217;s also been a couple small changes with the Debian repositories. I definitely wanted to support all actively supported distributions which is currently <b>Debian 9</b> <i>(Stretch)</i> and <b>Debian 10</b> <i>(Buster)</i>. To support this different distributions the URLs needed to be changed slightly. Although doing this isn&#8217;t ideal, it will make it easier to support other Debian based distributions in the future if we choose to.
</p>
<div class="org-src-container">
<pre class="src src-shell"><span class="org-comment-delimiter"># </span><span class="org-comment">Download and install the public key to verify deb packages.</span>
sudo apt-key adv --keyserver keys.openpgp.org <span class="org-sh-escaped-newline">\</span>
  --recv-keys 7B86848C194CE861

<span class="org-comment-delimiter"># </span><span class="org-comment">As root add the repository to apt.</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">For Debian 9 (Stretch)</span>
<span class="org-builtin">echo</span> <span class="org-string">"deb https://apt.digitalcombine.ca/stretch stretch main"</span> &gt; <span class="org-sh-escaped-newline">\</span>
  /etc/apt/sources.list.d/digitalcombine.list
<span class="org-comment-delimiter"># </span><span class="org-comment">For Debian 10 (Buster)</span>
<span class="org-builtin">echo</span> <span class="org-string">"deb https://apt.digitalcombine.ca/buster buster main"</span> &gt; <span class="org-sh-escaped-newline">\</span>
  /etc/apt/sources.list.d/digitalcombine.list

chmod 0644 /etc/apt/sources.list.d/digitalcombine.list

<span class="org-comment-delimiter"># </span><span class="org-comment">Update apt!</span>
sudo apt update
sudo apt install lchat
</pre>
</div>
<p>
Also, as an update, support for FreeBSD package repositories is being developed. Everything is in place with the exception of signing the repository. There&#8217;s still some testing that&#8217;s need here and hopefully will be done sooner than later.
</p>
<p>
The home page for the project can be found <a href="https://www.digitalcombine.ca/projects/local-chat/">here</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Local Chat 1.5.3 Released</title>
		<link>https://www.digitalcombine.ca/2021/02/27/local-chat-1-5-3-released/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Sat, 27 Feb 2021 17:57:14 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=726</guid>

					<description><![CDATA[Local chat 1.5.3 is another bug release. When a client disconnected unexpectedly it caused the lchat daemon to run away using a large amount of the CPU. Now when a client disconnects suddenly it is properly detected and the connection cleaned up as expected. Also with this release there is now a Debian repository available… <span class="read-more"><a href="https://www.digitalcombine.ca/2021/02/27/local-chat-1-5-3-released/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p>
Local chat 1.5.3 is another bug release.
</p>
<p>
When a client disconnected unexpectedly it caused the lchat daemon to run away<br />
using a large amount of the CPU. Now when a client disconnects suddenly it is<br />
properly detected and the connection cleaned up as expected.
</p>
<p>
Also with this release there is now a Debian repository available to simplify<br />
installation and keeping the software up to date. To make use of the repository<br />
it just needs to be added to the apt sources list as follows.
</p>
<div class="org-src-container">
<pre class="src src-shell"><span class="org-comment-delimiter"># </span><span class="org-comment">Download and install the public key to verify deb packages.</span>
sudo apt-key adv --keyserver keys.openpgp.org <span class="org-sh-escaped-newline">\</span>
  --recv-keys 7B86848C194CE861

<span class="org-comment-delimiter"># </span><span class="org-comment">As root add the repository to apt.</span>
<span class="org-builtin">echo</span> <span class="org-string">"deb https://apt.digitalcombine.ca/debian buster main"</span> &gt; <span class="org-sh-escaped-newline">\</span>
  /etc/apt/sources.list.d/digitalcombine.list
chmod 0644 /etc/apt/sources.list.d/digitalcombine.list

<span class="org-comment-delimiter"># </span><span class="org-comment">Update apt!</span>
sudo apt update
sudo apt install lchat
</pre>
</div>
<p>
Note, currently only Debian Buster is supported in the repositories. Other<br />
Debian versions may be supported in the future if there&#8217;s a demand for it.
</p>
<p>
We&#8217;re also working on creating a FreeBSD repository in the near future. So keep<br />
an eyes open for that!
</p>
<p>
The home page for the project can be found <a href="https://www.digitalcombine.ca/projects/local-chat/">here</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Quiet but Busy</title>
		<link>https://www.digitalcombine.ca/2020/08/17/quiet-but-busy/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Mon, 17 Aug 2020 02:19:10 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=714</guid>

					<description><![CDATA[It has been some time since I&#8217;ve posted anything to the site but I have been busy behind the scenes. A new bug release, 1.5.2, for lchat is now available. This release is fairly significant in the terms of the project. First a couple small bugs turned out to be pretty substantial so a lot… <span class="read-more"><a href="https://www.digitalcombine.ca/2020/08/17/quiet-but-busy/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p>
It has been some time since I&#8217;ve posted anything to the site but I have been busy behind the scenes.
</p>
<p>
A new bug release, 1.5.2, for <a href="https://www.digitalcombine.ca/projects/local-chat/">lchat</a> is now available. This release is fairly significant in the terms of the project. First a couple small bugs turned out to be pretty substantial so a lot of code got re-iterated. Also <code>make distcheck</code> revealed plenty of Automake build problems which also illuminated some Debian package build problems as well. After 3 weeks of tackling all this in my spare time, we now have the new release.
</p>
<p>
After contributing a couple minor fixes to the <a href="https://metasploit.com/">metasploit</a> project, it gave me some invaluable experience utilizing many of <a href="https://github.com/">github&#8217;s</a> tools. <a href="https://www.digitalcombine.ca/projects/local-chat/">lchat</a>, my simplest project, is pretty much all set up to make use of these tools. The other projects will follow as time permits.
</p>
<p>
Some time ago, a member of the <a href="http://www.losurs.org/">LOSURS Linux Users Group</a> asked if I was going to create an apt repository for the software I&#8217;ve been working on. When I initially looked into this, it all seemed incredibly involved and tedious and was more work than I was willing to put into it. I&#8217;m not sure what I had found that first time around but did revisit it and discovered the <a href="https://wiki.debian.org/DebianRepository/SetupWithReprepro">reprepro</a> software. This has made the whole Debian repository creation pretty simple and that is what I have done.
</p>
<p>
The new apt repository is only for Debian buster at the moment but should be fine to use for derived systems like <a href="https://ubuntu.com/">Ubuntu</a> and <a href="https://www.linuxmint.com/">Linux Mint</a>.
</p>
<div class="org-src-container">
<pre class="src src-shell"><span class="org-comment-delimiter"># </span><span class="org-comment">Download and install the public key to verify deb packages.</span>
sudo apt-key adv --keyserver keys.openpgp.org --recv-keys 7B86848C194CE861

<span class="org-comment-delimiter"># </span><span class="org-comment">As root add the repository to apt.</span>
<span class="org-builtin">echo</span> <span class="org-string">"deb https://apt.digitalcombine.ca/debian buster main"</span> &gt; <span class="org-sh-escaped-newline">\</span>
  /etc/apt/sources.list.d/digitalcombine.list
chmod 0644 /etc/apt/sources.list.d/digitalcombine.list

<span class="org-comment-delimiter"># </span><span class="org-comment">Update apt!</span>
sudo apt update
</pre>
</div>
<p>
The project pages should be updated in the near future to reflex all the changes made.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Local Chat 1.5.1 Released</title>
		<link>https://www.digitalcombine.ca/2020/04/26/local-chat-1-5-1-released/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Sun, 26 Apr 2020 20:52:42 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[local chat]]></category>
		<category><![CDATA[software]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=705</guid>

					<description><![CDATA[This is a bug fix release Fixed new messages being dropped when scroll buffer is full. Updated documentation about badly behaving bot that don&#8217;t read their input. The home page for the project can be found here.]]></description>
										<content:encoded><![CDATA[<p>
This is a bug fix release
</p>
<ul class="org-ul">
<li>Fixed new messages being dropped when scroll buffer is full.</li>
<li>Updated documentation about badly behaving bot that don&#8217;t read their input.</li>
</ul>
<p>
The home page for the project can be found <a href="https://www.digitalcombine.ca/projects/local-chat/">here</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Command Line Shells</title>
		<link>https://www.digitalcombine.ca/2020/04/18/command-line-shells/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Sat, 18 Apr 2020 15:12:38 +0000</pubDate>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[The Command Line]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=675</guid>

					<description><![CDATA[If you&#8217;re just joining us, this is the forth article is a series of introductory articles to the command line. We are continuing from the article &#8220;Command Line Terminals&#8221;. We&#8217;ve gone over a lot to get here. Now we&#8217;re going to look at the heart of it all, the command line shell. The shell is… <span class="read-more"><a href="https://www.digitalcombine.ca/2020/04/18/command-line-shells/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p class="flj">
If you&#8217;re just joining us, this is the forth article is a series of introductory articles to the command line. We are continuing from the article <a href="https://www.digitalcombine.ca/2019/12/19/command-line-terminals/">&#8220;Command Line Terminals&#8221;</a>.
</p>
<p class="flj">
We&#8217;ve gone over a lot to get here. Now we&#8217;re going to look at the heart of it all, the command line shell. The shell is the work horse of it all. It&#8217;s an interactive terminal/text based program that lets you type in commands instructing the computer what to do. On many Unix based systems there isn&#8217;t a single shell but usually a few to choose from. On Linux systems, <code>bash</code> is usually the default one, the one we&#8217;ll be focusing on. Other shells include zsh, tcsh, fish and korn.
</p>
<div id="outline-container-orgd346e5c" class="outline-2">
<h2 id="orgd346e5c">Features</h2>
<div class="outline-text-2" id="text-orgd346e5c">
<p class="flj">
Shells were originally created with the invention of Unix all the way back to the early 1970&#8217;s. Over the years, these shells have continually evolved with the technology and the needs of the users.
</p>
<p class="flj">
The first and most obvious feature is the command prompt. Although it&#8217;s a very simple interface for entering commands, it can be customized with a lot of advanced features to make working from it very productive.
</p>
<p class="flj">
An important feature is environment variables. These variables are used for customization, configuration and processing information. For example the PATH environment variable contains a list of directory paths the shell uses to find the commands from. Also the prompt, language, default editor and default pager are come of the settings found in the environment variables.
</p>
<p class="flj">
Each shell also have several builtin commands that add a lot of functionality and further configurable options. This includes multitasking and job management as well as IO redirection and piping.
</p>
<p class="flj">
Although the command prompt looks very simple most shells include a lot of advanced editing features. This includes cut, copy, paste, inserting, deleting and auto completion. Auto completion makes the TAB key absolutely magical.
</p>
<p class="flj">
Every command is saved in a history file that is searchable and commands can be recalled in many ways. The history can be used interactively and through builtin commands its behaviour tailored.
</p>
<p class="flj">
Commands can get quite complicated and hard to remember. To make this situation easier, commands can be saved into a text file known as a shell script. A shell script can be run as a command itself and is an incredibly powerful way to automate tasks.
</p>
</div>
</div>
<div id="outline-container-orgbddf29a" class="outline-2">
<h2 id="orgbddf29a">Putting the Shell to Work</h2>
<div class="outline-text-2" id="text-orgbddf29a">
<p class="flj">
The entire Unix operating system is based on the idea of it being a toolbox. Where a program does one thing, does is well and works with other programs. This toolbox approach doesn&#8217;t make any assumption on how the technology will be used but rather offers a great amount of flexibility with how it can be used. The simplicity of the text interface makes it very light weight and is one of the best compromises between the computer and the user. This interface allows programs be simple and lean and allows the user to truly harness the capabilities of the computer.
</p>
<p class="flj">
Now that we have all the pieces, with in the next articles, we can start looking at putting all of this to work.
</p>
</div>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Local Chat 1.5 Released</title>
		<link>https://www.digitalcombine.ca/2020/04/18/local-chat-1-5-released/</link>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Sat, 18 Apr 2020 00:31:11 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=668</guid>

					<description><![CDATA[This release is a more polished version of the software. The lchat client has been given a new status bar. The auto scroll feature can be turned on and off with the CTRL-A key combination. Also the text input has been improved by implementing the delete key and the insert key now toggles the input… <span class="read-more"><a href="https://www.digitalcombine.ca/2020/04/18/local-chat-1-5-released/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p class="flj">
This release is a more polished version of the software.
</p>
<p class="flj">
The <b>lchat</b> client has been given a new status bar. The auto scroll feature can be turned on and off with the <i>CTRL-A</i> key combination. Also the text input has been improved by implementing the <i>delete key</i> and the <i>insert key</i> now toggles the input between insert and overwrite modes.
</p>
<p class="flj">
The <b>lchatd</b> daemon no longer sends <i>joined/left</i> messages if a user already has a connection to the server. This cleans up server messages in the chat window when scripts post messages to the chat.
</p>
<p class="flj">
There also has been a major feature change with private messages. Normally this wouldn&#8217;t happen with a minor release, but the private messaging system was problematic and at this early stage of the software life it didn&#8217;t warrant a major version bump. Private messages are now sent with server side commands <code>/msg</code>, <code>/priv</code> or <code>/query</code> instead of with the <code>user: message</code> format.
</p>
<p class="flj">
Even the man pages have been updated and improved.
</p>
<p class="flj">
The home page for the project can be found <a href="https://www.digitalcombine.ca/projects/local-chat/">here</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Vi vs Emacs</title>
		<link>https://www.digitalcombine.ca/2020/04/09/vi-vs-emacs/</link>
					<comments>https://www.digitalcombine.ca/2020/04/09/vi-vs-emacs/#comments</comments>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Thu, 09 Apr 2020 18:40:20 +0000</pubDate>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[vi]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=639</guid>

					<description><![CDATA[If you have ever been on the internet at all there is no doubt you&#8217;ve come across this flame war at some point. The debate of which is the better Unix text editor, Vi or Emacs. Both of these programs are just about as old as Unix itself and neither is easy to use for… <span class="read-more"><a href="https://www.digitalcombine.ca/2020/04/09/vi-vs-emacs/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p class="flj">
If you have ever been on the internet at all there is no doubt you&#8217;ve come across this flame war at some point. The debate of which is the better Unix text editor, <a href="https://www.vim.org/">Vi</a> or <a href="https://www.gnu.org/software/emacs/">Emacs</a>. Both of these programs are just about as old as Unix itself and neither is easy to use for beginners. With that said, both are very powerful and are good at what they do as a testament to their longevity.
</p>
<p class="flj">
The <a href="https://www.vim.org/">Vi</a> editor is installed by default on just about every Unix based system and <a href="https://www.gnu.org/software/emacs/">Emacs</a> is almost always made available as well. One thing both editor have in common is how they have polarized their users. The editors take some investment to learn. It&#8217;s understandable how users would stick to one editor or the other and are not keen to invest in both. Although both are text editors, they are very different so I&#8217;m going to go over each editor to bring some perspective to this debate.
</p>
<div id="outline-container-orgb080091" class="outline-2">
<h2 id="orgb080091"><a href="https://www.vim.org/">Vi</a> &#8211; The Visual Editor</h2>
<div class="outline-text-2" id="text-orgb080091">
<p class="alignleft wp-image-433">
<img decoding="async" src="https://www.digitalcombine.ca/wp-content/uploads/2020/04/vim_editor.png" alt="vim_editor.png" class="alignleft wp-image-433" /> For the uninitiated, <a href="https://www.vim.org/">Vi</a> is an un-intuitive nightmare that makes no sense at all. When you open a new or empty file with the default <a href="https://www.vim.org/">Vi</a> on FreeBSD you get an almost blank console. If you just start typing all hell breaks loose. Despite all this, it has been and still is a default editor on just about every Unix based system out there.
</p>
<p class="flj">
To get an understanding how <a href="https://www.vim.org/">Vi</a> works you first have to understand it has several modes. The initial mode is the <code>COMMAND</code> mode. This is where the keys you type execute various commands instead of inserting characters into the document, for example; <code>x</code> &#8211; deletes a character, <code>j</code> &#8211; move down a line, <code>:w</code> &#8211; write to the file and <code>:q</code> &#8211; quit the editor. The &#8216;i&#8217; key will switch to the <code>INSERT</code> mode where now you can type characters into the document as you expected in the first place. The <code>ESC</code> key will switch you back to <code>COMMAND</code> mode.
</p>
<p class="flj">
The power <a href="https://www.vim.org/">Vi</a> is the ability for commands to be combined together to make editing easy with very few key strokes. It&#8217;s light weight with one purpose in mind, editing a file. Only in its relative recent history, can you open and edit more than file at a time.
</p>
</div>
</div>
<div id="outline-container-org193287a" class="outline-2">
<h2 id="org193287a"><a href="https://www.gnu.org/software/emacs/">Emacs</a> &#8211; Editing Macros</h2>
<div class="outline-text-2" id="text-org193287a">
<p class="alignleft wp-image-433">
<img decoding="async" src="https://www.digitalcombine.ca/wp-content/uploads/2020/04/Emacs-logo.png" alt="Emacs-logo.png" class="alignleft wp-image-433" /> The <a href="https://www.gnu.org/software/emacs/">Emacs</a> editor, also cheekily known as the Escape-Alt-Meta-Control Sequence editor, shouldn&#8217;t be considered just a text editor. Although this is the main purpose of the program, it&#8217;s more along the lines of a <a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)">lisp</a> interpreter with a text editor as a front end. Most people think of this the other way around, a text editor extended by <a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)">lisp</a>, and  this is wrong in my opinion. Just about every key you type executes a <a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)">lisp</a> command that can be reassigned. This means emacs can be used for so much more than just editing files. Actually it can do just about anything, email, games, terminal, debugging and so much more.
</p>
<p class="flj">
<a href="https://www.gnu.org/software/emacs/">Emacs</a> is the clear winner, right? Well it&#8217;s not so simple, with features comes software bloat and when you start using all these features <a href="https://www.gnu.org/software/emacs/">Emacs</a> becomes quite a heavy weight. It&#8217;s takes some experience be able to use its features and keep the startup times down and running fairly lean. Not to mention how much there is to learn. After 20 years of using <a href="https://www.gnu.org/software/emacs/">Emacs</a>, I&#8217;m still learning about all the features it has to offer.
</p>
</div>
</div>
<div id="outline-container-orgb925b4b" class="outline-2">
<h2 id="orgb925b4b">So Who&#8217;s Winning the Editor War?</h2>
<div class="outline-text-2" id="text-orgb925b4b">
<p class="flj">
So who&#8217;s winning&#x2026; neither editor! It&#8217;s like comparing apples with oranges. Although they are both technically text editors that&#8217;s where the similarities end. They both function very differently with different project goals in mind. If you had to decide which one to learn it all depends on your needs and both are worth learning.
</p>
<p class="flj">
Stay away from the flame wars. If someone tells you that one editor is flat out better than the other, they are wrong. If someone tells you never to use one of the editors, they are wrong. I wouldn&#8217;t trust the opinion of anyone that trashes on one or the other. Listen to the pro and cons for each editor. As mentioned before, ultimately which is the best choice for you is up to you and your needs.
</p>
<p class="flj">
For myself, I use Emacs for everything. All the articles and pages on this website are written in Emacs using org-mode. I also use it to check emails, programming, watch my system logs, task lists and so on. It can be a complete desktop in itself. I do use Vi usually for editing system configuration files and simple edits.
</p>
<p class="flj">
There are also several projects that are attempting to solve this debate by creating their own console text editors. So Vi and Emacs aren&#8217;t your only options. In the end, live in peace and you do you&#x2026; or is that just to cheesy 😉
</p>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalcombine.ca/2020/04/09/vi-vs-emacs/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Command Line Terminals</title>
		<link>https://www.digitalcombine.ca/2019/12/19/command-line-terminals/</link>
					<comments>https://www.digitalcombine.ca/2019/12/19/command-line-terminals/#comments</comments>
		
		<dc:creator><![CDATA[Ron Wills]]></dc:creator>
		<pubDate>Thu, 19 Dec 2019 01:46:02 +0000</pubDate>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[The Command Line]]></category>
		<guid isPermaLink="false">https://www.digitalcombine.ca/?p=615</guid>

					<description><![CDATA[If you&#8217;re just joining us, this is the third article is a series of introductory articles to the command line. We are continuing from the article &#8220;Command Line TTY Devices&#8221;. Before we get to the shell, we&#8217;re going to have a quick look at the terminal. The terminal itself is nothing more than a user… <span class="read-more"><a href="https://www.digitalcombine.ca/2019/12/19/command-line-terminals/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[<p class="flj">
If you&#8217;re just joining us, this is the third article is a series of introductory articles to the command line. We are continuing from the article <a href="https://www.digitalcombine.ca/2019/03/16/the-command-line/">&#8220;Command Line TTY Devices&#8221;</a>.
</p>
<p class="flj">
Before we get to the shell, we&#8217;re going to have a quick look at the terminal. The terminal itself is nothing more than a user interface. On its own it doesn&#8217;t really do much of anything. Terminals always setup a TTY device and usually starts a shell, although other software can be used. They can also come in various forms like terminal multiplexers <code>tmux</code> and <code>screen</code>. For now we&#8217;re just going to look at what makes up a terminal interface.
</p>
<div id="outline-container-orgb792bfd" class="outline-2">
<h2 id="orgb792bfd">Binary and Text Data</h2>
<div class="outline-text-2" id="text-orgb792bfd">
<p class="flj">
To understand the terminal interface, we&#8217;re going to take a quick look at how data is represented by computers internally. Everyone knows computers work in 1&#8217;s and 0&#8217;s also know as binary<sup><a id="fnr.1" class="footref" href="#fn.1">1</a></sup>. Lets briefly review how this is done.
</p>
<p class="flj">
When we count we do so in a numbering system called base 10. Base 10 means we have 10 digits in our numbering system 0-9. When we get to the number 9 another digit is added to get the next number 10. It works the same way with binary also known as base 2. There are 2 digits 0-1 and after 1 we add digits just like base 10.
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col  class="org-left" />
<col  class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Base 10</th>
<th scope="col" class="org-left">Base 2</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">0<sub>10</sub></td>
<td class="org-left">0<sub>2</sub></td>
</tr>
<tr>
<td class="org-left">1<sub>10</sub></td>
<td class="org-left">1<sub>2</sub></td>
</tr>
<tr>
<td class="org-left">2<sub>10</sub></td>
<td class="org-left">10<sub>2</sub></td>
</tr>
<tr>
<td class="org-left">3<sub>10</sub></td>
<td class="org-left">11<sub>2</sub></td>
</tr>
<tr>
<td class="org-left">4<sub>10</sub></td>
<td class="org-left">100<sub>2</sub></td>
</tr>
<tr>
<td class="org-left">5<sub>10</sub></td>
<td class="org-left">101<sub>2</sub></td>
</tr>
</tbody>
</table>
<p class="flj">
The basic size of a number used by computers is 8 digits or bits also know as a byte. A byte has 256 values 0 to 255 <i>(or 127 to -128 if we use signed values)</i>. When bigger numbers are required the number of digits/bits used is doubled, increasing to 16 bits, 32 bits, 64 bits and so on. Once we have 16 bits or higher there&#8217;s a quirk between different computer architectures known as <a href="https://en.wikipedia.org/wiki/Endianness">endianness</a>. There are two common endian systems, big and little. A big endian system orders the bytes the way you&#8217;d expect starting with the most significant digit going down to the least significant digit. A little endian system reverses this order.
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col  class="org-right" />
<col  class="org-left" />
<col  class="org-left" />
<col  class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-right">Bits</th>
<th scope="col" class="org-left">Value</th>
<th scope="col" class="org-left">Little Endian</th>
<th scope="col" class="org-left">Big Endian</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-right">8</td>
<td class="org-left">00000000<sub>2</sub></td>
<td class="org-left">00000000<sub>2</sub></td>
<td class="org-left">00000000<sub>2</sub></td>
</tr>
<tr>
<td class="org-right">16</td>
<td class="org-left">11111111 00000000<sub>2</sub></td>
<td class="org-left">00000000 11111111<sub>2</sub></td>
<td class="org-left">11111111 00000000<sub>2</sub></td>
</tr>
<tr>
<td class="org-right">32</td>
<td class="org-left">00000000 10000001 00000000 10011001<sub>2</sub></td>
<td class="org-left">10011001 00000000 10000001 00000000<sub>2</sub></td>
<td class="org-left">00000000 10000001 00000000 10011001<sub>2</sub></td>
</tr>
</tbody>
</table>
<p class="flj">
On an individual computer endianness is completely transparent and doesn&#8217;t affect anything. But in a world connected by the internet, sharing binary data between different systems makes this a very important issue <i>(32768 on one system could equal 1 on another)</i>. This might not seem to have much to do with terminal interfaces, but it gives insight into why text formatted data is still, to this day, a hugely popular format preferred over raw binary data.
</p>
</div>
<div id="outline-container-orgabcd921" class="outline-3">
<h3 id="orgabcd921">Data as Text</h3>
<div class="outline-text-3" id="text-orgabcd921">
<p class="flj">
There&#8217;s nothing more embarrassing than a teacher intercepting a note you passed to a friend in class and reading it everyone. So we learn to create secret key codes with our friends to prevent other people from reading our notes. The simplest way to do this is to substitute letters with numbers like A=1, B=2, C=3 and so on. For a computer, this type of code couldn&#8217;t keep a secret long, but it is used as a way to format information known as an encoding. The most common character to number key code is known as the <a href="https://en.wikipedia.org/wiki/ASCII">ASCII</a> encoding.
</p>
<p class="flj">
With the ASCII encoding system a character is represented by one byte. This means that ASCII can encode 256 individual characters. It covers all the basic Latin characters, numbers and punctuation, but if we want to support other languages like Russian or Chinese a different encoding is needed. Each encoding is known as a code page. The short coming of this encoding system is only a single language or family of languages can be supported at any given time.
</p>
<p class="flj">
Step in the <a href="https://en.wikipedia.org/wiki/Unicode">Unicode</a> encoding and the <a href="https://en.wikipedia.org/wiki/UTF-8">UTF-8</a> format. Unicode maps characters to a 32 bit number with the ability of encoding just over 4 billion characters. As described previously, 32 bit values are subject to endian issues. The UTF-8 format solves this by mapping values greater than 128 into several separate bytes therefore eliminating the endian issues<sup><a id="fnr.2" class="footref" href="#fn.2">2</a></sup>. Almost every conceivable language can be supported and easily shared across all systems.
</p>
<p class="flj">
If we look back at the hello program example in the previous article <a href="https://www.digitalcombine.ca/2019/11/21/command-line-tty-devices/">Command Line TTY Devices</a>, the program can be rewritten to display <i>&#8220;Hello World&#8221;</i> by send number codes to standard out. When we compile these example programs, this is exactly what the compiler is doing to the quoted text in the program, converting it to encoded numbers.
</p>
<div class="org-src-container">
<pre class="src src-c"><span class="org-preprocessor">#include</span> <span class="org-string">&lt;stdlib.h&gt;</span>
<span class="org-preprocessor">#include</span> <span class="org-string">&lt;unistd.h&gt;</span>
<span class="org-preprocessor">#include</span> <span class="org-string">&lt;stdio.h&gt;</span>

<span class="org-type">int</span> <span class="org-function-name">main</span>(<span class="org-type">int</span> <span class="org-variable-name">argc</span>, <span class="org-type">char</span> *<span class="org-variable-name">argv</span>[]) {
  <span class="org-comment-delimiter">// </span><span class="org-comment">Write "Hello World" to STDOUT using the ASCII number encodings.</span>
  putchar(72);  <span class="org-comment-delimiter">// </span><span class="org-comment">H</span>
  putchar(101); <span class="org-comment-delimiter">// </span><span class="org-comment">e</span>
  putchar(108); <span class="org-comment-delimiter">// </span><span class="org-comment">l</span>
  putchar(108); <span class="org-comment-delimiter">// </span><span class="org-comment">l</span>
  putchar(111); <span class="org-comment-delimiter">// </span><span class="org-comment">o</span>
  putchar(32);  <span class="org-comment-delimiter">// </span><span class="org-comment">space</span>
  putchar(87);  <span class="org-comment-delimiter">// </span><span class="org-comment">W</span>
  putchar(111); <span class="org-comment-delimiter">// </span><span class="org-comment">o</span>
  putchar(114); <span class="org-comment-delimiter">// </span><span class="org-comment">r</span>
  putchar(108); <span class="org-comment-delimiter">// </span><span class="org-comment">l</span>
  putchar(100); <span class="org-comment-delimiter">// </span><span class="org-comment">d</span>
  putchar(10);  <span class="org-comment-delimiter">// </span><span class="org-comment">newline</span>

  <span class="org-keyword">return</span> EXIT_SUCCESS; <span class="org-comment-delimiter">// </span><span class="org-comment">Return success</span>
}
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgcc826ff" class="outline-2">
<h2 id="orgcc826ff">The Terminal Interface</h2>
<div class="outline-text-2" id="text-orgcc826ff">
<p width="250" height="137" class="alignright wp-image-433">
<img decoding="async" src="https://www.digitalcombine.ca/wp-content/uploads/2019/12/Terminal-Grid-Diagram.png" alt="Terminal-Grid-Diagram.png" width="250" height="137" class="alignright wp-image-433" /><br />
Terminals are text encoded interfaces. They can use encodings like ASCII, code pages or Unicode. Typically a new terminal window starts with an 80×25 grid of characters and a cursor. Each character can have it&#8217;s own colours, be bold or underlined. On the surface, terminals seem extremely simple and in many ways they are but can have an endless amount of configurable options. If you look at the manual for xterm, <code>man xterm</code>, it goes on and on with no end in sight. Terminal software can have a lot of features that can vary for each different software suite.
</p>
<p class="flj">
I&#8217;m not going to go into all the features in this article, but an important one that all terminals support are escape codes. We&#8217;ve seen how we can display information on the terminal by writing to standard out. For a program to use the features of the terminal, like colouring text or move the cursor around, the ASCII escape character (33) is written to standard out with a number of other codes describing the desired effect.
</p>
<p class="flj">
Here&#8217;s a simple example using escape codes with the bash shell and in an xterm compatible terminal.
</p>
<div class="org-src-container">
<pre class="src src-shell"><span class="org-builtin">echo</span> -e <span class="org-string">"Using escape codes: \033[01;32mI'm in color\033[00m"</span>
</pre>
</div>
<p class="flj">
There are a lot of common escape codes supported by the different terminal software, but each terminal also have their own unique codes as well. In later articles, when we start looking at shell scripting, I&#8217;ll show how you can use programs like <code>tput</code> to take advantage of the terminal features with having to worry about the differences in escape codes.
</p>
<p class="flj">
Now that we have trudged through all this different components and systems we can move on to the heart of it all the &#8220;Command Line Shells&#8221;&#x2026;
</p>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">
<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1">1</a></sup> </p>
<div class="footpara">
<p class="footpara">
Internally binary is represented as a circuit either turn on or off. It can also be capacitors being charged or discharged <i>(similar to how RAM works)</i> or various magnetic storage being magnetized or not <i>(like hard drives or backup tapes)</i>.
</p>
</div>
</div>
<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2">2</a></sup> </p>
<div class="footpara">
<p class="footpara">
The first 128 characters in UTF-8 are backwards compatible with the ASCII encoding making most text file compatible with both encodings.
</p>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalcombine.ca/2019/12/19/command-line-terminals/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
