Skip to content

Instantly share code, notes, and snippets.

@rahuldottech
Created July 30, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuldottech/f8537e887fd9aa3a326e336d0d3261b3 to your computer and use it in GitHub Desktop.
Save rahuldottech/f8537e887fd9aa3a326e336d0d3261b3 to your computer and use it in GitHub Desktop.
Handy scripts to use when SSH-ing into servers for
@echo off
for /f "skip=1 tokens=2 delims==" %%A in ('wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature /value') do set /a "HunDegCel=(%%~A*10)-27315"
echo %HunDegCel:~0,-2%.%HunDegCel:~-2% Degree Celsius
@echo off
wmic OS get FreePhysicalMemory /Value | findstr FreePhysicalMemory > freemem
set /p a=<freemem
set %a%
set /a FreePhysicalMemory=%FreePhysicalMemory%/1000
echo %FreePhysicalMemory% MB
del freemem
shutdown -r -t 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment