command line interface – How to script out an install with flags?

I’ve downloaded an installer file in .msi format. I’m wanting to figure a way out to script the installer so that I can run it through one our automation tools and have it install and configure the software on hundreds of servers in our environment.

I looked at tools such as Silent Install Builder, and found it very easy to use. Unfortunately, our Enterprise InfoSec tools flag the bundle as malware, so I figured I would just do it via command line since the original .msi itself installs with no issues.

For the install, I’m wanting it to choose “Typical” for the setup type.

On the next screen, I’m wanting to choose both radio buttons.

And finally, I’m wanting it to input an IP address in the “Allowed hosts” field, and choose every module

I’ve looked around online at how to do this via command line, but unfortunately I was unsuccessful with having it choose the setup type, tick both radio buttons, and input the IP address for me and choose every module listed.

timeline – Display a range on a number line with a value

Is there a standard or good way to display a range of values (lower bound and upper bound) along with a particular value. The particular value might be too low (below the lower bound), too high (above the upper bound, or normal (between the bounds)? As in results from a blood test. For example, here’s a very crude drawing of those 3 scenarios:
enter image description here

Maybe a timeline type of interface?

command line – Run a piece of code in the background while using a script

Hey there I have a (for me atleast) complicated question.

I have a script that interacts with the plex (and sonarr but that isn’t important) api. I made it look and work like an interface. See the pictures:

I run the script and this is the first thing I see:

Home page

I choose to interact with the plex api and get to see the following page:

Home page plex api

There appears to be an update available for pms so I select “update”:

Updating but someone is using plex

But someone is watching a movie or series. So it doesn’t update because updating shuts down pms which would stop the stream of that person. So I made the script show that message when that happens (instead of updating). It shows it for 10 seconds and after that you go back to the menu in picture 2.

When nobody is streaming, it just goes through the update process and after that brings you back to Home page Plex API.

Now comes the question

I want to make an option called notify (an option like I could choose “plex” and “update” and now I want “notify”). So at the bottom of the message in picture 3, I would have exit | back | notify: (instead of sleeping 10s and going to Home page Plex API).

When I choose that option, it needs to run some code in the background. So it immediately goes back to Home page Plex API but in the background, it checks every 2 minutes if there’s still anybody watching. And when there isn’t anymore, it sets a variable to false.

But the problem for me is “in the background”. I want to run that piece of code in the background so that I could use the script in the mean time. So I choose “notify” and am then immediately able to use the script again. I can do (aka choose options/access parts of the api) anything I want, while in the background that part of code is running. And after it detects that that variable is set to false, it stops running in the background.

Do you have any idea how to do this?

Normally I’m already trying things and testing out if something works but with this problem, I really don’t know what to do/where to begin.

performance – Copy a block of data into existing cells, adding a new line

Wondering about efficiency here – I have a bit of code that does what I want; but it is terribly slow. I structured the code in a way that made sense to me logically, but I’m wondering if someone else could take a look at the code and find a shortcut or two that might make it faster. I’m guessing that I am referencing the Worksheet too often in one of the loops, but haven’t been able to find a good way to restructure to improve performance.

Option Explicit

Sub addAlternateRevCodeLogic()
Dim WS As Worksheet
Dim rng As Range
Dim lastColumn As Long
Dim row As Long
Dim i As Long

Dim ReferenceStyle As XlReferenceStyle

'Arrays of the different Alt Rev Code fields on an EAP
Dim AltID() As String
Dim EffFrom() As String
Dim EffTo() As String
Dim ProvType() As String
Dim BCC() As String
Dim DEP() As String
Dim EAF() As String
Dim Class() As String
Dim RevCode() As String

'Alt Rev Code data from the matching rows
Dim rowAltID As String
Dim rowEffFrom As String
Dim rowEffTo As String
Dim rowProvType As String
Dim rowBCC As String
Dim rowDEP As String
Dim rowEAF As String
Dim rowClass As String
Dim rowRevCode As String

'New and old cost centers
Dim newBCC() As String
Dim oldBCC As String
Dim CostCenter As Variant
Dim userInput As String

'Columns for Rev Code Ranges
Dim AltIDcol As Long 'I EAP 2431
Dim EffFromcol As Long 'I EAP 2434
Dim EffTocol As Long 'I EAP 2435
Dim ProvTypecol As Long 'I EAP 2439
Dim BCCcol As Long 'I EAP 2438
Dim DEPcol As Long 'I EAP 2437
Dim EAFcol As Long 'I EAP 2436
Dim Classcol As Long 'I EAP 2432
Dim RevCodecol As Long 'I EAP 2433

Application.ScreenUpdating = False
ReferenceStyle = Application.ReferenceStyle
If ReferenceStyle = xlR1C1 Then Application.ReferenceStyle = xlA1 'There are certain assumptions in the ranges that don't play nicely with R1C1

'Data is Chr(10) delimited
'Define the range of the EAP Export
Set WS = Worksheets("export")
lastColumn = eap.Cells.Find("*", After:=eap.Cells(1), LookIn:=xlValues, LookAt:=xlWhole, SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
Set rng = WS.Range("A1", WS.Columns(1).Find(what:="#LAST_ROW", LookIn:=xlComments, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Offset(0, lastColumn))

'Define all of the column IDs
AltIDcol = FindCol(2431, eap, True, 1, 1, 1, lastColumn)
EffFromcol = FindCol(2434, eap, True, 1, 1, 1, lastColumn)
EffTocol = FindCol(2435, eap, True, 1, 1, 1, lastColumn)
ProvTypecol = FindCol(2439, eap, True, 1, 1, 1, lastColumn)
BCCcol = FindCol(2438, eap, True, 1, 1, 1, lastColumn)
DEPcol = FindCol(2437, eap, True, 1, 1, 1, lastColumn)
EAFcol = FindCol(2436, eap, True, 1, 1, 1, lastColumn)
Classcol = FindCol(2432, eap, True, 1, 1, 1, lastColumn)
RevCodecol = FindCol(2433, eap, True, 1, 1, 1, lastColumn)

oldBCC = InputBox("What cost center do you want to copy?" & vbNewLine & "Select only one, and don't make typos")
If oldBCC = "" Then MsgBox "Must choose a cost center!", vbOKOnly + vbCritical: Exit Sub

Do
    userInput = InputBox("What are the new cost centers that need added?" & vbNewLine & "You can enter multiple, just keep adding them and then leave the box blank after the last one" & vbNewLine & "Don't make typos", "New Cost Centers")
    Select Case True
        Case CostCenter = "" And userInput <> "" 'Handle the 1st cost center
            CostCenter = userInput
        Case CostCenter <> "" And userInput <> "" 'Handle each new input
            CostCenter = CostCenter & "," & userInput
        Case CostCenter = "" And userInput = "" 'Handle no input
            MsgBox "Must choose at least one new cost center!", vbOKOnly + vbCritical: Exit Sub
    End Select
Loop While userInput <> ""

'oldBCC = "10005320" 'Test Emergency Cost Center
'oldBCC = "10004320" 'Test Pediatrics Cost Center
'CostCenter = "70005320" 'Test New Emergency Cost Center
'CostCenter = "70004110,70004130,70004140,70004200,70004420,70004510,70004400,70004430,70004500" 'Test New Pediatrics Cost Centers
newBCC() = Split(CostCenter, ",")

With rng
    For row = LBound(.Value2) To UBound(.Value2) 'Loop through each row from the export
    If Not IsEmpty(.Value2(row, RevCodecol)) Then 'Find any row that contains an alternate revenue code
        If InStr(1, .Value2(row, BCCcol), oldBCC) Then 'Check if the TRH Emergency Cost Center is using one of the alternate revenue codes
            'Build an array for each Alt Rev Code data item
            RevCode() = Split(.Value2(row, RevCodecol), Chr(10))
            AltID() = Split(.Value2(row, AltIDcol), Chr(10))
            EffFrom() = Split(.Value2(row, EffFromcol), Chr(10))
            EffTo() = Split(.Value2(row, EffTocol), Chr(10))
            ProvType() = Split(.Value2(row, ProvTypecol), Chr(10))
            BCC() = Split(.Value2(row, BCCcol), Chr(10))
            DEP() = Split(.Value2(row, DEPcol), Chr(10))
            EAF() = Split(.Value2(row, EAFcol), Chr(10))
            Class() = Split(.Value2(row, Classcol), Chr(10))
            For i = LBound(RevCode()) To UBound(RevCode())
                If InStr(1, BCC(i), oldBCC) Then 'Set row data for a line with the cost center to copy
                    rowAltID = AltID(i)
                    rowEffFrom = EffFrom(i)
                    rowEffTo = EffTo(i)
                    rowProvType = ProvType(i)
                    rowBCC = BCC(i)
                    rowDEP = DEP(i)
                    rowEAF = EAF(i)
                    rowClass = Class(i)
                    rowRevCode = RevCode(i)
                    'Copy the existing value and add the new line(s)
                    For Each CostCenter In newBCC 'Copy existing lines and add a new entry for each new cost center
                        .Cells(row, AltIDcol).Value = .Value2(row, AltIDcol) & Chr(10) & rowAltID ' & Chr(10)
                        .Cells(row, EffFromcol).Value = .Value2(row, EffFromcol) & Chr(10) & rowEffFrom ' & Chr(10)
                        .Cells(row, EffTocol).Value = .Value2(row, EffTocol) & Chr(10) & rowEffTo ' & Chr(10)
                        .Cells(row, ProvTypecol).Value = .Value2(row, ProvTypecol) & Chr(10) & rowProvType ' & Chr(10)
                        .Cells(row, BCCcol).Value = .Value2(row, BCCcol) & Chr(10) & CostCenter ' & Chr(10)
                        .Cells(row, DEPcol).Value = .Value2(row, DEPcol) & Chr(10) & rowDEP ' & Chr(10)
                        .Cells(row, EAFcol).Value = .Value2(row, EAFcol) & Chr(10) & rowEAF ' & Chr(10)
                        .Cells(row, Classcol).Value = .Value2(row, Classcol) & Chr(10) & rowClass ' & Chr(10)
                        .Cells(row, RevCodecol).Value = .Value2(row, RevCodecol) & Chr(10) & rowRevCode ' & Chr(10)
                    Next CostCenter
                End If
            Next i
        End If
    End If
    Next row
End With
If ReferenceStyle = xlR1C1 Then Application.ReferenceStyle = xlR1C1
Application.ScreenUpdating = True
MsgBox "Rev Codes updated. Test the import.", vbInformation + vbOKOnly
End Sub
```

multivariable calculus – Finding a point on the surface of $f(x, y, z) = 0$ where the tangent plane is perpendicular to a given line; what am I doing wrong?

I have to solve the following question; I believe my reasoning is correct, but I am getting the wrong answer so I’m not sure what’s happening.

Find a point on the surface $x^2 + y^2 + 4z^2 = 36$ where the tangent plane is perpendicular to the line with parametric equations
$$x = -4t -1, text{ } y = 2t+1 , text{ } z = 8t-3$$

My reasoning is as follows: define $f(x, y, z) = x^2 + y^2 + 4z^2$ and let $(a, b, c)$ be the desired point. We want the normal vector of the tangent plane at $(a, b, c)$ to be parallel to $langle -4, 2, 8 rangle$. But the normal vector of the tangent plane is given by the gradient, so

$$ langle 2a, 2b, 8c rangle = k langle -4, 2, 8 rangle $$

for some constant $k$. This gives the system
$$
begin{align*}
a & = -2k\
b & = k\
c & = k
end{align*}$$

Plugging in $(a, b, c)$ into $x^2 + y^2 + 4z^2 = 36$, we get that $k = pm sqrt 6$, so the the two desired points are $(-2 sqrt 6, sqrt 6, sqrt 6)$ and $(2 sqrt 6, -sqrt 6, -sqrt 6)$. However, these answers are incorrect; the correct ones are $(-4, 2, 2)$ and $(4, -2, -2).$ Can you please tell me what I am doing wrong?

linux – Cmd line tool to scan an eml file against spam/phishing rules

For a purpose of a security class I want to demonstrate a threat delivered via email. As a demo message I want to use an eml file that contains a banking-themed pdf attachment, requiring further actions from the user. I want to scan the eml file with a security tool indicating in particular how important it is to have these kind of checks, how output can be logged etc. I know there are plenty of commercial tools out there that provides this end-to-end email security however I want to get as granular as I can so students can visualize the problem better rather than understanding there is a black-box solution that does “the entire security”.

What would be a Linux tool that is capable of recognizing threats in eml files? Both from an email perspective (poor grammar, SPF checks, wording, calling to action – buliding spam scoring) as well as link/attachment perspective?

I was thinking about spamassassin however scanning a first random eml (that has a lot of hits on VirusTotal) gives me spam score of 1.3 while 5.0 is the default threshold. Is spamassassin still maintained? Is there any updated rules repository I can use?

command line – how to recursively list only hidden files from a terminal

I would like to do something like

ls -RA .?* >> LSRA.list

but with this command and some other variants I tried, I always get also all non-hidden files in the directory where I am.

Namely, if the directory contains files

.hiddenfile foo

with above command I get ther recursive list of both, while I would like to ave only the recursive list of files and directory starting with . (but not the . directory itself!)

I checked answers to this question but I did’t find the solution to my problem.

sharepoint online – How i can change the color of a single line of text if a People or Group column is empty or has a value

You can try the following JSON for (Breaks):

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "background-color": "=if(($Engineer)=='', 'Green', 'Red')",
    "color": "black",
    "font-size": "1.0em",
    "justify-content": "center"
  }
}

enter image description here

command line – Keyboard prevents mouse from selecting text in terminal [Kubuntu, Xubuntu]

since a few days I am having this really strange issue that when I have my mouse and keyboard plugged in, I cannot select text in a terminal using my mouse. The cursor becomes invisible as soon as I do not move it, and it flickers when I do. When I click and drag to select text, it continuously flickers, probably repeatedly “resetting” the text selection.

If I unplug my keyboard, it works fine.
If I plug the keyboard in again, it still works fine.
As soon as I press any key(s) on the keyboard, it reverts to the same problem.

Reproducible under Xubuntu and Kubuntu, both with installed systems and live systems.

Note: This only happens in the terminal. I can select text and icons fine in any other program. In Win10 (this is a dual boot), it also works without any issue.

I tested with a different mouse – same problem. Unfortunately, I don’t have a second keyboard to try, but I am not sure this will solve the issue. It’s strange that this only affects Linux terminals.

This is what it looks like: https://www.youtube.com/watch?v=8InE5CiR5jo

I’d appreciate any help! Thanks!