diff options
| Commit | 6a84efc70706da6a8a15394dcbbf90eaa7198cb1 (patch) | |
|---|---|---|
| Author | 2025-07-24 21:12:39 +0300 | |
| Committer | 2025-07-24 21:12:39 +0300 | |
| Files | 4cbc8d0891685d88c9fd55125f8d8b2460d71d6c | |
| syndamia.com-6a84efc70706da6a8a15394dcbbf90eaa7198cb1.tar syndamia.com-6a84efc70706da6a8a15394dcbbf90eaa7198cb1.tar.gz syndamia.com-6a84efc70706da6a8a15394dcbbf90eaa7198cb1.zip | ||
| Parent | d8ab2f2019034aad3bdc5083aa80f4e43c57f774 (diff) | |
feat(tutorials): Converted half of the tutorials into dunbar
17 files changed, 624 insertions, 408 deletions
diff --git a/dunbar b/dunbar -Subproject 3a4b5347b12b97a67da220516ec31a4f8c4716c +Subproject 05a8aaeaf5afecb2020eb896e5c550c18baf260 diff --git a/generate.sh b/generate.sh index 2594305..d2ba7f9 100755 --- a/generate.sh +++ b/generate.sh @@ -35,6 +35,7 @@ EOF -e ./ext/meta.awk -e ./ext/attention.awk \ -e ./ext/heading-anchors.awk -e ./ext/pagenav.awk \ -e ./ext/icons.awk -e ./ext/presentation.awk \ + -e ./ext/contents.awk \ -wo \ -he ./ext/header.du.html -fo ./ext/footer.du.html \ $(find "$GEN_DIR" -type f -name "*.du") diff --git a/src/meta.tsv b/src/meta.tsv index 37f491c..9da5c0f 100644 --- a/src/meta.tsv +++ b/src/meta.tsv @@ -21,6 +21,14 @@ teaching/index.du Teaching List of subjects and their corresponding materials I' tutorials.du Tutorials Educational articles tutorials/index.du Tutorials Educational articles +tutorials/connect-to-mysql-in-dotnet-ef/index.du Connect to MySql in .NET and Entity Framework Connecting a .NET application to a MySql database (with Entity Framework) can be tricky. Here is what works for me. +tutorials/disable-sticky-keys-popup/index.du How to disable Sticky Keys prompt Quick and easy instructions on disabling the Windows prompt 'Do you want to turn on Sticky Keys?' +tutorials/export-skype/index.du How to export Skype data You navigate to Skype's data-export page, download your data, then you open it with Skype's official tool or with an improved fork of it. +tutorials/fix-network-brother-printers/index.du Fix networked Brother printers not working in Linux To fix a networked Brother printer under linux: check CUPS recongnises it on the network, check support, find drivers +tutorials/fix-no-frame-buffer-plan9/index.du Fix 'No frame buffer' error in Plan 9 Installing Plan 9 by Bell Labs on QEMU/KVM might give an initdisplay error. To fix it, you'll need to change the monitor type from xga to vesa. +tutorials/fix-qc-timeout/index.du Fix 'qc timeout' kernel log error Depending on your harddrive, you may get a 15 second boot delay, cause by a qc timeout error. The solution is to tell the kernel that DMA logs are not supported. +tutorials/gns3-initsh-no-such-file/index.du Fix 'exec /gns3/init.sh: no such file or directory' This problem occurs on new installations, the solution is to make GNS3 use Debian's busybox implementation. +tutorials/how-to-encrypt-email/index.du How to encrypt email For PGP add keys in your client. For S/MIME another article is linked. Also contains a comparison of a lot of mail clients. slides.du Slides Slides from presentations I've made slides/index.du Slides Slides from presentations I've made diff --git a/src/tutorials/connect-to-mysql-in-dotnet-ef/index.du b/src/tutorials/connect-to-mysql-in-dotnet-ef/index.du new file mode 100644 index 0000000..b720264 --- /dev/null +++ b/src/tutorials/connect-to-mysql-in-dotnet-ef/index.du @@ -0,0 +1,78 @@ +# Connect to MySql in .NET and Entity Framework + +'define expected-reading 3 min +'define created 21 May 2020 +'define edited 19 June 2021 +[$pagenav] + +:contents +.numbered +1. [url #nuget-packages NuGet packages] +2. [url #connection-string Connection string] +3. [url #connecting Connecting] + .numbered + 1. [url #asp.net-startup ASP.NET Startup] + 2. [url #dbcontext-child-class DBContext child class] + + +I have found that connecting a `[.NET]` application to a `[MySql]` database (with Entity Framework) can be tricky. Here is what works for me. + +Also, [url https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/ MySql.Data.EntityFrameworkCore] has been =[depricated]= since *[October 2020]*. If you need setup instructions with it, read [url https://gitlab.com/Syndamia/syndamiadotcom/-/blob/0510e29526c6d7681587fff4c98a339e8c69e9b5/src/tutorials/connect-to-mysql-in-csharp-ef/article.md this]. + +## NuGet packages + +You'll need to install [url https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql/ Pomelo.EntityFrameworkCore.MySql]. It provides the stuff necessary for connecting and using a `[MySql]` database. + +## Connection string + +There are [url https://www.connectionstrings.com/mysql/ a lot] of ways to setup the connection string but I've found that this one works the best: + +``` +"server=localhost; port=YOUR-PORT; user id=YOUR-USER-ID; password=YOUR-PASSWORD; database=NAME-OF-DATABASE; SslMode=none" + +If you are using `[MySQL Workbench]` and you don't know your port and id, you can look at the server information from the `[MySQL Connections]` page. + +[image ./img/connections.png MyServer root 127.0.0.1:3306] In this example, the user id is _root_ and the port is _3306_. + +## Connecting + +To connect, you'll need to call the `[UseMySql]` method, either in [url #asp.net-startup ASP.NET Startup] or in a [url #dbcontext-child-class DBContext child class]. + +The method requires at least two arguments: connection string and `[MySql]` server version. The latter you can find, by going to the `[Help/About Workbench]` window inside `[MySQL Workbench]`. + +[image ./img/about-workbench.png] +[image ./img/workbench-version.png] + +For the server version argument, create a new object of type `[MySqlServerVersion]` and give it's constructor a new object of type `[Version]`, to which you give the version numbers. The result should look something like this: + +```c# +.UseMySql(CONNECTION_STRING, new MySqlServerVersion(new System.Version(8, 0, 21))) + +Where `[CONNECTION_STRING]` is a (constant) variable that contains your connection string, and 8, 0, 21 are the version numbers. + +### ASP.NET Startup + +For `[ASP.NET]` applications, the connection must be put inside the `[ConfigureServices]` method of the `[Startup.cs]` file. If you already have a `[.UseSQL]` method call in there, just replace it with your `[.UseMySql]` method and arguments. + +The result should look something along the lines of: + +```c# +// This method gets called by the runtime. Use this method to add services to the container. +public void ConfigureServices(IServiceCollection services) +{ + ... + services.AddDbContext<AppDbContext>(opt => + { + opt.UseMySql(...); + }); +} + +### DBContext child class + +Another way to connect is via a `[DBContext]` child class (so, inside your own DB context). Just, override the `[OnConfiguring]` method and call the `[.UseMySql]` method from the `[optionsBuilder]` parameter. + +```c# +protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) +{ + optionsBuilder.UseMySql(...); +} diff --git a/src/tutorials/connect-to-mysql-in-dotnet-ef/index.md b/src/tutorials/connect-to-mysql-in-dotnet-ef/index.md deleted file mode 100644 index c5f0e9d..0000000 --- a/src/tutorials/connect-to-mysql-in-dotnet-ef/index.md +++ /dev/null @@ -1,75 +0,0 @@ -# Connect to MySql in .NET and Entity Framework - -## Contents - -1. [NuGet packages](#nuget-packages) -2. [Connection string](#connection-string) -3. [Connecting](#connecting) - 1. [ASP.NET Startup](#asp.net-startup) - 2. [DBContext child class](#dbcontext-child-class) - -I have found that connecting a `.NET` application to a `MySql` database (with Entity Framework) can be tricky. Here is what works for me. - -Also, [MySql.Data.EntityFrameworkCore](https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/) has been **depricated** since *October 2020*. If you need setup instructions with it, read [this](https://gitlab.com/Syndamia/syndamiadotcom/-/blob/0510e29526c6d7681587fff4c98a339e8c69e9b5/src/tutorials/connect-to-mysql-in-csharp-ef/article.md). - -## NuGet packages - -You'll need to install [Pomelo.EntityFrameworkCore.MySql](https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql/). It provides the stuff necessary for connecting and using a `MySql` database. - -## Connection string - -There are [a lot](https://www.connectionstrings.com/mysql/) of ways to setup the connection string but I've found that this one works the best: - -``` -"server=localhost; port=YOUR-PORT; user id=YOUR-USER-ID; password=YOUR-PASSWORD; database=NAME-OF-DATABASE; SslMode=none" -``` - -If you are using `MySQL Workbench` and you don't know your port and id, you can look at the server information from the `MySQL Connections` page. - - In this example, the user id is _root_ and the port is _3306_. - -## Connecting - -To connect, you'll need to call the `UseMySql` method, either in [ASP.NET Startup](#asp.net-startup) or in a [DBContext child class](#dbcontext-child-class). - -The method requires at least two arguments: connection string and `MySql` server version. The latter you can find, by going to the `Help/About Workbench` window inside `MySQL Workbench`. - - - - -For the server version argument, create a new object of type `MySqlServerVersion` and give it's constructor a new object of type `Version`, to which you give the version numbers. The result should look something like this: - -```csharp -.UseMySql(CONNECTION_STRING, new MySqlServerVersion(new System.Version(8, 0, 21))) -``` - -Where `CONNECTION_STRING` is a (constant) variable that contains your connection string, and 8, 0, 21 are the version numbers. - -### ASP.NET Startup - -For `ASP.NET` applications, the connection must be put inside the `ConfigureServices` method of the `Startup.cs` file. If you already have a `.UseSQL` method call in there, just replace it with your `.UseMySql` method and arguments. - -The result should look something along the lines of: - -```csharp -// This method gets called by the runtime. Use this method to add services to the container. -public void ConfigureServices(IServiceCollection services) -{ - ... - services.AddDbContext<AppDbContext>(opt => - { - opt.UseMySql(...); - }); -} -``` - -### DBContext child class - -Another way to connect is via a `DBContext` child class (so, inside your own DB context). Just, override the `OnConfiguring` method and call the `.UseMySql` method from the `optionsBuilder` parameter. - -```csharp -protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) -{ - optionsBuilder.UseMySql(...); -} -``` diff --git a/src/tutorials/disable-sticky-keys-popup/index.du b/src/tutorials/disable-sticky-keys-popup/index.du new file mode 100644 index 0000000..414419e --- /dev/null +++ b/src/tutorials/disable-sticky-keys-popup/index.du @@ -0,0 +1,27 @@ +# How to disable Sticky Keys prompt + +'define expected-reading 1 min +'define created 01 November 2021 +'define edited 01 November 2021 +[$pagenav] + +We've all been there: you're playing a game and after pressing `[Shift]` multiple times, you get a popup about "Sticky Keys", similar to this one: + +[image ./img/windows-sticky-keys-prompt.png ] + +This is how to stop the popup from showing up ever again: + +:numbered +1. Press =[Windows key + R]=, type in `[control access.cpl]`, and then press =[OK]= + .p [image ./img/windows-run-control-access.png] + +2. Inside the opened up window, press =[Make the keyboard easier to use]= + .p [image ./img/windows-make-keyboard-highlighted.png] + +3. After that, press =[Set up Sticky Keys]= + .p [image ./img/windows-sticky-keys-highlighted.png] + +4. Uncheck the =[Turn on Sticky Keys when SHIFT is pressed five times]= + .p [image ./img/windows-sticky-keys-disable.png] + +5. Finally, press =[OK]= and close the window diff --git a/src/tutorials/disable-sticky-keys-popup/index.md b/src/tutorials/disable-sticky-keys-popup/index.md deleted file mode 100644 index d9c00f4..0000000 --- a/src/tutorials/disable-sticky-keys-popup/index.md +++ /dev/null @@ -1,21 +0,0 @@ -# How to disable Sticky Keys prompt - -We've all been there: you're playing a game and after pressing `Shift` multiple times, you get a popup about "Sticky Keys", similar to this one: - - - -This is how to stop the popup from showing up ever again: - -1. Press **Windows key + R**, type in `control access.cpl`, and then press **OK** - -  -2. Inside the opened up window, press **Make the keyboard easier to use** - -  -3. After that, press **Set up Sticky Keys** - -  -4. Uncheck the **Turn on Sticky Keys when SHIFT is pressed five times** - -  -5. Finally, press **OK** and close the window diff --git a/src/tutorials/export-skype/index.du b/src/tutorials/export-skype/index.du new file mode 100644 index 0000000..aa404b6 --- /dev/null +++ b/src/tutorials/export-skype/index.du @@ -0,0 +1,88 @@ +# How to export Skype data + +'define expected-reading 3 min +'define created 03 October 2021 +'define edited 03 October 2021 +[$pagenav] + +:contents +.numbered +1. [url #downloading-files Downloading files] +2. [url #viewing-your-export-official-tool Viewing your export - Official Tool] +3. [url #viewing-your-export-artemveremienko-fork Viewing your export - ArtemVeremienko Fork] + + +Skype has always allowed to export your chat history (and files), but it's not as straight forward as it should. +Continue reading for the required steps on doing it. + +## Downloading files + +:numbered +1. Open [url https://secure.skype.com/en/data-export secure.skype.com/en/data-export] + .p + .bulleted + - You could be asked to sign in. + After signing in you'll need to *[open the link again]*, since you would be redirected to the wrong place. + +2. After opening the link you should be greeted by something like this. + Check the two checkboxes next to =[Conversations]= and =[Files]= *[(pointed to by the red arrows)]*. + + .p [image ./img/initial-screen.png ] + +3. Press =[Submit request]=. + After being greeted by this screen, press =[Continue]=. + + .p [image ./img/export-prepared.png ] + + .bulleted + - You should now see an =[Available exports]= section near the top of the page. + The status will be =[Pending]=. + .p [image ./img/available-exports.png ] + +5. Reload the page after a bit of time. When your export is ready, you'll find a =[Download]= button next to it, click it. + + .p [image ./img/download-button.png ] + + +Your export will be downloaded as a `[.tar]` archive file. +You'll need an archiver utility to extract the files, something like [url https://www.rarlab.com/download.htm WinRAR] or [url https://www.7-zip.org/ 7-Zip] *[(I personally recommend 7-Zip, it is completely free (no need to worry about your [url https://youtu.be/fTgZRVVr3_Y infinite trial]) and works faster)]*. + +## Viewing your export - Official Tool + +:numbered +1. Extract your archive + +2. Open the [url https://go.skype.com/skype-parser Skype Parser Download], which will prompt you to save `[skype-parser.zip]` + +3. Extract `[skype-parser.zip]` + +4. Inside the `[skype-parser]` folder, open `[index.html]` (it might be named just `[index]`). You'll be greeted by this page in your browser: + .p [image ./img/default-skype-parser-index.png ] + +5. Click the `[Choose File]` option and select the `[messages.json]` (it might be named just `[messages]`) file from your export. + .p [image ./img/choose-file.png ] + +6. Press the `[Load]` button right below, and you're done. + On the left side you have your conversations, and when opening one, your messages will be displayed to the right (just like in Skype itself) + .p [image ./img/archived-conversations-skype-default.png ] + + +There is only one issue with this method - the official tool is somewhat broken. +Images and links are shown as formatting codes, but you can't actually look at them as you would in Skype itself. + +The fix is using an alternative to the official tool. + +## Viewing your export - ArtemVeremienko Fork + +[url https://github.com/ArtemVeremienko ArtemVeremienko] is a GitHub user that took the official parser and fixed it. +Their source code can be found over at [url https://github.com/ArtemVeremienko/skype-parser github.com/ArtemVeremienko/skype-parser]. + +:numbered +1. Go to the [url https://github.com/ArtemVeremienko/skype-parser/releases/latest latest release of his skype-parser] and download `[skype-parser.zip]` + + .p [image ./img/github-skype-parser-download.png ] + +2. Extract all of the files. + They'll be in the same folder as the `[skype-parser.zip]` file, so find the `[index.html]` file and open it. + +3. Continue from step 5 onward of the [url #viewing-your-export-official-tool Viewing your export - Official Tool] section diff --git a/src/tutorials/export-skype/index.md b/src/tutorials/export-skype/index.md deleted file mode 100644 index 1957a9c..0000000 --- a/src/tutorials/export-skype/index.md +++ /dev/null @@ -1,58 +0,0 @@ -# How to export Skype data - -## Contents - -1. [Downloading files](#downloading-files) -2. [Viewing your export - Official Tool](#viewing-your-export---official-tool) -3. [Viewing your export - ArtemVeremienko Fork](#viewing-your-export---artemveremienko-fork) - -Skype has always allowed to export your chat history (and files), but it's not as straight forward as it should. Continue reading for the required steps on doing it. - -## Downloading files - -1. Open [secure.skype.com/en/data-export](https://secure.skype.com/en/data-export) - - You could be asked to sign in. After signing in you'll need to *open the link again*, since you would be redirected to the wrong place. -2. After opening the link you should be greeted by something like this. Check the two checkboxes next to **Conversations** and **Files** *(pointed to by the red arrows)*. - -  -3. Press **Submit request**. After being greeted by this screen, press **Continue**. - -  - - - You should now see an **Available exports** section near the top of the page. The status will be **Pending**. - -  -5. Reload the page after a bit of time. When your export is ready, you'll find a **Download** button next to it, click it. - -  - -Your export will be downloaded as a `.tar` archive file. You'll need an archiver utility to extract the files, something like [WinRAR](https://www.rarlab.com/download.htm) or [7-Zip](https://www.7-zip.org/) *(I personally recommend 7-Zip, it is completely free (no need to worry about your [infinite trial](https://youtu.be/fTgZRVVr3_Y)) and works faster)*. - -## Viewing your export - Official Tool - -1. Extract your archive -2. Open the [Skype Parser Download](https://go.skype.com/skype-parser), which will prompt you to save `skype-parser.zip` -3. Extract `skype-parser.zip` -4. Inside the `skype-parser` folder, open `index.html` (it might be named just `index`). You'll be greeted by this page in your browser: - -  -5. Click the `Choose File` option and select the `messages.json` (it might be named just `messages`) file from your export. - -  -6. Press the `Load` button right below, and you're done. On the left side you have your conversations, and when opening one, your messages will be displayed to the right (just like in Skype itself) - -  - -There is only one issue with this method - the official tool is somewhat broken. Images and links are shown as formatting codes, but you can't actually look at them as you would in Skype itself. - -The fix is using an alternative to the official tool. - -## Viewing your export - ArtemVeremienko Fork - -[ArtemVeremienko](https://github.com/ArtemVeremienko) is a GitHub user that took the official parser and fixed it. Their source code can be found over at [github.com/ArtemVeremienko/skype-parser](https://github.com/ArtemVeremienko/skype-parser). - -1. Go to the [latest release of his skype-parser](https://github.com/ArtemVeremienko/skype-parser/releases/latest) and download `skype-parser.zip` - -  -2. Extract all of the files. They'll be in the same folder as the `skype-parser.zip` file, so find the `index.html` file and open it. -3. Continue from step 5 onward of the [Viewing your export - Official Tool](#viewing-your-export---official-tool) section diff --git a/src/tutorials/fix-network-brother-printers/index.md b/src/tutorials/fix-network-brother-printers/index.du index 3265377..c6ac699 100644 --- a/src/tutorials/fix-network-brother-printers/index.md +++ b/src/tutorials/fix-network-brother-printers/index.du @@ -1,55 +1,58 @@ # Fix networked Brother printers not working in Linux +'define expected-reading 4 min +'define created 28 June 2023 +'define edited 28 June 2023 +[$pagenav] + Before we start, make sure you have CUPS and avahi installed and running. ## Make sure CUPS recognises it -Go to [localhost:631/printers](https://localhost:631/printers/) and make sure your printer is listed there. -If **not**, go to `Administration/Add Printer` and select your printer. -If it's **not** listed even there, then you have some other network connectivity issue. +Go to [url https://localhost:631/printers/ localhost:631/printers] and make sure your printer is listed there. +If =[not]=, go to `[Administration/Add Printer]` and select your printer. +If it's =[not]= listed even there, then you have some other network connectivity issue. -Otherwise [try to print a test page](#try-to-print-a-test-page). +Otherwise [url #try-to-print-a-test-page try to print a test page]. -### Check if it **is** recognised on the network. +### Check if it =[is]= recognised on the network. Execute in the command line: ```bash avahi-browse --all -t -r -``` -There will be a lot of output, but scroll down until you find something *like*: +There will be a lot of output, but scroll down until you find something *[like]*: ``` = enp0s25 IPv4 Brother HL-L2350DW series _pdl-datastream._tcp local hostname = [BRW9C305B9EC83D.local] address = [192.168.0.110] -``` The exact values aren't important, just make sure the part after IPv4 is the model of your printer. -`address` is the local printer address, ping it. +`[address]` is the local printer address, ping it. In this example, the command would be: ```bash ping 192.168.0.110 -``` +.bulleted - If the ping is successful, you might also want to put that IP address in your browser. - With the example, you would open the link `http://192.168.0.110`. - Your printer **may** or **may not** support Web Based Management, which would allow you to edit it's setting from the browser. + With the example, you would open the link `[http://192.168.0.110]`. + Your printer =[may]= or =[may not]= support Web Based Management, which would allow you to edit it's setting from the browser. If the page isn't available, don't worry about it. -If output is **not** something like `64 bytes from ...` (so, if it is `Destination Host Unreachable` or ping just hangs, without output), then it's an issue with your network or printer network configuration. -Make sure the printer is properly connected to the network. +If output is =[not]= something like `[64 bytes from ...]` (so, if it is `[Destination Host Unreachable]` or ping just hangs, without output), then it's an issue with your network or printer network configuration. +Make sure the printer is properly connected to the network.\n Otherwise, this shows that your computer has network access to the printer, and all problems are local. ### Check if your printer is supported by Linux. -Go to [www.openprinting.org/printers](https://www.openprinting.org/printers) and enter your model. +Go to [url https://www.openprinting.org/printers www.openprinting.org/printers] and enter your model. If it isn't listed then it doesn't work for sure. -Alternatively, if it is and the rating [isn't "Perfectly"](https://wiki.linuxfoundation.org/openprinting/database/databaseintro#about_the_data), then read the whole page, in case networking is listed as nonfunctional. -If it **is** supported, then: +Alternatively, if it is and the rating [url https://wiki.linuxfoundation.org/openprinting/database/databaseintro#about_the_data isn't "Perfectly"], then read the whole page, in case networking is listed as nonfunctional. +If it =[is]= supported, then: ### Check if there are drivers available @@ -57,10 +60,9 @@ Run in the command line: ```bash lpinfo -v -``` -If you only get entries like `network WORD`, without anything which looks like a URL (URI), then you may not have a working driver. -Make sure you have installed any or tried all of the drivers listed in the printer's [www.openprinting.org](https://www.openprinting.org/printers) page. +If you only get entries like `[network WORD]`, without anything which looks like a URL (URI), then you may not have a working driver. +Make sure you have installed any or tried all of the drivers listed in the printer's [url https://www.openprinting.org/printers www.openprinting.org] page. ## Try to print a test page @@ -71,13 +73,13 @@ After a little while, the "State" should change from "pending" to "processing" ( ### Unable to locate printer "SOMETHING.local" If you also have the error "Unable to locate printer "SOMETHING.local"." (obviously SOMETHING is the exact value you get), then that means the printer is accessed via the domain name "SOMETHING.local". -`.local` domains require a special DNS server to be resolved, so inside `/etc/nsswitch.conf`, on the line that starts with `hosts`, add to it's end the value `mdns_minimal`. +`[.local]` domains require a special DNS server to be resolved, so inside `[/etc/nsswitch.conf]`, on the line that starts with `[hosts]`, add to it's end the value `[mdns_minimal]`. It should look something like: ``` hosts: files dns mdns_minimal -``` After saving your changes, your printer should pretty quickly start printing the test page, no need to restart anything. -- if your printer supports Web Based Management, then you should be able to go open the page `http://SOMETHING.local` in your browser and edit your printer settings from there. +.bulleted +- if your printer supports Web Based Management, then you should be able to go open the page `[http://SOMETHING.local]` in your browser and edit your printer settings from there. diff --git a/src/tutorials/fix-no-frame-buffer-plan9/index.du b/src/tutorials/fix-no-frame-buffer-plan9/index.du new file mode 100644 index 0000000..bce1cd9 --- /dev/null +++ b/src/tutorials/fix-no-frame-buffer-plan9/index.du @@ -0,0 +1,94 @@ +# Fix "No frame buffer" error in Plan 9 + +'define expected-reading 3 min +'define created 30 July 2022 +'define edited 30 July 2022 +[$pagenav] + +Let's say you installed [url https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs Plan 9 by Bell Labs] on a QEMU/KVM virtual machine by just following the prompts and entering defaults. In certain cases, you might find your install booting to a shell with the errors: + +``` +aux/vga: inportl(0xc100): permission denied +rio: can't open display: initdisplay: /dev/draw/new: no frame buffer +init: rc exit status: rio 31: display open + +[image ./img/boot-prompt-no-frame-buffer-error.png ] + +For some reason, on certain configurations, the `[xga]` (`[vga]`) monitor type does not work when booting into Plan 9, even though it works fine during install. The fix is to adjust monitor settings to `[vesa]`: + +:ordered +1. In the shell prompt enter + + ``` +aux/vga -m vesa -l + + You should get a cursor and a cleared prompt. + + .p [image ./img/manual-prompt.png ] + +2. In this "new" shell prompt, enter + + ``` +rio + + You should now get a grey background with the cursor in it. + + .p [image ./img/manual-rio.png ] + + .p + .bulleted + - You are now in a graphical environment, so technically you can stop here. The other steps are for configuring it so you wont ever have that problem again. + +3. Create a new window (refer to the bullet point for instructions). Enter + + ``` +9fat: + + and afterwards + + ``` +sam /n/9fat/plan9.ini + + this is the configuration file we will be changing. + + .p [image ./img/rio-9fat-commands.png ] + + .p + .bulleted + - How to make a window: right click, hold, hover over "New" and release the right click. Now right click somewhere in the top left, hold, drag to somewhere in bottom right, release. + +4. Now we will be editing the config file with sam, a line editor. Click the green-backgrounded box, the cursor should appear. + First select our file: + + ``` +b /n/9fat/plan9.ini + + and click the green-backgrounded box. + Then replace `[xga]` with `[vesa]`: + + ``` +, x/xga/ s/xga/vesa + + and click the green-backgrounded box again. We're almost done here, enter `[w]`, wait a bit, and finally enter `[q]`. + + :p + :bulleted + - If you want to check whether the file was properly saved, feel free to run + + ``` +cat /n/9fat/plan9.ini + + and check that monitor is equal to vesa (you can scroll with the arrow keys, or with left and right mouse buttons, acting as up and down). + + .p [image ./img/rio-plan9ini-cat.png ] + + - The first command opens the `[plan9.ini]` file for editing, and the second command, finds every line that contains `[xga]` (there should probably be only one) and on each matching line replaces `[xga]` with `[vesa]`. Refer to the [url https://p9f.org/sys/doc/sam/sam.html docs] for more information. + + + +5. That's it, all we have to do is halt our file system with `[fshalt]` (or type out the command in the [url https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/ Qemu installation guide]) and Force Reset the virtual machine. + + +The next time you boot into Plan 9 and into your user, the graphical environment should load fine. Enjoy Plan 9! + +[image ./img/rio-default-login.png ] diff --git a/src/tutorials/fix-no-frame-buffer-plan9/index.md b/src/tutorials/fix-no-frame-buffer-plan9/index.md deleted file mode 100644 index 57a2a21..0000000 --- a/src/tutorials/fix-no-frame-buffer-plan9/index.md +++ /dev/null @@ -1,87 +0,0 @@ -# Fix "No frame buffer" error in Plan 9 - -Let's say you installed [Plan 9 by Bell Labs](https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs) on a QEMU/KVM virtual machine by just following the prompts and entering defaults. In certain cases, you might find your install booting to a shell with the errors: - -``` -aux/vga: inportl(0xc100): permission denied -rio: can't open display: initdisplay: /dev/draw/new: no frame buffer -init: rc exit status: rio 31: display open -``` - - - -For some reason, on certain configurations, the `xga` (`vga`) monitor type does not work when booting into Plan 9, even though it works fine during install. The fix is to adjust monitor settings to `vesa`: - -1. In the shell prompt enter - - ``` - aux/vga -m vesa -l - ``` - - You should get a cursor and a cleared prompt. - -  - -2. In this "new" shell prompt, enter - - ``` - rio - ``` - - You should now get a grey background with the cursor in it. - -  - - - You are now in a graphical environment, so technically you can stop here. The other steps are for configuring it so you wont ever have that problem again. - -3. Create a new window (refer to the bullet point for instructions). Enter - - ``` - 9fat: - ``` - - and afterwards - - ``` - sam /n/9fat/plan9.ini - ``` - - this is the configuration file we will be changing. - -  - - - How to make a window: right click, hold, hover over "New" and release the right click. Now right click somewhere in the top left, hold, drag to somewhere in bottom right, release. - -4. Now we will be editing the config file with sam, a line editor. Click the green-backgrounded box, the cursor should appear. - First select our file: - - ``` - b /n/9fat/plan9.ini - ``` - - and click the green-backgrounded box. - Then replace `xga` with `vesa`: - - ``` - , x/xga/ s/xga/vesa - ``` - - and click the green-backgrounded box again. We're almost done here, enter `w`, wait a bit, and finally enter `q`. - - - If you want to check whether the file was properly saved, feel free to run - - ``` - cat /n/9fat/plan9.ini - ``` - - and check that monitor is equal to vesa (you can scroll with the arrow keys, or with left and right mouse buttons, acting as up and down). - -  - - - The first command opens the `plan9.ini` file for editing, and the second command, finds every line that contains `xga` (there should probably be only one) and on each matching line replaces `xga` with `vesa`. Refer to the [docs](https://p9f.org/sys/doc/sam/sam.html) for more information. - -5. That's it, all we have to do is halt our file system with `fshalt` (or type out the command in the [Qemu installation guide](https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/)) and Force Reset the virtual machine. - -The next time you boot into Plan 9 and into your user, the graphical environment should load fine. Enjoy Plan 9! - - diff --git a/src/tutorials/fix-qc-timeout/index.md b/src/tutorials/fix-qc-timeout/index.du index 9b02a48..d36383d 100644 --- a/src/tutorials/fix-qc-timeout/index.md +++ b/src/tutorials/fix-qc-timeout/index.du @@ -1,7 +1,12 @@ # Fix "qc timeout" kernel log error +'define expected-reading 4 min +'define created 16 December 2023 +'define edited 16 December 2023 +[$pagenav] + Depending on your harddrive, you may get a 15 second delay on boot. -Looking at the kernel logs (with `dmesg`), you may find the following errors: +Looking at the kernel logs (with `[dmesg]`), you may find the following errors: ``` kernel: ata1.00: qc timeout after 15000 msecs (cmd 0x47) @@ -9,38 +14,35 @@ kernel: ata1.00: Read log 0x00 page 0x00 failed, Emask 0x40 kernel: ata1.00: NCQ Send/Recv Log not supported kernel: ata1.00: Read log 0x00 page 0x00 failed, Emask 0x40 kernel: ata1.00: ATA Identify Device Log not supported -``` ## Solution -Add a kernel parameter which tells Linux that the drive doesn't support DMA logs. +Add a kernel parameter which tells Linux that the drive doesn't support DMA logs.\n Meaning, add the following parameter: ``` libata.force=1.00:nodmalog -``` -where `1.00` is the thing between "ata" and ":". +where `[1.00]` is the thing between "ata" and ":". So, if your logs were ``` kernel: ata3.01: qc timeout after 15000 msecs (cmd 0x47) ... -``` then the parameter would be: ``` libata.force=3.01:nodmalog -``` ## Explanation -&:important The following is how I understand the issue, but I did not find definitive proof thats exactly what happens. - Take this section with a grain of salt. +.important +The following is how I understand the issue, but I did not find definitive proof thats exactly what happens.\n +Take this section with a grain of salt. -A harddrive can support [dma transfers](https://en.wikipedia.org/wiki/Direct_memory_access), normally the CPU would handle data transfer from the harddrive to the system memory (RAM), meaning it asks for a bit of data, waits, when the data comes, puts it in memory, then asks for next bit and so on. +A harddrive can support [url https://en.wikipedia.org/wiki/Direct_memory_access dma transfers], normally the CPU would handle data transfer from the harddrive to the system memory (RAM), meaning it asks for a bit of data, waits, when the data comes, puts it in memory, then asks for next bit and so on. With DMA, the CPU could ask the drive for everythng it wants (not a tiny bit), and then the DMA controller (DMAC) on the drive will handle the actual data transfer from the drive to the memory (when the transfer is done, the drive will tell the CPU). The benefit is that the CPU can do other work while the transfer is going on, greatly improving efficiency, but the downside is that the harddrive has to support it (have a DMAC chip on it). @@ -54,7 +56,7 @@ The simplest definition would be for the drive to return an error singal, but in In that case, how would we know if the drive just doesn't know how to respond (meaning it doesn't support the logs) or if it's just very slow? Well, we can't, so we put a time limit, if it doesn't respond in 15 seconds, then it probably doesn't support it. -That's what the error is saying: `qc` is short for ["queued command"](https://docs.kernel.org/driver-api/libata.html#origins-of-commands), it's used to represent a (S)ATA command (hence the `cmd` at the end, telling us which command it's referring to). +That's what the error is saying: `[qc]` is short for [url https://docs.kernel.org/driver-api/libata.html#origins-of-commands "queued command"], it's used to represent a (S)ATA command (hence the `[cmd]` at the end, telling us which command it's referring to). So, the kernel is telling us "The hard drive (ATA) command to read (DMA) logs timed out after 15 seconds" (it first says a command timed out, then it says which one). By adding that kernel parameter, we're telling Linux that the drive doesn't support DMA logs, therefore the kernel doesn't need to do this "wait 15 seconds for response if support exists" routine. diff --git a/src/tutorials/gns3-initsh-no-such-file/index.du b/src/tutorials/gns3-initsh-no-such-file/index.du new file mode 100644 index 0000000..2b6f908 --- /dev/null +++ b/src/tutorials/gns3-initsh-no-such-file/index.du @@ -0,0 +1,27 @@ +# Fix "exec /gns3/init.sh: no such file or directory" + +'define expected-reading 1 min +'define created 14 June 2023 +'define edited 14 June 2023 +[$pagenav] + +This problem can easily occur on new installations and can be hard to figure out. +In a [url https://github.com/GNS3/gns3-server/issues/2069#issuecomment-1296741195 GitHub issue], the solution that fixed it for me was using Debian's busybox: + +:ordered +0. Get into a temporary folder + + ```bash +cd /tmp + +1. Get and extract the Debian binary + + ```bash +wget -q http://launchpadlibrarian.net/471755664/busybox-static_1.30.1-4ubuntu6_amd64.deb +ar x busybox-static_1.30.1-4ubuntu6_amd64.deb +tar -xf data.tar.xz + +2. Move it to the proper location, your path may differ slightly + + ```bash +sudo mv ./bin/busybox /usr/lib/python3.11/site-packages/gns3server/compute/docker/resources/bin/busybox diff --git a/src/tutorials/gns3-initsh-no-such-file/index.md b/src/tutorials/gns3-initsh-no-such-file/index.md deleted file mode 100644 index a56c587..0000000 --- a/src/tutorials/gns3-initsh-no-such-file/index.md +++ /dev/null @@ -1,24 +0,0 @@ -# Fix "exec /gns3/init.sh: no such file or directory" - -This problem can easily occur on new installations and can be hard to figure out. -In a [GitHub issue](https://github.com/GNS3/gns3-server/issues/2069#issuecomment-1296741195), the solution that fixed it for me was using Debian's busybox: - -0. Get into a temporary folder - - ```bash - cd /tmp - ``` - -1. Get and extract the Debian binary - - ```bash - wget -q http://launchpadlibrarian.net/471755664/busybox-static_1.30.1-4ubuntu6_amd64.deb - ar x busybox-static_1.30.1-4ubuntu6_amd64.deb - tar -xf data.tar.xz - ``` - -2. Move it to the proper location, your path may differ slightly - - ```bash - sudo mv ./bin/busybox /usr/lib/python3.11/site-packages/gns3server/compute/docker/resources/bin/busybox - ``` diff --git a/src/tutorials/how-to-encrypt-email/index.du b/src/tutorials/how-to-encrypt-email/index.du new file mode 100644 index 0000000..f5cb9ca --- /dev/null +++ b/src/tutorials/how-to-encrypt-email/index.du @@ -0,0 +1,263 @@ +# How to encrypt email + +'define expected-reading 5 min +'define created 16 September 2022 +'define edited 16 November 2022 +[$pagenav] + +:contents +:ordered +1. [url #getting-keys Getting keys] + :ordered + 1. [url #pgp PGP] + .ordered + 1. [url #pgptool.org pgptool.org] + 2. [url #gnu-privacy-guard GNU Privacy Guard] + + 2. [url #smime S/MIME] + + +2. [url #exchanging-keys Exchanging keys] +3. [url #configuring-clients Configuring clients] + + + +In [url /blog/encrypted-email this] blog post I shared the most common technologies for email encryption and a bit of how they work. PGP and S/MIME are the most popular schemes, with support from a lot of clients. + +These are all the steps required to go from having no encryption, to encrypting all of your future emails. + +## Getting keys + +PGP and S/MIME are both built upon [url https://en.wikipedia.org/wiki/Public-key_cryptography public-key cryptography] so you and all of your recipients need to have a pair of public and private keys. + +### PGP + +As [url /blog/encrypted-email/#pgp discussed], PGP relies on a [url https://en.wikipedia.org/wiki/Web_of_trust web of trust], meaning you can generate your keys by yourself. + +#### pgptool.org + +By far, the easiest way to do this is via the website [url https://pgptool.org/ pgptool.org]. Just open the link, fill out your details, select the recommended values (select never as your expiration time) and wait a couple minutes. After they are done, you can click the two red buttons to download your public and private keys. + +#### GNU Privacy Guard + +As an alternative, you can use a desktop program. The most popular one is [url https://www.gnupg.org/ GNU Privacy Guard] (GPG for short). It is [url https://gnupg.org/download/#binary available] on most desktop operating systems, including [url https://gpg4win.org/download.html Windows] and [url https://gpgtools.org/ MacOS]. + +The *[Windows]* version comes with a graphical user interface, so it's easiest to use that: + +:ordered +1. Open the application "Kleopatra" + +2. Click on `[File]` -> `[New Certificate]` + +3. Input your details and press `[OK]` + .bulleted + - Feel free to click on `[Advanced Settings]` and look if if the value for `[RSA]` is `[4096 bit]`, the value for `[+ RSA]` is enabled and is `[4096 bits]`, and finally both `[Signing]` and `[Authentication]` are selected + +4. On the next screen, press `[Create]` + +5. You'll be asked for a password. Make one up, and enter it, but do not forget it! + .bulleted + - The password is used for your private key. If anyone gets ahold if it, they =[will]= be able to impersonate you. A password makes sure that doesn't happen, at least until you tell everyone that your key was leaked. + +6. On the final screen, click `[Finish]` + +7. To help with the next chapter, we'll extract your public key. In "Kleopatra" you should see a line, containing your name and email. Right-click on it, and select `[Export Certificate]`. + + +On *[Linux]* and *[MacOS]*, you can use the command line: + +:ordered +1. Enter this command in your favorite terminal + + ```bash +gpg --full-generate-key + +2. Follow the prompt on the screen (sample pictures available in [url https://www.encryptionconsulting.com/how-to-generate-pgp-key-pair/ encryptionconsulting.com]) + +3. Export your public key (of course, change me@email.com and the location to the one you want, but don't forget the .asc extension) + + ```bash +gpg --armor --export me@email.com > ~/Documents/me-email.com-publickey.asc + + +### S/MIME + +Contrary to PGP, S/MIME relies on a certificate authority, meaning you'll have to buy your keys from someone. Any provider from [url https://support.google.com/a/answer/7448393?hl=en&ref_topic=9061730 Google]'s list of trusted CAs will work. + +Currently, the only one that provides free certificates is [url https://www.actalis.com/s-mime-certificates.aspx Actalis]. Their process is pretty straight forward, just follow the instructions (shown in [url https://www.dannyguo.com/blog/how-to-get-a-free-s-mime-certificate/ this] article). + +## Exchanging keys + +You should now have a text file with your public key in it. When you want to send an encrypted email to someone, ask them for their public key, and meanwhile send them your public key. It doesn't matter how you do that, even if it's with unencrypted emails. + +Remember, =[never]= send your =[private]= key to anyone! + +## Configuring clients + +Now we need to configure your email application to automatically encrypt and decrypt messages. There are a lot of email clients, so I have compiled the most used ones and linked resources on how to set them up. + +When writing a message, don't forget to check if encryption is turned on for this email! On most clients, in the compose window, you'll have to select an option to enable encryption, but others do that automatically. + +*[Freemium means it has a free and a paid tier. Premium means you have to pay for it. FOSS means it's free and open source. FreemiumOSS means it is free and open source, but also has paid tiers.]* + +:table +|= Client =||= Type =||= Platform =||= PGP/Inline =||= PGP/MIME =||= S/MIME =| + +|= Web =||::||::||::||::||::| + +|:Gmail:| + |:Freemium:| + |:Web:| + |:[url https://flowcrypt.com/ Yes]^[[url #1 1]]^:| + |:[url https://flowcrypt.com/ Yes]^[[url #1 1]]^:| + |:[url https://support.google.com/a/answer/6374496?hl=en&ref_topic=9061730 Yes]^[[url #2 2]]^:| + +|:Outlook:| + |:Freemium:| + |:Web:| + |:No:| + |:No:| + |:[url https:://support.microsoft.com/en-us/office/encrypt-email-messages-373339cb-bf1a-4509-b296-802a39d801dc#bkmk_encryptwithsmime Yes]^[[url #2 2]]^:| + +|:iCloud mail:| + |:Freemium:| + |:Web:| + |:[url https://support.apple.com/en-us/HT201214 Yes]:| + |:[url https://support.apple.com/en-us/HT201214 Yes]:| + |:[url https://support.apple.com/en-us/HT202345 Yes]:| + +|:Yahoo!:| + |:Freemium:| + |:Web:| + |:No:| + |:No:| + |:No:| + +|:Protonmail:| + |:Freemium:| + |:Web:| + |:[url https://proton.me/support/how-to-use-pgp Yes]:| + |:[url https://proton.me/support/how-to-use-pgp Yes]:| + |:No:| + +|:Roundcube:| + |:Self-hosted:| + |:Web:| + |:[url https://github.com/roundcube/roundcubemail/tree/master/plugins/enigma Yes]^[[url #1 1]]^:| + |:[url https://github.com/roundcube/roundcubemail/tree/master/plugins/enigma Yes]^[[url #1 1]]^:| + |:[url https://github.com/roundcube/roundcubemail/issues/4977 No]:| + +|:Rainloop:| + |:Self-hosted:| + |:Web:| + |:Yes:| + |:[url https://github.com/RainLoop/rainloop-webmail/issues/1798 No]:| + |:No:| + +|= Desktop =||::||::||::||::||::| + +|:Thunderbird:| + |:FOSS:| + |:Windows, MacOS, Linux:| + |:[url https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq#w_i-have-never-used-openpgp-with-thunderbird-before-how-do-i-setup-openpgp Yes]:| + |:[url https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq#w_i-have-never-used-openpgp-with-thunderbird-before-how-do-i-setup-openpgp Yes]:| + |:[url https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq Yes]:| + +|:Outlook:| + |:Premium:| + |:Windows, MacOS:| + |:No:| + |:No:| + |:[url https://support.microsoft.com/en-us/office/encrypt-email-messages-373339cb-bf1a-4509-b296-802a39d801dc#bkmk_encryptwithsmime Yes]:| + +|:Mailbird:| + |:Premium:| + |:Windows:| + |:[url https://mailbird.featureupvote.com/suggestions/74494/pgp-encryption-support No]:| + |:[url https://mailbird.featureupvote.com/suggestions/74494/pgp-encryption-support No]:| + |:[url https://mailbird.featureupvote.com/suggestions/160861/smime-support No]:| + +|:Evolution:| + |:FOSS:| + |:Linux:| + |:[url https://help.gnome.org/users/evolution/stable/mail-encryption-gpg-set-up.html.en Yes]:| + |:[url https://help.gnome.org/users/evolution/stable/mail-encryption-gpg-set-up.html.en Yes]:| + |:[url https://help.gnome.org/users/evolution/stable/mail-encryption-s-mime-manage.html.en Yes]:| + +|:Sylpheed:| + |:FOSS:| + |:Windows, MacOS, Linux:| + |:[url https://sylpheed.sraoss.jp/doc/manual/en/sylpheed-8.html#ss8.2 Yes]:| + |:[url https://sylpheed.sraoss.jp/doc/manual/en/sylpheed-8.html#ss8.2 Yes]:| + |:[url https://www.sraoss.jp/pipermail/sylpheed/2011-May/004551.html No]:| + +|:Claws-mail:| + |:FOSS:| + |:Windows, Linux:| + |:[url https://claws-mail.org/plugin.:php?plugin=gpg Yes]^[[url #1 1]]^:| + |:[url https://claws-mail.org/plugin.php?plugin=gpg Yes]^[[url #1 1]]^:| + |:[url https://claws-mail.org/plugins.php Yes]^[[url #1 1]]^:| + +|= Mobile =||::||::||::||::||::| + +|:Gmail:| + |:Free:| + |:Android, iOS:| + |:No:| + |:No:| + |:Yes^[[url #3: 3]]^:| + +|:Outlook:| + |:Free:| + |:Android, iOS:| + |:No:| + |:No:| + |:Yes^[[url #3: 3]]^:| + +|:Apple Mail :| + |:Free:| + |:iOS:| + |:Yes:| + |:Yes:| + |:Yes:| + +|:Yahoo!:| + |:Free:| + |:Android, iOS:| + |:No:| + |:No:| + |:No:| + +|:Edison:| + |:Free:| + |:Android, iOS:| + |:No:| + |:No:| + |:No:| + +|:Protonmail:| + |:Free:| + |:Android, iOS:| + |:[url https://proton.me/support/how-to-use-pgp Yes]:| + |:[url https://proton.me/support/how-to-use-pgp Yes]:| + |:No:| + +|:K-9 Mail:| + |:FOSS:| + |:Android:| + |:[url https://docs.k9mail.app/en/current/security/pgp/ Yes]:| + |:[url https://docs.k9mail.app/en/current/security/pgp/ Yes]:| + |:[url https://docs.k9mail.app/en/current/security/overview/#end-to-end-encryption No]:| + +|:FairEmail:| + |:FreemiumOSS:| + |:Android:| + |:[url https://github.com/M66B/FairEmail/blob/master/FAQ.md Yes]:| + |:[url https://github.com/M66B/FairEmail/blob/master/FAQ.md Yes]:| + |:[url https://github.com/M66B/FairEmail/blob/master/FAQ.md Yes]^[[url #* *]]^:| + + +<sup id="1">1</sup> Available with an extension/plugin\n +<sup id="2">2</sup> Available in a paid version of the software (assuming the software is Freemium; this is true for all Premium software)\n +<sup id="3">3</sup> Available with a Premium account (even if the software is Free)\n +<sup id="*">*</sup> You can read S/MIME messages, but signing and encrypting is a pro feature diff --git a/src/tutorials/how-to-encrypt-email/index.md b/src/tutorials/how-to-encrypt-email/index.md deleted file mode 100644 index 9d95b45..0000000 --- a/src/tutorials/how-to-encrypt-email/index.md +++ /dev/null @@ -1,109 +0,0 @@ -# How to encrypt email - -## Contents - -1. [Getting keys](#getting-keys) - 1. [PGP](#pgp) - 1. [pgptool.org](#pgptool.org) - 2. [GNU Privacy Guard](#gnu-privacy-guard) - 2. [S/MIME](#smime) -2. [Exchanging keys](#exchanging-keys) -3. [Configuring clients](#configuring-clients) - -In [this](/blog/encrypted-email) blog post I shared the most common technologies for email encryption and a bit of how they work. PGP and S/MIME are the most popular schemes, with support from a lot of clients. - -These are all the steps required to go from having no encryption, to encrypting all of your future emails. - -## Getting keys - -PGP and S/MIME are both built upon [public-key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography) so you and all of your recipients need to have a pair of public and private keys. - -### PGP - -As [discussed](/blog/encrypted-email/#pgp), PGP relies on a [web of trust](https://en.wikipedia.org/wiki/Web_of_trust), meaning you can generate your keys by yourself. - -#### pgptool.org - -By far, the easiest way to do this is via the website [pgptool.org](https://pgptool.org/). Just open the link, fill out your details, select the recommended values (select never as your expiration time) and wait a couple minutes. After they are done, you can click the two red buttons to download your public and private keys. - -#### GNU Privacy Guard - -As an alternative, you can use a desktop program. The most popular one is [GNU Privacy Guard](https://www.gnupg.org/) (GPG for short). It is [available](https://gnupg.org/download/#binary) on most desktop operating systems, including [Windows](https://gpg4win.org/download.html) and [MacOS](https://gpgtools.org/). - -The *Windows* version comes with a graphical user interface, so it's easiest to use that: - -1. Open the application "Kleopatra" -2. Click on `File` -> `New Certificate` -3. Input your details and press `OK` - - Feel free to click on `Advanced Settings` and look if if the value for `RSA` is `4096 bit`, the value for `+ RSA` is enabled and is `4096 bits`, and finally both `Signing` and `Authentication` are selected -4. On the next screen, press `Create` -5. You'll be asked for a password. Make one up, and enter it, but do not forget it! - - The password is used for your private key. If anyone gets ahold if it, they **will** be able to impersonate you. A password makes sure that doesn't happen, at least until you tell everyone that your key was leaked. -6. On the final screen, click `Finish` -7. To help with the next chapter, we'll extract your public key. In "Kleopatra" you should see a line, containing your name and email. Right-click on it, and select `Export Certificate`. - -On *Linux* and *MacOS*, you can use the command line: - -1. Enter this command in your favorite terminal - - ```bash - gpg --full-generate-key - ``` -2. Follow the prompt on the screen (sample pictures available in [encryptionconsulting.com](https://www.encryptionconsulting.com/how-to-generate-pgp-key-pair/)) -3. Export your public key (of course, change me@email.com and the location to the one you want, but don't forget the .asc extension) - - ```bash - gpg --armor --export me@email.com > ~/Documents/me-email.com-publickey.asc - ``` - -### S/MIME - -Contrary to PGP, S/MIME relies on a certificate authority, meaning you'll have to buy your keys from someone. Any provider from [Google](https://support.google.com/a/answer/7448393?hl=en&ref_topic=9061730)'s list of trusted CAs will work. - -Currently, the only one that provides free certificates is [Actalis](https://www.actalis.com/s-mime-certificates.aspx). Their process is pretty straight forward, just follow the instructions (shown in [this](https://www.dannyguo.com/blog/how-to-get-a-free-s-mime-certificate/) article). - -## Exchanging keys - -You should now have a text file with your public key in it. When you want to send an encrypted email to someone, ask them for their public key, and meanwhile send them your public key. It doesn't matter how you do that, even if it's with unencrypted emails. - -Remember, **never** send your **private** key to anyone! - -## Configuring clients - -Now we need to configure your email application to automatically encrypt and decrypt messages. There are a lot of email clients, so I have compiled the most used ones and linked resources on how to set them up. - -When writing a message, don't forget to check if encryption is turned on for this email! On most clients, in the compose window, you'll have to select an option to enable encryption, but others do that automatically. - -*Freemium means it has a free and a paid tier. Premium means you have to pay for it. FOSS means it's free and open source. FreemiumOSS means it is free and open source, but also has paid tiers.* - -|Client |Type |Platform |PGP/Inline |PGP/MIME |S/MIME | -|-----------|-----------|---------------------|-----------|-----------|-----------| -|**Web** | | | | | | -|Gmail |Freemium |Web |[Yes](https://flowcrypt.com/)^[1](#1)|[Yes](https://flowcrypt.com/)^[1](#1)|[Yes](https://support.google.com/a/answer/6374496?hl=en&ref_topic=9061730)^[2](#2)| -|Outlook |Freemium |Web |No |No |[Yes](https://support.microsoft.com/en-us/office/encrypt-email-messages-373339cb-bf1a-4509-b296-802a39d801dc#bkmk_encryptwithsmime)^[2](#2)| -|iCloud mail|Freemium |Web |[Yes](https://support.apple.com/en-us/HT201214)|[Yes](https://support.apple.com/en-us/HT201214)|[Yes](https://support.apple.com/en-us/HT202345)| -|Yahoo! |Freemium |Web |No |No |No | -|Protonmail |Freemium |Web |[Yes](https://proton.me/support/how-to-use-pgp)|[Yes](https://proton.me/support/how-to-use-pgp)|No| -|Roundcube |Self-hosted|Web |[Yes](https://github.com/roundcube/roundcubemail/tree/master/plugins/enigma)^[1](#1)|[Yes](https://github.com/roundcube/roundcubemail/tree/master/plugins/enigma)^[1](#1)|[No](https://github.com/roundcube/roundcubemail/issues/4977)| -|Rainloop |Self-hosted|Web |Yes |[No](https://github.com/RainLoop/rainloop-webmail/issues/1798)|No| -|**Desktop**| -|Thunderbird|FOSS |Windows, MacOS, Linux|[Yes](https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq#w_i-have-never-used-openpgp-with-thunderbird-before-how-do-i-setup-openpgp)|[Yes](https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq#w_i-have-never-used-openpgp-with-thunderbird-before-how-do-i-setup-openpgp)|[Yes](https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq)| -|Outlook |Premium |Windows, MacOS |No |No |[Yes](https://support.microsoft.com/en-us/office/encrypt-email-messages-373339cb-bf1a-4509-b296-802a39d801dc#bkmk_encryptwithsmime) | -|Mailbird |Premium |Windows |[No](https://mailbird.featureupvote.com/suggestions/74494/pgp-encryption-support)|[No](https://mailbird.featureupvote.com/suggestions/74494/pgp-encryption-support)|[No](https://mailbird.featureupvote.com/suggestions/160861/smime-support) -|Evolution |FOSS |Linux |[Yes](https://help.gnome.org/users/evolution/stable/mail-encryption-gpg-set-up.html.en) |[Yes](https://help.gnome.org/users/evolution/stable/mail-encryption-gpg-set-up.html.en) |[Yes](https://help.gnome.org/users/evolution/stable/mail-encryption-s-mime-manage.html.en) | -|Sylpheed |FOSS |Windows, MacOS, Linux|[Yes](https://sylpheed.sraoss.jp/doc/manual/en/sylpheed-8.html#ss8.2) |[Yes](https://sylpheed.sraoss.jp/doc/manual/en/sylpheed-8.html#ss8.2) |[No](https://www.sraoss.jp/pipermail/sylpheed/2011-May/004551.html)| -|Claws-mail |FOSS |Windows, Linux |[Yes](https://claws-mail.org/plugin.php?plugin=gpg)^[1](#1)|[Yes](https://claws-mail.org/plugin.php?plugin=gpg)^[1](#1)|[Yes](https://claws-mail.org/plugins.php)^[1](#1)| -|**Mobile** | -|Gmail |Free |Android, iOS |No |No |Yes^[3](#3)| -|Outlook |Free |Android, iOS |No |No |Yes^[3](#3)| -|Apple Mail |Free |iOS |Yes |Yes |Yes | -|Yahoo! |Free |Android, iOS |No |No |No | -|Edison |Free |Android, iOS |No |No |No | -|Protonmail |Free |Android, iOS |[Yes](https://proton.me/support/how-to-use-pgp)|[Yes](https://proton.me/support/how-to-use-pgp)|No| -|K-9 Mail |FOSS |Android |[Yes](https://docs.k9mail.app/en/current/security/pgp/)|[Yes](https://docs.k9mail.app/en/current/security/pgp/)|[No](https://docs.k9mail.app/en/current/security/overview/#end-to-end-encryption)| -|FairEmail |FreemiumOSS|Android |[Yes](https://github.com/M66B/FairEmail/blob/master/FAQ.md)|[Yes](https://github.com/M66B/FairEmail/blob/master/FAQ.md)|[Yes](https://github.com/M66B/FairEmail/blob/master/FAQ.md)^[\*](#*) - -<sup id="1">1</sup> Available with an extension/plugin -<sup id="2">2</sup> Available in a paid version of the software (assuming the software is Freemium; this is true for all Premium software) -<sup id="3">3</sup> Available with a Premium account (even if the software is Free) -<sup id="*">\*</sup> You can read S/MIME messages, but signing and encrypting is a pro feature |