hard drive – How to find disk serial on raid1 system on Ubuntu 18.04

I have a remote server with SSD RAID1 disks.
I do not find the serial of the disk with error.
Any help here? Thanx!

I have this error message:
A DegradedArray event had been detected on md device /dev/md/1.

P.S. The /proc/mdstat file currently contains the following:

Personalities : (raid1) (raid6) (raid5) (raid4) (linear) (multipath) (raid0) (raid10)
md0 : active raid1 sda1(0) sdc1(2) sdd1(3)
16760832 blocks super 1.2 (4/3) (U_UU)

md2 : active raid6 sdd3(3) sdc3(2) sda3(0)
432926720 blocks super 1.2 level 6, 512k chunk, algorithm 2 (4/3) (U_UU)
bitmap: 2/2 pages (8KB), 65536KB chunk

md1 : active raid1 sda2(0) sdd2(3) sdc2(2)
523712 blocks super 1.2 (4/3) (U_UU)

unused devices:

lshw -class disk reports

*-disk:0

   description: SCSI Disk
   product: MR9260-4i
   vendor: LSI
   physical id: 2.0.0
   bus info: scsi@0:2.0.0
   logical name: /dev/sda
   version: 2.13
   serial: 00f03316f7f4b700ffa0bf2c09b00506
   size: 223GiB (239GB)
   capabilities: partitioned partitioned:dos
   configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=0aff576a

*-disk:1

   description: SCSI Disk
   product: MR9260-4i
   vendor: LSI
   physical id: 2.2.0
   bus info: scsi@0:2.2.0
   logical name: /dev/sdc
   version: 2.13
   serial: 006c491cf7f5b700ffa0bf2c09b00506
   size: 223GiB (239GB)
   capabilities: partitioned partitioned:dos
   configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=2fc55799

*-disk:2

   description: SCSI Disk
   product: MR9260-4i
   vendor: LSI
   physical id: 2.3.0
   bus info: scsi@0:2.3.0
   logical name: /dev/sdd
   version: 2.13
   serial: 002ee71ff7f5b700ffa0bf2c09b00506
   size: 223GiB (239GB)
   capabilities: partitioned partitioned:dos
   configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=fecae65e

python – Conditional traffic light system

I have written Python code which uses multiple if conditions and a for loop. The main objective of the code is to produce a traffic light system based on certain conditions.

Red = -1
Yellow = 0
Green = 1

It takes 4 months (m0, m1, m2, m3) and dataframe as an input, runs the condition through each row, and returns -1, 0 or 1.

scenarios

The code compares Month 1 with Month 0, Month 2 with Month 1 and Month 3 with Month 2.

For input:

if month+1 < Month for any value, then red else green.

For example, if the revenue of July 2020 is less than June 2020 then the input is red, otherwise green. Based on three comparisons the outcome is calculated. The outcome could be either 1-, 0, or 1.

The code I have written works well but is not optimised in any way. Is there a better way to do this?

This would be an O(n) operation but, at least there should be a way to write it concisely in Python. Or if code can be improved operationally as well.

def getTrafficLightData(df, dimension, m1, m2, m3, m4):
'''
Inputs - 
    Dataframe
    dimension = on which we want to calculate traffic light system
    m1, m2, m3, m4 - Could be any for months but we have taken consecutive months for Traffic Light System.
    Example Call - getTrafficLightData(report6_TLS_data, "Revenue_","2020-6","2020-7","2020-8","2020-9")

'''

TFS_df = pd.DataFrame(columns=(dimension + "_TLS"))

