Pascal: change TProcess description? - process

Is there a way to change the process description (Shown in the Task Manager > Processes (Depends on OS) > Description)? If I create a TProcess, using
Process1:=TProcess.Create(NIL);
then the description will most likely be the same as the executable's name.

Related

How to strip the XHTML tags from the SQL query

I have this below query for Rapid 7 Nexpose SQL database and have been trying to remove xhtl,
SELECT
dp.policy_id, dp.title as policy_title, dpr.rule_id, dpr.title as policy_rule_title,
dp.benchmark_name, da.ip_address, da.host_name, dpr.description, dp.category,
fapr.date_tested, htmlToText(fapr.proof) as proof, fapr.compliance,
dpr.severity, htmlToText(dpr.rationale) as rationale, htmlToText(dpr.remediation) as remediation
FROM fact_asset_policy_rule fapr
JOIN dim_policy dp on dp.policy_id = fapr.policy_id
JOIN dim_policy_rule dpr on dpr.policy_id = fapr.policy_id and fapr.rule_id = dpr.rule_id
JOIN dim_asset da on da.asset_id = fapr.asset_id
WHERE fapr.compliance = false order by dp.title, dpr.title`
However it exports the below content for rationale and remediation with below xhtml tags which i would like to get rid off:
Rationale column example:
<xhtml:p xmlns="http://checklists.nist.gov/xccdf/1.2"
xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
xmlns:notes="http://benchmarks.cisecurity.org/notes"
xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Attack surface
reduction helps prevent actions and apps that are typically used by
exploit-seeking malware to infect machines.</xhtml:p>
I would only like to get the output with TEXT "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines" and remove rest of the data.
Remediation Example:
<xhtml:div xmlns="http://checklists.nist.gov/xccdf/1.2"
xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
xmlns:notes="http://benchmarks.cisecurity.org/notes"
xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xhtml:p>
<xhtml:p> To establish the recommended configuration via GP, set the
following UI path to <xhtml:span
class="inline_block">Enabled</xhtml:span> : </xhtml:p> <xhtml:code
class="code_block">Computer Configuration\Policies\Administrative
Templates\Windows Components\Windows Defender Antivirus\Windows Defender
Exploit Guard\Attack Surface Reduction\Configure Attack Surface
Reduction rules </xhtml:code> <xhtml:p> <xhtml:strong>Note:
</xhtml:strong> This Group Policy path may not exist by default. It is
provided by the Group Policy template <xhtml:span
class="inline_block">WindowsDefender.admx/adml</xhtml:span> that is
included with the Microsoft Windows 10 Release 1709 Administrative
Templates (or newer). </xhtml:p> <xhtml:p class="bold">Impact:</xhtml:p>
<xhtml:p> <xhtml:p>When a rule is triggered, a notification will be
displayed from the Action Center.</xhtml:p> </xhtml:p> </xhtml:p>
</xhtml:div>
Again need to output of remediation to be clean without XHTML and xmlns, so the clean text should look like something below:
To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\Policies\Administrative Templates\Windows Components\Windows Defender Antivirus\Windows Defender Exploit Guard\Attack Surface Reduction\Configure Attack Surface Reduction rules, This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer).
Impact: When a rule is triggered, a notification will be displayed from the Action Center.
Is there a way I can get clean HTML to text ? without the content that I don't need?
Is there a way I can get clean HTML to text?
If it is fully valid XHTML, you can cast it as XML and then select the value of the node that interests you using XPath.
declare #xhtml varchar(max)
set #xhtml = '<xhtml:div xmlns="http://checklists.nist.gov/xccdf/1.2" xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5" xmlns:cc6="http://cisecurity.org/20-cc/v6.1" xmlns:cc7="http://cisecurity.org/20-cc/v7.0" xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0" xmlns:notes="http://benchmarks.cisecurity.org/notes" xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xhtml:p> <xhtml:p>To establish the recommended configuration via GP, set the following UI path to <xhtml:span class="inline_block">Enabled</xhtml:span> : </xhtml:p> <xhtml:code class="code_block">Computer Configuration\Policies\Administrative Templates\Windows Components\Windows Defender Antivirus\Windows Defender Exploit Guard\Attack Surface Reduction\Configure Attack Surface Reduction rules </xhtml:code> <xhtml:p> <xhtml:strong>Note:</xhtml:strong> This Group Policy path may not exist by default. It is provided by the Group Policy template <xhtml:span class="inline_block">WindowsDefender.admx/adml</xhtml:span> that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer). </xhtml:p> <xhtml:p class="bold">Impact:</xhtml:p> <xhtml:p> <xhtml:p>When a rule is triggered, a notification will be displayed from the Action Center.</xhtml:p> </xhtml:p> </xhtml:p> </xhtml:div>'
;with xmlnamespaces('http://www.w3.org/1999/xhtml' as xhtml)
select (cast(#xhtml as xml)).value('(//xhtml:p)[1]', 'varchar(max)')
See http://sqlfiddle.com/#!18/9eecb/136834.
Use more specific XPath if you need. For more complex requirements than "value of a single node" you can switch to XQuery, too.

How to make the SSIS package status to failure when propagate was set to false for a Sequence container

I have an SSIS package with for each loop > sequence container. The sequence container is trying to read file from For each loop and process its data. The requirement was to not fail the entire package when any exception happened in processing a file but to continue processing the next file until all the files were processed from the for each loop. For this, I have set the Propagate variable for the sequence container to False. I have also added email step on On Error event of Sequence container. The package is running as expected and able to process all files even when any exception happened with any file. But I would like the status of my SSIS package to be failed finally since one of the files got failed. How can I achieve that ?
Did you try this options?
(SSIS version in russian on the left side but it's sequence container)
View -> Properties window -> Then click on your sequence container and it will show you ther properties of sequence container.
If i were you first of all i would try property "FailPackageOnFailture" - it should cover your question if i get it right.
P.S. Also you can see the whole properties of your project when you click on a free place in your project
UPDATED (after comments and more clear understanding task):
The idea is - set this param Maximum ErrorCount for SQ as max as you want - in this case it wont stop the package because 1 of the files was failed in SQ and next file will process, but it should stop package after SQ will finish his work because you don't change MaximumErrorCount for package.
Important - a value of zero sets the error count threshold to infinity and package or task never get's Failure

how to run multiple coordinators in oozie bundle

I'm fresher in oozie bundle. I want to run multiple coordinators one after another in bundle job.My requirement is after completion of one coordinator job _SUCCESS file will be generated, then by using that _SUCCESS file second coordinator should be triggered. I don't know how to do that.For that i used data dependency technique which will keep track for generated output files of previous coordinator. I'm sharing some code which i tried.
Lets say there are 2 coordinator jobs:A and B.and i want to trigger only A coordinator.and if _SUCCESS file for Coordinator A generated then only Coordinator B should get start.
A - coordinator.xml
<workflow>
<app-path>${aDir}/aWorkflow</app-path>
</workflow>
this will call respective workflow.and _SUCCESS file is generated at ${aDir}/aWorkflow/final_data/${date}/aDim location so i included this location in
B coordinator:
<dataset name="input1" frequency="${freq}" initial-instance="${START_TIME1}" timezone="UTC">
<uri-template>${aDir}/aWorkflow/final_data/${date}/aDim</uri-template>
</dataset>
<done-flag>_SUCCESS</done-flag>
<data-in name="coordInput1" dataset="input1">
<instance>${START_TIME1}</instance>
</data-in>
<workflow>
<app-path>${bDir}/bWorkflow</app-path>
</workflow>
but when i run it first coordinator gets KILLED itself, but if i run individually they are running successfully.i'm not getting why these are all getting KILLED.
help to sort out
I find out easy way to do that. I'm sharing solution.For coordinator B coordinator.xml I'm sharing.
1)For Data-set instance should be start time of second one but it should not be time instance of first coordinator.otherwise that particular coordinator will get KILLED.
2)If you want to run multiple coordinators one after another then you can also include controls in coordinator.xml. e.g. concurrency, timeout or throttle. Detailed information about these controls you can find out in "apache oozie" book's 6th chapter.
3)in "" i included latest(0) it will take latest generated folder in mentioned output path.
4)for "input-events" it is mandatory to include it's name as a input to ${coord:dataIn('coordInput1')}.otherwise oozie will not consider dataset.
30
1
${aimDir}/aDimWorkflow/final_data/${date}/aDim
_SUCCESS
${coord:latest(0)}
${bDir}/bWorkflow
input_files
${coord:dataIn('coordInput1')}

How to get process scheduler history in Solaris?

I would like to know if there is way to get the process sheduler history in Solaris operating system. The output may have the following details.
user : user name who invoked the process
name : name of the process / command used to invoke the process
loc : location or path of the binary
pid : process id
event: event happened to the process (init, suspend or end)
time : time the event happend
date : date the event happeed
I'm interested to hear if any such thing available for other OS as well.
You might implement that with a dtrace script leveraging the proc provider (proc:::exec-success, proc:::exit and proc:::signal_handle).
Your event list looks dubious, should probably be at least "start,suspend,resume and exit"
You want the audit feature of Solaris. man audit and associated utilities, auditconfig etc

Program empty in System Status information for transaction SNOTE

How can I view the source code for the transaction SNOTE? I use the system dialog (System -> Status -> Program name) but the "program" field is empty.
You can find the program associated with any transaction using the transaction se93. This will give you the program and, if needed, the selection-screen variant used.
You can then use the transactions se38 or se80. The later will give you at the same time the source code, classes and dynpro associated with the program.
open the program SCWN_ENTRY_TREE in SE38