gui design – How to display comparison of two versions of a blog post?

Suppose I develop a blog web application with a blog post editor. The blog posts are stored as JSON files. The web application renders these JSON files to display blog posts with their titles, headers, images, etc.

A user can save different versions of a blog post. I want to provide a new screen to compare two different versions of the same post and merge them if necessary. I don’t want to expose the JSONs so it cannot be a JSON comparison tool.

How would you display the comparison of the post versions ? Do you have any examples ?

apt – How to install older version of mariadb galera cluster to match the running galera cluster versions?

I have following collected deb packages:

~/mariadb_deb_packages$ ll
total 18728
drwxrwxr-x 2 ciasto ciasto    4096 Nov 24 22:47 ./
drwxr-xr-x 7 ciasto ciasto    4096 Nov 24 22:44 ../
-rw-r--r-- 1 ciasto ciasto  821668 Apr 28  2017 galera-3_25.3.20-1_arm64.deb
-rw-r--r-- 1 ciasto ciasto    6320 Apr  2  2019 libaio1_0.3.110-5ubuntu0.1_arm64.deb
-rw-r--r-- 1 ciasto ciasto 4965688 Oct 26 19:18 mariadb-client-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
-rw-r--r-- 1 ciasto ciasto 4140088 Oct 26 19:18 mariadb-client-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
-rw-r--r-- 1 ciasto ciasto   16068 Oct 26 19:18 mariadb-common_1%3a10.1.47-0ubuntu0.18.04.1_all.deb
-rw-r--r-- 1 ciasto ciasto 4535116 Oct 26 19:18 mariadb-server-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
-rw-r--r-- 1 ciasto ciasto 4329988 Oct 26 19:18 mariadb-server-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
-rw-r--r-- 1 ciasto ciasto   12904 Oct 26 19:18 mariadb-server_1%3a10.1.47-0ubuntu0.18.04.1_all.deb
-rw-r--r-- 1 ciasto ciasto  321936 Apr  4  2018 socat_1.7.3.2-2ubuntu2_arm64.deb
~/mariadb_deb_packages$ sudo dpkg -i mariadb-server_1%3a10.1.47-0ubuntu0.18.04.1_all.deb 
(Reading database ... 49379 files and directories currently installed.)
Preparing to unpack mariadb-server_1%3a10.1.47-0ubuntu0.18.04.1_all.deb ...
Unpacking mariadb-server (1:10.1.47-0ubuntu0.18.04.1) over (1:10.1.47-0ubuntu0.18.04.1) ...
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1); however:
  Package mariadb-server-10.1 is not installed.

