<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Scripting &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:Scripting</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 14:39:25 +0000</pubDate>
    <item>
      <title>Networking and SSh</title>
      <link>https://personaljournal.ca/paulsutton/networking-and-ssh</link>
      <description>&lt;![CDATA[Networking and SSh&#xA;&#xA;I have decided to republish these links as there are a few people on  the Fediverse who work or are involved in InfoSec and CyberSecurity.  &#xA;&#xA;These videos are a starting point for understanding networking and also SSH which allows remote login to remote computer.   &#xA;&#xA;So next up are the links to the videos on Networking and another video on OpenSSH (SSH being Secure SHell of course. &#xA;&#xA;I am reposting links to previous blog posts that looked at these topics:-&#xA;&#xA;Networking&#xA;OpenSSH&#xA;&#xA;I can be contacted on Fediverse / mastodon,  search for @zleap@qoto.org.&#xA; &#xA;&#xA;TAGS&#xA;&#xA;#GNULinux,#Shell,#Bash,#Scripting,#Nano,#Editor,#InfoSec,#Cybersecurity,#CodeClub,#PaigntonLibrarySTEMGroup&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Networking and SSh</p>

<p>I have decided to republish these links as there are a few people on  the Fediverse who work or are involved in InfoSec and CyberSecurity.</p>

<p>These videos are a starting point for understanding networking and also SSH which allows remote login to remote computer.</p>

<p>So next up are the links to the videos on Networking and another video on OpenSSH (SSH being Secure SHell of course.</p>

<p>I am reposting links to previous blog posts that looked at these topics:-</p>
<ul><li><a href="https://personaljournal.ca/paulsutton/cybersecurity-part-15" rel="nofollow">Networking</a></li>
<li><a href="https://personaljournal.ca/paulsutton/cybersecurity-part-17" rel="nofollow">OpenSSH</a></li></ul>

<p>I can be contacted on Fediverse / mastodon,  search for <a href="https://personaljournal.ca/@/zleap@qoto.org" class="u-url mention" rel="nofollow">@<span>zleap@qoto.org</span></a>.</p>

<p><strong>TAGS</strong></p>

<p><a href="/paulsutton/tag:GNULinux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">GNULinux</span></a>,<a href="/paulsutton/tag:Shell" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Shell</span></a>,<a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Scripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Scripting</span></a>,<a href="/paulsutton/tag:Nano" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nano</span></a>,<a href="/paulsutton/tag:Editor" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Editor</span></a>,<a href="/paulsutton/tag:InfoSec" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">InfoSec</span></a>,<a href="/paulsutton/tag:Cybersecurity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Cybersecurity</span></a>,<a href="/paulsutton/tag:CodeClub" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">CodeClub</span></a>,<a href="/paulsutton/tag:PaigntonLibrarySTEMGroup" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">PaigntonLibrarySTEMGroup</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/networking-and-ssh</guid>
      <pubDate>Fri, 23 Jun 2023 06:00:00 +0000</pubDate>
    </item>
    <item>
      <title>NANO and Shell scripting</title>
      <link>https://personaljournal.ca/paulsutton/nano-and-shell-scripting</link>
      <description>&lt;![CDATA[NANO and Shell scripting&#xA;&#xA;I have decided to republish these links as there are a few people on  the Fediverse who work or are involved in InfoSec and CyberSecurity.  These videos are a starting point as it is very useful to understand how to use the GNU/Linux command line along with related tools in general. &#xA;&#xA;You may find the links on the BASH Basics post useful&#xA;&#xA;I am reposting links to previous blog posts that looked at these topics:-&#xA;&#xA;Nano Editor &#xA;Shell Scripting &#xA;Sed, Grep &amp; Cron &#xA;&#xA;I can be contacted on Fediverse / mastodon,  search for @zleap@qoto.org.&#xA; &#xA;&#xA;TAGS&#xA;&#xA;#GNULinux,#Shell,#Bash,#Scripting,#Nano,#Editor,#InfoSec,#Cybersecurity,#Video,#CodeClub,#PaigntonLibrarySTEMGroup&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>NANO and Shell scripting</p>

<p>I have decided to republish these links as there are a few people on  the Fediverse who work or are involved in InfoSec and CyberSecurity.  These videos are a starting point as it is very useful to understand how to use the GNU/Linux command line along with related tools in general.</p>

<p>You may find the links on the <a href="https://personaljournal.ca/paulsutton/bash-videos-part-2" rel="nofollow">BASH Basics post useful</a></p>

<p>I am reposting links to previous blog posts that looked at these topics:-</p>
<ul><li><a href="https://personaljournal.ca/paulsutton/cybersecurity-part-11" rel="nofollow">Nano Editor</a></li>
<li><a href="https://personaljournal.ca/paulsutton/cybersecurity-part-12" rel="nofollow">Shell Scripting</a></li>
<li><a href="https://personaljournal.ca/paulsutton/cybersecuritypart-13" rel="nofollow">Sed, Grep &amp; Cron</a></li></ul>

<p>I can be contacted on Fediverse / mastodon,  search for <a href="https://personaljournal.ca/@/zleap@qoto.org" class="u-url mention" rel="nofollow">@<span>zleap@qoto.org</span></a>.</p>

<p><strong>TAGS</strong></p>

<p><a href="/paulsutton/tag:GNULinux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">GNULinux</span></a>,<a href="/paulsutton/tag:Shell" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Shell</span></a>,<a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Scripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Scripting</span></a>,<a href="/paulsutton/tag:Nano" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nano</span></a>,<a href="/paulsutton/tag:Editor" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Editor</span></a>,<a href="/paulsutton/tag:InfoSec" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">InfoSec</span></a>,<a href="/paulsutton/tag:Cybersecurity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Cybersecurity</span></a>,<a href="/paulsutton/tag:Video" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Video</span></a>,<a href="/paulsutton/tag:CodeClub" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">CodeClub</span></a>,<a href="/paulsutton/tag:PaigntonLibrarySTEMGroup" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">PaigntonLibrarySTEMGroup</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/nano-and-shell-scripting</guid>
      <pubDate>Thu, 22 Jun 2023 06:00:00 +0000</pubDate>
    </item>
    <item>
      <title>FSF Workshops</title>
      <link>https://personaljournal.ca/paulsutton/fsf-workshops-3gqg</link>
      <description>&lt;![CDATA[FSF Workshops&#xA;&#xA;The first of the post LibrePlanet workshops takes place on Monday 10th April.  Details below.&#xA;&#xA;Newk Script: Code katas to learn programming&#xA;&#xA;Time: Monday, April 10, 12:00–13:30 EDT (16:00–17:30 UTC)&#xA;Format: Online workshop&#xA;Event link&#xA;Registration link&#xA;Presenter: Reynaldo Cordero&#xA;Description:&#xA;&#xA;Are you interested in a serendipitous Haskell programming learning method on your computer with over 1,700 katas ready to train? Newk is a Bash script using a 100% free software environment that takes advantage of serendipity the same way you learn to speak in childhood. No formal (or informal) classes: you are simply exposed to spoken information of any kind and at any level in real contexts, where everything is new, surprising, and true. Did you learn to speak? You will learn to program!&#xA;&#xA;Links&#xA;&#xA;Free Software Foundation&#xA;Kata)&#xA;&#xA;Tags&#xA;&#xA;#FSF,#Workshops,#Coding,#Scripting&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>FSF Workshops</p>

<p>The first of the post LibrePlanet workshops takes place on Monday 10th April.  Details below.</p>

<p><strong>Newk Script: Code katas to learn programming</strong></p>
<ul><li>Time: Monday, April 10, 12:00–13:30 EDT (16:00–17:30 UTC)</li>
<li>Format: Online workshop</li>
<li><a href="https://www.fsf.org/events/libreplanet-workshop-april-10-newk-script-code-katas-to-learn-programming-by-reynaldo-cordero" rel="nofollow">Event link</a></li>
<li><a href="https://my.fsf.org/civicrm/event/info?id=115&reset=1" rel="nofollow">Registration link</a></li>
<li>Presenter: Reynaldo Cordero</li>
<li>Description:</li></ul>

<pre><code>Are you interested in a serendipitous Haskell programming learning method on your computer with over 1,700 katas ready to train? Newk is a Bash script using a 100% free software environment that takes advantage of serendipity the same way you learn to speak in childhood. No formal (or informal) classes: you are simply exposed to spoken information of any kind and at any level in real contexts, where everything is new, surprising, and true. Did you learn to speak? You will learn to program!
</code></pre>

<p><strong>Links</strong></p>
<ul><li><a href="https://www.fsf.org" rel="nofollow">Free Software Foundation</a></li>
<li><a href="https://en.wikipedia.org/wiki/Kata_(programming)" rel="nofollow">Kata</a></li></ul>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:FSF" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">FSF</span></a>,<a href="/paulsutton/tag:Workshops" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Workshops</span></a>,<a href="/paulsutton/tag:Coding" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Coding</span></a>,<a href="/paulsutton/tag:Scripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Scripting</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/fsf-workshops-3gqg</guid>
      <pubDate>Sat, 08 Apr 2023 06:30:00 +0000</pubDate>
    </item>
    <item>
      <title>CyberSecurity part 12</title>
      <link>https://personaljournal.ca/paulsutton/cybersecurity-part-12</link>
      <description>&lt;![CDATA[CyberSecurity part 12&#xA;&#xA;So we are on part 12,  well done and thank you to everyone who has stuck with this so far.  Today I am linking to s shell scripting crass course.   &#xA;&#xA;Shell Scripting Crash Course - Beginner Level&#xA;&#xA;Joe Collins who presented the bash videos earlier also has a series of videos on shell scripting&#xA;&#xA;Part 1&#xA;Part 2&#xA;Part 3&#xA;Custom BASH Environment&#xA;BASH Environment | Aliases, Functions and Scripts &#xA;&#xA;Useful stuff&#xA;&#xA;If you write a bash script, that needs the user to run as with elevated privileges this code may be handy.&#xA;&#xA;if [ &#34;$EUID&#34; -ne 0 ]&#xA;  then echo &#34;Please run as root / sudo&#34;&#xA;exit&#xA;&#xA;  else&#xA;&#xA;Links&#xA;&#xA;login link &#xA;Bash Tutorials&#xA;Tuxiversity Forum&#xA;Udemy Course&#xA;&#xA;Tags&#xA;&#xA;#CyberSecurity,#Shell,#Scripting&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>CyberSecurity part 12</p>

<p>So we are on part 12,  well done and thank you to everyone who has stuck with this so far.  Today I am linking to s shell scripting crass course.</p>
<ul><li><a href="https://www.youtube.com/watch?v=v-F3YLd6oMw" rel="nofollow">Shell Scripting Crash Course – Beginner Level</a></li></ul>

<p>Joe Collins who presented the bash videos earlier also has a series of videos on shell scripting</p>
<ul><li><a href="https://www.youtube.com/watch?v=k91lumNE2zU" rel="nofollow">Part 1</a></li>
<li><a href="https://www.youtube.com/watch?v=6W8sAWakcxY" rel="nofollow">Part 2</a></li>
<li><a href="https://www.youtube.com/watch?v=9aD59kA_P1M" rel="nofollow">Part 3</a></li>
<li><a href="https://www.youtube.com/watch?v=y_vAFd7Uk5U" rel="nofollow">Custom BASH Environment</a></li>
<li><a href="https://www.youtube.com/watch?v=dDyoNC33TY8" rel="nofollow">BASH Environment | Aliases, Functions and Scripts </a></li></ul>

<p><strong>Useful stuff</strong></p>

<p>If you write a bash script, that needs the user to run as with elevated privileges this code may be handy.</p>

<pre><code>if [ &#34;$EUID&#34; -ne 0 ]
  then echo &#34;Please run as root / sudo&#34;
exit

  else
</code></pre>

<p><strong>Links</strong></p>
<ul><li><a href="https://vfsync.org/index.html" rel="nofollow">login link</a></li>
<li><a href="https://tecadmin.net/tutorial/bash-scripting/" rel="nofollow">Bash Tutorials</a></li>
<li><a href="https://forum.tuxiversity.org/" rel="nofollow">Tuxiversity Forum</a></li>
<li><a href="https://www.udemy.com/course/bash-scripting/" rel="nofollow">Udemy Course</a></li></ul>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:CyberSecurity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">CyberSecurity</span></a>,<a href="/paulsutton/tag:Shell" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Shell</span></a>,<a href="/paulsutton/tag:Scripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Scripting</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/cybersecurity-part-12</guid>
      <pubDate>Fri, 13 May 2022 06:30:00 +0000</pubDate>
    </item>
    <item>
      <title>Ansi Weather</title>
      <link>https://personaljournal.ca/paulsutton/ansi-weather</link>
      <description>&lt;![CDATA[Ansi Weather&#xA;&#xA;img src=&#34;https://socialhub.activitypub.rocks/uploads/default/original/1X/6aac842b7ff5c58385a02f3a131c259281be88c8.png&#34; target=&#34;_blank&#34; &#xA;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xA;&#xA;Getting weather information is really useful. What happens if you&#39;re at the command line in Linux?  I found a really little application that can help&#xA;&#xA;ansiweather &#xA;&#xA;apt install ansiweather&#xA;&#xA;ansiweather -l Plymouth, UK&#xA;&#xA;Ansi Weather Output&#xA;&#xA;So what else can we do with this&#xA;&#xA;Send the output to Mastodon with toot post&#xA;&#xA;This is a two step process&#xA;&#xA;ansiweather -l Plymouth, UK   weather.txt&#xA;toot post &lt; weather.txt&#xA;&#xA;Will send the weather info to Mastodon.&#xA;&#xA;However this does not include any date info&#xA;&#xA;We can fix this with&#xA;&#xA;date   weatherinfo.txt&#xA;ansiweather -l Plymouth, UK     weatherinfo.txt&#xA;&#xA;then send the whole lot to Mastodon with&#xA;&#xA;toot post &lt; weatherinfo.txt&#xA;&#xA;So, if we put this in to a final shell script we need:- &#xA;&#xA;send weather info to Mastodon&#xA;current date&#xA;date   weatherinfo.txt&#xA;current weather&#xA;ansiweather -l Plymouth, UK     weatherinfo.txt&#xA;send to Mastodon&#xA;toot post &lt; weatherinfo.txt&#xA;done&#xA;echo done&#xA;&#xA;Again released under GPLv3&#xA;&#xA;I tried to get festival to speak the weather, it is not perfect but this sort of works,  you will need to direct to weather.txt first.  &#xA;&#xA;festival --tts &lt; weather.txt&#xA; &#xA;Looking in to this further, the issue is the brackets etc, so this stackoverflow post&#xA;&#xA;strips out the colour formatting&#xA;&#xA;sed &#39;s/\x1b\[m//g&#39; weatherinfo.txt&#xA;&#xA;Therefore &#xA;&#xA;sed &#39;s/\x1b\[m//g&#39; weatherinfo.txt   weatherinfo2.txt&#xA;&#xA;Sends the newly formatted text to weatherinfo2.txt&#xA;&#xA;So running back through festival&#xA;&#xA;festival --tts &lt; weather.txt&#xA;&#xA;Is perhaps a little better, but not perfect&#xA;&#xA;So going back to what we wrote earlier to send to Mastodon, the new script &#xA;&#xA;  1 #send weather info to Mastodon&#xA;  2 # current date&#xA;  3 date   weatherinfo.txt&#xA;  4 # current weather&#xA;  5 ansiweather -l Plymouth, UK     weatherinfo.txt&#xA;  6 # clean up output with sed&#xA;  7 sed &#39;s/\x1b\[*m//g&#39; weatherinfo.txt   weatherinfo2.txt&#xA;  8 #send to Mastodon&#xA;  9 toot post &lt; weatherinfo2.txt&#xA; 10 # done&#xA; 11 echo done&#xA;&#xA;Produces much nicer output. The top bottom part of this illustrates what was sent before we stripped out the colour formatting&#xA;&#xA;However it still isn&#39;t perfect, as it removes part some of the wording, but it is hopefully getting there.  &#xA;&#xA;Weather Output (new)&#xA;&#xA;REFERENCES&#xA;&#xA;Ansi Weather&#xA;Free Software Foundation&#xA;&#xA;TAGS&#xA;&#xA;#YearOfTheFediverse,#Weather,#Scripting,#Bash,#Linux,&#xA;#Mastodon,#ProblemSolving,#AnsiWeather,#programming,&#xA;#Stackoverflow,#sed,#cat,#grep,GPL3,#FSF&#xA;&#xA;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-sa/4.0/&#34;img alt=&#34;Creative Commons Licence&#34; style=&#34;border-width:0&#34; src=&#34;https://i.creativecommons.org/l/by-sa/4.0/88x31.png&#34; //abr /This work is licensed under a a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-sa/4.0/&#34;Creative Commons Attribution-ShareAlike 4.0 International License/a&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Ansi Weather</p>

<p><a href="https://torresjrjr.com/archive/2020-07-19-guide-to-the-fediverse" rel="nofollow"><img src="https://socialhub.activitypub.rocks/uploads/default/original/1X/6aac842b7ff5c58385a02f3a131c259281be88c8.png"></a></p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>

<p>Getting weather information is really useful. What happens if you&#39;re at the command line in Linux?  I found a really little application that can help</p>

<p>ansiweather</p>

<p>apt install ansiweather</p>

<p>ansiweather -l Plymouth, UK</p>

<p><img src="https://git.qoto.org/zleap/documents/-/raw/master/ansiweather.png" alt="Ansi Weather Output"></p>

<p>So what else can we do with this</p>
<ol><li>Send the output to Mastodon with toot post</li></ol>

<p>This is a two step process</p>
<ol><li>ansiweather -l Plymouth, UK &gt; weather.txt</li>
<li>toot post &lt; weather.txt</li></ol>

<p>Will send the weather info to Mastodon.</p>

<p>However this does not include any date info</p>

<p>We can fix this with</p>
<ol><li>date &gt; weatherinfo.txt</li>
<li>ansiweather -l Plymouth, UK &gt;&gt; weatherinfo.txt</li></ol>

<p>then send the whole lot to Mastodon with</p>
<ol><li>toot post &lt; weatherinfo.txt</li></ol>

<p>So, if we put this in to a final shell script we need:-</p>

<pre><code>#send weather info to Mastodon
# current date
date &gt; weatherinfo.txt
# current weather
ansiweather -l Plymouth, UK &gt;&gt; weatherinfo.txt
#send to Mastodon
toot post &lt; weatherinfo.txt
# done
echo done

</code></pre>

<p>Again released under <a href="https://www.gnu.org" rel="nofollow">GPLv3</a></p>

<p>I tried to get festival to speak the weather, it is not perfect but this sort of works,  you will need to direct to weather.txt first.</p>

<p>festival —tts &lt; weather.txt</p>

<p>Looking in to this further, the issue is the brackets etc, so this <a href="https://stackoverflow.com/questions/36547654/remove-colour-code-from-linux-files" rel="nofollow">stackoverflow post</a></p>

<p>strips out the colour formatting</p>

<p>sed &#39;s/\x1b[[^\x1b]*m//g&#39; weatherinfo.txt</p>

<p>Therefore</p>

<p>sed &#39;s/\x1b[[^\x1b]*m//g&#39; weatherinfo.txt &gt; weatherinfo2.txt</p>

<p>Sends the newly formatted text to weatherinfo2.txt</p>

<p>So running back through festival</p>

<p>festival —tts &lt; weather.txt</p>

<p>Is perhaps a little better, but not perfect</p>

<p>So going back to what we wrote earlier to send to Mastodon, the new script</p>

<pre><code>  1 #send weather info to Mastodon
  2 # current date
  3 date &gt; weatherinfo.txt
  4 # current weather
  5 ansiweather -l Plymouth, UK &gt;&gt; weatherinfo.txt
  6 # clean up output with sed
  7 sed &#39;s/\x1b\[[^\x1b]*m//g&#39; weatherinfo.txt &gt; weatherinfo2.txt
  8 #send to Mastodon
  9 toot post &lt; weatherinfo2.txt
 10 # done
 11 echo done

</code></pre>

<p>Produces much nicer output. The top bottom part of this illustrates what was sent before we stripped out the colour formatting</p>

<p>However it still isn&#39;t perfect, as it removes part some of the wording, but it is hopefully getting there.</p>

<p><img src="https://git.qoto.org/zleap/documents/-/raw/master/weatheroutput.png" alt="Weather Output (new)"></p>

<p><strong>REFERENCES</strong></p>
<ul><li><a href="https://www.maketecheasier.com/check-weather-from-terminal-with-ansiweather/" rel="nofollow">Ansi Weather</a></li>
<li><a href="https://www.fsf.org" rel="nofollow">Free Software Foundation</a></li></ul>

<p><strong>TAGS</strong></p>

<p><a href="/paulsutton/tag:YearOfTheFediverse" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">YearOfTheFediverse</span></a>,<a href="/paulsutton/tag:Weather" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Weather</span></a>,<a href="/paulsutton/tag:Scripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Scripting</span></a>,<a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Linux</span></a>,
<a href="/paulsutton/tag:Mastodon" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Mastodon</span></a>,<a href="/paulsutton/tag:ProblemSolving" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ProblemSolving</span></a>,<a href="/paulsutton/tag:AnsiWeather" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">AnsiWeather</span></a>,<a href="/paulsutton/tag:programming" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">programming</span></a>,
<a href="/paulsutton/tag:Stackoverflow" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Stackoverflow</span></a>,<a href="/paulsutton/tag:sed" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">sed</span></a>,<a href="/paulsutton/tag:cat" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">cat</span></a>,<a href="/paulsutton/tag:grep" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">grep</span></a>,GPL3,<a href="/paulsutton/tag:FSF" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">FSF</span></a></p>

<p><a href="http://creativecommons.org/licenses/by-sa/4.0/" rel="nofollow"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"/></a><br/>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/4.0/" rel="nofollow">Creative Commons Attribution-ShareAlike 4.0 International License</a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/ansi-weather</guid>
      <pubDate>Sat, 30 Jan 2021 22:42:42 +0000</pubDate>
    </item>
    <item>
      <title>Script for $\LaTeX$ Tables</title>
      <link>https://personaljournal.ca/paulsutton/macro-for-latex-tables</link>
      <description>&lt;![CDATA[Script for $\LaTeX$ Tables&#xA;&#xA;I was asked in irc ( ##chemistry on frenode) about a project to create a table for periodic table data in $\LaTeX$.&#xA;&#xA;This post, is meant to be a rough guide. You are expected to do your own research in to any specific features you need. &#xA;&#xA;As there are now about 120 elements, doing this manually could be rather long winded.  So I am trying to develop a small shell script to help with this process.&#xA;&#xA;Firstly Looking at loops in Bash&#xA;&#xA;bash-for-loop&#xA;how-to-write-multiple-line-string-using-bash-with-variables&#xA;Tables Generator&#xA;&#xA;now how to generate a basic table in $\LaTeX$&#xA;&#xA;\begin{table}[]&#xA;\begin{tabular}{llllll}&#xA; &amp;  &amp;  &amp;  &amp;  &amp; &#xA;\end{tabular}&#xA;\caption{}&#xA;\label{tab:my-table}&#xA;\end{table}&#xA;&#xA;This is for a 1 row table, to add multiple rows, you need to add \\ at the end of the row as in:-&#xA;&#xA;\begin{table}[]&#xA;\begin{tabular}{llllll}&#xA; &#xA; &amp;  &amp;  &amp;  &amp;  &amp;  \\&#xA; &amp;  &amp;  &amp;  &amp;  &amp;  \\&#xA; &amp;  &amp;  &amp;  &amp;  &amp; &#xA;\end{tabular}&#xA;\caption{}&#xA;\label{tab:my-table}&#xA;\end{table}&#xA;&#xA;The following shell script should help us with this. &#xA;&#xA;Please note that the \\,  should be removed from the very last row. &#xA;&#xA;I have added a script for 10 rows. This can be changed via the shell script. &#xA;&#xA; 1 #!/bin/bash&#xA;  2 &#xA;  3 echo &#34; &#34;   data.txt&#xA;  4 echo &#34;\begin{table}[]&#34;   data.txt&#xA;  5 echo &#34;\begin{tabular}{llllll}&#34;     data.txt&#xA;  6 #wc -l data.txt&#xA;  7 &#xA;  8 for i in {1..10..1}&#xA;  9   do &#xA; 10 &#xA; 11      #echo &#34;hello&#34;&#xA; 12      echo  &#34;&amp;  &amp;  &amp;  &amp;  &amp; \\&#34;     data.txt&#xA; 13  done&#xA; 14 #wc -l data.txt&#xA; 15  echo  &#34;\end{tabular}&#34;     data.txt&#xA; 16  echo  &#34;\caption{}&#34;     data.txt&#xA; 17  echo  &#34;\label{tab:my-table}&#34;     data.txt&#xA; 18  echo  &#34;\end{table}&#34;     data.txt&#xA;&#xA;Required table headings were :&#xA; atom ; r atomic ; density ; Tf ; Tg ;... ?&#xA;&#xA;Table headings are obviously at the top, therefore, once you have run the script and generated the right number of rows amending the first row to&#xA;&#xA;&amp; atom &amp; r atomic &amp; density &amp; Tf &amp; Tg \\&#xA;&#xA;Should give the required headings&#xA;&#xA;I have added some word count (wc) to help with diagnostics.&#xA;&#xA;You will need to change the output file extension to .tex for a $\LaTeX$ file.  I&#39;ll leave it as data.txt as you need to add the other components of a $\LaTeX$ document anyway. &#xA;&#xA;If the table spans more than 1 page then the table should use&#xA;&#xA;\begin{longtable}{llllll}&#xA;\end{longtable}&#xA;&#xA;#chemistry, #typesetting, #bash, #LaTeX, #tables, &#xA;scripting&#xA;&#xA;You can find me on Friendica at zleap@social.isurf.ca&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Script for $\LaTeX$ Tables</p>

<p>I was asked in irc ( #<a href="/paulsutton/tag:chemistry" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">chemistry</span></a> on frenode) about a project to create a table for periodic table data in $\LaTeX$.</p>

<p>This post, is meant to be a rough guide. <strong>You are expected</strong> to do your own research in to any specific features you need.</p>

<p>As there are now about 120 elements, doing this manually could be rather long winded.  So I am trying to develop a small shell script to help with this process.</p>

<p>Firstly Looking at loops in Bash</p>
<ul><li><a href="https://www.cyberciti.biz/faq/bash-for-loop/" rel="nofollow">bash-for-loop</a></li>
<li><a href="https://stackoverflow.com/questions/7875540/how-to-write-multiple-line-string-using-bash-with-variables" rel="nofollow">how-to-write-multiple-line-string-using-bash-with-variables</a></li>
<li><a href="https://tablesgenerator.com/" rel="nofollow">Tables Generator</a></li></ul>

<p>now how to generate a basic table in $\LaTeX$</p>

<pre><code>\begin{table}[]
\begin{tabular}{llllll}
 &amp;  &amp;  &amp;  &amp;  &amp; 
\end{tabular}
\caption{}
\label{tab:my-table}
\end{table}
</code></pre>

<p>This is for a 1 row table, to add multiple rows, you need to add <strong>\ at the end of the row</strong> as in:-</p>

<pre><code>\begin{table}[]
\begin{tabular}{llllll}
 
 &amp;  &amp;  &amp;  &amp;  &amp;  \\
 &amp;  &amp;  &amp;  &amp;  &amp;  \\
 &amp;  &amp;  &amp;  &amp;  &amp; 
\end{tabular}
\caption{}
\label{tab:my-table}
\end{table}
</code></pre>

<p>The following shell script should help us with this.</p>

<p><strong>Please note that the \,  should be removed from the very last row.</strong></p>

<p>I have added a script for 10 rows. This can be changed via the shell script.</p>

<pre><code> 1 #!/bin/bash
  2 
  3 echo &#34; &#34; &gt; data.txt
  4 echo &#34;\begin{table}[]&#34; &gt; data.txt
  5 echo &#34;\begin{tabular}{llllll}&#34; &gt;&gt; data.txt
  6 #wc -l data.txt
  7 
  8 for i in {1..10..1}
  9   do 
 10 
 11      #echo &#34;hello&#34;
 12      echo  &#34;&amp;  &amp;  &amp;  &amp;  &amp; \\&#34; &gt;&gt; data.txt
 13  done
 14 #wc -l data.txt
 15  echo  &#34;\end{tabular}&#34; &gt;&gt; data.txt
 16  echo  &#34;\caption{}&#34; &gt;&gt; data.txt
 17  echo  &#34;\label{tab:my-table}&#34; &gt;&gt; data.txt
 18  echo  &#34;\end{table}&#34; &gt;&gt; data.txt
</code></pre>

<p>Required table headings were :
 atom ; r atomic ; density ; T<em>f ; T</em>g ;... ?</p>

<p>Table headings are obviously at the top, therefore, once you have run the script and generated the right number of rows amending the first row to</p>

<p>&amp; atom &amp; r atomic &amp; density &amp; T<em>f &amp; T</em>g \</p>

<p>Should give the required headings</p>

<p>I have added some word count (wc) to help with diagnostics.</p>

<p>You will need to change the output file extension to .tex for a $\LaTeX$ file.  I&#39;ll leave it as data.txt as you need to add the other components of a $\LaTeX$ document anyway.</p>

<p>If the table spans more than 1 page then the table should use</p>

<pre><code>\begin{longtable}{llllll}
\end{longtable}
</code></pre>

<p><a href="/paulsutton/tag:chemistry" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">chemistry</span></a>, <a href="/paulsutton/tag:typesetting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">typesetting</span></a>, <a href="/paulsutton/tag:bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">bash</span></a>, <a href="/paulsutton/tag:LaTeX" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">LaTeX</span></a>, <a href="/paulsutton/tag:tables" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">tables</span></a>,
<a href="/paulsutton/tag:scripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">scripting</span></a></p>

<p><a href="https://social.isurf.ca/profile/zleap" rel="nofollow">You can find me on Friendica at zleap@social.isurf.ca</a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/macro-for-latex-tables</guid>
      <pubDate>Mon, 02 Mar 2020 18:07:36 +0000</pubDate>
    </item>
  </channel>
</rss>