Long term WorkFromHome – tips

Ideally, anything that you wouldn’t deal with at work should be taken care of outside of your working hours.

Power backup and Internet backup

Office table/chair – monitors, wireless mice/keyboard
Good posture while sitting

Water + small ready to eat snacks by the side

Work in chunks, 2-3 hour blocks to do the important work and the chores.

Patching Windows Server 2016

There is no security monthly quality rollups for Windows server 2016, like we used to have for earlier windows OS versions (before win 2012).

You need to install SSU followed by CU for each month.

The servicing stack is the set of components that update the operating system. (Patcher)

The servicing stack update (SSU) patches the patcher.

Cumulative Updates (CUs) do the fixing or securing the operating system itself.

Microsoft strongly recommends you install the latest servicing stack update (SSU) for your operating system before installing the latest cumulative update (LCU)

Example:

Sept-2019 patches for Windows server 2016 for X86 systems

SSU

KB4512574

CU

KB4516044

Link to download SSUs and CUs : https://www.catalog.update.microsoft.com

Search terms:

windows server 2016 servicing stack

windows server 2016 cumulative update

reference:

Servicing Stack Updates: What Is This Madness?

Patching Windows Server 2016

Save windows command output to a file using python

Step 1: Save below script in C:\ (or any other location)

$ cat  save_ipconfig.py
import os,datetime

log_folder = r'C:\IP-log'

#create log directory if it doesn't  exist
if not os.path.exists(log_folder):
    os.makedirs(log_folder)

#output file is created everytime this script is run in "C:\IP-log" directory location
out_file = ( log_folder + "\\" + os.environ['COMPUTERNAME'] + "-" + datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S'))
#print(out_file)

command = "ipconfig /all " + "> " + out_file
#print(command)

os.system(command)

Step 2: Schedule a task to run every 5 minutes

-Following command should be run on the windows command line
-Select any duration for the task updating schtasks /SC arguments accordigly
-use correct python.exe and save_ipconfig.py locations

/RU "SYSTEM" option is for running the task in background, this way you don’t have to see a command line window appear briefly every time task runs

schtasks /Create /SC MINUTE /MO 5 /RU "SYSTEM" /TN PythonTask_SaveIP /TR "'C:\Program Files\Python37\python.exe' C:\save_ipconfig.py"

Step 3: check if the task created correctly and running as expected

schtasks.exe /query /TN PythonTask_SaveIP

-monitor C:\IP-log directory, it should get created and a new file with ipconfig output should get created every 5 minutes

enable/disable hyper threading (HT) on rhel 6 HP servers

enable/disable hyper threading (HT) on rhel 6 HP servers

check hyper threading :
lscpu |head -8|tail -5
host1:root# lscpu |head -8|tail -5
CPU(s):                32
On-line CPU(s) list:   0-31
Thread(s) per core:    2     <–
Core(s) per socket:    8
Socket(s):             2

host1:root# hpasmcli
hpasmcli>
hpasmcli>  show HT
Processor hyper-threading is currently enabled.

hpasmcli> DISABLE HT
Successfully disabled processor hyper-threading.

hpasmcli> show HT
Processor hyper-threading is currently disabled.

Note: this requires reboot to take effect

Following rpm includes hpasmcli command
hp-health-10.20-1723.28.rhel6.x86_64.rpm for

disable hyperthreading (HT) via DELL idrac CLI using racadm

–>disable hyperthreading (HT) via DELL idrac CLI using racadm
->Tested on Dell R730xd

->check Hyperthreading
#racadm get BIOS.ProcSettings.LogicalProc

->disable Hyperthreading
#racadm set BIOS.ProcSettings.LogicalProc Disabled
[Key=BIOS.Setup.1-1#ProcSettings]
RAC1017: Successfully modified the object value and the change is in
pending state.
To apply modified value, create a configuration job and reboot
the system. To create the commit and reboot jobs, use “jobqueue”
command. For more information about the “jobqueue” command, see RACADM
help.

#racadm get BIOS.ProcSettings.LogicalProc
[Key=BIOS.Setup.1-1#ProcSettings]
LogicalProc=Enabled (Pending Value=Disabled)

->commit the changes and reboot, withbelow command
#racadm jobqueue create BIOS.Setup.1-1 -r pwrcycle -s TIME_NOW -e TIME_NA
RAC1024: Successfully scheduled a job.
Verify the job status using “racadm jobqueue view -i JID_xxxxx” command.
Commit JID = JID_013472598840
Reboot JID = RID_013472599617

#racadm get BIOS.ProcSettings.LogicalProc
[Key=BIOS.Setup.1-1#ProcSettings]
LogicalProc=Disabled
/admin1->