Read characters from a string in C#

using System;
using System.IO;

public class CharsFromStr
{
    public static void Main()
    {
        string str = "Some number of characters";
        char[] b = new char[str.Length];

        using (StringReader sr = new StringReader(str))
        {
            // Read 13 characters from the string into the array.
            sr.Read(b, 0, 13);
            Console.WriteLine(b);

            // Read the rest of the string starting at the current string position.
            // Put in the array starting at the 6th array member.
            sr.Read(b, 5, str.Length - 13);
            Console.WriteLine(b);
        }
    }
}
// The example has the following output:
//
// Some number o
// Some f characters

References
https://learn.microsoft.com/en-us/dotnet/standard/io/how-to-read-characters-from-a-string

Allow GUI root login on Ubuntu 22.04

sudo passwd
sudo nano /etc/gdm3/custom.conf

Inside the GDM configuration file, we need to add the AllowRoot=true line. After you have made this change, you can save and exit the file.

AllowRoot=true
sudo nano /etc/pam.d/gdm-password

Inside of the PAM authentication daemon file, comment out the following line, which denies root access to the graphical user interface, with a pound sign #. You can save your changes and exit this file when done.

auth   required        pam_succeed_if.so user != root quiet_success
reboot

References
https://linuxconfig.org/how-to-allow-gui-root-login-on-ubuntu-22-04-jammy-jellyfish-linux

Install .NET Core SDK in Manjaro Linux

sudo pacman -S dotnet-sdk
sudo pacman -S aspnet-runtime

Then, you’ll need to create /etc/profile.d/dotnet.sh and add the following:

export DOTNET_ROOT=/usr/share/dotnet
export MSBuildSDKsPath=$DOTNET_ROOT/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks
export PATH=${PATH}:${DOTNET_ROOT}
dotnet --list-sdks

To use the extra tools, such as dotnet ef, you will want to add a line to your .bashrc file.

nano ~/.bashrc

And add the following at the end:

export PATH="$PATH:/home/jeremy/.dotnet/tools"
source ~/.bashrc

 

References
https://www.jeremymorgan.com/tutorials/linux/how-to-install-dotnet-manjaro/
https://github.com/dotnet/core/issues/7087