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

<channel>
	<title>Sandy &#8211; Sandy Scott&#039;s Web Spot</title>
	<atom:link href="https://www.sandyscott.net/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sandyscott.net</link>
	<description>My little corner of the web</description>
	<lastBuildDate>Wed, 25 Jun 2025 19:50:15 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Neovim from scratch</title>
		<link>https://www.sandyscott.net/2025/06/neovim-from-scratch/</link>
					<comments>https://www.sandyscott.net/2025/06/neovim-from-scratch/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Tue, 24 Jun 2025 21:29:56 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=927</guid>

					<description><![CDATA[So, after playing around with lazyvim and getting quite frustrated with all sorts of weirdness due to mismatched versions and suchlike, I thought I&#8217;d dig into the fundamentals and build my own setup, install various plugins manually, maybe setup an LSP from scratch. This is not a beginner tutorial &#8211;...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2025/06/neovim-from-scratch/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>So, after playing around with lazyvim and getting quite frustrated with all sorts of weirdness due to mismatched versions and suchlike, I thought I&#8217;d dig into the fundamentals and build my own setup, install various plugins manually, maybe setup an LSP from scratch.</p>



<p>This is not a beginner tutorial &#8211; if you&#8217;ve never used vim or neovim before then there plenty of videos, blogs and even books to help you get started. Also, if you have a working installation of [neo]vim, then you can also start it and type: <code>:Tutor</code> (including the colon) and press enter and follow the instructions.</p>



<p>Anyway, lets dig in. First port of call, as always, is the manual.</p>



<pre class="wp-block-code"><code>:help</code></pre>



<p>I wont&#8217; reproduce the whole help file here, but this first page is super useful, as it tells you how to find specific information, like on a specific command or option:</p>



<pre class="wp-block-code"><code>help.txt        Nvim

                        VIM - main help file
                                                                         k  
      Move around:  Use the cursor keys, or "h" to go left,            h   l
                    "j" to go down, "k" to go up, "l" to go right.       j
Close this window:  Use ":q&lt;Enter&gt;".                                        
   Get out of Vim:  Use ":qa!&lt;Enter&gt;" (careful, all changes are lost!).
        
Jump to a subject:  Position the cursor on a tag (e.g. bars) and hit CTRL-].
   With the mouse:  Double-click the left mouse button on a tag, e.g. bars.
        Jump back:  Type CTRL-O.  Repeat to go further back.
                                                
Get specific help:  It is possible to go directly to whatever you want help
                    on, by giving an argument to the :help command. 
                    Prepend something to specify the context:  help-context   
        
                          WHAT                  PREPEND    EXAMPLE
                      Normal mode command                  :help x
                      Visual mode command         v_       :help v_u
                      Insert mode command         i_       :help i_&lt;Esc&gt;
                      Command-line command        :        :help :quit
                      Command-line editing        c_       :help c_&lt;Del&gt;
                      Vim command argument        -        :help -r
                      Option                      '        :help 'textwidth'
                      Regular expression          /        :help /&#91;
                    See help-summary for more contexts and an explanation.
</code></pre>



<p>We can make the help full screen with <code>:only</code>.</p>



<p>Before we start adding our own stuff, lets have a quick look at what gets included by default. <code>:help initialization</code> shows a serious list of stuff that goes on under the hood when Neovim is started.</p>



<p>Item 4. mentions <code>default-mappings </code>and <code>default-autocmds</code>, take a quick look at those to see what&#8217;s going on.</p>



<p>One little note, if you&#8217;re going to get deep into Neovim, I recommend you get used to Lua. This means that the mapping functions end up looking different. Instead of adding <code>:noremap F3</code> i to your <code>init.vim</code>, you put <code>vim.keymap.set('F3','i')</code> in your <code>init.lua</code>.</p>



<p>On the subject of key mappings, there are a few useful tools to keep in mind:</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>:help index</strong></td><td>Shows the default key list</td></tr><tr><td><strong>:map</strong></td><td>Shows a list of all the mappings currently in effect</td></tr><tr><td><strong>:help map-which-keys</strong></td><td>Some advice from the manual about which keys to use for mappings</td></tr></tbody></table></figure>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2025/06/neovim-from-scratch/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Advanced Apt &#8211; 1. What is a Repository?</title>
		<link>https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/</link>
					<comments>https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Sun, 01 Jun 2025 17:52:30 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=917</guid>

					<description><![CDATA[This post series is to clarify some of the more advanced stuff about how apt works, specifically when dealing with multiple repositories and versions, that you might want to use apt-pinning to sort out. What is a repository? This is an important question, because answering it explains where a lot...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>This post series is to clarify some of the more advanced stuff about how apt works, specifically when dealing with multiple repositories and versions, that you might want to use apt-pinning to sort out.</p>



<h1 class="wp-block-heading">What is a repository?</h1>



<p>This is an important question, because answering it explains where a lot of the different fields or tags come from when you&#8217;re describing how to select packages.</p>



<p>A repository is just a web server, with files arranged in a specific way that allows <code>apt</code> to collect all the metadata about all the hosted packages and then download the one you want.</p>



<p>Lets take a look at sources.list to find one, the default for Debian 12 (Bookworm) is:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">deb http://deb.debian.org/debian bookworm main contrib non-free-firmware non-free
deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware non-free
deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware non-free</pre></div>



<p>so the first <code>deb</code> just tells us this repository contains the binary files, the only other option is <code>deb-src</code>, which means instead it contains the source code. The next bit <a href="http://deb.debian.org/debian">http://deb.debian.org/debian</a> is the url for the repository, so before we look the rest of the line, lets look there:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2025/06/image.png"><img fetchpriority="high" decoding="async" width="492" height="567" src="https://www.sandyscott.net/wp-content/uploads/2025/06/image.png" alt="" class="wp-image-919" srcset="https://www.sandyscott.net/wp-content/uploads/2025/06/image.png 492w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-260x300.png 260w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-130x150.png 130w" sizes="(max-width: 492px) 100vw, 492px" /></a></figure>



<p>As you can see it&#8217;s just a list of files and folder, and conveniently the owner of the repo has implemented a nice web interface so we can see that. The critical info is in the <code>dists/</code> folder:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2025/06/image-1.png"><img decoding="async" width="524" height="810" src="https://www.sandyscott.net/wp-content/uploads/2025/06/image-1.png" alt="" class="wp-image-921" srcset="https://www.sandyscott.net/wp-content/uploads/2025/06/image-1.png 524w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-1-194x300.png 194w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-1-97x150.png 97w" sizes="(max-width: 524px) 100vw, 524px" /></a></figure>



<p>There&#8217;s quite a few things in here, but actually less than it first appears. So there are versions of debian referred to in 3 different ways:</p>



<ul class="wp-block-list">
<li>Version &#8211; the 3 Debian XX.YY folders at the top</li>



<li>Release Codename &#8211; bookworm, trixie etc.</li>



<li>Suite names or release aliases &#8211; stable, testing etc.</li>



<li></li>
</ul>



<p>You also have a sub suite or sub release for some combination of</p>



<ul class="wp-block-list">
<li>backports</li>



<li>backports-sloppy</li>



<li>updates</li>



<li>proposed-updates</li>
</ul>



<p>Lets open up <a href="https://deb.debian.org/debian/dists/bookworm/">bookworm</a></p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2025/06/image-2.png"><img decoding="async" width="595" height="424" src="https://www.sandyscott.net/wp-content/uploads/2025/06/image-2.png" alt="" class="wp-image-923" srcset="https://www.sandyscott.net/wp-content/uploads/2025/06/image-2.png 595w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-2-300x214.png 300w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-2-150x107.png 150w" sizes="(max-width: 595px) 100vw, 595px" /></a></figure>



<p>Notice that the 4 names of the folders at the bottom match the last 4 values on the deb line, but for now well have a look at <a href="https://deb.debian.org/debian/dists/bookworm/Release">Release</a> (it&#8217;s a plain text file)</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">Origin: Debian
Label: Debian
Suite: stable
Version: 12.11
Codename: bookworm
Changelogs: https://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog
Date: Sat, 17 May 2025 09:13:04 UTC
Acquire-By-Hash: yes
No-Support-for-Architecture-all: Packages
Architectures: all amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x
Components: main contrib non-free-firmware non-free
Description: Debian 12.11 Released 17 May 2025
MD5Sum:
 0ed6d4c8891eb86358b94bb35d9e4da4  1484322 contrib/Contents-all
 d0a0325a97c42fd5f66a8c3e29bcea64    98581 contrib/Contents-all.gz
 f49a4e0893e46866e12d086ec218fd81   840868 contrib/Contents-amd64
 06c8860da678334327980e51b5c1780b    60955 contrib/Contents-amd64.gz
 ...</pre></div>



<p>Now we&#8217;re getting somewhere. This has a lot of useful data laid out in black and white</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Field</strong></td><td><strong>Data</strong></td><td><strong>Description</strong></td></tr><tr><td>Origin</td><td>Debian</td><td>Who made the package</td></tr><tr><td>Label</td><td>Debian</td><td>? (appears to always be &#8220;Debian&#8221; in here)</td></tr><tr><td>Suite</td><td>stable</td><td></td></tr><tr><td>Version</td><td>12.11</td><td></td></tr><tr><td>Codename</td><td>bookworm</td><td></td></tr><tr><td>Architectures</td><td>all amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x</td><td>List of processor architectures for which this repository contains compiled software</td></tr><tr><td>Components</td><td>main contrib non-free-firmware non-free</td><td>Subdivisions within the repository &#8211; for the main Debian repositories the distinction is about how free the software is.</td></tr></tbody></table></figure>



<p>Lets drill a bit deeper. If you do into <a href="https://deb.debian.org/debian/dists/bookworm/main/binary-amd64/">main/binary-amd64/</a> the, download and extract <a href="https://deb.debian.org/debian/dists/bookworm/main/binary-amd64/Packages.gz">Packages.gz</a> you&#8217;ll get another plain text file with a massive list of data about the packages you can install, here&#8217;s an excerpt:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">...
Package: apt
Version: 2.6.1
Installed-Size: 4232
Maintainer: APT Development Team &lt;deity@lists.debian.org&gt;
Architecture: amd64
Replaces: apt-transport-https (&lt;&lt; 1.5~alpha4~), apt-utils (&lt;&lt; 1.3~exp2~)
Provides: apt-transport-https (= 2.6.1)
Depends: adduser, gpgv | gpgv2 | gpgv1, libapt-pkg6.0 (&gt;= 2.6.1), debian-archive-keyring, libc6 (&gt;= 2.34), libgcc-s1 (&gt;= 3.0), libgnutls30 (&gt;= 3.7.5), libseccomp2 (&gt;= 2.4.2), libstdc++6 (&gt;= 11), libsystemd0
Recommends: ca-certificates
Suggests: apt-doc, aptitude | synaptic | wajig, dpkg-dev (&gt;= 1.17.2), gnupg | gnupg2 | gnupg1, powermgmt-base
Breaks: apt-transport-https (&lt;&lt; 1.5~alpha4~), apt-utils (&lt;&lt; 1.3~exp2~), aptitude (&lt;&lt; 0.8.10)
Description: commandline package manager
Description-md5: 9fb97a88cb7383934ef963352b53b4a7
Tag: admin::package-management, devel::lang:ruby, hardware::storage,
 hardware::storage:cd, implemented-in::c++, implemented-in::perl,
 implemented-in::ruby, interface::commandline, network::client,
 protocol::ftp, protocol::http, protocol::ipv6, role::program,
 scope::application, scope::utility, suite::debian, use::downloading,
 use::organizing, use::playing, use::searching, works-with-format::html,
 works-with::audio, works-with::software:package, works-with::text
Section: admin
Priority: required
Filename: pool/main/a/apt/apt_2.6.1_amd64.deb
Size: 1372852
MD5sum: 2a077296b9b9f4f8b027f86d9500192b
SHA256: 6ea03cbbc7a7bfcee601c9fb08d4e026fd522ede5350561f06867ad9c0a0fa6b                                                                                                                 

Package: apt-doc
Source: apt
...</pre></div>



<p>Here you&#8217;ve got the name of the package, it&#8217;s version, processor architecture and dependencies and some metadata like the Description, Tags, Section (for a categorised list). The file hashes at the end are used by apt to download the file.</p>



<h3 class="wp-block-heading">More reading:</h3>



<ul class="wp-block-list">
<li>Apt Configuration: <a href="https://wiki.debian.org/AptConfiguration#apt_preferences_.28APT_pinning.29">https://wiki.debian.org/AptConfiguration#apt_preferences_.28APT_pinning.29</a></li>



<li>Apt preferences (ie. apt pinning) <a href="https://manpages.debian.org/buster/apt/apt_preferences.5.en.html">https://manpages.debian.org/buster/apt/apt_preferences.5.en.html</a></li>



<li>APT Repositories Explained <a href="https://gist.github.com/CodingKoopa/3b30afe8c91e3950f6b124cd2abe3b6b">https://gist.github.com/CodingKoopa/3b30afe8c91e3950f6b124cd2abe3b6b</a></li>



<li><code>apt-cache policy</code></li>



<li><code>apt-cache policy [packagename]</code></li>
</ul>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Update Nextcloud</title>
		<link>https://www.sandyscott.net/2024/08/update-nextcloud/</link>
					<comments>https://www.sandyscott.net/2024/08/update-nextcloud/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Fri, 16 Aug 2024 20:36:39 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=877</guid>

					<description><![CDATA[If you&#8217;re updating Nextcloud, it offers the alternative to run the upgrade via the command line: However, on most systems you&#8217;ll have to work a little harder than just On my system there are 2 main problems: This is the command I use: And a few of the other commonly-used...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2024/08/update-nextcloud/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;re updating Nextcloud, it offers the alternative to run the upgrade via the command line:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2024/08/image.png"><img loading="lazy" decoding="async" width="749" height="602" src="https://www.sandyscott.net/wp-content/uploads/2024/08/image.png" alt="" class="wp-image-878" srcset="https://www.sandyscott.net/wp-content/uploads/2024/08/image.png 749w, https://www.sandyscott.net/wp-content/uploads/2024/08/image-300x241.png 300w, https://www.sandyscott.net/wp-content/uploads/2024/08/image-150x121.png 150w, https://www.sandyscott.net/wp-content/uploads/2024/08/image-350x280.png 350w" sizes="auto, (max-width: 749px) 100vw, 749px" /></a></figure>



<p>However, on most systems you&#8217;ll have to work a little harder than just</p>



<pre class="wp-block-code"><code>./occ upgrade</code></pre>



<p>On my system there are 2 main problems:</p>



<ul class="wp-block-list">
<li>You don&#8217;t generally login as the same user as the Nextcloud web service &#8211; as I&#8217;m using a Debian system the correct user is <code>www-data</code>. </li>



<li>It needs to start PHP to run the command, which by default doesn&#8217;t include the APCu module when you start it from the command line, so we need to fix that.</li>
</ul>



<p>This is the command I use:</p>



<pre class="wp-block-code"><code>sudo -u www-data php --define apc.enable_cli=1 ./occ upgrade</code></pre>



<p>And a few of the other commonly-used commands after updating (the Administration Overview screen will tell you which of these you need to run:</p>



<pre class="wp-block-code"><code>sudo -u www-data php --define apc.enable_cli=1 ./occ maintenance:repair --include-expensive
sudo -u www-data php --define apc.enable_cli=1 ./occ db:add-missing-indices</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2024/08/update-nextcloud/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Relay Contact Materials</title>
		<link>https://www.sandyscott.net/2022/05/relay-contact-materials/</link>
					<comments>https://www.sandyscott.net/2022/05/relay-contact-materials/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Wed, 04 May 2022 11:13:35 +0000</pubDate>
				<category><![CDATA[PLCs]]></category>
		<category><![CDATA[controlengineering]]></category>
		<category><![CDATA[relay]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=859</guid>

					<description><![CDATA[I&#8217;ve made this quick reference guide to help pick the contact materials for your relay. The abbreviations are those used by Finder. Abbreviation Material Benefits Downsides Used for AgNi Silver Nickel Low Cost, popular Everything. Resistive Loads, slightly inductive loads AgNi + Au Silver Nickel + Gold plated Lower contact...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2022/05/relay-contact-materials/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve made this quick reference guide to help pick the contact materials for your relay. The abbreviations are those used by Finder.</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Abbreviation</strong></td><td><strong>Material</strong></td><td><strong>Benefits</strong></td><td><strong>Downsides</strong></td><td><strong>Used for</strong></td></tr><tr><td>AgNi</td><td>Silver Nickel</td><td>Low Cost, popular</td><td></td><td>Everything. Resistive Loads, slightly inductive loads</td></tr><tr><td>AgNi + Au</td><td>Silver Nickel + Gold plated</td><td>Lower contact resistance</td><td></td><td>Low power loads. Use at medium power will erode the gold and turn it into an AgNi contact.</td></tr><tr><td>AgCdO</td><td>Silver Cadmium Oxide</td><td>Good Resistance to contact welding</td><td>Cadmium is toxic, and is slowly being banned.</td><td>Heavy Inductive Loads with large inrush currents</td></tr><tr><td>AgSnO2</td><td>Silver Tin<br>Oxide</td><td>Best Resistance to contact welding</td><td></td><td>Capacitive Loads with very large inrush currents (more than twice as much as AgCdO</td></tr></tbody></table></figure>



<p>Sources:</p>



<ul class="wp-block-list"><li><a href="https://www.finder-relais.net/en/Finder-general-technical-information-en.pdf">Finder relays, general technical information (finder-relais.net)</a></li><li><a href="https://www.findernet.com/en/uk/news/relay-contact-materials-does-it-matter/">Relay contact materials – does it matter? &#8211; Finder (findernet.com)</a></li><li><a href="https://ibex.tech/resources/geek-area/electronics/relays/relay-contact-materials">Relay Contact Materials – IBEX Resources</a></li><li><a href="https://eblogbd.com/relay-contact-materials-and-load-capacity-in-brief/">How to choose relay as per relay contact material for variations of load. &#8211; Electrical Blog (eblogbd.com)</a></li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2022/05/relay-contact-materials/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>KiCad Simulation &#8211; Node sequence</title>
		<link>https://www.sandyscott.net/2022/03/kicad-simulation-node-sequence/</link>
					<comments>https://www.sandyscott.net/2022/03/kicad-simulation-node-sequence/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Thu, 17 Mar 2022 11:13:26 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=846</guid>

					<description><![CDATA[I&#8217;ve just started using KiCad, and I&#8217;m really impressed. However, setting up a simulation can be awkward, because you need to match up the pin numbers from your schematic (which defines what is connected to what) with the node numbers that you ngspice model has. Most people encounter this first...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2022/03/kicad-simulation-node-sequence/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve just started using KiCad, and I&#8217;m really impressed. However, setting up a simulation can be awkward, because you need to match up the pin numbers from your schematic (which defines what is connected to what) with the node numbers that you ngspice model has.</p>



<p>Most people encounter this first with transistors. eg. a typical BJT has the following pin assignments:</p>



<ol class="wp-block-list"><li>Emitter</li><li>Base</li><li>Collector</li></ol>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image.png"><img loading="lazy" decoding="async" width="346" height="225" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image.png" alt="" class="wp-image-847" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image.png 346w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-300x195.png 300w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-150x98.png 150w" sizes="auto, (max-width: 346px) 100vw, 346px" /></a><figcaption>This is fine &#8211; KiCad is mainly for creating PCBs, so the most important thing is that the pins on the schematic match up to the pins on the footprint on the PCB.<br></figcaption></figure>



<p>However, our simulation models have nodes, and each node will correspond to a pin on the schematic and PCB, so we need to make sure that each pin is connected to the right node.</p>



<p>From the datasheet you&#8217;ll be able to get the pin assignments &#8211; e.g. pin 2 is the Base. Where do you find the ngspice node assignments? It depends on the type of spice model you&#8217;re using. </p>



<ul class="wp-block-list"><li>Built-in .MODEL. These are used for standard components, so the behaviour of the component can be defined with just a few parameters &#8211; e.g. for a basic simulation all you need to know about a resistor is the resistance. There are 17 types of model.</li><li>Custom .SUBCKT (Sub-circuit). These can be used for components that don&#8217;t fit into the standard categories, or for a complete add-on board.</li></ul>



<p>Which one is it? In KiCad, look at the spice model editor:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image-1.png"><img loading="lazy" decoding="async" width="348" height="116" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image-1.png" alt="" class="wp-image-848" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image-1.png 348w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-1-300x100.png 300w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-1-150x50.png 150w" sizes="auto, (max-width: 348px) 100vw, 348px" /></a><figcaption>The first highlighted text shows that this is a .MODEL</figcaption></figure>



<h2 class="wp-block-heading">.MODEL</h2>



<p>To get the information you need, you&#8217;ll need to <a href="http://ngspice.sourceforge.net/docs/ngspice-html-manual/manual.xhtml#magicparlabel-952">look at the ngspice manual</a>.</p>



<p>This includes the <a href="http://ngspice.sourceforge.net/docs/ngspice-html-manual/manual.xhtml#magicparlabel-952">list of 17 standard models</a> (reproduced here):</p>



<figure class="wp-block-table"><table><tbody><tr><td>Code</td><td>Model Type</td></tr><tr><td>R</td><td>Semiconductor resistor model</td></tr><tr><td>C</td><td>Semiconductor capacitor model</td></tr><tr><td>L</td><td>Inductor model</td></tr><tr><td>SW</td><td>Voltage controlled switch</td></tr><tr><td>CSW</td><td>Current controlled switch</td></tr><tr><td>URC</td><td>Uniform distributed RC model</td></tr><tr><td>LTRA</td><td>Lossy transmission line model</td></tr><tr><td>D</td><td>Diode model</td></tr><tr><td>NPN</td><td>NPN BJT model</td></tr><tr><td>PNP</td><td>PNP BJT model</td></tr><tr><td>NJF</td><td>N-channel JFET model</td></tr><tr><td>PJF</td><td>P-channel JFET model</td></tr><tr><td>NMOS</td><td>N-channel MOSFET model</td></tr><tr><td>PMOS</td><td>P-channel MOSFET model</td></tr><tr><td>NMF</td><td>N-channel MESFET model</td></tr><tr><td>PMF</td><td>P-channel MESFET model</td></tr><tr><td>VDMOS</td><td>Power MOS model</td></tr></tbody></table></figure>



<p>Go back to KiCad Spice Model Editor</p>



<figure class="wp-block-image size-full is-style-default"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image-1.png"><img loading="lazy" decoding="async" width="348" height="116" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image-1.png" alt="" class="wp-image-848" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image-1.png 348w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-1-300x100.png 300w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-1-150x50.png 150w" sizes="auto, (max-width: 348px) 100vw, 348px" /></a><figcaption>The second highlighted text shows that this is an NPN BJT.</figcaption></figure>



<p>So, now look at <a href="http://ngspice.sourceforge.net/docs/ngspice-html-manual/manual.xhtml#magicparlabel-8435">the section of the ngspice manual for BJTs</a>:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image-3.png"><img loading="lazy" decoding="async" width="687" height="361" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image-3.png" alt="" class="wp-image-850" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image-3.png 687w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-3-300x158.png 300w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-3-150x79.png 150w" sizes="auto, (max-width: 687px) 100vw, 687px" /></a></figure>



<p>This tells us that ngspice expects the nodes to be listed in the order <strong>collector</strong>, <strong>base</strong>, <strong>emitter</strong>.</p>



<p>We&#8217;ll use this later.</p>



<h2 class="wp-block-heading">.SUBCKT</h2>



<p>Sub-circuits can be easy to figure out, or they can be hard, depending on whether the creator of the model has made sensible choices about the node names.</p>



<p>Look at the KiCad Spice Model Editor &#8211; this example is from a manufacturer spice model of an N-channel MOSFET, that has chosen to use .SUBCKT instead of .MODEL:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image-4.png"><img loading="lazy" decoding="async" width="365" height="134" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image-4.png" alt="" class="wp-image-851" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image-4.png 365w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-4-300x110.png 300w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-4-150x55.png 150w" sizes="auto, (max-width: 365px) 100vw, 365px" /></a><figcaption>The stuff immediately after the .SUBCKT is what we need &#8211; the first thing is the type of device, the next 3 items are the nodes, helpfully lablled as <strong>drain</strong>, <strong>gate </strong>and <strong>source </strong>in that order.</figcaption></figure>



<h2 class="wp-block-heading">Alternate Node Sequence</h2>



<p>Now we&#8217;re ready to fill in the Alternate Node Sequence box in KiCad:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image-5.png"><img loading="lazy" decoding="async" width="365" height="51" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image-5.png" alt="" class="wp-image-852" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image-5.png 365w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-5-300x42.png 300w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-5-150x21.png 150w" sizes="auto, (max-width: 365px) 100vw, 365px" /></a></figure>



<p>In this you write a list of the <strong>pin numbers</strong>, separated by spaces, in the correct <strong>node sequence</strong>.</p>



<p>e.g. for our BJT example we know that the correct node sequence is</p>



<p><strong><em>collector, base, emmitter</em></strong></p>



<p>Recall our pin assigments:</p>



<ol class="wp-block-list"><li>Emitter</li><li>Base</li><li>Collector</li></ol>



<p>So I&#8217;ll rewrite the node sequence with the pin number in brackets:</p>



<p><strong><em>collector (3), base(2), emmitter(1)</em></strong></p>



<p>Now all we need are the pin numbers, so strip out everything else:</p>



<p><strong><em>3 2 1</em></strong></p>



<p>And put that in the Alternate Node Sequence box:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2022/03/image-6.png"><img loading="lazy" decoding="async" width="242" height="37" src="https://www.sandyscott.net/wp-content/uploads/2022/03/image-6.png" alt="" class="wp-image-853" srcset="https://www.sandyscott.net/wp-content/uploads/2022/03/image-6.png 242w, https://www.sandyscott.net/wp-content/uploads/2022/03/image-6-150x23.png 150w" sizes="auto, (max-width: 242px) 100vw, 242px" /></a><figcaption>Hit OK and we&#8217;re done!</figcaption></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2022/03/kicad-simulation-node-sequence/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Backup</title>
		<link>https://www.sandyscott.net/2022/02/backup/</link>
					<comments>https://www.sandyscott.net/2022/02/backup/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Mon, 21 Feb 2022 22:04:43 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=838</guid>

					<description><![CDATA[I&#8217;ve been using SpiderOak for backup, and to cut a long story short it&#8217;s becoming tiresome. In fairness, it&#8217;s not really meant for backing up servers, but there&#8217;s still a lot of things it could do better. So I&#8217;m on the hunt for an offsite backup solution for this server....<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2022/02/backup/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve been using SpiderOak for backup, and to cut a long story short it&#8217;s becoming tiresome. In fairness, it&#8217;s not really meant for backing up servers, but there&#8217;s still a lot of things it could do better.</p>



<p>So I&#8217;m on the hunt for an offsite backup solution for this server.</p>



<p>This is Linux, so nothing is simple &#8211; the solution is divided into two pieces:</p>



<ul class="wp-block-list"><li>Remote data storage service &#8211; to actually hold the data.</li><li>Backup software &#8211; to figure out what needs to be uploaded, and keep track of versions and suchlike.</li></ul>



<p>For the remote side I&#8217;ve got three real options:</p>



<ul class="wp-block-list"><li>rsync.net &#8211; starts at $10/mo for 400 GB</li><li>Backblaze B2 &#8211; starts at $5/mo for 1TB</li><li>Wasabi &#8211; starts at $5.99/mo for 1TB</li></ul>



<p>However, although rsync.net looks pretty simple &#8211; the price isn&#8217;t competitive. Backblaze B2 and Wasabi are similar &#8211; the benefit of Wasabi is that the&#8217;s no extra charges for downloads &#8211; B2 has a 1GB daily download threshold, and you start getting charged if you go over that.</p>



<p>For the backup software. These are the options I&#8217;m looking at. Please note that tools like rsync and rclone aren&#8217;t backup tools &#8211; they&#8217;re just for syncing, so don&#8217;t manage the versions or encryption</p>



<ul class="wp-block-list"><li>duplicity</li><li>borg</li><li>restic</li><li>duplicacy</li><li>Duplicati</li></ul>



<h3 class="wp-block-heading" id="duplicacy">Duplicacy</h3>



<p>I&#8217;m going to rule this one out right away it&#8217;s not free &#8211; I&#8217;m only mentioning it because it&#8217;s often included in conversations about Linux backup software.</p>



<h3 class="wp-block-heading" id="duplicity">Duplicity</h3>



<p>Duplicity has been described as an <a href="https://www.backblaze.com/blog/backing-linux-backblaze-b2-duplicity-restic/">old-school approach by this Backblaze blog post</a>. That means it&#8217;s the model whereby you create a backup of everything &#8211; a <strong>full backup</strong>, then the next time you back up you only back up what&#8217;s changed &#8211; that&#8217;s an <strong>incremental backup</strong>. This can be space-efficient and fast and easy to understand, but the downside is to do a restore you need the last full backup, and all the incremental backups since then. This then creates headaches about deciding when to create a new full backup and how often to get rid of the old ones. Having said that it&#8217;s a respected and reliable tool which supports everything it needs to: Encryption, Compression, Backblaze B2 storage is supported, Wasabi is not.</p>



<h3 class="wp-block-heading" id="restic">Restic</h3>



<p>The same article describes Restic as the new-school tool &#8211; which supports deduplication to save space. There isn&#8217;t a version 1.0.0 yet, but it seems to be fairly popular already, and supports B2 storage &amp; Wasabi.</p>



<h3 class="wp-block-heading" id="borg">Borg</h3>



<p>Borg is also a deduplicating backup software &#8211; seems to be a bit less fashionable that restic, a bit more mature. As far as I can tell the key advantage that Borg offers is compression, but can be slower with large respositories and large files because it&#8217;s single-threaded. However it doesn&#8217;t natively support remote object storage, so needs another tool to upload the data. <a href="https://forum.rclone.org/t/borgbackup-backblaze-b2-uploading/3679/5">See this forum post</a>. It has some nice features, like the ability to mount a backup as a FUSE filesystem so you can browse it.</p>



<h3 class="wp-block-heading" id="duplicati">Duplicati</h3>



<p>Not sure which type of tool this is. It does support B2 storage, but not Wasabi. Some people have had issues with reliability with it.</p>



<h2 class="wp-block-heading" id="final-thoughts">Final Thoughts</h2>



<p>I&#8217;ve gone with restic and Backblaze B2. They can talk to each other directly, but I like the idea of having a local copy of the repo, so I&#8217;ve set restic to backup to a portable HDD, the which then is copied to Backblaze. This means I have the offsite copy in case my house burns down but can still get at the data in more mundane scenarios.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2022/02/backup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux software updates &#8211; How to resolve changed configuration files.</title>
		<link>https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/</link>
					<comments>https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Fri, 02 Apr 2021 15:46:00 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[dpkg]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=821</guid>

					<description><![CDATA[Sometimes, when you&#8217;re updating software on your Linux machine, the person maintaining the package will have also updated the default configuration file that ships with the software. This is an issue if you have customised that configuration file on your system &#8211; the system doesn&#8217;t know whether it should keep...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>Sometimes, when you&#8217;re updating software on your Linux machine, the person maintaining the package will have also updated the default configuration file that ships with the software.</p>



<p>This is an issue if you have customised that configuration file on your system &#8211; the system doesn&#8217;t know whether it should keep your version, use the new one, or something else. So it asks you to decide what to do about it.</p>



<p>I&#8217;m using Debian, which uses the <code>dpkg </code>package management system &#8211; that name may be unfamiliar, but if you&#8217;ve used any of the Debain family (Ubuntu, Mint, MX, elementary etc.) you will have used one of the friendlier wrappers around it: <code>apt </code>or <code>apt-get</code>.</p>



<p>Today, it&#8217;s the Collabora Office configuration file that has been updated:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">Configuration file '/etc/loolwsd/loolwsd.xml'
 ==&gt; Modified (by you or by a script) since installation.
 ==&gt; Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D    : show the differences between the versions
      Z    : start a shell to examine the situation
 The default action is to keep your current version.
*** loolwsd.xml (Y/I/N/O/D/Z) [default=N] ?</pre></div>



<ul class="wp-block-list"><li>The first option is self-explanatory &#8211; you&#8217;ll lose any customizations you&#8217;ve made, but that might be OK for you.</li><li>Keeping your currently-installed version is usually OK &#8211; well designed software shouldn&#8217;t break because it&#8217;s missing a line in an old configuration file.</li></ul>



<p>In either case the system will keep a copy of the one you don&#8217;t pick, so you can change your mind later. If you choose to use the package mantainer&#8217;s version, there will be a copy of your old one with <code>.dpkg-old</code> added to the filename. If you keep you own config file, the package maintainer&#8217;s version will be saved alongside it, with <code>.dpkg-dist</code> added to the filename.</p>



<ul class="wp-block-list"><li>Choosing option D can help you decide &#8211; but ultimately doesn&#8217;t resolve the situation.</li><li>Option Z is the point of today&#8217;s post &#8211; this is how you can fix the situation.</li></ul>



<p>Lets hit Z, and this is what I get:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}"> The default action is to keep your current version.
*** loolwsd.xml (Y/I/N/O/D/Z) [default=N] ? Z
Useful environment variables:
 - DPKG_SHELL_REASON
 - DPKG_CONFFILE_OLD
 - DPKG_CONFFILE_NEW
Type 'exit' when you're done.
root@waldorf:/# </pre></div>



<p>The system tells you about 3 environment variables that might be useful to help fix the situation. here I&#8217;ve use the echo command (with a $ before the environment variable name) to see what&#8217;s in them:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">root@waldorf:/# echo $DPKG_SHELL_REASON
conffile-prompt
root@waldorf:/# echo $DPKG_CONFFILE_OLD
/etc/loolwsd/loolwsd.xml
root@waldorf:/# echo $DPKG_CONFFILE_NEW
/etc/loolwsd/loolwsd.xml.dpkg-new</pre></div>



<p>DPKG_CONFFILE_PROMPT isn&#8217;t much use to us, but the other two are. We can start a program to compare and merge the differences between the two. I&#8217;m using Neovim in diff mode &#8211; there are lots of otherways of doing this &#8211; I&#8217;d suggest you do your research and find your preferred merge tool or text editor.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">root@waldorf:/# nvim -d $DPKG_CONFFILE_OLD $DPKG_CONFFILE_NEW</pre></div>



<p>I wont to get into the details of how to use [Neo]vim, but if you&#8217;re already a vim user and haven&#8217;t used diff mode before, these commands will get you started. <a href="https://neovim.io/doc/user/diff.html">You can find more info in the documentation.</a></p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Keystrokes</strong></td><td><strong>Command</strong></td></tr><tr><td>&lt;Ctrl-w&gt; l</td><td>Move to the right window</td></tr><tr><td>&lt;Ctrl-w&gt; h</td><td>Move to the left window</td></tr><tr><td>]c</td><td>Move to the next change</td></tr><tr><td>[c</td><td>Move to the previous change</td></tr><tr><td>:diffget</td><td>Copy the change you&#8217;re on from the other window</td></tr><tr><td>:diffput</td><td>Push the change from your current window into the other one.</td></tr></tbody></table></figure>



<dl class="wp-block-simple-definition-list-blocks-list"></dl>



<p>Note that the last two commands will make the files the same at that point</p>



<p>Modifiy one of the files (I typically modify my old file &#8211; pulling the changes from the new one that I want, and leaving the ones that I don&#8217;t), then save and exit your text editor or mergetool</p>



<p>Type exit at the prompt, then the system will ask you again what you want to do:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">*** loolwsd.xml (Y/I/N/O/D/Z) [default=N] ?</pre></div>



<p>In this case I&#8217;ll choose N or O because I&#8217;ve made the changes I want to the original config file.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install Sage Math from source on WSL</title>
		<link>https://www.sandyscott.net/2020/12/install-sage-math-from-source-on-wsl/</link>
					<comments>https://www.sandyscott.net/2020/12/install-sage-math-from-source-on-wsl/#comments</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Wed, 02 Dec 2020 15:59:14 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sage]]></category>
		<category><![CDATA[sagemath]]></category>
		<category><![CDATA[WSL]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=747</guid>

					<description><![CDATA[Here&#8217;s how I got a fully featured Sage Math install on my system. I did this because I wanted to run on windows, and still be able to install packages, which isn&#8217;t possible with the precompiled binary. Basic process: Enable hardware assisted virtualization. Set up WSL (Windows Subsystem for Linux)...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/12/install-sage-math-from-source-on-wsl/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>Here&#8217;s how I got a fully featured Sage Math install on my system. I did this because I wanted to run on windows, and still be able to install packages, which isn&#8217;t possible with the precompiled binary.</p>



<h2 class="wp-block-heading">Basic process:</h2>



<ol class="wp-block-list"><li>Enable hardware assisted virtualization.</li><li>Set up WSL (Windows Subsystem for Linux)</li><li>Install Linux into WSL</li><li>Download and compile Sage</li><li>Configure JupyterLab</li><li>Make it easy to start from windows</li></ol>



<h2 class="wp-block-heading">Enable hardware assisted virtualization</h2>



<p>WSL requires that your system supports hardware assisted virtualization (which pretty much all modern systems do), there are 3 things that you need to get it working:</p>



<ul class="wp-block-list"><li>The CPU must support it</li><li>The motherboard must support it.</li><li>You need to enable it in the EFI (or BIOS)</li></ul>



<p>This article takes you through getting everything sorted out:</p>



<p><a href="https://support.bluestacks.com/hc/en-us/articles/115003174386-How-to-enable-Virtualization-VT-on-Windows-10-for-BlueStacks-4">https://support.bluestacks.com/hc/en-us/articles/115003174386-How-to-enable-Virtualization-VT-on-Windows-10-for-BlueStacks-4</a></p>



<h2 class="wp-block-heading">Set up WSL 2</h2>



<p>Follow this guide: <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">https://docs.microsoft.com/en-us/windows/wsl/install-win10</a></p>



<h2 class="wp-block-heading">Install and configure Linux:</h2>



<ol class="wp-block-list"><li>Go to the Microsoft store and install Ubuntu.</li></ol>



<p>Note: If you already have Ubuntu installed, I&#8217;d recommend you follow these instructions to set up a separate, clean install for sage: <a href="https://hfakhraei.github.io/Install-multiple-instance-of-same-Linux-Distribution-on-WSL">https://hfakhraei.github.io/Install-multiple-instance-of-same-Linux-Distribution-on-WSL</a></p>



<ol class="wp-block-list" start="2"><li>Start Ubuntu from the start menu. A command window should pop up.</li><li>Run these commands to update Ubuntu:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">    sudo apt update
    sudo apt upgrade</pre></div>



<ol class="wp-block-list" start="4"><li>Reboot by going (in Windows) to Services and restarting the LxssManager. You can also shut down all running WSL instances using the command <code>wsl --shutdown</code> in the Windows command prompt or Powershell.</li><li>If necessary upgrade to the latest release: <a href="https://linuxconfig.org/how-to-upgrade-ubuntu-to-20-10">https://linuxconfig.org/how-to-upgrade-ubuntu-to-20-10</a></li></ol>



<h2 class="wp-block-heading">Set up Sage</h2>



<p>These instructions are a simplified version of the official documentation: <a href="https://doc.sagemath.org/html/en/installation/source.html">https://doc.sagemath.org/html/en/installation/source.html</a></p>



<ol class="wp-block-list"><li>Start Ubuntu &#8211; All the commands in this section should be run on the Ubuntu installation.</li><li>Install the packages we need to have ready in advance:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo apt install bc binutils bzip2 ca-certificates cliquer cmake coinor-cbc coinor-libcbc-dev curl default-jdk dvipng eclib-tools fflas-ffpack ffmpeg flintqs g++ gcc gfan gfortran git glpk-utils gmp-ecm imagemagick latexmk lcalc libatomic-ops-dev libavdevice-dev libboost-dev libbraiding-dev libbrial-dev libbrial-groebner-dev libbz2-dev libcdd-dev libcdd-tools libcliquer-dev libcurl4-openssl-dev libec-dev libecm-dev libffi-dev libfile-slurp-perl libflint-arb-dev libflint-dev libfreetype6-dev libgc-dev libgd-dev libgf2x-dev libgiac-dev libgivaro-dev libglpk-dev libgmp-dev libgsl-dev libiml-dev libisl-dev libjson-perl liblfunction-dev liblrcalc-dev liblzma-dev libm4rie-dev libmongodb-perl libmpc-dev libmpfi-dev libmpfr-dev libnauty-dev libncurses5-dev libntl-dev libopenblas-dev libpari-dev libpcre3-dev libperl-dev libplanarity-dev libppl-dev libpython3-dev libreadline-dev librw-dev libsqlite3-dev libssl-dev libsuitesparse-dev libsvg-perl libsymmetrica2-dev libterm-readkey-perl libterm-readline-gnu-perl libxml2-dev libxml-libxslt-perl libxml-writer-perl libz-dev libzmq3-dev libzn-poly-dev m4 make nauty ninja-build openssl palp pandoc pari-doc pari-elldata pari-galdata pari-galpol pari-gp2c pari-seadata patch perl pkg-config planarity ppl-dev python3 python3-distutils r-base-dev r-cran-lattice sqlite3 sympow tachyon tar texlive texlive-xetex xcas xz-utils yasm</pre></div>



<ol class="wp-block-list" start="3"><li>Download and extract the source tarball into a subfolder of your home directory</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd ~
wget http://www.mirrorservice.org/sites/www.sagemath.org/src/sage-9.2.tar.gz
tar xvf sage-9.2.tar.gz</pre></div>



<ol class="wp-block-list" start="4"><li>Start building</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd sage-9.2/
./configure
make</pre></div>



<p>This will take a long time (3 hours on my system)</p>



<ol class="wp-block-list" start="5"><li>Test sage</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">./sage</pre></div>



<p>You should get a prompt that looks like this:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.2, Release Date: 2020-10-24                     │
│ Using Python 3.8.6. Type &quot;help()&quot; for help.                        │
└────────────────────────────────────────────────────────────────────┘
sage:</pre></div>



<ol class="wp-block-list" start="6"><li>Type <code>exit </code>and press enter to leave.</li></ol>



<ol class="wp-block-list" start="7"><li>Make the command available from anywhere on this ubuntu system &#8211; edit ~/.bashrc and add this line:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">alias sage=~/sage-9.2/sage</pre></div>



<ol class="wp-block-list" start="8"><li>Close ubuntu then reopen it.</li><li>Try typing <code>sage</code> and verify that it starts.</li></ol>



<h2 class="wp-block-heading">JupyterLab</h2>



<ol class="wp-block-list"><li>Install Jupyter Lab and it&#8217;s extras:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sage -i jupyterlab_widgets</pre></div>



<p>This also involves compliation from source, so will take a while.</p>



<ol class="wp-block-list" start="2"><li>When it&#8217;s done, try starting the jupyterlab notebook like this:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sage --notebook jupyterlab</pre></div>



<p>You might notice a problem &#8211; the list of files only includes those on your linux machine &#8211; you probably want the ones on your windows computer. You can do this by navigating to where the windows files are mounted in linux.</p>



<ol class="wp-block-list" start="3"><li>Try it (fill in your windows username instead of the square brackets):</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd /mnt/c/Documents\ and\ Settings\[your windows username]
sage --notebook jupyterlab</pre></div>



<p>The list of files should now be the ones in that folder on your windows machine.</p>



<ol class="wp-block-list" start="4"><li>Lets wrap this all in a script for convenience &#8211; Create a file called ~/<code>sage_nb.sh</code> and put these lines into it:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">#!/bin/bash
cd /mnt/c/Documents\ and\ Settings/[your windows username]
/home/[your linux username]/sage-9.2/sage --notebook jupyterlab</pre></div>



<ol class="wp-block-list" start="5"><li>We need to make it executable &#8211; ie. so linux will run this file like it would run a program:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">chmod ug+x sage_nb.sh</pre></div>



<ol class="wp-block-list" start="6"><li>Now go back to your home directory and try it again:</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd ~
./sage_nb.sh</pre></div>



<p>The JupyterLab server should start, showing your windows files in the browser.</p>



<h2 class="wp-block-heading">Create windows shortcut</h2>



<p>This is a final nicety that lets you start the JupyterLab server in one click:</p>



<ol class="wp-block-list"><li>Open Windows explorer, and type %APPDATA%\Microsoft\Windows\Start Menu\Programs</li><li>Make a copy of any of the program icons &#8211; we&#8217;ll customise it to do what we want</li><li>Right-click, and choose properties.</li><li>On the General tab:<ul><li>Change the name to whatever you want.</li></ul></li><li>On the Shortcut tab:<ul><li>Change Target to: <code>ubuntu.exe run ~/sage_nb.sh</code></li><li>Change Start in to: <code>%USERPROFILE%</code></li><li>Change Run to: Minimised</li><li>Change the icon if you want &#8211; there are plenty of pieces of software that can create a <code>.ico</code> icon file one from an image file.</li></ul></li><li>Now hit the start button or key and type the name you gave it. it should appear in the list, and should load the server and fire up your browser when you click on it.</li></ol>



<dl class="wp-block-simple-definition-list-blocks-list"></dl>



<h2 class="wp-block-heading">Software versions:</h2>



<p>This is what I used when I wrote this post &#8211; you might get different results if your versions are significantly different.</p>



<ul class="wp-block-list"><li>Windows 10 Pro Version 2004 (OS Build 19041.264)</li><li>Ubuntu 20.10 (Originally installed 20.04 as 20.10 was not available in the Windows Store)</li><li>Sage 9.2</li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/12/install-sage-math-from-source-on-wsl/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>UniLogic INT/REAL conversion blocks</title>
		<link>https://www.sandyscott.net/2020/09/unilogic-int-real-conversion-blocks/</link>
					<comments>https://www.sandyscott.net/2020/09/unilogic-int-real-conversion-blocks/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Fri, 25 Sep 2020 08:21:58 +0000</pubDate>
				<category><![CDATA[PLCs]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[UniLogic]]></category>
		<category><![CDATA[UniStream]]></category>
		<category><![CDATA[Unitronics]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=726</guid>

					<description><![CDATA[I don&#8217;t think the documentation for the Real to Int and Int to Real blocks in Unitronics UniLogic is very clear, so here&#8217;s my explanation: Real to Int There&#8217;s a special case when r2i_Precision_in is 0 (ie. round to the nearest integer): when the magnitude of th fractional part is...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/09/unilogic-int-real-conversion-blocks/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>I don&#8217;t think the documentation for the <strong>Real to Int</strong> and <strong>Int to Real</strong> blocks in Unitronics UniLogic is very clear, so here&#8217;s my explanation:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="678" height="236" src="https://www.sandyscott.net/wp-content/uploads/2020/09/image.png" alt="" class="wp-image-727" srcset="https://www.sandyscott.net/wp-content/uploads/2020/09/image.png 678w, https://www.sandyscott.net/wp-content/uploads/2020/09/image-300x104.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/09/image-150x52.png 150w" sizes="auto, (max-width: 678px) 100vw, 678px" /></figure>



<h2 class="wp-block-heading">Real to Int</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="321" height="147" src="https://www.sandyscott.net/wp-content/uploads/2020/09/image-1.png" alt="" class="wp-image-738" srcset="https://www.sandyscott.net/wp-content/uploads/2020/09/image-1.png 321w, https://www.sandyscott.net/wp-content/uploads/2020/09/image-1-300x137.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/09/image-1-150x69.png 150w" sizes="auto, (max-width: 321px) 100vw, 321px" /></figure>



<dl class="wp-block-simple-definition-list-blocks-list">
<dt class="wp-block-simple-definition-list-blocks-term">r2i_REAL_in (Data type: REAL):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">The real number to convert.</dd>



<dt class="wp-block-simple-definition-list-blocks-term">r2i_Precision_in (Data Types: UINT8, UINT16, UINT32):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">Number of decimal places to add to the fractional part.</dd>



<dt class="wp-block-simple-definition-list-blocks-term">r2i_INT_out (Data Types: INT8, INT16, INT32):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">this is the integer part of <strong>r2i_REAL_in</strong>, no matter what the value of <strong>r2i_Precision_in</strong> is.</dd>



<dt class="wp-block-simple-definition-list-blocks-term">r2i_frac_out: (Data Types: INT8, INT16, INT32):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">This is the fractional part of r2i_REAL_in, rounded to the specified number of decimal places, multiplied by 10^( r2i_Precision_in ).</dd>
</dl>



<p>There&#8217;s a special case when <strong>r2i_Precision_in</strong> is 0 (ie. round to the nearest integer): when the magnitude of th fractional part is less than 0.5, it will be 0, otherwise it will be 1 or -1, (the same sign as <strong>r2i_REAL_in</strong>). To get the correctly rounded number, you need to add <strong>r2i_frac_out</strong> to <strong>r2i_INT_out</strong></p>



<p>The behaviour when the number is too big to fit into either of the integers seems to be inconsistent. If r2i_INT_out is an INT32, then it will 2 147 483 647 if <strong>r2i_REAL_in</strong> is bigger than that, or -2147483648 if <strong>r2i_REAL_in</strong> is smaller than that. INT16s and INT8s sometimes overflow instead. (i.e. 128 becomes -128 if   <strong>r2i_INT_out</strong> is an INT8), but it doesn&#8217;t do this for all values). I&#8217;d avoid using this function in this situation if at all possible.</p>



<p>Examples:</p>



<figure class="wp-block-table is-style-stripes"><table><tbody><tr><td><strong>r2i_REAL_in</strong></td><td><strong>r2i_Precision_in</strong></td><td><strong>r2i_INT_out</strong></td><td><strong>r2i_frac_out</strong></td></tr><tr><td>123.456</td><td>3</td><td>123</td><td>456</td></tr><tr><td>123.500</td><td>1</td><td>123</td><td>5</td></tr><tr><td>123.500</td><td>0</td><td>123</td><td>1</td></tr><tr><td>-0.03</td><td>2</td><td>0</td><td>-3</td></tr><tr><td>-12.75</td><td>3</td><td>-12</td><td>-750</td></tr><tr><td>-12.75</td><td>0</td><td>-12</td><td>-1</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Int to Real</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="318" height="187" src="https://www.sandyscott.net/wp-content/uploads/2020/09/image-2.png" alt="" class="wp-image-739" srcset="https://www.sandyscott.net/wp-content/uploads/2020/09/image-2.png 318w, https://www.sandyscott.net/wp-content/uploads/2020/09/image-2-300x176.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/09/image-2-150x88.png 150w" sizes="auto, (max-width: 318px) 100vw, 318px" /></figure>



<dl class="wp-block-simple-definition-list-blocks-list">
<dt class="wp-block-simple-definition-list-blocks-term">i2r_INT_in (Data Types: INT8, INT16, INT32):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">Integer part of value. Not actually necessary, because you can do everything without it.</dd>



<dt class="wp-block-simple-definition-list-blocks-term">i2r_FRAC_in (Data Types: INT8, INT16, INT32):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">This is the only way to populate it the fractional part of the output, but it will also contribute to the fractional part.</dd>



<dt class="wp-block-simple-definition-list-blocks-term">i2r_DECPOS_in (Data Types: UINT8, UINT16, UINT32):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">This controls how <strong>i2r_FRAC_in</strong> is intepreted. Values above 7 result in the fractional part being ignored.</dd>



<dt class="wp-block-simple-definition-list-blocks-term">i2r_REAL_out (Data type: REAL):</dt>



<dd class="wp-block-simple-definition-list-blocks-details">The Real output value. This is calculated as:<br><strong>i2r_INT_in </strong>+ <strong>i2r_FRAC_in </strong>/ 10 ^ ( <strong>i2r_DECPOS_in </strong>)</dd>
</dl>



<p>Examples</p>



<figure class="wp-block-table is-style-stripes"><table><tbody><tr><td><strong>i2r_INT_in</strong></td><td><strong>i2r_FRAC_in</strong></td><td><strong>i2r_DECPOS_in</strong></td><td><strong>i2r_REAL_out</strong></td></tr><tr><td>156</td><td>456</td><td>3</td><td>156.456000</td></tr><tr><td>0</td><td>456</td><td>2</td><td>4.560000</td></tr><tr><td>13</td><td>214</td><td>2</td><td>15.140000</td></tr><tr><td>0</td><td>2147483647</td><td>7</td><td>214.748400</td></tr><tr><td>0</td><td>2147483647</td><td>8</td><td>0</td></tr></tbody></table></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/09/unilogic-int-real-conversion-blocks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Duck Pop-up Card</title>
		<link>https://www.sandyscott.net/2020/06/duck-pop-up-card/</link>
					<comments>https://www.sandyscott.net/2020/06/duck-pop-up-card/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Tue, 16 Jun 2020 08:26:29 +0000</pubDate>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[card]]></category>
		<category><![CDATA[duck]]></category>
		<category><![CDATA[pop-up]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=690</guid>

					<description><![CDATA[I made this card for my friend, I thought I&#8217;d share the pattern in case anyone want to make the same thing. Patterns: this .zip file contains: PDFs, which should be easiest to use, Original SVG files which you can open and edit in Inkscape (which is completely free). (Sorry...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/06/duck-pop-up-card/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>I made this card for my friend, I thought I&#8217;d share the pattern in case anyone want to make the same thing.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="790" height="484" src="https://www.sandyscott.net/wp-content/uploads/2020/06/image.png" alt="" class="wp-image-691" srcset="https://www.sandyscott.net/wp-content/uploads/2020/06/image.png 790w, https://www.sandyscott.net/wp-content/uploads/2020/06/image-300x184.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/06/image-768x471.png 768w, https://www.sandyscott.net/wp-content/uploads/2020/06/image-150x92.png 150w" sizes="auto, (max-width: 790px) 100vw, 790px" /></figure>



<p>Patterns: this .zip file contains:</p>



<ul class="wp-block-list"><li>PDFs, which  should be easiest to use,</li><li>Original SVG files which you can open and edit in <a href="https://inkscape.org/">Inkscape </a>(which is completely free).</li></ul>



<div class="wp-block-file"><a href="https://www.sandyscott.net/wp-content/uploads/2020/06/DuckPattern.zip">DuckPattern.zip</a><a href="https://www.sandyscott.net/wp-content/uploads/2020/06/DuckPattern.zip" class="wp-block-file__button" download>Download</a></div>



<p>(Sorry for the poor quality photo &#8211; it&#8217;s a still from a video of me making it &#8211; I didn&#8217;t take any others before sending it.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/06/duck-pop-up-card/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
