<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Bash &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:Bash</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 11:27:16 +0000</pubDate>
    <item>
      <title>Weather logging</title>
      <link>https://personaljournal.ca/paulsutton/weather-logging</link>
      <description>&lt;![CDATA[Weather logging&#xA;&#xA;So been experimenting with some of the options for ansiweather, partly as schools   need to teach data logging as part of the national curriculum computing,  however not all schools have the kit required.&#xA;&#xA;As I have this running on a Raspberry Pi,  I thought it may be possible to set one up to log just the location and temperature.  &#xA;&#xA;ansiweather -l paignton -p false -h false  -w false -i false   temponly.txt&#xA;&#xA;so the above will display the location and temperature,   but exclude pressure, humidity, wind and UV index.&#xA;&#xA;now=$(date +&#34;%m%d%Y&#34;)&#xA;echo &#34;Filename : /nas/backup$weather.csv&#34;&#xA;echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l Paignton -a false)     weather$now.csv&#xA;&#xA;Control what is sent to stdout.&#xA;&#xA;now=$(date +&#34;%m%d%Y&#34;)&#xA;echo &#34;Filename : /nas/backup$weather.csv&#34;&#xA;echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l torquay -p false -h false  -w false -i false)     torquay$now.csv&#xA;&#xA;Final script&#xA;&#xA;now=$(date +&#34;%m%d%Y&#34;)&#xA;echo &#34;Filename : /nas/backup$weather.csv&#34;&#xA;echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l torquay -p false -h false  -w false -i false)     torquay$now.csv&#xA;&#xA;Tags&#xA;&#xA;#Bash,#BashScripting,#Logging,#Data&#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>Weather logging</p>

<p>So been experimenting with some of the options for ansiweather, partly as schools   need to teach data logging as part of the national curriculum computing,  however not all schools have the kit required.</p>

<p>As I have this running on a Raspberry Pi,  I thought it may be possible to set one up to log just the location and temperature.</p>

<pre><code>ansiweather -l paignton -p false -h false  -w false -i false &gt;temponly.txt
</code></pre>

<p>so the above will display the location and temperature,   but exclude pressure, humidity, wind and UV index.</p>

<pre><code>now=$(date +&#34;%m_%d_%Y&#34;)
echo &#34;Filename : /nas/backup_$weather.csv&#34;
echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l Paignton -a false) &gt;&gt; weather_$now.csv
</code></pre>

<p>Control what is sent to stdout.</p>

<pre><code>now=$(date +&#34;%m_%d_%Y&#34;)
echo &#34;Filename : /nas/backup_$weather.csv&#34;
echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l torquay -p false -h false  -w false -i false) &gt;&gt; torquay_$now.csv
</code></pre>

<p>Final script</p>

<pre><code>now=$(date +&#34;%m_%d_%Y&#34;)
echo &#34;Filename : /nas/backup_$weather.csv&#34;
echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l torquay -p false -h false  -w false -i false) &gt;&gt; torquay_$now.csv
</code></pre>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Logging" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Logging</span></a>,<a href="/paulsutton/tag:Data" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Data</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/weather-logging</guid>
      <pubDate>Fri, 18 Jul 2025 06:52:59 +0000</pubDate>
    </item>
    <item>
      <title>Logging the weather</title>
      <link>https://personaljournal.ca/paulsutton/logging-the-weather</link>
      <description>&lt;![CDATA[Logging the weather&#xA;&#xA;I have modified the script that runs every 10 minutes to record the output from the ansiweather utility,   This still saves the output to a file but adds the current date to the file name.&#xA;&#xA;now=$(date +&#34;%m%d%Y&#34;)&#xA;echo &#34;Filename : /nas/backup$weather.csv&#34;&#xA;echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l Paignton -a false)     weather$now.csv&#xA;&#xA;So the output looks like&#xA;&#xA; Humidity: 71% - Pressure: 1023 hPa&#xA;06/09/25, 14:20:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.79 m/s WSW - Humidity: 69% - Pressure: 1024 hPa&#xA;06/09/25, 14:30:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 2.24 m/s SW - Humidity: 70% - Pressure: 1023 hPa&#xA;06/09/25, 14:40:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 3.13 m/s W - Humidity: 69% - Pressure: 1023 hPa&#xA;06/09/25, 14:50:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.79 m/s SW - Humidity: 69% - Pressure: 1023 hPa&#xA;06/09/25, 15:00:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.79 m/s WSW - Humidity: 71% - Pressure: 1023 hPa&#xA;06/09/25, 15:10:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.34 m/s SSW - Humidity: 71% - Pressure: 1024 hPa&#xA;&#xA;As this runs on a headless pi4,  I can login and copy the data files locally before uploading to my gopherspace (Look it up) &#xA;&#xA;gopher://vern.cc/1/~zleap&#xA;&#xA;Tags&#xA;&#xA;#Bash,#BashScripting,#Data,#Logging,#Gopher,#RaspberryPi,&#xA;Weather&#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>Logging the weather</p>

<p>I have modified the script that runs every 10 minutes to record the output from the ansiweather utility,   This still saves the output to a file but adds the current date to the file name.</p>

<pre><code class="language-bash">now=$(date +&#34;%m_%d_%Y&#34;)
echo &#34;Filename : /nas/backup_$weather.csv&#34;
echo $(date &#34;+ %D, %T&#34;), $(ansiweather -l Paignton -a false) &gt;&gt; weather_$now.csv
</code></pre>

<p>So the output looks like</p>

<pre><code> Humidity: 71% - Pressure: 1023 hPa
06/09/25, 14:20:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.79 m/s WSW - Humidity: 69% - Pressure: 1024 hPa
06/09/25, 14:30:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 2.24 m/s SW - Humidity: 70% - Pressure: 1023 hPa
06/09/25, 14:40:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 3.13 m/s W - Humidity: 69% - Pressure: 1023 hPa
06/09/25, 14:50:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.79 m/s SW - Humidity: 69% - Pressure: 1023 hPa
06/09/25, 15:00:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.79 m/s WSW - Humidity: 71% - Pressure: 1023 hPa
06/09/25, 15:10:01, Weather in Paignton: 18 °C - UVI: 7.03 - Wind: 1.34 m/s SSW - Humidity: 71% - Pressure: 1024 hPa
</code></pre>

<p>As this runs on a headless pi4,  I can login and copy the data files locally before uploading to my gopherspace (<strong>Look it up</strong>)</p>

<pre><code>gopher://vern.cc/1/~zleap
</code></pre>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Data" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Data</span></a>,<a href="/paulsutton/tag:Logging" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Logging</span></a>,<a href="/paulsutton/tag:Gopher" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Gopher</span></a>,<a href="/paulsutton/tag:RaspberryPi" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">RaspberryPi</span></a>,
<a href="/paulsutton/tag:Weather" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Weather</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/logging-the-weather</guid>
      <pubDate>Mon, 09 Jun 2025 14:23:22 +0000</pubDate>
    </item>
    <item>
      <title>ssh - secure shell</title>
      <link>https://personaljournal.ca/paulsutton/ssh-secure-shell</link>
      <description>&lt;![CDATA[ssh - secure shell&#xA;&#xA;Secure shell is a remote login client.   The following is from the man page&#xA;&#xA;DESCRIPTION&#xA;       ssh (SSH client) is a program for logging into a remote machine and for executing  commands on a remote machine.  It is intended to provide secure encrypted communications between two untrusted hosts over an insecure network.  X11 connections, arbitrary  TCP  ports  and  Unix-domain sockets can also be forwarded over the secure channel.&#xA;So as mentioned before, vfsync can&#39;t do everything, so if you do need a full Linux system to log in to and install what you want.  By this, I am saying you also need to at least have sudo access to that remote system, even if this is a Raspberry Pi. &#xA; &#xA;While being able to log in with &#xA;&#xA;ssh user@host &#xA;Is useful, you still need a password,  which is fine.  If you want to use some services provided by [vern.cc] then you need to be able to log in with an authentication key.  This can be generated with&#xA;&#xA;ssh-keygen&#xA;DESCRIPTION&#xA;       ssh-keygen generates, manages  and  converts  authentication  keys  for  ssh(1).  ssh-keygen can create keys for use by SSH protocol version 2.&#xA;Which will generate a public / private key pair&#xA;&#xA;man ssh-copy-id &#xA;&#xA;NAME&#xA;       ssh-copy-id  —  use locally available keys to authorise logins on a re‐mote machine&#xA;&#xA;DESCRIPTION&#xA;       ssh-copy-id  is  a script that uses ssh(1) to log into a remote machine  (presumably using a login password, so password  authentication  should be enabled, unless you&#39;ve done some clever use of multiple identities).  It  assembles  a  list of one or more fingerprints (as described below) and tries to log in with each key, to see if any of  them  are  already installed (of course, if you are not using ssh-agent(1) this may result  in  you being repeatedly prompted for pass-phrases).  It then assembles a list of those that failed to log in and, using ssh(1), enables logins with those keys on the remote server.  By default it adds the  keys  by appending  them  to  the remote user&#39;s ~/.ssh/authorized_keys (creating  the file, and directory, if necessary).  It is also capable of  detecting if the remote system is a NetScreen, and using its ‘set ssh pka-dsa&#xA;       key ...’ command instead.&#xA;&#xA;There is some good information here too&#xA;&#xA;ssh cheat sheet&#xA;&#xA;The following allowed me to remote login to my Raspberry Pi  from my desktop&#xA;&#xA;cd .ssh (I did this so I was in the right place to generate the key)&#xA;ssh-keygen&#xA;ssh-copy-id -i ~/.ssh/Pi4.pub paul@xxx.xxx.xxx.xxx&#xA;ssh paul@xxx.xxx.xxx.xxx&#xA;Login with password, and you will be asked for the passphrase the first time you do this.  After which, you will be able to just ssh in without the password. &#xA;&#xA;Replace the x&#39;s with your IPv4 address. &#xA;&#xA;While using vern,  I had to use&#xA;ssh-keygen -lf ./key.pub&#xA;To address an error, it came up with about keyboard authentication.    This worked for me,  but should not &#39;just&#39; be used in every situation.&#xA;&#xA;Graphical ssh&#xA;&#xA;With Linux mint, it is also possible to connect the file manager nemo to a remote server.&#xA;&#xA;File -  Connect to server, then fill in the credentials.&#xA;&#xA;Remote with nemo&#xA;&#xA;With folder, it is probably a good idea to enter the path to your home directory on the remote server, so for a Raspberry Pi with a default username of pi, this is:-&#xA;&#xA;/home/pi&#xA;&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Bash,#Linux,#ssh,#RemoteAccess,#Security,#SSHKeys,#SecureShell&#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>ssh – secure shell</p>

<p>Secure shell is a remote login client.   The following is from the man page</p>

<pre><code>DESCRIPTION
       ssh (SSH client) is a program for logging into a remote machine and for executing  commands on a remote machine.  It is intended to provide secure encrypted communications between two untrusted hosts over an insecure network.  X11 connections, arbitrary  TCP  ports  and  Unix-domain sockets can also be forwarded over the secure channel.
</code></pre>

<p>So as mentioned before, <a href="https://personaljournal.ca/paulsutton/vfsync" rel="nofollow">vfsync</a> can&#39;t do everything, so if you do need a full Linux system to log in to and install what you want.  By this, I am saying you also need to at least have sudo access to that remote system, even if this is a Raspberry Pi.</p>

<p>While being able to log in with</p>

<pre><code>ssh user@host 
</code></pre>

<p>Is useful, you still need a password,  which is fine.  If you want to use some services provided by [vern.cc] then you need to be able to log in with an authentication key.  This can be generated with</p>

<pre><code>ssh-keygen
</code></pre>

<pre><code>DESCRIPTION
       ssh-keygen generates, manages  and  converts  authentication  keys  for  ssh(1).  ssh-keygen can create keys for use by SSH protocol version 2.
</code></pre>

<p>Which will generate a public / private key pair</p>

<pre><code>man ssh-copy-id 

NAME
       ssh-copy-id  —  use locally available keys to authorise logins on a re‐mote machine

DESCRIPTION
       ssh-copy-id  is  a script that uses ssh(1) to log into a remote machine  (presumably using a login password, so password  authentication  should be enabled, unless you&#39;ve done some clever use of multiple identities).  It  assembles  a  list of one or more fingerprints (as described below) and tries to log in with each key, to see if any of  them  are  already installed (of course, if you are not using ssh-agent(1) this may result  in  you being repeatedly prompted for pass-phrases).  It then assembles a list of those that failed to log in and, using ssh(1), enables logins with those keys on the remote server.  By default it adds the  keys  by appending  them  to  the remote user&#39;s ~/.ssh/authorized_keys (creating  the file, and directory, if necessary).  It is also capable of  detecting if the remote system is a NetScreen, and using its ‘set ssh pka-dsa
       key ...’ command instead.
</code></pre>

<p>There is some <a href="https://www.ssh.com/academy/ssh/copy-id" rel="nofollow">good information here too</a></p>
<ul><li><a href="https://www.sshhandbook.com/ssh-command-cheat-sheet/" rel="nofollow">ssh cheat sheet</a></li></ul>

<p>The following allowed me to remote login to my Raspberry Pi  from my desktop</p>

<pre><code>cd .ssh (I did this so I was in the right place to generate the key)
ssh-keygen
ssh-copy-id -i ~/.ssh/Pi4.pub paul@xxx.xxx.xxx.xxx
ssh paul@xxx.xxx.xxx.xxx
</code></pre>

<p>Login with password, and you will be asked for the passphrase the first time you do this.  After which, you will be able to just ssh in without the password.</p>

<p>Replace the x&#39;s with your IPv4 address.</p>

<p>While using vern,  I had to use</p>

<pre><code>ssh-keygen -lf ./key.pub
</code></pre>

<p>To address an error, it came up with about keyboard authentication.    This worked for me,  but should not &#39;just&#39; be used in every situation.</p>

<p>Graphical ssh</p>

<p>With Linux mint, it is also possible to connect the file manager nemo to a remote server.</p>

<p>File –&gt; Connect to server, then fill in the credentials.</p>

<p><img src="https://salsa.debian.org/zleap-guest/blog-media/-/raw/master/connecttoserver.png" alt="Remote with nemo"></p>

<p>With folder, it is probably a good idea to enter the path to your home directory on the remote server, so for a Raspberry Pi with a default username of pi, this is:-</p>

<pre><code>/home/pi
</code></pre>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

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

<p><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:ssh" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ssh</span></a>,<a href="/paulsutton/tag:RemoteAccess" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">RemoteAccess</span></a>,<a href="/paulsutton/tag:Security" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Security</span></a>,<a href="/paulsutton/tag:SSHKeys" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">SSHKeys</span></a>,<a href="/paulsutton/tag:SecureShell" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">SecureShell</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/ssh-secure-shell</guid>
      <pubDate>Tue, 20 May 2025 14:56:10 +0000</pubDate>
    </item>
    <item>
      <title>Bash Shortcuts</title>
      <link>https://personaljournal.ca/paulsutton/bash-shortcuts</link>
      <description>&lt;![CDATA[Bash Shortcuts&#xA;&#xA;This question was asked on the Linux Mint Matrix Support recently, I helped by looking up what was needed, and posting this as a reply, As this is also really useful and worth sharing more widely too.&#xA;&#xA;Bash Shortcuts&#xA;&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Bash,#BashScripting,#Bashscripting,#Keyboard,#Shortcuts&#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>Bash Shortcuts</p>

<p>This question was asked on the Linux Mint Matrix Support recently, I helped by looking up what was needed, and posting this as a reply, As this is also really useful and worth sharing more widely too.</p>
<ul><li><a href="https://www.howtogeek.com/181/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/" rel="nofollow">Bash Shortcuts</a></li></ul>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:Keyboard" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Keyboard</span></a>,<a href="/paulsutton/tag:Shortcuts" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Shortcuts</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/bash-shortcuts</guid>
      <pubDate>Thu, 15 May 2025 12:00:00 +0000</pubDate>
    </item>
    <item>
      <title>File integrity</title>
      <link>https://personaljournal.ca/paulsutton/file-integrity</link>
      <description>&lt;![CDATA[File integrity&#xA;&#xA;If providing downloadable files, it is important to ensure that the downloaded file is the same as that provided on the host server, this ensures the file has not been tampered with in some way.  The end user needs a way to check what they have downloaded is safe.&#xA;&#xA;One way to do this is to create a file checksum with md5sum&#xA;&#xA;let&#39;s say we have two files&#xA;-rw-rw-r-- 1 psutton psutton  67200 May  3 19:42 jcr.pdf&#xA;-rw-rw-r-- 1 psutton psutton 433231 Apr 28 17:50 southwest1.png&#xA;We want to create a checksum for both files.  To do this we can run&#xA;&#xA;md5sum southwest1.png &#xA;502d4f9dacab9240f2622c032e6ea11f  southwest1.png&#xA;md5sum jcr.pdf &#xA;b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf&#xA;This sends the checksum to stdout&#xA;&#xA;So need a file to store this&#xA;&#xA;md5sum jcr.pdf southwest1.png   md5sum2&#xA;We can then view the contents if this with&#xA;&#xA;as previously discussed the   directs output to a specified file&#xA;&#xA;cat md5sums&#xA;502d4f9dacab9240f2622c032e6ea11f  southwest1.png&#xA;b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf&#xA;&#xA;In this example, we listed the files we want to create a checksum for.&#xA;&#xA;If we were to add a 3rd file say tux.png  then we can do this and append the new checksum with&#xA;md5sum tux.png     md5sums&#xA;Then example our new md5sums file&#xA;cat md5sums&#xA;502d4f9dacab9240f2622c032e6ea11f  southwest1.png&#xA;b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf&#xA;d52cd5e7164eccd6da50e10d5a9c3dbf  tux.png&#xA;&#xA;So now that we have 3 files and a md5sums file,  we can check all the files listed&#xA;&#xA;md5sum -c md5sums&#xA;southwest1.png: OK&#xA;jcr.pdf: OK&#xA;tux.png: OK&#xA;&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Bash,#BashScripting,#Bashscripting,#md5sums,#md5sum,#file,&#xA;#integrity,#check&#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>File integrity</p>

<p>If providing downloadable files, it is important to ensure that the downloaded file is the same as that provided on the host server, this ensures the file has not been tampered with in some way.  The end user needs a way to check what they have downloaded is safe.</p>

<p>One way to do this is to create a file checksum with md5sum</p>

<p>let&#39;s say we have two files</p>

<pre><code>-rw-rw-r-- 1 psutton psutton  67200 May  3 19:42 jcr.pdf
-rw-rw-r-- 1 psutton psutton 433231 Apr 28 17:50 southwest1.png
</code></pre>

<p>We want to create a checksum for both files.  To do this we can run</p>

<pre><code>md5sum southwest1.png 
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
md5sum jcr.pdf 
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
</code></pre>

<p>This sends the checksum to stdout</p>

<p>So need a file to store this</p>

<pre><code>md5sum jcr.pdf southwest1.png &gt; md5sum2
</code></pre>

<p>We can then view the contents if this with</p>

<p><em>as previously discussed the &gt; directs output to a specified file</em></p>

<pre><code>cat md5sums
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
</code></pre>

<p>In this example, we listed the files we want to create a checksum for.</p>

<p>If we were to add a 3rd file say tux.png  then we can do this and append the new checksum with</p>

<pre><code>md5sum tux.png &gt;&gt; md5sums
</code></pre>

<p>Then example our new md5sums file</p>

<pre><code>cat md5sums
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
d52cd5e7164eccd6da50e10d5a9c3dbf  tux.png
</code></pre>

<p>So now that we have 3 files and a md5sums file,  we can check all the files listed</p>

<pre><code>md5sum -c md5sums
southwest1.png: OK
jcr.pdf: OK
tux.png: OK
</code></pre>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:md5sums" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">md5sums</span></a>,<a href="/paulsutton/tag:md5sum" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">md5sum</span></a>,<a href="/paulsutton/tag:file" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">file</span></a>,
<a href="/paulsutton/tag:integrity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">integrity</span></a>,<a href="/paulsutton/tag:check" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">check</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/file-integrity</guid>
      <pubDate>Thu, 15 May 2025 06:00:00 +0000</pubDate>
    </item>
    <item>
      <title>Fun bash stuff</title>
      <link>https://personaljournal.ca/paulsutton/fun-bash-stuff</link>
      <description>&lt;![CDATA[Fun bash stuff&#xA;&#xA;While these are not bash commands, there are a few fun tools.&#xA;&#xA;One is fortune,  this displays a random quote on the console or terminal.&#xA;&#xA;fortune&#xA;Many pages make a thick book, except for pocket Bibles which are on very&#xA;very thin paper.&#xA;Another is cowsay which takes an argument and prints a picture of a cow (there are options to change how it looks or to other characters)&#xA;&#xA;cowsay hello&#xA; ____&#xA; hello &#xA; -------&#xA;        \   ^^&#xA;         \  (oo)\___&#xA;            ()\       )\/\&#xA;                ||----w |&#xA;                ||     ||&#xA;&#xA;As with other commands these can be combined&#xA;fortune | cowsay&#xA; ____________________________________&#xA;/ I don&#39;t know half of you half as well  \&#xA;| as I should like; and I like less than |&#xA;| half of you half as well as you        |&#xA;| deserve.                               |&#xA;|                                        |&#xA;\ -- J. R. R. Tolkien                    /&#xA; ----------------------------------------&#xA;        \   ^^&#xA;         \  (oo)\___&#xA;            ()\       )\/\&#xA;                ||----w |&#xA;                ||     ||&#xA;&#xA;Options&#xA;cowsay -f tux hello&#xA; _____&#xA; hello &#xA; -------&#xA;   \&#xA;    \&#xA;        .--.&#xA;       |oo |&#xA;       |:/ |&#xA;      //   \ \&#xA;     (|     | )&#xA;    /&#39;\   /`\&#xA;    \)=(/&#xA;&#xA;cowsay -f daemon hello&#xA; ___&#xA; hello &#xA; -------&#xA;   \         ,        ,&#xA;    \       /(        )`&#xA;     \      \ \   / |&#xA;            /-   `-/  &#39;&#xA;           (/\/ \ \   /\&#xA;           / /   | `    \&#xA;           O O   ) /    |&#xA;           -^--&#39;&lt;     &#39;&#xA;          (.)    )   /&#xA;           ./    /&#xA;             `-----&#39; /&#xA;&lt;----.      /    \&#xA;&lt;----|====O)))==) \) /====&#xA;&lt;----&#39;    --&#39; .,&#39; \&#xA;             |        |&#xA;              \       /&#xA;        _____( (  / \___&#xA;      ,&#39;  ,-----&#39;   |        \&#xA;      `--{_______)        \/&#xA;&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Bash.#BashScripting,#Bashscripting,#Cowsay,#Fortune&#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>Fun bash stuff</p>

<p>While these are not bash commands, there are a few fun tools.</p>

<p>One is fortune,  this displays a random quote on the console or terminal.</p>

<pre><code>fortune
Many pages make a thick book, except for pocket Bibles which are on very
very thin paper.
</code></pre>

<p>Another is cowsay which takes an argument and prints a picture of a cow (there are options to change how it looks or to other characters)</p>

<pre><code>cowsay hello
 _______
&lt; hello &gt;
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

</code></pre>

<p>As with other commands these can be combined</p>

<pre><code>fortune | cowsay
 ________________________________________
/ I don&#39;t know half of you half as well  \
| as I should like; and I like less than |
| half of you half as well as you        |
| deserve.                               |
|                                        |
\ -- J. R. R. Tolkien                    /
 ----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
</code></pre>

<p>Options</p>

<pre><code>cowsay -f tux hello
 _______
&lt; hello &gt;
 -------
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /&#39;\_   _/`\
    \___)=(___/

</code></pre>

<pre><code>cowsay -f daemon hello
 _______
&lt; hello &gt;
 -------
   \         ,        ,
    \       /(        )`
     \      \ \___   / |
            /- _  `-/  &#39;
           (/\/ \ \   /\
           / /   | `    \
           O O   ) /    |
           `-^--&#39;`&lt;     &#39;
          (_.)  _  )   /
           `.___/`    /
             `-----&#39; /
&lt;----.     __ / __   \
&lt;----|====O)))==) \) /====
&lt;----&#39;    `--&#39; `.__,&#39; \
             |        |
              \       /
        ______( (_  / \______
      ,&#39;  ,-----&#39;   |        \
      `--{__________)        \/

</code></pre>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>.<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:Cowsay" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Cowsay</span></a>,<a href="/paulsutton/tag:Fortune" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Fortune</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/fun-bash-stuff</guid>
      <pubDate>Tue, 13 May 2025 07:00:00 +0000</pubDate>
    </item>
    <item>
      <title>More security : fail2ban</title>
      <link>https://personaljournal.ca/paulsutton/more-security-fail2ban</link>
      <description>&lt;![CDATA[More security : fail2ban&#xA;&#xA;Fail2ban is a program that will help you with the security of your system.&#xA;&#xA;There is a tutorial for this at Linux Handbook, so I have quoted the description, or part of, below.&#xA;&#xA;This is where a tool like Fail2Ban comes into picture. Fail2Ban is a free and open source software that helps in securing your Linux server against malicious logins. Fail2Ban will ban the IP (for a certain time) if there is a certain number of failed login attempts. [1]&#xA;Links&#xA;&#xA;1] [Linux handbook : fail2ban&#xA;&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Linux,#Bash,#ssh,#Security,#fail2ban&#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>More security : fail2ban</p>

<p>Fail2ban is a program that will help you with the security of your system.</p>

<p>There is a tutorial for this at Linux Handbook, so I have quoted the description, or part of, below.</p>

<pre><code>This is where a tool like Fail2Ban comes into picture. Fail2Ban is a free and open source software that helps in securing your Linux server against malicious logins. Fail2Ban will ban the IP (for a certain time) if there is a certain number of failed login attempts. [1]
</code></pre>

<p><strong>Links</strong></p>

<p>[1] <a href="https://linuxhandbook.com/run-shell-script/" rel="nofollow">Linux handbook : fail2ban</a></p>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

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

<p><a href="/paulsutton/tag:Linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Linux</span></a>,<a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:ssh" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ssh</span></a>,<a href="/paulsutton/tag:Security" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Security</span></a>,<a href="/paulsutton/tag:fail2ban" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">fail2ban</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/more-security-fail2ban</guid>
      <pubDate>Thu, 08 May 2025 06:00:00 +0000</pubDate>
    </item>
    <item>
      <title>Removing users</title>
      <link>https://personaljournal.ca/paulsutton/removing-users</link>
      <description>&lt;![CDATA[Removing users&#xA;&#xA;To remove a user, you can issue the following, as we are no longer setting up a gopher server on the pi, I will just remove the user.  &#xA;&#xA;sudo deluser gopher&#xA;&#xA;Which will remove the user, but not that users /home directory, which for the most part is fine if you want to keep hold of the user account data.&#xA;&#xA;For more information and options,  consult the man page&#xA;&#xA;man deluser&#xA;Chat&#xA;&#xA;I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.&#xA;&#xA;Tags&#xA;&#xA;#Bash,#Bashscripting,#BashScripting#users,#removing&#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>Removing users</p>

<p>To remove a user, you can issue the following, as we are no longer setting up a gopher server on the pi, I will just remove the user.</p>

<pre><code>sudo deluser gopher
</code></pre>

<p>Which will remove the user, but not that users /home directory, which for the most part is fine if you want to keep hold of the user account data.</p>

<p>For more information and options,  consult the man page</p>

<pre><code>man deluser
</code></pre>

<p><strong>Chat</strong></p>

<p>I am on the <a href="https://www.dcglug.org.uk/" rel="nofollow">Devon and Cornwall Linux user group</a> mailing list and also their <a href="https://matrix.to/#/%23dcglug:matrix.org" rel="nofollow">matrix channel</a> as zleap, it is better to ask there, that way others can answer too.</p>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a><a href="/paulsutton/tag:users" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">users</span></a>,<a href="/paulsutton/tag:removing" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">removing</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/removing-users</guid>
      <pubDate>Wed, 07 May 2025 06:00:00 +0000</pubDate>
    </item>
    <item>
      <title>Viewing processes</title>
      <link>https://personaljournal.ca/paulsutton/viewing-processes</link>
      <description>&lt;![CDATA[Viewing processes&#xA;&#xA;You can view a table that shows currently running processes and information about them.&#xA;&#xA;There are several tools for this:-  Both of these update in real time so you can see what is going on&#xA;&#xA;One is top &#xA;man top&#xA;top&#xA;&#xA;top&#xA;&#xA;The other is htop, which is the same as top, but has a colour output.&#xA;&#xA;man htop&#xA;htop&#xA;&#xA;htop&#xA;&#xA;These are really useful tools,  there is also ps&#xA;&#xA;man ps&#xA;$ ps&#xA;    PID TTY          TIME CMD&#xA;  51221 pts/0    00:00:00 bash&#xA;  51239 pts/0    00:00:00 ps&#xA;ps -a&#xA;    PID TTY          TIME CMD&#xA;  51251 pts/0    00:00:00 ps&#xA;ps -u&#xA;USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND&#xA;psutton    51221  0.0  0.0  11284  5504 pts/0    Ss   22:51   0:00 bash&#xA;psutton    51256  0.0  0.0  13760  4608 pts/0    R+   22:53   0:00 ps -u&#xA;ps -x&#xA;&#xA;PID TTY      STAT   TIME COMMAND&#xA;   2016 ?        Ss     0:00 /usr/lib/systemd/systemd --user&#xA;   2017 ?        S      0:00 (sd-pam)&#xA;   2029 ?        S&lt;sl   0:13 /usr/bin/pipewire&#xA;   2030 ?        Ssl    0:00 /usr/bin/pipewire -c filter-chain.conf&#xA;   2031 ?        S&lt;sl   0:00 /usr/bin/wireplumber&#xA;   2033 ?        S&lt;sl   0:21 /usr/bin/pipewire-pulse&#xA;Note : Above is NOT full output,  &#xA;&#xA;If you are ever unsure as to what a process is, you can try seeing if there is a man page.&#xA;NAME&#xA;       pipewire - The PipeWire media server&#xA;If not,  you can look it up using a search tool such as duckduckgo, which from this I found info on wireplumber on the Arch Linux wiki.&#xA;&#xA;Links&#xA;&#xA;Linux performance tools&#xA;&#xA;Tags&#xA;&#xA;#Bash,#Tools,#Processes,#htop,#top&#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>Viewing processes</p>

<p>You can view a table that shows currently running processes and information about them.</p>

<p>There are several tools for this:–  Both of these update in real time so you can see what is going on</p>

<p>One is top</p>

<pre><code>man top
top
</code></pre>

<p><img src="https://salsa.debian.org/zleap-guest/blog-media/-/raw/master/top.png" alt="top"></p>

<p>The other is htop, which is the same as top, but has a colour output.</p>

<pre><code>man htop
htop
</code></pre>

<p><img src="https://salsa.debian.org/zleap-guest/blog-media/-/raw/master/htop.png" alt="htop"></p>

<p>These are really useful tools,  there is also ps</p>

<pre><code>man ps
</code></pre>

<pre><code>$ ps
    PID TTY          TIME CMD
  51221 pts/0    00:00:00 bash
  51239 pts/0    00:00:00 ps
</code></pre>

<pre><code>ps -a
    PID TTY          TIME CMD
  51251 pts/0    00:00:00 ps
</code></pre>

<pre><code>ps -u
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
psutton    51221  0.0  0.0  11284  5504 pts/0    Ss   22:51   0:00 bash
psutton    51256  0.0  0.0  13760  4608 pts/0    R+   22:53   0:00 ps -u
</code></pre>

<pre><code>ps -x

PID TTY      STAT   TIME COMMAND
   2016 ?        Ss     0:00 /usr/lib/systemd/systemd --user
   2017 ?        S      0:00 (sd-pam)
   2029 ?        S&lt;sl   0:13 /usr/bin/pipewire
   2030 ?        Ssl    0:00 /usr/bin/pipewire -c filter-chain.conf
   2031 ?        S&lt;sl   0:00 /usr/bin/wireplumber
   2033 ?        S&lt;sl   0:21 /usr/bin/pipewire-pulse
</code></pre>

<p>Note : Above is NOT full output,</p>

<p>If you are ever unsure as to what a process is, you can try seeing if there is a man page.</p>

<pre><code>NAME
       pipewire - The PipeWire media server
</code></pre>

<p>If not,  you can look it up using a search tool such as <a href="https://duckduckgo.com/" rel="nofollow">duckduckgo</a>, which from this I found info on <a href="https://wiki.archlinux.org/title/WirePlumber" rel="nofollow">wireplumber</a> on the Arch Linux wiki.</p>

<p><strong>Links</strong></p>
<ul><li><a href="https://www.brendangregg.com/linuxperf.html" rel="nofollow">Linux performance tools</a></li></ul>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Tools" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Tools</span></a>,<a href="/paulsutton/tag:Processes" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Processes</span></a>,<a href="/paulsutton/tag:htop" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">htop</span></a>,<a href="/paulsutton/tag:top" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">top</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/viewing-processes</guid>
      <pubDate>Sat, 03 May 2025 06:00:00 +0000</pubDate>
    </item>
    <item>
      <title>Bash scripting 24 – firewalls</title>
      <link>https://personaljournal.ca/paulsutton/bash-scripting-24-firewalls</link>
      <description>&lt;![CDATA[Bash scripting 24 – firewalls&#xA;&#xA;I am still experimenting with gopher, however this got me thinking about system security, so I have installed.&#xA;&#xA;If you are not sure what you are doing with this, please consult the man page&#xA;&#xA;man ufw&#xA;&#xA;So this describes ufw as&#xA;&#xA;ufw - program for managing a netfilter firewall&#xA;As I am ssh&#39;d in to the pi, then the firewall needs to be enabled, however, first make sure that that port 22 (or which ever port you are using for ssh) is allowed.   I have to do this as being logged in via ssh, emabling the firewall could block ssh preventing access.&#xA;&#xA;sudo ufw allow 22&#xA;&#xA;Then check the status&#xA;&#xA;sudo ufw status&#xA;Status: active&#xA;&#xA;To                         Action      From&#xA;--                         ------      ----&#xA;22                         ALLOW       Anywhere                  &#xA;22 (v6)                  ALLOW       Anywhere (v6)             &#xA;&#xA;To confirm that port 22 is allowed,  then enable&#xA;&#xA;sudo ufw enable&#xA;&#xA;Links&#xA;&#xA;using UFW&#xA;Port Numbers&#xA;Wikipedia TCP&#xA;Wikipedia UDP&#xA;&#xA;Tags&#xA;&#xA;#Bash,#Bashscripting,#BashScripting#Security,#Firewall&#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>Bash scripting 24 – firewalls</p>

<p>I am still experimenting with gopher, however this got me thinking about system security, so I have installed.</p>

<p>If you are not sure what you are doing with this, please consult the man page</p>

<pre><code>man ufw
</code></pre>

<p>So this describes ufw as</p>

<pre><code>ufw - program for managing a netfilter firewall
</code></pre>

<p>As I am ssh&#39;d in to the pi, then the firewall needs to be enabled, however, first make sure that that port 22 (or which ever port you are using for ssh) is allowed.   I have to do this as being logged in via ssh, emabling the firewall could block ssh preventing access.</p>

<pre><code>sudo ufw allow 22
</code></pre>

<p>Then check the status</p>

<pre><code>sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
22 (v6)                  ALLOW       Anywhere (v6)             
</code></pre>

<p>To confirm that port 22 is allowed,  then enable</p>

<pre><code>sudo ufw enable
</code></pre>

<p><strong>Links</strong></p>
<ul><li><a href="https://learnubuntu.com/ufw-commands/" rel="nofollow">using UFW</a></li>
<li><a href="https://www.newtechie.com/2014/07/list-of-common-tcpudp-port-numbers.html" rel="nofollow">Port Numbers</a></li>
<li><a href="https://en.wikipedia.org/wiki/Transmission_Control_Protocol" rel="nofollow">Wikipedia TCP</a></li>
<li><a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol" rel="nofollow">Wikipedia UDP</a></li></ul>

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

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a><a href="/paulsutton/tag:Security" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Security</span></a>,<a href="/paulsutton/tag:Firewall" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Firewall</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/bash-scripting-24-firewalls</guid>
      <pubDate>Tue, 29 Apr 2025 06:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>