How to create a NFS root for Ubuntu

I am trying to set up a system that boots a NFS image from PXE.

I have succeeded in PXE booting the live CD by hosting the contents of the Live CD on a nfs share. I pass the kernel and the initrd from the install disk to the booting machine via PXE/TFTP.

The next step I want to take is to install or copy an installation of Xubuntu to the NFS root.

How do I make an NFS root for Ubuntu?

SharePoint Online – PowerShell – CSOM ExecuteQuery Exception is Root Element is Missing

I am used to working with SharePoint on-premises environments, but I am now trying to come up to speed with SharePoint Online. I can connect to my tenant using Connect-SPOService and use the standard SharePoint Online cmdlets, so my credentials are working and that route of access seems to be in good order for me.

However, I will need to use the greater utility of CSOM for work that I need to do. Initially, I have just tried to set up a simple PowerShell procedure to start walking through some of the basics using CSOM with SharePoint Online. But I continue to have a problem with ClientContext.ExecuteQuery. It always fails with the “root element is missing” error. I’m not sure if this is due to the query not retrieving any data or something else relating to my environment.

I currently have my own SharePoint tenant with some initial sites and lists. I am the only user and administrator. Everything is still very simple. I have installed and imported (using PSGallery) the following modules to set my PS environment (and sessions). I think that I have identified everything that I need, but it’s certainly possible that I am missing something important.

   ModuleType Version    Name                                 ---------- -------    ----                                    Binary     16.0.90... Microsoft.Online.SharePoint.PowerShell    Manifest   3.1.0.0    Microsoft.PowerShell.Management       Manifest   3.0.0.0    Microsoft.PowerShell.Security        Manifest   3.1.0.0    Microsoft.PowerShell.Utility           Script     1.2        PSReadline                             Script     1.0.0      SharePointOnline.CSOM                 Binary     3.11.19... SharePointPnPPowerShellOnline        Script     2.1.6      SharePointSDK  

I am working in Windows 10 with PowerShell 5.1 (running as Administrator). Everything is still very simple, but I can’t get past the query execution to load the web context so I can start trying to do additional things.

I have found many online examples of PowerShell/CSOM to connect to sites and set context. I’ve tried them all (at least it seems like I have), but nothing has worked so far. I can’t find anything else to try or additional diagnostic steps to take. So I would welcome any suggestions at this point.

Here is a PS Session Log of one of my test runs with the error message at the end …

PS C:>$  LibPath = "C:\Program Files\WindowsPowerShell\Modules\SharePointOnline.CSOM.0.0" PS C:>[System.Reflection.Assembly]::LoadFile("$  LibPath\Microsoft.SharePoint.Client.dll") GAC    Version        Location ---    -------        -------- False  v4.0.30319     C:\Program Files\WindowsPowerShell\Modules\SharePointOnline.CSOM.0.0\Microsoft.SharePoint.Cl...  PS C:>[System.Reflection.Assembly]::LoadFile("$  LibPath\Microsoft.SharePoint.Client.Runtime.dll") GAC    Version        Location ---    -------        -------- False  v4.0.30319     C:\Program Files\WindowsPowerShell\Modules\SharePointOnline.CSOM.0.0\Microsoft.SharePoint.Cl...  PS C:>[System.Reflection.Assembly]::LoadFile("$  LibPath\Microsoft.SharePoint.Client.UserProfiles.dll") GAC    Version        Location ---    -------        -------- False  v4.0.30319     C:\Program Files\WindowsPowerShell\Modules\SharePointOnline.CSOM.0.0\Microsoft.SharePoint.Cl...  PS C:> PS C:># try simple connection test PS C:>Write-Host "Start connection test ..." Start connection test ...  PS C:> PS C:>$  UserName = "xxxxxxx@xxxxxx.onmicrosoft.com" PS C:>$  SiteUrl = "https://xxxxxx.sharepoint.com/sites/Testing" PS C:>$  ctx = New-Object Microsoft.SharePoint.Client.ClientContext($  SiteUrl) PS C:> PS C:>$  pwd = Read-Host -Prompt "Enter password" -AsSecureString Enter password: ********** PS C:>$  securePwd = ConvertTo-SecureString $  pwd -AsPlainText -Force PS C:> PS C:>$  Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($  UserName, $  securePwd) PS C:> PS C:>$  ctx.credentials = $  Cred PS C:>if (!$  ctx.ServerOjectIsNull.Value) {     Write-Host "Connected to $  SiteUrl" -ForegroundColor Green } Connected to https://xxxxxx.sharepoint.com/sites/Testing  PS C:> PS C:>$  web = $  ctx.Web PS C:>Write-Host "Context is $  ctx" Context is Microsoft.SharePoint.Client.ClientContext  PS C:>Write-Host "Web is $  web" Web is Microsoft.SharePoint.Client.Web  PS C:>$  ctx.Load($  web) PS C:>$  ctx.ExecuteQuery()  **Exception calling "ExecuteQuery" with "0" argument(s): "Root element is missing." At line:1 char:1 + $  ctx.ExecuteQuery() + ~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : XmlException** 

How to enable passwordless sudo programmatically to ubuntu user without access to root

I am doing a fresh install of Ubuntu 18.04 via automated methods which runs a script under the ubuntu user programmatically. However when the script tries to run sudo it prompts for the users password. I know I can prevent prompting for the ubuntu password on sudo by doing:

echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers > /dev/null 

However, this fails as I need sudo without password to update /etc/sudoers programmatically.

How can I accomplish this? I know on Amazon EC2 the Ubuntu AMI uses cloudinit to automatically enable passwordless sudo. It seems like cloudinit is running, how can I configure it to mirror what Amazon EC2 Ubuntu AMI does?

System directories not owned by root after preseed install 18.04.2

