How to list all processes holding a specific port on Linux and windows via command line
Let’s find all processes pid using port 80 on linux and windows:
How to check how many CPU cores I have in Windows & Linux?
Open a command prompt (Windows) or Terminal (Linux) and type:
Windows: WMIC CPU Get /Format:List
Linux: cat /proc/cpuinfo | grep processor | wc -l
For more details on Linux: ls /sys/devices/system/cpu/
Powershell script to un-archive a folder silently in Windows
Let’s continue with our automation scripting tool series. Doing things on windows by using the mouse manually is fun until you run into the need to go to a major OS upgrade and have tons of applications to reinstall. To avoid human errors and save lots of time, you can write a script to pick up your archived applications like tomcat zip files and unarchive it. This powershell scripts shows you how to unarchive a zip file silently.
#Unzip FIle Function
function Expand-ZIPFile($file, $destination)
$shell = new-object -com shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
# Call the function to unzip
Expand-ZIPFile –File $Origin_Zip_File –Destination $Destination_Folder
VB script to Stop Application Pools on Windows IIS 6
As SysAdmin, We sometimes need to auto-stop some application pools in order to run a specific task like IIS logs cleanup.
This script will detect all application pools that are running and stop them.
myComputer = “.”
Set objWMIService = GetObject (“winmgmts:\\” & myComputer & “\root\microsoftiisv2”)
Set colItems = objWMIService.ExecQuery (“Select name from IISApplicationPoolSetting where AppPoolState = 2”)
For Each objItems In colItems
set PoolcolItems = objWMIService.ExecQuery (“Select name from IISApplicationPool where name='” & poolname & “‘”)
For Each objItem In PoolcolItems
Enter that script in a text file, save it with extension “.vbs”. Copy it at C:\Windows\System32\
Run it manually or via a batch scheduler.
Thanks to Euk-marie. See the equivalent script by Euk-Marie to start the App Pool at https://www.eukhost.com/forums/f15/start-application-pool-simple-script-8937/