if dimension == "Overstrike_":
    suffix = "%"
    for i in range(len(df)):
        if (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (-1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (-1)
        elif (
            (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (-1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (0)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (  #
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (  #
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (0)
        else:
            TFS_df.loc(i) = (0)
    return TFS_df
else:
    if dimension == "Margin_":
        suffix = "%"
    else:
        suffix = ""
    for i in range(len(df)):
        if (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (-1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                < df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (0)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                > df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (-1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                > df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (-1)
        elif (
            (
                df(dimension + m1 + suffix).iloc(i)
                < df(dimension + m2 + suffix).iloc(i)
            )
            and (
                df(dimension + m2 + suffix).iloc(i)
                < df(dimension + m3 + suffix).iloc(i)
            )
            and (
                df(dimension + m3 + suffix).iloc(i)
                > df(dimension + m4 + suffix).iloc(i)
            )
        ):
            TFS_df.loc(i) = (0)
        else:
            TFS_df.loc(i) = (0)
    return TFS_df

The function is called in below way –

report6_TLS_data('Revenue_TLS')=getTrafficLightData(report6_TLS_data, "Revenue_","2020-6","2020-7","2020-8","2020-9")
report6_TLS_data("Margin_TLS")=getTrafficLightData(report6_TLS_data, "Margin_","2020-6","2020-7","2020-8","2020-9")
report6_TLS_data("Overstrike_TLS")=getTrafficLightData(report6_TLS_data, "Overstrike_","2020-6","2020-7","2020-8","2020-9")

Any pointers would be helpful.

The input data is of form –

ym  PART NUMBER BranchCode  Revenue_2019-1  Revenue_2019-10 Revenue_2019-11 Revenue_2019-12 Revenue_2019-2  Revenue_2019-3  Revenue_2019-4  Revenue_2019-5  Revenue_2019-6  Revenue_2019-7  Revenue_2019-8  Revenue_2019-9  Revenue_2020-1  Revenue_2020-2  Revenue_2020-3  Revenue_2020-4  Revenue_2020-5  Revenue_2020-6  Revenue_2020-7  Revenue_2020-8  Revenue_2020-9  Margin_2019-1   Margin_2019-10  Margin_2019-11  Margin_2019-12  Margin_2019-2   Margin_2019-3   Margin_2019-4   Margin_2019-5   Margin_2019-6   Margin_2019-7   Margin_2019-8   Margin_2019-9   Margin_2020-1   Margin_2020-2   Margin_2020-3   Margin_2020-4   Margin_2020-5   Margin_2020-6   Margin_2020-7   Margin_2020-8   Margin_2020-9   Overstrike_2019-1   Overstrike_2019-10  Overstrike_2019-11  Overstrike_2019-12  Overstrike_2019-2   Overstrike_2019-3   Overstrike_2019-4   Overstrike_2019-5   Overstrike_2019-6   Overstrike_2019-7   Overstrike_2019-8   Overstrike_2019-9   Overstrike_2020-1   Overstrike_2020-2   Overstrike_2020-3   Overstrike_2020-4   Overstrike_2020-5   Overstrike_2020-6   Overstrike_2020-7   Overstrike_2020-8   Overstrike_2020-9   Transactions_2019-1 Transactions_2019-10    Transactions_2019-11    Transactions_2019-12    Transactions_2019-2 Transactions_2019-3 Transactions_2019-4 Transactions_2019-5 Transactions_2019-6 Transactions_2019-7 Transactions_2019-8 Transactions_2019-9 Transactions_2020-1 Transactions_2020-2 Transactions_2020-3 Transactions_2020-4 Transactions_2020-5 Transactions_2020-6 Transactions_2020-7 Transactions_2020-8 Transactions_2020-9 Margin_2019-1%  Margin_2019-10% Margin_2019-11% Margin_2019-12% Margin_2019-2%  Margin_2019-3%  Margin_2019-4%  Margin_2019-5%  Margin_2019-6%  Margin_2019-7%  Margin_2019-8%  Margin_2019-9%  Margin_2020-1%  Margin_2020-2%  Margin_2020-3%  Margin_2020-4%  Margin_2020-5%  Margin_2020-6%  Margin_2020-7%  Margin_2020-8%  Margin_2020-9%  Overstrike_2019-1%  Overstrike_2019-10% Overstrike_2019-11% Overstrike_2019-12% Overstrike_2019-2%  Overstrike_2019-3%  Overstrike_2019-4%  Overstrike_2019-5%  Overstrike_2019-6%  Overstrike_2019-7%  Overstrike_2019-8%  Overstrike_2019-9%  Overstrike_2020-1%  Overstrike_2020-2%  Overstrike_2020-3%  Overstrike_2020-4%  Overstrike_2020-5%  Overstrike_2020-6%  Overstrike_2020-7%  Overstrike_2020-8%  Overstrike_2020-9%
0   BAGG001 BC  71.75   90.00   20.25   43.50   42.50   30.00   70.00   44.25   45.00   46.75   129.50  58.00   81.00   36.00   33.25   0.75    15.00   24.75   0.00    0.00    2.50    32.97   39.15   8.95    14.31   18.95   7.86    30.68   19.27   19.74   18.12   59.38   22.30   34.95   17.59   14.10   0.32    6.35    5.30    0.00    0.00    1.06    0.00    0.00    0.00    1.00    0.00    1.00    0.00    0.00    3.00    3.00    1.00    1.00    2.00    0.00    0.00    0.00    0.00    2.00    0.00    0.00    0.00    8   16  5   9   5   6   12  7   10  7   13  10  13  5   11  1   2   4   0   0   1   1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    0.00    0.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    1.00    0.00    0.00    1.00
1   BAGG001 PK  0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    25.50   0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    9.90    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    1.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0   0   0   0   0   0   0   0   0   2   0   0   0   0   0   0   0   0   0   0   0   0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    1.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    1.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00

kubuntu – Can’t do a KDE neon system upgrade

I tried to upgrade KDE Neon to the lastest version (Based Ubuntu 18.04 to 20.04).

First i couldn’t start the upgrade, because it says, that I should update some packages, even I updated all, I had to disable a couple of sources, so that I only have left the neon sources:

deb http://archive.neon.kde.org/user/ bionic main 
deb-src http://archive.neon.kde.org/user/ bionic main 

Now I can start the upgrade, but I breaks on updating with the following error:

Hold prevents MarkGarbage of intel-microcode:amd64 < 3.20180312.0~ubuntu18.04.1 | 3.20200609.0ubuntu0.20.04.2 @hi uH >
Log time: 2020-10-27 13:24:31.695861

Any ideas?

MacOS mounts OS X Base System (Catalina) from my Time Machine backup drive by itself

While my iMac (Retina 5k, 27-inch, Late 2015) was in sleep mode last night it mounted the OS X Base System (Catalina) and opened the image folder. Lately my Time Machine backup drive (Seagate Backup+ Hub) seems to be more active than usual even without an active backup process.

Power Nap, WoL, etc are all deactivated. Put HDD to sleep when possible is activated.
First Aid check in Disk Utility on the drive showed no error.

My question is, how could that happen that this has been mounted without user interaction? Is it a sign that the drive might be dying soon despite it shown as healthy?

dungeons and dragons – Upgrading from D&D Adventure System to a full D&D Campaign

As someone who started with the D&DAS games and moved to D&D, here are some thoughts.

The D&DAS board games are not RPGs. They are board games inspired by D&D 4e, with the latest installment, Temple of Elemental Evil, also having a few basic elements from 5e. As you have noticed, if you expect an RPG experience from them, you’ll be disappointed.

They are, however, a great gateway to D&D. They share the basic mechanic of rolling a d20, adding a modifier, and comparing the result to a target number. Additionally, they are a fantastic source of minis to use in any edition of D&D. Specifically, Temple of Elemental Evil contains hero minis matching the classes and races of the pregenerated characters that are found in the 5e starter set.

Which brings us to the 5e starter set. This box includes a rule book containing the most minimal set of rules possible for 5e. It does not contain any rules for using a grid and minis. However, the accompanying adventure works perfectly well with a grid and minis. Basic rules for grids are found in the 5e Players Handbook or SRD, with more complete rules in the Dungeon Master’s Guide.

In order to utilize minis in the starter set, you will need to either draw or print (or build, if you’re really ambitious) each location where fights take place to scale (1″:5′). Most locations described in the book are accompanied by gridded maps which can either be drawn by hand to scale, or either scanned or purchased online for printing to scale. Those locations that don’t have maps in the book are easily drawn (a road with bushes to either side, a simple cave, etc).

Having transitioned from D&DAS games to the 5e starter set, I highly recommend giving it a try, adding in the rules for grid and minis from the PH and DMG. I also recommend following the starter set with Princes of the Apocalypse, a great adventure for 5e, which will utilize just about every mini you got in Temple of Elemental Evil, as they were released together.

However, coming from a war gaming background, 5e may not be your best choice. D&D 4e required much more tactical play than 5e, which is more optionally tactics-heavy. 5e’s more tactical play options (flanking, facing, more exact grid usage) are found in the DMG. D&D of any edition is, in the end, a pen and paper game. If your groups are not interested in this, but actually want a single unit war game, D&D is not right for you.

In summary, my advice to you is to take the 5e starter set, throw away the rule book it comes with, get the PH or SRD and the DMG, and give it a try, printing/drawing out the adventure’s maps to scale.

ordinary differential equations – If i have this non linear system: $x’=-2y^3 , y’=3(y^2)(-2+x)$, which are the stable points?

Thanks for contributing an answer to Mathematics Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.

linux – mdadm – Attempted to move raid array to new system, superblocks gone?

I attempted to move a mdadm raid 1 array to a different system this evening.

I took the 2 SSDs out of one system and put them in another, then booted that system.

I opened gparted to check what the disks appeared as. They showed up as being blank (unallocated) drives.

I then shut down this system and moved the drives back to the original system, and booted.

sudo mdadm --assemble --scan --verbose

reported that no raid superblocks were found on sdg or sgh, which is where I would expect the data to be.

I thought this should be a fairly trivial process, but I’m now not sure what to do.

Any help would be appreciated, it’s kind of important I don’t loose the data on these drives…

root access – Best adb command and system tweaks for non rooted phone to get closer to rooted experience

As I always owned rooted phones I find frustrating living with all the limitations of non-rooted phones.

I would like to list here all the adb commands you can issue and system settings you can tweak to get your non-rooted phone experience closer to a rooted one. In a way decreasing “security” when connected to a PC.

Especially targeting Android 10+

Of course we all know everything starts enabling Developer Options and USB Debug

I can execute some pm disable package or pm uninstall package to get rid of some bloat system apps.

Then I can do some setting put global parameter n to tweak some system settings.
I.E. setting put global dropbox_max_files 9 limits the number of files in /data/system/dropbox directory (unaccessible) to 9 instead of hundreds (if not thousands).
Dropbox app not installed, but there is log activity in /data/system/dropbox

Finally there’s pm grant com.package.name android.permission.WRITE_SECURE_SETTINGS to play with…