wmic temperature - wmic

How can I get temperature (for example CPU) of my 32bit windows 7 PC? (by using WMIC)
my results:
wmic temperature
No Instance(s) Available.
I run this command even with admin privileges, but the result was the same.

You can just try :
wmic /namespace:\\root\WMI path MSAcpi_ThermalZoneTemperature

Related

Boot QEMU KVM with libvirt/sVirt but without using virt-install tool in command line

Can anyone help me on how to boot QEMU KVM with libvirt/sVirt but without using virt-install tool in command line.
or using virsh tool
In order to use virt-install, you need to install the following:
yum install qemu-kvm qemu-img libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils tigervnc-server
Then, you can start the daemon:
systemctl start libvirtd
Now, download the OS you want to install, and then copy it to the folder shown below:
cp CentOS-7-x86_64-Everything-1708.iso /var/lib/libvirt/images/
Finally, run virt-install. Here is an example of what the script should look like:
os="--os-type=linux --os-
variant=centos7.0"
location="--location=/var/lib/libvirt/images/CentOS-7-x86_64-Everything-1708.iso"
cpu="--vcpus 2"
ram="--ram 2048"
name="centos7"
disk="--disk /dev/mapper/centos_192- root,size=40"
type="--virt-type qemu"
network="--network network=default"
graphics="--graphics none"
virt-install $os $network $disk $location $cpu $ram $type $disk $graphics --name=$name
After running virt-install, verify that the VM is running using virsh:
virsh list
Id Name State
----------------------------------------------------
4 centos7 running
Virt-install command-line options
Below are some command-line options, but this isn't an extensive list, so I encourage you to do some research in order to fully take advantage of this tool.
os="--os-type=linux --os-variant=centos7.0" --
Some of these commands have main options, as well as sub options. For example, if you type os-type=linux, then you need to further specify --os-variant=centos7.0. You can get a list of OSes that virt-install supports by typing osinfo-query os.
location="--location=/var/lib/libvirt/images/CentOS-7-x86_64-Everything-1708.iso"
This is where you've copied the ISO image file containing the OS you want to install.
cpu="--vcpus 2"
The CPU command-line option enables you to specify the number of vCPUs assigned to the VM. In this example, I'm assigning two vCPUs.
ram="--ram 2048"
The RAM command-line option enables you to specify the amount of memory assigned to the VM. In this example, I'm assigning 2,048 MBs -- or 2 GBs.
name="centos7"
The name command-line option enables you to assign a name to the VM. In this example, I'm naming the VM centos7.
disk="--disk /dev/mapper/centos_192-root,size=40"
This is where the VM will be installed and the size, in gigabytes, to be allocated. This must be a disk partition and not a mount point. Type df -h to list disk partitions.
type="--virt-type qemu"
The type command-line enables you to choose the type of VM you want to install. You can use KVM, QEMU, Xen or KQEMU. Type virsh capabilities to list all of the options. In this example, I'm using QEMU.
network="--network network=default"
Use network=default to set up bridge networking using the default bridge device. This is the easiest method, but there are other options.
graphics="--graphics none"
The graphics command-line option specifies that no graphical VNC or SPICE interface should be created. Use this for a kickstart installation or if you want to use a ttyS0 serial connection.

How to set JVM XMX parameter for SQL Workbench? (increase available memory)

I'm running Sql Workbench/J and keep running out of memory on a heavy query. (on MAC osx)
I just need to fetch this data once in a blue moon and would like to increase the available memory.
The exact error I get is:
I found a solution when running from terminal which is to use the command below, but I would like to have one from the Sql Workbench application itself:
java -Xmx4g -jar sqlworkbench.jar
Disclaimer: I am not a Mac user.
The memory setting that is used for the MacOS launcher is stored in the file Info.plist which should be inside the sub-folder Contents of the SQL Workbench/J "app" folder (not sure how this is called).
There is already an entry with -Xmx2048m present that you can change.

Change bash.exe with multiple linux subsystems on windows

I first installed a Ubuntu linux subsystem with the windows store.
I then installed the hyper terminal for windows like explained in this tutorial : https://medium.com/#ssharizal/hyper-js-oh-my-zsh-as-ubuntu-on-windows-wsl-terminal-8bf577cdbd97
Like it is written in the tutorial I put C:\\Windows\\System32\\bash.exe in the hyper configuration file.
However, afterwards, I installed another linux subsystem, Wlinux.
So now I have two subsytems located here
Wlinux : C:\Users\martinpc\AppData\Local\Packages\WhitewaterFoundryLtd.Co....
Ubuntu : C:\Users\martinpc\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_7...
However, when I open the hyper terminal, It seem like I can only access the files of the ubuntu distrib and not the Wlinux. Therefore, I would like to know how I can point Hyper to Wlinux and not Ubuntu anymore. Thank you for your answer.
First of all, bash.exe has been deprecated. You should use wsl.exe in command lines. Check your installed distributions in WSL with wslconfig.exe /list /all command. Alternatively, for Windows 10 version 1903 and above, wsl.exe --list --all command can be used. Choose the distribution that you want to connect with HyperJS Terminal emulator. Open up Hyper.js configuration with Ctrl + , or open %UserProfile%\.hyper.js in any text editor. Edit the shell configuration from these two named values:
shell: 'C:\\Windows\\System32\\wsl.exe',
shellArgs: ['--distribution', 'Your-Distro-Name'],
Alternatively, you can use wslconfig.exe /setdefault <DistributionName> command to change default distribution. With this step, you can skip the shellArgs line in .hyper.js configuration file.

Vmware web development kit

I am using Virtual Disk Management Kit v5.0 link.
The command i am using is
C:\Program Files\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount I:
C:\Users\Rushil\Documents\Virtual Machines\Ubuntu\Ubuntu-s001.vmdk
Unfortunately the above command does nothing except that every time i run it a (sort of) vmware-mount man page is displayed on the command prompt telling about other command options. Any solutions ???
You have a space in your path to the vmdk and surely need to quote it:
vmware-mount I: "C:\Users\Rushil\Documents\Virtual Machines\Ubuntu\Ubuntu-s001.vmdk"

Get the current working directory of process with a pid programmatically on OS X

Is there a way to get the current working directory of a process using it's PID programmatically on OS X?
Cocoa, Carbon, or AppleScript are all acceptable.
It is not acceptable to send "pwd" to the current terminal window/tab (Do not want to affect the workspace).
The linux command "pwdx" also is also unacceptable (just in case you read over the "Cocoa" part)
On 10.5 and later:
lsof -a -p $PID -d cwd -Fn
(Prefix with sudo if the process is owned by root.)
The following AppleScript is a partial solution for your problem. Given the UNIX pid in the variable thePID it first gets the name of the process. It then sends the do shell script command to the application process which will result in a child shell process being spawned. The child process inherits the current directory which can then be determined by running the pwd command.
tell application "System Events"
set theName to name of first process whose unix id is thePID
end tell
tell application theName
do shell script "/bin/pwd"
end tell
The script does not work for processes that do not link to the AppleEvent framework (e.g., pure POSIX processes).