dpkg: error processing package mariadb-server (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-server
~/mariadb_deb_packages$ sudo dpkg -i mariadb-server-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
dpkg: regarding mariadb-server-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb containing mariadb-server-core-10.1:
 mariadb-server-core-10.1 breaks mysql-client-5.5
  mariadb-client-10.4 provides mysql-client-5.5 and is present and installed.

dpkg: error processing archive mariadb-server-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb (--install):
 installing mariadb-server-core-10.1 would break mariadb-client-10.4, and
 deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
 mariadb-server-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
~/mariadb_deb_packages$ sudo dpkg -i mariadb-client-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
dpkg: regarding mariadb-client-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb containing mariadb-client-10.1:
 mariadb-client-10.1 conflicts with mysql-client-core-5.5
  mariadb-client-core-10.4 provides mysql-client-core-5.5 and is present and installed.

dpkg: error processing archive mariadb-client-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb (--install):
 conflicting packages - not installing mariadb-client-10.1
Errors were encountered while processing:
 mariadb-client-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
~/mariadb_deb_packages$ sudo dpkg -i mariadb-client-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
dpkg: regarding mariadb-client-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb containing mariadb-client-core-10.1:
 mariadb-client-core-10.1 conflicts with mysql-client-5.5
  mariadb-client-10.4 provides mysql-client-5.5 and is present and installed.

dpkg: error processing archive mariadb-client-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb (--install):
 conflicting packages - not installing mariadb-client-core-10.1
Errors were encountered while processing:
 mariadb-client-core-10.1_1%3a10.1.47-0ubuntu0.18.04.1_arm64.deb
~/mariadb_deb_packages$ sudo apt purge mariadb-client-10.4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mariadb-client : Depends: mariadb-client-10.4 (>= 1:10.4.17+maria~bionic) but it is not going to be installed
 mariadb-client-core-10.4 : Depends: mariadb-common (>= 1:10.4.17+maria~bionic) but 1:10.1.47-0ubuntu0.18.04.1 is to be installed
 mariadb-server : Depends: mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
~/mariadb_deb_packages$ sudo apt purge mariadb-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mariadb-client-core-10.4 : Depends: mariadb-common (>= 1:10.4.17+maria~bionic) but 1:10.1.47-0ubuntu0.18.04.1 is to be installed
 mariadb-server : Depends: mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
~/mariadb_deb_packages$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  galera-4 mariadb-common mariadb-server mariadb-server-10.4 mariadb-server-core-10.4
Suggested packages:
  mailx mariadb-test tinyca
Recommended packages:
  libhtml-template-perl
The following packages will be REMOVED:
  galera-3
The following NEW packages will be installed:
  galera-4 mariadb-server-10.4 mariadb-server-core-10.4
The following packages will be upgraded:
  mariadb-common mariadb-server
2 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 3532 B/19.5 MB of archives.
After this operation, 150 MB of additional disk space will be used.
Do you want to continue? (Y/n) n
Abort.
~/mariadb_deb_packages$ sudo apt remove mariadb-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libmariadb3 : Depends: mariadb-common but it is not going to be installed
 mariadb-client-10.4 : Depends: mariadb-common but it is not going to be installed
 mariadb-client-core-10.4 : Depends: mariadb-common (>= 1:10.4.17+maria~bionic) but it is not going to be installed
 mariadb-server : Depends: mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I have tried removing individual but throws error

~/mariadb_deb_packages$ sudo apt remove libmariadb3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libmariadbclient18 : Depends: libmariadb3 (= 1:10.4.17+maria~bionic) but it is not going to be installed
 mariadb-client-core-10.4 : Depends: libmariadb3 but it is not going to be installed
                            Depends: mariadb-common (>= 1:10.4.17+maria~bionic) but 1:10.1.47-0ubuntu0.18.04.1 is to be installed
 mariadb-server : Depends: mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
~/mariadb_deb_packages$ sudo apt remove libmariadbclient18
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mariadb-client-core-10.4 : Depends: mariadb-common (>= 1:10.4.17+maria~bionic) but 1:10.1.47-0ubuntu0.18.04.1 is to be installed
 mariadb-server : Depends: mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

can anyone please help me install maraidb galera cluster distrib 10.1.47 and its dependencies ?

Maven dependencies with versions [0.0.0,999.999.999)

I have this situation where we have a couple of maven repositories. Some are frontend..ish (JSP, Spring Controllers etc.) meant to be deployed as war files and others are for the hibernate mappings etc. which are used as dependencies.

I noticed that in most of the pom.xml files for the frontend..ish applications the dependencies are listed as follows:

        <dependency>
            <groupId>com.myco.backend</groupId>
            <artifactId>db-objects</artifactId>
            <version>(0.0.0,999.999.999)</version>
        </dependency>

To me this looks like terrible practice because of reasons listed below. I know that maven’s LATEST was deprecated, but I don’t know whether this was because of it being bad practice to use it.

Some cons I can think of using this:

  • Maven has to download all versions but only uses latest.
  • Using latest version makes one uncertain as to what versions are being deployed.
  • Perhaps multiple versions can be active at the same time?
  • Could be using SNAPSHOT versions if we’re not careful

So my question is this: is there any upside to specifying the version as (0.0.0,999.999.999)? Any critique of this or suggestions of how to do it better would be appreciated.

P.S. I know some of the stack sites are not for opinion questions and this may be off-topic. If this is the case, please direct me to the correct site.

dual boot – Correctly installing multiple OS versions on 2 drives

I have a tough question.

I need to i install multiple linux versions and windows together on 2 drives without messing the bootloader.

Potentially important Hardware:
CPU ryzen 3600
MB Asrock B450
UEFI

So here’s the thing. I currently have an NVME with Windows 10, which is also bitlocker encrypted so I have to enter its password every time I boot. I want this to be my default system.

Together with that, I want to put a SATA SSD which i will partition in 4 parts, 2 of which i will have with 2 different versions of Ubuntu, 1 oracle based OS and another edition of Windows 10, different from my current win 10 which is on the NVME.

How would you suggest that i take on the matter, so that i can install the 4 extra OS’s on the sata SSD, and after be able to chose the OS i want to boot trough the default windows Boot loader screen.

Also, would you suggest that i partition the SSD trough my current windows 10 partitioning tool?

Thank you in advance and please feel free to add any vital details i might need to know. Semi noob here. 🙏🏻

macOS Big Sur creates duplicate versions of files

Several times in a day, I notice duplicate versions of my files being created. Refer to the screenshot – empty.html.erb was duplicated, and a new empty.html 2.erb was created.

What is causing this, and how can I stop this?

enter image description here

php – Why does DateInterval lack weeks, quarters/seasons, as well as decimal/float versions of each property?

This has puzzled and frustrated me for years: https://www.php.net/manual/en/class.dateinterval.php

y

    Number of years.
m

    Number of months.
d

    Number of days.
h

    Number of hours.
i

    Number of minutes.
s

    Number of seconds.
f

    Number of microseconds, as a fraction of a second.

Where are the weeks and quarters/seasons? In particular, the weeks are sorely missing. In turn, I feel as if I am missing something.

You’d call me crazy if you knew how many hours of my life I’ve plowed into trying to manually calculate the weeks and seasons and decimal versions of all of these based on the existing values, without luck.

I don’t want “rough approximations”, because they fall apart as the two dates drift too far away from each other. “Rough approximations” are easy to make, but I’m looking for exact, accurate information.

virtualization – Intel HAXM not working on the machine where previous versions worked fine

I installed the latest version of Android Stdudio/SDK bundle and went to edit the device. There is a yellow banner over the device list that tells me that HAXM is not installed even though it was part of the installation and the installer actually said “We have detected that… it can run accelerated”. When I go to install it it throws the error that folder blah-blah-blah does not exist. Googled the error and the consensus is that it means that the CPU, BIOS, or whatever does not support VT-x.

This machine has a CPU with VT-x support, and virtualization is enabled in the BIOS. These would have been important points, had I not already developed for Android on this very machine years ago: between 2013 and 2015.

Since then the machine has been rebuilt from UNIX to Windows but nothing else changed inside the box, so it should work. I tried to go to Google’s archive, but they only have old versions going as far as 2017’s studio 2.3.2 and I know that I previously used an older version that worked perfect.

Any ideas how to get an accelerated device running? I do not have all the time in the universe to wait for every sneeze on a non-accelerated device.

How to solve different versions of python on Ubuntu 18.04

On ubuntu 18.04 if I run the command in terminal

sys.version

it returns:

3.6.9 (default, Oct  8 2020, 12:12:24) n(GCC 8.4.0)

But if I run this command in jupyter notebook, first run notetook in terminal:

jupyter notebook

and in notebook:

import sys
print (sys.version)

it returns:

3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:01:00) (GCC 7.3.0)