I have an issue where there are no files owned by root after an unattended install using preseed on Ubuntu 18.04.2. I discovered this when I could not use sudo. Upon investigation, I found that /usr, /lib and /home were owned by 1001:1001, not root, and the same for any files or sub-directories. This wasn’t a problem in the past, so I’m a bit mystified. Please see my preseed file below:

  # Localization d-i debian-installer/locale             string  en_US.UTF-8 d-i debian-installer/language           string  en d-i debian-installer/country            string US  # Keyboard layout d-i console-setup/ask_detect            boolean false d-i keyboard-configuration/layoutcode   string  us d-i keyboard-configuration/charmap      select  UTF-8 d-i keyboard-configuration/layout       string English (US)   ### Network configuration d-i netcfg/choose_interface             select auto d-i netcfg/use_autoconfig               boolean true d-i netcfg/get_domain                   string cg.chrysler.com  ### Mirror settings d-i mirror/country                      string  manual d-i mirror/http/hostname                string  us.archive.ubuntu.com d-i mirror/http/directory               string  /ubuntu d-i mirror/http/proxy                   string   d-i proxy                               string   d-i mirror/protocol                     string  http  ### Account setup d-i passwd/user-fullname                string ictadmin d-i passwd/username                     string ictadmin d-i passwd/user-password                password chrysler1 d-i passwd/user-password-again          password chrysler1 d-i user-setup/encrypt-home             boolean false  ### Clock and time zone setup - TS verified ntp server  d-i clock-setup/utc                     boolean true d-i time/zone                           string  America/Detroit d-i clock-setup/ntp                     boolean false d-i clock-setup/ntp-server             string  ntp.example.com   # Automatically detect device name of install disk d-i partman/early_command   string      debconf-set partman-auto/disk /dev/"$  (fdisk -l |grep -i linux | awk '{print $  1}' | cut -d / -f 3 |sed 's/p[0-9]$  //p' |head -n1)"  ### Partitioning and disk encryption d-i partman-auto/method                 string  crypto d-i partman-crypto/passphrase             password  d-i partman-crypto/passphrase-again       password   d-i partman-lvm/purge_lv_from_device    boolean true d-i partman-lvm/device_remove_lvm       boolean true d-i partman-md/device_remove_md         boolean true d-i partman-lvm/confirm                boolean true d-i partman-lvm/confirm_nooverwrite    boolean true d-i partman-auto/choose_recipe          select  atomic  d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition            select finish d-i partman/confirm                     boolean true d-i partman-lvm/confirm_nooverwrite    boolean true  ### Package selection tasksel tasksel/first                   multiselect ubuntu-desktop ubiquity    ubiquity/keep-installed string icedtea6-plugin openoffice.org # Enable extras.ubuntu.com. d-i apt-setup/extras    boolean true d-i pkgsel/include/install-recommends   boolean true  ### Boot loader installation d-i grub-installer/only_debian          boolean true##  TO DO:  Resolve how to create more file systems ##  Need to have OS separated from data d-i grub-installer/with_other_os        boolean true    ### Copy and install some extra stuff  ### When ubiquity/success_command is invoked /target is mounted  ubiquity ubiquity/success_command       string \    in-target apt purge gdm3 ; \    in-target apt update ; \    in-target apt-get -y install net-tools libwebkitgtk-3.0 terminator gdm3 ; \    in-target hostname `echo "ubn"$  (lshw | grep -m 1 serial | awk '{print tolower ($  2)}')` ; \    hostname > /target/etc/hostname ; \    sed -i "2s/.*/127.0.1.1\t$  (cat /target/etc/hostname)/" /target/etc/hosts  ubiquity ubiquity/use_nonfree   boolean true ubiquity ubiquity/reboot   boolean  true 

How to split Aggregate Root that have equal identity?

In DDD, creating smaller aggregates is encouraged where possible, but in a system we are designing we are running into an issue regarding the identity of aggregates.

The system evolves around phyisical events, like music festivals or sports events, and within these events there are separated bounded contexts representing some business use case. For example, there can be Accreditation and Badges.

Solution One

In a first design of the system we had modeled an Event aggregate (see Figure 1), where all business logic around Accreditation, Badges, and future business use cases would live.

enter image description here

Figure 1: Event aggregate

Solution Two

However, this would result in a huge aggregate, so we decided it would be best to split these up into smaller aggregates (see Figure 2). Events itself was no longer a concept because we had split these up into separate Accreditation and Badges. However, because they all refer to the same physical event, they only identifier we could come up with was the same eventId.

Implementing this with event sourcing would also raise the issue that there are multiple event streams with the same identifier.

enter image description here

Figure 2: Split aggregates with shared identity.

Solution Three

Another solution would be the “natural” DDD approach where we would tread the different modules as Entities with their own identity (see Figure 3). This however, feels very unnatural and does not represent the actual domain logic. In the implementation we would therefor also need a lookup table of some sort to map the eventId to the required moduleId (see Figure 4).

enter image description here

Figure 3: Split aggregates with own identity.

enter image description here

Figure 4: Lookup table that maps the event to their modules.

Question

The question in this case is which of the following solution seems the most efficient and DDD-like approach?

Help me install Ubuntu 18.04 (No root file system is defined error):

I’m trying to install Ubuntu alongside Windows 10. I have the Legacy BIOS and my disk partition is MBR. I downloaded Ubuntu 18.04 and put it on a usb flash drive using Rufus. I also created 30 GB free space for Ubuntu. However, when I’m trying to install the Ubuntu, when I’m selecting the free space, the change function can’t be accessed, and when I try to install, it says “No root file system is defined. Please correct this from the partitioning menu”. Would be really great if someone can help me figure this out. screenshot_1 screenshot_2