tag:blogger.com,1999:blog-36152412502140090422024-03-14T10:19:31.450+00:00Andrew PottsUnknownnoreply@blogger.comBlogger405125tag:blogger.com,1999:blog-3615241250214009042.post-47279823560046563652024-01-23T09:02:00.005+00:002024-01-23T09:29:04.596+00:00ASP.NET Development Certificates in TraefikThe ASP.NET Core HTTPS development certificate can be created with the <a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-dev-certs" target="_blank">dotnet dev-certs</a> command.<div><br /></div><div>It is found in Certificate Manager (User Certificates, NOT Local Computer) under the Personal Certificates and Trusted Root Certification Authorities nodes.</div><div><br /></div><div>You can search for it by it's SHA-1 hash (known as the thumbprint in the Certificate Details tab).</div><div><br /></div><div>To export the certificate for use in a Traefik Reverse Proxy, type:</div><div><br /></div><div>dotnet dev-certs https --export-path aspnet.crt --trust --format Pem --no-password</div><div><br /></div><div>and follow these instructions to add it to Traefik:</div><div><br /></div><div>https://www.andrewdixon.co.uk/2020/03/14/using-https-certificates-with-traefik-and-docker-for-a-development-environment/</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-17996286506975592722024-01-10T18:13:00.008+00:002024-01-10T19:01:18.240+00:00CSS Selector syntax in Chrome<p> </p><p>Chrome allows you to search for elements using <a href="https://www.w3schools.com/cssref/css_selectors.php" target="_blank">CSS selectors</a> or <a href="https://www.w3schools.com/xml/xpath_syntax.asp" target="_blank">XPath</a>.</p><p><a href="https://devdocs.io/puppeteer/index#pageselector-1" target="_blank">Puppeteer </a>uses <br /></p><p></p><ol style="text-align: left;"><li>Type selector </li><li>CSS Selector</li><li>Class selector </li><li>ID selector </li><li>Attribute selector </li></ol><p></p><h4>xpath selector</h4>
<table><tbody>
<tr><td>Find the anchor within the td</td><td><code>td a</code></td></tr>
</tbody></table>
<h4 style="text-align: left;">XPath</h4>
<table><tbody>
<tr><td>Find element with the text</td><td><code>//p[text()='Asset']</code></td></tr>
<tr><td>Find parent of the element with the text</td><td><code>//p[text()='Asset']/..</code></td></tr>
</tbody></table>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-52990959126782321592023-12-24T19:13:00.004+00:002023-12-24T19:13:56.700+00:00FreeBSD commands<p><br /></p><p>Find the date of modified files<br />https://forums.freebsd.org/threads/a-script-to-get-date-time-of-file-modification.12121/</p><p>find . -type f -exec stat -t "%Y-%m" -f "%Sm %N" {} \;</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-43103403062923638922023-12-23T18:51:00.000+00:002023-12-23T18:51:00.450+00:00Setting the DHCP domain name on a Draytek router<p>To set the domain that all DHCP clients become connected to; read the article:</p><p>https://faq.draytek.com.au/2011/12/14/how-do-i-set-the-domain-name-issued-by-the-dhcp-server/</p><p><br /></p><p>It is performed by issuing a command on the telnet interface:</p><p>sys domainname wan1 .local</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-18163403186018942872023-12-17T18:55:00.000+00:002023-12-17T18:55:08.854+00:00Emulator Summary<p></p><h2 style="text-align: left;">Z80 Spectrum</h2><a href="https://github.com/chernandezba/zesarux/tree/main" target="_blank">Zesarux</a> - a good Windows (and Linux) Z80 emulator with a wealth of command-line options. Good for testing Z80 Assembler.<p></p><p><a href="https://github.com/ArjunNair/Zero-Emulator" target="_blank">Zero Emulator</a> - a good Z80 Spectrum emulator, written in C#, that runs on Windows.</p><p></p><h2 style="text-align: left;">x86</h2><a href="https://gitlab.com/qemu-project/qemu" target="_blank">Qemu</a> - a good emulator that runs on Linux. Good for x86 assembly.<p></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-717369085159783012023-12-15T16:49:00.000+00:002023-12-15T16:49:14.371+00:00The role of launch.json and tasks.json in VSCode<p>Launch.json describes the activity that takes place when the <a href="https://code.visualstudio.com/docs/editor/debugging" target="_blank">debugger is launched</a> or the program is started.</p><p>It can rely upon a task defined in tasks.json - see "<a href="https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson" target="_blank">preLaunchTask</a>".</p><p>You can reference variables defined in settings.json.</p><p>You can build up a dependency tree of tasks using "dependsOn".</p><p>If you want to launch an application such as an emulator as part of the debugger - and leave it running - then you define it as a background task. But it is necessary <a href="https://stackoverflow.com/questions/44242048/how-to-make-vscode-not-wait-for-finishing-a-prelaunchtask" target="_blank">to set a problem watcher</a> for it to work.</p><p>You will need to manually close the task in VSCode when you are done debugging.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-76011160691922041252023-11-12T20:05:00.003+00:002023-11-12T20:06:00.369+00:00Docker cheatsheet<p>Attach to a running container:<br />docker exec -i -t <container> /bin/bash</p><p>Run networking tools:<br />docker run -d praqma/network-multitool --name netshoot<br />docker exec -it netshoot /bin/bash</p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-68046394191974654362023-11-09T09:37:00.001+00:002023-11-09T09:37:07.689+00:00Git cheatsheet<h2 style="text-align: left;">Tags</h2>
<table border="1">
<tbody><tr><td>Create a tag</td><td>git tag -a 1.0.0 -m "First release"</td></tr>
</tbody><tbody><tr><td>Delete a remote tag</td><td>git push --delete main 1.0.0</td></tr></tbody><tbody></tbody><tbody></tbody></table><h2>Commits</h2><table border="1"><tbody><tr><td>Remove all commit history and set the code as the only commit</td><td><pre style="--theme-background-attachment: auto; --theme-background-color: var(--white); --theme-background-position: top left; --theme-background-repeat: repeat; --theme-background-size: auto; --theme-base-primary-color-h: 27; --theme-base-primary-color-l: 48%; --theme-base-primary-color-s: 89%; --theme-body-font-color: var(--black-600); --theme-body-font-family: var(--ff-sans); --theme-button-active-background-color: initial; --theme-button-color: initial; --theme-button-hover-background-color: initial; --theme-button-hover-color: initial; --theme-button-outlined-border-color: initial; --theme-button-outlined-selected-border-color: initial; --theme-button-primary-active-background-color: initial; --theme-button-primary-active-color: initial; --theme-button-primary-background-color: initial; --theme-button-primary-color: initial; --theme-button-primary-hover-background-color: initial; --theme-button-primary-hover-color: initial; --theme-button-primary-selected-background-color: initial; --theme-button-primary-selected-color: initial; --theme-button-selected-background-color: initial; --theme-button-selected-color: initial; --theme-content-background-color: var(--white); --theme-content-border-color: var(--black-225); --theme-footer-background-border-top: 0; --theme-footer-background-color: hsl(210,8%,5%); --theme-footer-background-position: top left; --theme-footer-background-repeat: no-repeat; --theme-footer-background-size: auto; --theme-footer-divider-color: hsl(210,8%,25%); --theme-footer-link-caret-color: var(--theme-footer-background-color); --theme-footer-link-color-active: hsl(27,89%,48%); --theme-footer-link-color-hover: hsl(210,8%,68%); --theme-footer-link-color: hsl(210,8%,68%); --theme-footer-padding-bottom: 0; --theme-footer-padding-top: 0; --theme-footer-text-color: hsl(210,8%,68%); --theme-footer-title-color: hsl(210,9%,75%); --theme-header-background-border-bottom: 0; --theme-header-background-color: var(--theme-primary); --theme-header-background-position: center left; --theme-header-background-repeat: repeat; --theme-header-background-size: auto; --theme-header-foreground-color: transparent; --theme-header-foreground-position: bottom right; --theme-header-foreground-repeat: no-repeat; --theme-header-foreground-size: auto; --theme-header-link-color: var(--theme-primary); --theme-header-sponsored-color: hsla(0,0%,100%,0.4); --theme-link-color-hover: initial; --theme-link-color-visited: initial; --theme-link-color: initial; --theme-post-body-font-family: var(--ff-sans); --theme-post-owner-background-color: var(--theme-secondary-100); --theme-post-owner-new-background-color: var(--theme-secondary-200); --theme-post-title-color-hover: var(--theme-link-color-hover); --theme-post-title-color-visited: var(--theme-link-color-visited); --theme-post-title-color: var(--theme-link-color); --theme-post-title-font-family: var(--ff-sans); --theme-primary-custom-100: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .9))); --theme-primary-custom-200: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .75))); --theme-primary-custom-300: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .5))); --theme-primary-custom-400: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), var(--theme-base-primary-color-l)); --theme-primary-custom-500: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + (var(--theme-base-primary-color-l) * -.3))); --theme-primary-custom-600: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + (var(--theme-base-primary-color-l) * -.6))); --theme-primary-custom: var(--theme-primary-custom-400); --theme-tag-background-color: initial; --theme-tag-border-color: initial; --theme-tag-color: initial; --theme-tag-hover-background-color: initial; --theme-tag-hover-border-color: initial; --theme-tag-hover-color: initial; --theme-tag-required-background-color: var(--theme-secondary-500); --theme-tag-required-border-color: transparent; --theme-tag-required-color: var(--white); --theme-tag-required-hover-background-color: var(--theme-secondary-400); --theme-tag-required-hover-border-color: transparent; --theme-tag-required-hover-color: var(--white); --theme-topbar-bottom-border: 1px solid var(--black-225); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: #0c0d0e; font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--fs-body1); font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variant-position: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;"><code style="--theme-background-attachment: auto; --theme-background-color: var(--white); --theme-background-position: top left; --theme-background-repeat: repeat; --theme-background-size: auto; --theme-base-primary-color-h: 27; --theme-base-primary-color-l: 48%; --theme-base-primary-color-s: 89%; --theme-body-font-color: var(--black-600); --theme-body-font-family: var(--ff-sans); --theme-button-active-background-color: initial; --theme-button-color: initial; --theme-button-hover-background-color: initial; --theme-button-hover-color: initial; --theme-button-outlined-border-color: initial; --theme-button-outlined-selected-border-color: initial; --theme-button-primary-active-background-color: initial; --theme-button-primary-active-color: initial; --theme-button-primary-background-color: initial; --theme-button-primary-color: initial; --theme-button-primary-hover-background-color: initial; --theme-button-primary-hover-color: initial; --theme-button-primary-selected-background-color: initial; --theme-button-primary-selected-color: initial; --theme-button-selected-background-color: initial; --theme-button-selected-color: initial; --theme-content-background-color: var(--white); --theme-content-border-color: var(--black-225); --theme-footer-background-border-top: 0; --theme-footer-background-color: hsl(210,8%,5%); --theme-footer-background-position: top left; --theme-footer-background-repeat: no-repeat; --theme-footer-background-size: auto; --theme-footer-divider-color: hsl(210,8%,25%); --theme-footer-link-caret-color: var(--theme-footer-background-color); --theme-footer-link-color-active: hsl(27,89%,48%); --theme-footer-link-color-hover: hsl(210,8%,68%); --theme-footer-link-color: hsl(210,8%,68%); --theme-footer-padding-bottom: 0; --theme-footer-padding-top: 0; --theme-footer-text-color: hsl(210,8%,68%); --theme-footer-title-color: hsl(210,9%,75%); --theme-header-background-border-bottom: 0; --theme-header-background-color: var(--theme-primary); --theme-header-background-position: center left; --theme-header-background-repeat: repeat; --theme-header-background-size: auto; --theme-header-foreground-color: transparent; --theme-header-foreground-position: bottom right; --theme-header-foreground-repeat: no-repeat; --theme-header-foreground-size: auto; --theme-header-link-color: var(--theme-primary); --theme-header-sponsored-color: hsla(0,0%,100%,0.4); --theme-link-color-hover: initial; --theme-link-color-visited: initial; --theme-link-color: initial; --theme-post-body-font-family: var(--ff-sans); --theme-post-owner-background-color: var(--theme-secondary-100); --theme-post-owner-new-background-color: var(--theme-secondary-200); --theme-post-title-color-hover: var(--theme-link-color-hover); --theme-post-title-color-visited: var(--theme-link-color-visited); --theme-post-title-color: var(--theme-link-color); --theme-post-title-font-family: var(--ff-sans); --theme-primary-custom-100: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .9))); --theme-primary-custom-200: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .75))); --theme-primary-custom-300: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + ((100% - var(--theme-base-primary-color-l)) * .5))); --theme-primary-custom-400: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), var(--theme-base-primary-color-l)); --theme-primary-custom-500: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + (var(--theme-base-primary-color-l) * -.3))); --theme-primary-custom-600: hsl(var(--theme-base-primary-color-h), var(--theme-base-primary-color-s), calc(var(--theme-base-primary-color-l) + (var(--theme-base-primary-color-l) * -.6))); --theme-primary-custom: var(--theme-primary-custom-400); --theme-tag-background-color: initial; --theme-tag-border-color: initial; --theme-tag-color: initial; --theme-tag-hover-background-color: initial; --theme-tag-hover-border-color: initial; --theme-tag-hover-color: initial; --theme-tag-required-background-color: var(--theme-secondary-500); --theme-tag-required-border-color: transparent; --theme-tag-required-color: var(--white); --theme-tag-required-hover-background-color: var(--theme-secondary-400); --theme-tag-required-hover-border-color: transparent; --theme-tag-required-hover-color: var(--white); --theme-topbar-bottom-border: 1px solid var(--black-225); border-radius: 0px; border: 0px; box-sizing: inherit; color: var(--black-600); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--_pr-code-fs); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">git checkout --orphan newBranch
git add -A # Add all files and commit them
git commit
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master # Force push master branch to github
git gc --aggressive --prune=all # remove the old files</code></pre></td></tr></tbody><tbody></tbody><tbody><tr><td></td><td><br /></td></tr></tbody><tbody><tr><td><br /></td><td></td></tr></tbody></table>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-27058575893509008972023-11-02T17:45:00.001+00:002023-11-02T17:45:26.761+00:00Durable Functions vs Bespoke Event Sourcing<p> You can write an application that uses Event Sourcing using code like the <a href="https://github.com/ASOS/asos-eventsourcing" target="_blank">asos-eventsourcing</a> and <a href="https://github.com/ASOS/SimpleEventStore" target="_blank">SimpleEventStore</a>.</p><p>However, you can take advantage of the built-in event sourcing capabilities of <a href="https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-orchestrations?tabs=csharp-inproc" target="_blank">Durable Functions</a>.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-58021038761186163732023-08-02T20:56:00.008+01:002023-08-04T08:17:02.782+01:00Open TTD settings<h2 style="text-align: left;">Settings</h2><p>Settings > Interface > General > Close window on right-click: on</p><p>Settings > Disasters/Accidents > Vehicle breakdowns: none</p><p>Settings > Localisation > Speed units: Imperial (mpg)</p><p>Settings > World Generation > Road vehicles: Drive on left</p><p>Settings > Limitations > Vehicles never expire: on</p><p>Settings > Environment > Authorities > Allow buying exclusive transport rights: off</p><p><br /></p><h2 style="text-align: left;">GRFs</h2><p>BRTrains v2</p><p>British Town Names</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-34402251457488547972023-08-02T20:49:00.004+01:002023-08-02T20:49:41.791+01:00Get an app to open this 'ms-gamingoverlay' link error<p>Whenever I loaded <a href="https://www.openttd.org/" target="_blank">OpenTTD</a> on a locked-down machine it raised the error </p><p>"Get an app to open this 'ms-gamingoverlay' link"</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHc7s8RQsBuR6tiDe3GugxZ_XzTM1OSTr1MmnIOSdjlD6V604BQyCWH6x1PGMGUe_CrLg_4ogFPjQjBdNshajMXl9ihFuNHDq5bFTTW_O8iuivTqZ2QHg-tqlGmflbilBSBMLGAcVSqGoZAoe5qHzDoBVodP727dvo13j7PpD7c9jwlMQ_ljbU4uuIJjc/s678/AppCapture.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="336" data-original-width="678" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHc7s8RQsBuR6tiDe3GugxZ_XzTM1OSTr1MmnIOSdjlD6V604BQyCWH6x1PGMGUe_CrLg_4ogFPjQjBdNshajMXl9ihFuNHDq5bFTTW_O8iuivTqZ2QHg-tqlGmflbilBSBMLGAcVSqGoZAoe5qHzDoBVodP727dvo13j7PpD7c9jwlMQ_ljbU4uuIJjc/s320/AppCapture.png" width="320" /></a></div><br /><p>This was because Windows had detected a game had been loaded and started to invoke XBox Game features - such as the Game Bar and the ability to record video. However the PC was locked down through policy and these features were unavailable. Clicking on the "Browse Microsoft Store" link wouldn't work because the Windows Store was removed by policy.</p><p><a href="https://windowsreport.com/youll-need-new-app-open-ms-gamingoverlay-link/#:~:text=Windows%2010%20and,using%20the%20hotkey." target="_blank">This article</a> helped.</p><p>Creating the DWORD registry key</p><p>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR\AppCaptureEnabled</p><p>and setting the value to 0 fixed it.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-89224378938468022882023-06-22T10:01:00.002+01:002023-06-22T10:01:28.520+01:00Removing X-Frame-Options in ASP.NET MVC Core 7I had an ASP.NET Core 7 App that used forms.<div><br /></div><div>And I actually WANTED it to be used within an iFrame.</div><div><br /></div><div>As soon as you add a form to a Web App, the server immediately starts returning X-Frame-Options: SameOrigin in all requests.</div><div><br /></div><div>I tried a variety of means to remove this, including:</div><div><br /></div><div><div>app.UseStaticFiles();</div><div><br /></div><div> app.Use(async (context, next) =></div><div> {</div><div> context.Response.Headers.Remove("X-Frame-Options");</div><div> context.Response.Headers.Add("Bob", "Hello");</div><div> await next.Invoke();</div><div> });</div><div><br /></div><div><br /></div><div> app.UseRouting();</div></div><div><br /></div><div>The Bob header was being added, but X-Frame-Options stubbonly remained.</div><div>In the end I found the solution was to use:</div><div><br /></div><div><div>// Remove X-Frame-Options, allowing Framing</div><div> builder.Services.AddAntiforgery(options =></div><div> {</div><div> options.SuppressXFrameOptionsHeader = true;</div><div> });</div></div><div><br /></div><div><a href="https://blog.elmah.io/the-asp-net-core-security-headers-guide/">The ASP.NET Core security headers guide (elmah.io)</a></div><div><a href="https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-7.0">Enable Cross-Origin Requests (CORS) in ASP.NET Core | Microsoft Learn</a></div><div><a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-7.0#middleware-order">ASP.NET Core Middleware | Microsoft Learn</a></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-1086318556399476312023-06-17T10:05:00.002+01:002023-06-17T10:05:43.971+01:00Transferring domains to GoogleI decided to leave 123-reg after they chose to upgrade their email services and removed catch-all email forwarding.
I found a slight issue when transferring Nominet (.uk) domains to Google.
The transfer process requires Google to send a handshake email to the registrant's email address, requesting them to approve the transfer.
However, if you don't have a gmail address registered, you don't seem to get an email.
So it is important to set the registrant's contact email to a Gmail address first, before setting the IPS tag.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-162424141373171382023-02-25T16:40:00.001+00:002023-02-25T16:40:11.254+00:00FreeBSD discretionary ACLs<p> As well as the normal user,group,all file permissions, my FreeBSD server had additional ACLs that were preventing the NFS client from accessing files.</p><p><br /></p><p>To solve this, use <a href="https://man.freebsd.org/cgi/man.cgi?query=setfacl&apropos=0&sektion=1&manpath=FreeBSD+7.3-RELEASE&arch=default&format=html">setfacl</a>:</p><p>setfacl -bn *</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-75180406209758756582023-02-24T16:09:00.003+00:002023-02-24T16:09:29.457+00:00Docker bind mount assumes ownership of container user<p>I had a mosquitto image running in Docker, with a bind mount:</p><div style="background-color: #1e1e1e; color: #d4d4d4; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">docker run -it --name mosquitto -p 1883:1883 -v /home/pi/mosquitto/mosquitto:/mosquitto/ -v ~/mosquitto/mosquitto/log:/mosquitto/log -v ~/mosquitto/mosquitto/data:/mosquitto/data eclipse-mosquitto</div><p>Before I ran the container: I created the source folder and set the owner to pi:</p><div style="background-color: #1e1e1e; color: #d4d4d4; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">sudo chown -R pi /home/pi/mosquitto/</div><p>Yielding the following permissions</p><p>drwxr-xr-x 5 pi 1883 4096 Feb 19 20:14 mosquitto</p><p>On running the container the folder changes permissions:</p><p>drwxr-xr-x 5 1883 1883 4096 Feb 19 20:14 mosquitto</p><p>Debugging the container:</p><p>docker exec -it mosquitto /bin/sh</p><p>and checking the users:</p><p>sudo nano /etc/passwd</p><p>It can be seen that UID 1883 is the mosquitto user:</p><p>mosquitto:x:1883:1883:mosquitto:/var/empty:/sbin/nologin</p><p><br /></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-89862278725542394092023-02-24T15:59:00.006+00:002023-02-24T16:01:21.629+00:00Linux utilities<p><span color="var(--color-text-acc-2)" face="Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"" style="background-color: white; font-size: 16px; word-spacing: normal;">The strace program prints all the system calls made by a program.</span></p><pre style="border-radius: var(--global-radius); border: 1px solid var(--color-border); box-sizing: inherit; color: #333333; font-family: var(--font-mono); font-size: 16px; hyphens: none; line-height: var(--line-height-base); margin-bottom: var(--gap-lg) !important; margin-top: 0px; max-width: 100%; overflow-wrap: normal; overflow: auto; padding: var(--gap); tab-size: 4; width: 640px; word-break: normal;"><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: var(--global-radius); border: none; box-shadow: none; box-sizing: inherit; color: var(--color-text-acc-2); font-family: var(--font-mono); font-size: 0.9rem; hyphens: none; line-height: var(--line-height-base); margin: 0 0 var(--gap-lg); max-width: 100%; overflow-wrap: normal; overflow: auto; padding: 0px; position: relative; tab-size: 4; word-break: normal; word-spacing: normal;"><pre style="border-radius: var(--global-radius); border: 1px solid var(--color-border); box-sizing: inherit; font-family: var(--font-mono); font-size: 16px; hyphens: none; line-height: var(--line-height-base); margin-bottom: var(--gap-lg) !important; margin-top: 0px; max-width: 100%; overflow-wrap: normal; overflow: auto; padding: var(--gap); tab-size: 4; width: 640px; word-break: normal;"><span style="font-size: 0.9rem; word-spacing: normal;">strace ls -lhn $(which sleep) 2>&1 | grep passwd</span></pre><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;"><span style="word-spacing: normal;">What you are trying to see is whether </span><code style="background-color: var(--color-bg-acc-1); border-radius: var(--global-radius); border: 1px solid var(--color-border); box-sizing: inherit; color: var(--color-primary); font-family: var(--font-mono); font-size: 0.9rem; hyphens: none; line-height: var(--line-height-base); margin: 0 0 var(--gap-lg); max-width: 100%; overflow-wrap: normal; overflow: auto; padding: 0.1em 0.3em; position: relative; tab-size: 4; word-break: normal; word-spacing: normal;">ls</code><span style="word-spacing: normal;"> command is trying to read the </span><code style="background-color: var(--color-bg-acc-1); border-radius: var(--global-radius); border: 1px solid var(--color-border); box-sizing: inherit; color: var(--color-primary); font-family: var(--font-mono); font-size: 0.9rem; hyphens: none; line-height: var(--line-height-base); margin: 0 0 var(--gap-lg); max-width: 100%; overflow-wrap: normal; overflow: auto; padding: 0.1em 0.3em; position: relative; tab-size: 4; word-break: normal; word-spacing: normal;">/etc/passwd</code><span style="word-spacing: normal;"> file or not.</span></p><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;">Networking tools:</p><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEglI8-nzNhlNTvWJBsU3m06rsccmX7aYpYgzo4gXgp9ICJ7-80tiKznjLJlmJoJ7trge_OwSRklOu2XNhItVCpAziJLwhwrjBXrgx1NlkWbwijkZmdnA8g2xL-7QLc_7INRG5vLOXmkERAfyD5tgsZw96-4tbN_uvGNVSnwOSaONk_CXV5w4n9SQwv-" style="font-family: monospace; font-size: 14.4px; margin-left: 1em; margin-right: 1em; text-align: center; white-space: pre;"><img alt="" data-original-height="1680" data-original-width="1280" height="498" src="https://blogger.googleusercontent.com/img/a/AVvXsEglI8-nzNhlNTvWJBsU3m06rsccmX7aYpYgzo4gXgp9ICJ7-80tiKznjLJlmJoJ7trge_OwSRklOu2XNhItVCpAziJLwhwrjBXrgx1NlkWbwijkZmdnA8g2xL-7QLc_7INRG5vLOXmkERAfyD5tgsZw96-4tbN_uvGNVSnwOSaONk_CXV5w4n9SQwv-=w380-h498" width="380" /></a></p><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;">Performance tools:</p><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhchmg9g7-puI9FNwxwVC0OaezQEumJ4lnJdzyTTDOqpQMbu8Y95QbsxvJ0O4tOscZEdKwYpNL0G7L3QW_sEWVRLxlssOn3RP98OIA7ixRh9rtvg968dION0UuDBxwpWRdWMAybkMYurCkRAhGRQMzPKUscUbni3yKxrWrlfqxxwY9TGG0vsuDcAEPL/s920/linux.png" imageanchor="1" style="font-family: monospace; font-size: 14.4px; margin-left: 1em; margin-right: 1em; text-align: center; white-space: pre;"><img border="0" data-original-height="682" data-original-width="920" height="349" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhchmg9g7-puI9FNwxwVC0OaezQEumJ4lnJdzyTTDOqpQMbu8Y95QbsxvJ0O4tOscZEdKwYpNL0G7L3QW_sEWVRLxlssOn3RP98OIA7ixRh9rtvg968dION0UuDBxwpWRdWMAybkMYurCkRAhGRQMzPKUscUbni3yKxrWrlfqxxwY9TGG0vsuDcAEPL/w471-h349/linux.png" width="471" /></a></p><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;"><br /></p><p style="background-color: white; box-sizing: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: calc(0.1 + var(--line-height-base)); margin: 0 0 var(--gap-lg); white-space: normal;"></p><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><span style="background-color: white; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; text-align: left; white-space: normal;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><br /></div></code></pre><blockquote style="border: none; margin: 0 0 0 40px; padding: 0px;"><pre style="border-radius: var(--global-radius); border: 1px solid var(--color-border); box-sizing: inherit; color: #333333; font-family: var(--font-mono); font-size: 16px; hyphens: none; line-height: var(--line-height-base); margin-bottom: var(--gap-lg) !important; margin-top: 0px; max-width: 100%; overflow-wrap: normal; overflow: auto; padding: var(--gap); tab-size: 4; width: 640px; word-break: normal;"><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: var(--global-radius); border: none; box-shadow: none; box-sizing: inherit; color: var(--color-text-acc-2); font-family: var(--font-mono); font-size: 0.9rem; hyphens: none; line-height: var(--line-height-base); margin: 0 0 var(--gap-lg); max-width: 100%; overflow-wrap: normal; overflow: auto; padding: 0px; position: relative; tab-size: 4; word-break: normal; word-spacing: normal;"><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><br /></div></div></div></code></pre></blockquote><pre style="border-radius: var(--global-radius); border: 1px solid var(--color-border); box-sizing: inherit; color: #333333; font-family: var(--font-mono); font-size: 16px; hyphens: none; line-height: var(--line-height-base); margin-bottom: var(--gap-lg) !important; margin-top: 0px; max-width: 100%; overflow-wrap: normal; overflow: auto; padding: var(--gap); tab-size: 4; width: 640px; word-break: normal;"><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: var(--global-radius); border: none; box-shadow: none; box-sizing: inherit; color: var(--color-text-acc-2); font-family: var(--font-mono); font-size: 0.9rem; hyphens: none; line-height: var(--line-height-base); margin: 0 0 var(--gap-lg); max-width: 100%; overflow-wrap: normal; overflow: auto; padding: 0px; position: relative; tab-size: 4; word-break: normal; word-spacing: normal;"></code><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: var(--global-radius); border: none; box-shadow: none; box-sizing: inherit; color: var(--color-text-acc-2); font-family: var(--font-mono); font-size: 0.9rem; hyphens: none; line-height: var(--line-height-base); margin: 0 0 var(--gap-lg); max-width: 100%; overflow-wrap: normal; overflow: auto; padding: 0px; position: relative; tab-size: 4; word-break: normal; word-spacing: normal;"><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;">Pe<br /><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><br /><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><br /></div></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><p></p></code></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-21542856349385143842023-02-20T11:52:00.001+00:002023-02-20T11:52:04.112+00:00Setting a password remotely when you can't login to RDP<p> <a href="https://evotec.xyz/how-to-change-your-own-expired-password-when-you-cant-login-to-rdp/">How to change your own expired password when you can't login to RDP - Evotec</a></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-71564792239799499922023-02-05T19:37:00.006+00:002023-02-05T21:55:01.349+00:00Fine Offset WH1080 Weather Station and a Raspberry Pi<p>To receive the weather readings from a WH1080 by radio, you can use a SDR USB with a Raspberry Pi 3/4, however it will not work with a Raspberry Pi as it is's power requirements are too high. The SDR USBs draw considerable current from the USB port as they are powering the amplifier.</p><p>The appeal of using a Pi Zero is it's <a href="https://www.pidramble.com/wiki/benchmarks/power-consumption" target="_blank">low power usage</a> - it is approximately 0.7W (120mA) compare to a Pi 4's 5.1W (1010mA).<br /></p><p>So we need another radio receiver. The RFM01 and RFM12b are candidates, and <a href="https://www.susa.net/wordpress/2012/08/raspberry-pi-reading-wh1081-weather-sensors-using-an-rfm01-and-rfm12b/" target="_blank">this article</a> describes using them with a Raspberry Pi.</p><p>My weather station transmits data on 868Mhz, using Frequency Shift Keying (FSK). This is where a digital '1' is transmitted at one frequency and the '0' at another.</p><p>Video: <a href="https://www.youtube.com/watch?v=Xe5Bj_N4Crw" target="_blank">433Mhz with the Pi</a></p><p>Code for <a href="https://github.com/ToninoTarsi/swpi/blob/master/wh1080_rf/wh1080_rf.c" target="_blank">controlling the RFM01 with SPI on the Pi</a>.</p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-39776018183377350412023-01-11T19:42:00.008+00:002023-12-15T16:52:19.674+00:00z80 ZX Spectrum assembler and emulator tools<p><span style="font-family: trebuchet;"> </span></p><p><a href="http://www.breakintoprogram.co.uk/hardware/computers/zx-spectrum/assembly-language/z80-development-toolchain" target="_blank"><span style="font-family: trebuchet;">Download tools</span></a></p><ul style="background-color: white; box-sizing: border-box; list-style: outside none circle; margin: 0px 0px 0.5em 1.5em; overflow-wrap: break-word; padding: 0px;"><li style="margin: 0px; overflow-wrap: break-word; padding: 0px;"><span style="font-family: trebuchet;"><a href="http://www.breakintoprogram.co.uk/programming/installing-and-configuring-visual-studio-code" style="background: transparent; color: #0000ee; overflow-wrap: break-word; text-decoration-line: none;">Visual Studio Code</a> – Editor, with the following extensions:</span><ul style="box-sizing: border-box; list-style-image: none; list-style-position: outside; margin: 0px 0px 0.5em 1.5em; overflow-wrap: break-word; padding: 0px;"><li style="margin: 0px; overflow-wrap: break-word; padding: 0px;"><span style="font-family: trebuchet;">Z80 Assembly 0.0.3 by Imanolea</span></li><li style="margin: 0px; overflow-wrap: break-word; padding: 0px;"><span style="font-family: trebuchet;">DeZog 2.2.3 by Maziac (this is a renamed update to Z80 Debugger 0.9.1, also by Maziac)</span></li></ul></li><li style="margin: 0px; overflow-wrap: break-word; padding: 0px;"><span style="font-family: trebuchet;"><a href="http://www.breakintoprogram.co.uk/programming/installing-and-configuring-zesarux" style="background: transparent; color: #0000ee; overflow-wrap: break-word; text-decoration-line: none;">ZEsarUX </a>10.1 – Emulator</span></li><li style="margin: 0px; overflow-wrap: break-word; padding: 0px;"><span style="font-family: trebuchet;"><a href="http://www.breakintoprogram.co.uk/programming/installing-and-configuring-sjasmplus" style="background: transparent; color: #0000ee; overflow-wrap: break-word; text-decoration-line: none;">sjasmplus</a> 1.18,2 – Z80 compiler</span></li></ul><div><span style="font-family: trebuchet;">A comparison of the debugger compatibilities <a href="https://github.com/maziac/DeZog/blob/HEAD/documentation/Usage.md#remote-capabilities-comparison" target="_blank">are here</a>.</span></div><div><span style="font-family: trebuchet;"><br /></span></div><div><span style="font-family: trebuchet;">Add launch.json to your workspace's .vscode folder:</span>
<pre>{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "dezog",
"request": "launch",
"name": "Z80 Debugger",
"remoteType": "zrcp",
"zrcp": {
"hostname": "localhost",
"port": 10000,
"skipInterrupt": false
},
// "topOfStack": "Stack_Top",
"rootFolder": "${fileDirname}",
"sjasmplus": [
{
"path": "${fileDirname}/${fileBasenameNoExtension}.sld",
"useFiles": true,
"asm": "sjasmplus",
"mainFile": "${fileDirname}/${fileBasenameNoExtension}.z80"
}
],
"disassemblerArgs": {
"esxdosRst": true
},
"load": "${fileDirname}/${fileBasenameNoExtension}.sna",
"startAutomatically": false,
"preLaunchTask": "sjasmplus"
}
]
}
</pre>
</div><div>Add tasks.json to the same folder:</div><div>
<pre> {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "sjasmplus",
"type": "shell",
"command": "sjasmplus",
"args": [
"--fullpath",
"--sld=${fileDirname}/${fileBasenameNoExtension}.sld",
"${file}"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
</pre>
To launch zesarux automatically, see <a href="https://github.com/maziac/z80-sample-program/blob/main/.vscode/tasks.json" target="_blank">this article</a>.</div><div><br /></div><div><a href="http://www.breakintoprogram.co.uk/hardware/computers/zx-spectrum/assembly-language/z80-demos" target="_blank"><span style="font-family: trebuchet;">Compilation instructions</span></a></div><p><span style="font-family: trebuchet;">Download <a href="https://github.com/chernandezba/zesarux/releases" target="_blank">zesarux for Windows</a> (or it's Linux alternative - remember to include lib-spectrum). The source code <a href="https://github.com/chernandezba/zesarux" target="_blank">is here</a>.</span></p><p><span style="font-family: trebuchet;">Start zesarux<br />Set up zesarux remote debugging</span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiwDPB9nlpgL3BtZ-GG2du5TWJcTzRIe6mrD6RQlnm9HaY5jPoKntrOQVDEF5tT80wOmVo8mfQHUlFslrYOieFwPxAsIwDFDbqCtUAS8QomNnrEJ3nYe6jiS5Bwo1Pieg7UfDc2MaLgsTaHGNcsPwfIZwK-2CGJayB7L6c0kLYtaEb0ANMgO02ZrRL2" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: trebuchet;"><img alt="" data-original-height="859" data-original-width="880" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEiwDPB9nlpgL3BtZ-GG2du5TWJcTzRIe6mrD6RQlnm9HaY5jPoKntrOQVDEF5tT80wOmVo8mfQHUlFslrYOieFwPxAsIwDFDbqCtUAS8QomNnrEJ3nYe6jiS5Bwo1Pieg7UfDc2MaLgsTaHGNcsPwfIZwK-2CGJayB7L6c0kLYtaEb0ANMgO02ZrRL2" width="246" /></span></a></div><br /><p></p><div>Or start it with the following command-line parameters:</div><div>"C:\Program Files\ZEsarUX_win-X\zesarux.exe" --disablefooter --zoomx 2 --zoomy 2 --disable-all-first-aid --quickexit --advancedmenus --enable-remoteprotocol --nosplash --nowelcomemessage</div><div><br /></div><div>(the command-line parameters can be <a href="https://github.com/chernandezba/zesarux/blob/b7194dd5a9d95a942beecf6aac6c15039782e00d/src/start.c#L556" target="_blank">found here</a>).</div><div><br /></div><div>Select the .z80 file</div><div><br /></div><div>Compile and Debug</div><div>Terminal > Run Task > sjasmplus</div><div>Run > Start Debugging</div><div><br /></div><div><br /></div><div>Another way to do this is to start ZESarUX using build tasks in VSCode.</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-61628099725612268562023-01-04T19:23:00.005+00:002023-01-05T11:12:00.169+00:00FreeBSD find files commands<p>Recursively find files in folder</p><p>find .//. ! -name . -print | grep -c //</p><p>Count of directories</p><p>find . -type d | wc -l</p><p>Count of directories (depth 1)</p><p>find . -maxdepth 1 -type d | wc -l</p><p>Count of files (depth 1)</p><p>find . -maxdepth 1 -type f | wc -l</p><p>Delete files that are called Zone.Identifier</p><p>find . -name "*:Zone.Identifier" -type f -delete</p><p><a href="https://www.freebsd.org/cgi/man.cgi?query=find&apropos=0&sektion=1&manpath=FreeBSD+7.3-RELEASE&arch=default&format=html">https://www.freebsd.org/cgi/man.cgi?query=find&apropos=0&sektion=1&manpath=FreeBSD+7.3-RELEASE&arch=default&format=html</a></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-75341112327290599352022-12-26T09:43:00.003+00:002022-12-26T09:45:14.836+00:00Replacing a disk on FreeNAS<p><span style="color: #222222; font-family: Lato, sans-serif;"><span style="font-size: 15px;">The documentation for the older FreeNAS server is slowly disappearing from the Internet. Thank you to the blog post on </span></span><a href="https://www.netlife.co.za/rebuilding-a-degraded-raid1-array-in-freenas/" style="font-family: Lato, sans-serif; font-size: 15px;" target="_blank">this link</a><span style="color: #222222; font-family: Lato, sans-serif;"><span style="font-size: 15px;"> for instructions on how to rebuild a FreeNAS RAID.</span></span></p><p><span style="background-color: white; color: #222222; font-family: Lato, sans-serif; font-size: 15px;">If you have a degraded RAID 1 array in FreeNAS you may need to replace the disk and trigger the rebuild on your NAS device. Thankfully it is really easy to repair broken raid in FreeNAS.</span></p><p style="background-color: white; box-sizing: border-box; color: #222222; font-family: Lato, sans-serif; font-size: 15px; margin: 0px 0px 10.5px;">If you go to disk > software raid and click on tools you can send commands and if you send the status command you will see that your RAID 1 is marked degraded.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN0jWbIOFKsMl0PhX_PfJN_DewQZpKGzNSrfsIb_bd-dh5fTZMJ-hWhSh8GScpq9LM_5g_5j-MEiP3jlMVt6EzmhWXtOaVb7yuSa_dkVckB8ETVDc90fgQM-yot5h4i96wywE1P5E_Etpj8KEksquo3M4DhcE4QF6kIhmXw3DPfU7fp0N2Fceq47CK/s357/freenas%20raid%201%20rebuild%20list.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="192" data-original-width="357" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN0jWbIOFKsMl0PhX_PfJN_DewQZpKGzNSrfsIb_bd-dh5fTZMJ-hWhSh8GScpq9LM_5g_5j-MEiP3jlMVt6EzmhWXtOaVb7yuSa_dkVckB8ETVDc90fgQM-yot5h4i96wywE1P5E_Etpj8KEksquo3M4DhcE4QF6kIhmXw3DPfU7fp0N2Fceq47CK/s320/freenas%20raid%201%20rebuild%20list.jpg" width="320" /></a></div><br /><p style="background-color: white; box-sizing: border-box; color: #222222; font-family: Lato, sans-serif; font-size: 15px; margin: 0px 0px 10.5px;">You can also see which disk is still running so that you know which disk to remove, the next step is to forget the broken disk. All you need to do is use the forget command.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFE6O6ia8i1qg_WpEhgT_fYhFRE6wOIXSkbEG8PZGv4XnRAw0gFc0QXAzKDjFIIvgMtfFCpY7dVOwxb-vumpAVXmnry4_qjy5BFM6-82MmmxeNvwNg5xqXA9tq-9MfUzOghRF-ZVf1pAGpozoFtx8rSjRr4eq5EBRAceHYJmyuLKSZtsiPOr6reSOK/s346/freenas%20raid%201%20rebuild%20forget.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="136" data-original-width="346" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFE6O6ia8i1qg_WpEhgT_fYhFRE6wOIXSkbEG8PZGv4XnRAw0gFc0QXAzKDjFIIvgMtfFCpY7dVOwxb-vumpAVXmnry4_qjy5BFM6-82MmmxeNvwNg5xqXA9tq-9MfUzOghRF-ZVf1pAGpozoFtx8rSjRr4eq5EBRAceHYJmyuLKSZtsiPOr6reSOK/s320/freenas%20raid%201%20rebuild%20forget.jpg" width="320" /></a></div><br /><p style="background-color: white; box-sizing: border-box; color: #222222; font-family: Lato, sans-serif; font-size: 15px; margin: 0px 0px 10.5px;">Once you have done this you can insert your new disk into the array and the rebuild should start automatically, it may take some time to rebuild a RAID 1 array.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_OUm1HHp7xT6GWsbCaPvSN6GRce7wFiCyTw3N9g_MJ0KcH3WGU75gLSq-usvYGdG4I-dpBxQR0KOhOmsnqlIGTroWurtLNnJvmeaoRvz12zWocM74GUfjpbaJqFOuFq2-dkyUAPtYQTqDKiF7h_E3VV9u6x8pULPbk2ySlvALTxSKjVDyjtiq5sz_/s343/freenas%20raid%201%20recover%20insert.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="134" data-original-width="343" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_OUm1HHp7xT6GWsbCaPvSN6GRce7wFiCyTw3N9g_MJ0KcH3WGU75gLSq-usvYGdG4I-dpBxQR0KOhOmsnqlIGTroWurtLNnJvmeaoRvz12zWocM74GUfjpbaJqFOuFq2-dkyUAPtYQTqDKiF7h_E3VV9u6x8pULPbk2ySlvALTxSKjVDyjtiq5sz_/s320/freenas%20raid%201%20recover%20insert.jpg" width="320" /></a></div><p style="background-color: white; box-sizing: border-box; color: #222222; font-family: Lato, sans-serif; font-size: 15px; margin: 0px 0px 10.5px;"><br /></p><p style="background-color: white; box-sizing: border-box; color: #222222; font-family: Lato, sans-serif; font-size: 15px; margin: 0px 0px 10.5px;">A few hours later you will have fixed a degraded RAID 1 array which you can once again confirm by running the status or list command in the freenas GUI. The FreeNAS RAID is pretty user friendly in this regard since you can remove and add disks easily and have a raid rebuild running in a matter of seconds. </p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-60778878379116170852022-11-23T12:45:00.005+00:002022-11-23T12:45:44.245+00:00Running multiple identities on GitHub on Windows<p> </p><p>You can run multiple identities on GitHub, by putting a copy of the two files</p><p>id_ed25519 and id_ed25519.pub </p><p>in the </p><p>C:\Users\<username>\.ssh </p><p>directory.</p><p>It is worth creating two subfolders</p><p>C:\Users\<username>\.ssh\user1 and</p><p>C:\Users\<username>\.ssh\user2</p><p>to keep the original copies of the keys and copy them into the parent folder as required.</p><p>If you try and clone a GitHub repo under the wrong user, than isn't permissioned, then you will get the error:</p><p>Cloning into 'myrepo'...</p><p>remote: Repository not found.</p><p>fatal: repository 'https://github.com/myteam/myrepo.git/' not found</p><p><br /></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-72393507226198977472022-10-14T18:50:00.007+01:002022-10-14T18:50:55.380+01:00ZoomIt shortcuts<p>Ctrl+1 Zoom</p><p>Ctrl+5 Record</p><p>e <span style="white-space: pre;"> </span>delete all</p><p><br /></p><h2 style="text-align: left;">pens</h2><p>r<span style="white-space: pre;"> </span>red</p><p>b<span style="white-space: pre;"> </span>blue</p><p>g<span style="white-space: pre;"> </span>green</p><p>o<span style="white-space: pre;"> </span>orange</p><p>y<span style="white-space: pre;"> </span>yellow</p><p>p<span style="white-space: pre;"> </span>pink</p><p><br /></p><p>shift<span style="white-space: pre;"> </span>line</p><p>ctrl<span style="white-space: pre;"> </span>rectangle</p><p>elipse<span style="white-space: pre;"> </span>tab</p><p>shift+ctrl arrow</p><p>w<span style="white-space: pre;"> </span>white</p><p>b<span style="white-space: pre;"> </span>black</p><p><br /></p><p>ctrl+c<span style="white-space: pre;"> </span>copy</p><p>ctrl+s <span style="white-space: pre;"> </span>save</p><p><br /></p><p><br /></p><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-86624402884543216862022-09-30T12:41:00.007+01:002022-09-30T20:46:49.167+01:00Docker & Kubernetes cheat sheet<h4 style="text-align: left;">Attach to a running container</h4><p>docker exec -i -t <container> /bin/bash</p><h4 style="text-align: left;">Test network connectivity</h4>
<pre class="brush:bash">apt update
apt install net-tools
apt install curl
curl -kv
</pre>
<h4 style="text-align: left;">Read logs on failed startup</h4><h4 style="text-align: left;"><br /></h4><h4 style="text-align: left;">Networking tools</h4><pre class="brush:bash">docker run --rm -it praqma/network-multitool bash<br /></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3615241250214009042.post-44745024646830567542022-09-28T20:28:00.001+01:002022-09-28T20:28:04.300+01:003D Printer tips for the Longer LK4<p>Tree supports are the best kind of support. Select "Touching Buildplate" to avoid having them join the print.</p><p>Support structure: Tree</p><p>Support placement: Touching Buildplate</p><p><br /></p>Unknownnoreply@blogger.com0