I would like to know why there are two different versions of python 3? As I am trying to install igraph and I have managed to install it, but it is not found in jupyter notebook.

How can current Ubuntu versions be installed via PXE network boot and an automated installation?

Instead of having a small package specific to the task, it’s now necessary to use the regular full ISO image. Only the server installer Subiquity can be automated, so it’s required to use the server image even for a desktop installation.

The following steps are for the current version 20.10 (Groovy Gorilla). For future versions, replace all occurrences of 20.10 by the version number you want to install.

Prerequisites on the server machine that is going to serve the PXE files, installer image and autoinstall configuration:

  • A working TFTP server and corresponding DHCP configuration
  • A working web server
  • Having the packages pxelinux, syslinux-efi, syslinux-common installed
  1. Download the full live server image: wget https://releases.ubuntu.com/20.10/ubuntu-20.10-live-server-amd64.iso
  2. Copy the ISO image to your web server
  3. Create a directory on the web server to hold the autoinstall configuration. Create the files meta-data and user-data in the directory.
  4. Write your autoinstall configuration to the file user-data by using https://ubuntu.com/server/docs/install/autoinstall-reference as a reference
  1. Go to the directory your TFTP server serves, by default /srv/tftp

  2. Copy the ISO image downloaded in the previous section to the current directory

  3. Create some directories that we are going to use in the following steps: mkdir -p iso_mount init boot/uefi boot/bios pxelinux.cfg

  4. Mount the image and extract the kernel and initrd:

     mount -o loop ubuntu-20.10-live-server-amd64.iso iso_mount/
     cp -p iso_mount/casper/vmlinuz init/
     cp -p iso_mount/casper/initrd init/
     umount iso_mount
    
  5. Prepare the PXELINUX files for booting via UEFI as well as via BIOS:

     # UEFI
     cp -p /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi boot/uefi
     cp -p /usr/lib/syslinux/modules/efi64/ldlinux.e64 boot/uefi
     cp -p /usr/lib/syslinux/modules/efi64/libcom32.c32 boot/uefi
     cp -p /usr/lib/syslinux/modules/efi64/libutil.c32 boot/uefi
     cp -p /usr/lib/syslinux/modules/efi64/vesamenu.c32 boot/uefi
    
     # BIOS
     cp -p /usr/lib/PXELINUX/pxelinux.0 boot/bios
     cp -p /usr/lib/syslinux/modules/bios/ldlinux.c32 boot/bios
     cp -p /usr/lib/syslinux/modules/bios/libcom32.c32 boot/bios
     cp -p /usr/lib/syslinux/modules/bios/libutil.c32 boot/bios
     cp -p /usr/lib/syslinux/modules/bios/vesamenu.c32 boot/bios
    
  6. Configure your DHCP server to set the boot filename to boot/uefi/syslinux.efi for UEFI clients and boot/bios/pxelinux.0 for BIOS clients

  7. Create a PXELINUX config at pxelinux.cfg/default similar to the following. Replace the URLs in angle brackets by the URLs to your web server: Replace <iso url> by the URL to the ISO image and <autoinstall url> by the URL to the directory containing the autoinstall configuration (including a trailing slash!).

     DEFAULT vesamenu.c32
     PROMPT 0
     NOESCAPE 1
    
     MENU TITLE PXE System Installation
    
     LABEL Ubuntu 20.10
       MENU LABEL ubuntu_20.10
       KERNEL ../../init/vmlinuz
       INITRD ../../init/initrd
       APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=<iso url> autoinstall ds=nocloud-net;s=<autoinstall url>
    
  8. Link the PXELINUX config into the boot directories for UEFI and BIOS:

     ln -s ../../pxelinux.cfg boot/uefi/pxelinux.cfg
     ln -s ../../pxelinux.cfg boot/bios/pxelinux.cfg
    

You should now be able to boot both UEFI and BIOS clients via PXE into the Subiquity installer, which will then run automated according to your autoinstall config.

Desktop installation

If you are installing a desktop system, it’s necessary to install the ubuntu-desktop package.

You’ll also need to fix the network configuration in the installed system, since Subiquity enables systemd-networkd instead of NetworkManager, which is normally used on desktop systems:

  1. Remove the network configuration created by Subiquity: rm /etc/netplan/00-installer-config.yaml

  2. Create a file /etc/netplan/01-network-manager-all.yaml with the following contents:

     # Let NetworkManager manage all devices on this system
     network:
       version: 2
       renderer: NetworkManager
    
  3. Run netplan apply or reboot

Is there any reason other than (effectively) extortion for Google to stop security updates for 2 year old versions of Android?

I have a first-gen Google Pixel. It came with Android 9 (Oreo), then after I’d had it a while, upgraded itself to 10 (Pie). Just about the time Android 11 (Q?) came out, I was notified that Google would no longer supply updates (not even security updates, it seems) for my phone — then not yet quite two years old.

Sure, most people buy a new phone as soon as the purchase agreement runs out on their old one. I, however, bought the Pixel originally with the idea that, if I was going to spend $750 for a phone, I’d make it as future resistant as possible. I bought the best camera, fastest processor, and largest storage (128 GB) that I could find, which is how I wound up with a Pixel (Apple wasn’t in contention, because Apple).

Now, however, I have to choose between buying a new Pixel 4a (for less than half what I paid for my original Pixel), essentially the same phone I have but with very slightly upgraded specs (camera hardware supports longer exposures, CPU is slightly faster), in order to get two years of updates on a new Android version, buying a Pixel 5 or something else to get a significant hardware upgrade (and paying as much as I did originally) — or continuing to carry and use my original Pixel, which still works fine, holds charge well, and is nowhere even vaguely close to full.

The only reason I have to think about this is that I’m apparently no longer eligible for security updates, meaning there’s the possibility that a flaw that’s been fixed for years in newer versions might let someone take control of my phone, steal my photos and storeds passwords, take over my email, etc.

Is there any sensible reason (other than wanting more of my money) for Google to have stopped even security updates after a mere two years from release? Closely related: is there a way to upgrade manually, legally, with a non-rooted phone, and have the upgraded system work correctly with my hardware (camera etc.)?

The phone is on Verizon, if that matters (not sure why it would, but not sure it wouldn’t).