Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
i'm using this commands for disable mikrotik interface:
user#host:~$ snmpget -v 2c -c public 192.168.0.10 1.3.6.1.2.1.2.2.1.7.3
iso.3.6.1.2.1.2.2.1.7.3 = INTEGER: 1
user#host:~$ snmpset -v 2c -c public 192.168.0.10 1.3.6.1.2.1.2.2.1.7.3 i 2
iso.3.6.1.2.1.2.2.1.7.3 = INTEGER: 2
user#host:~$ snmpget -v 2c -c public 192.168.0.10 1.3.6.1.2.1.2.2.1.7.3
iso.3.6.1.2.1.2.2.1.7.3 = INTEGER: 1
snmp have write-access,
where is problem?
Instead of 'public' you need to use the write community string of the target system. It's like a password, else anyone could change system parameters.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
Program :
package main
import (
"fmt"
)
func main() {
ch := make(chan int)
fmt.Println(ch)
fmt.Println(0xc000062060)
}
Output :
0xc00009e000
824634122336
What does that output (824634122336) mean?
I think (0xc00009e000) is a starting address of an channel.
If (0xc00009e000 is address of channel)
Then please tell me what is this (824634122336)
else
Then please tell what are those outputs.
0xc00009e000 is a hexadecimal value of 824634122336. So 824634122336 not a value in the channel.
fmt.Println(0x10) //Output: 16
In software calculations, "0x" prefix adding to represent the hexadecimal numbers.
Refer this why-are-hexadecimal-numbers-prefixed-with-0x
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Yes, I realize I can just look at the green-light when the video camera is on. That's not the point.
I'd like to write a little utility that notices when the mic or video camera is in use. I don't have any interest in knowing what app is using it. I just want to know if the mic / camera on or off.
This is for me as a parent. I was thinking I could get one of those color changing LED lights, and then when the camera/mic is on, my app could detect it, then send a signal to the light to change color. Then when one of my kids walks in, they'd see the light is "red" (meaning, do not disturb) and they'd know I'm on a conference call.
I have pretty much the exact same problem to solve. This is my prototype solution. It monitors the number of threads of the AppleCamera process. On the test macbook, the base number of threads seems to be 3. When an application uses the camera, the count increases to 4. I plan to implement microphone checking as well. I'm sure my code could be more compact and I could get the shell commands down to a one-liner but I prefer readability.
import subprocess
import pywemo
DEVICE_NAME = "BatSignal"
def count_camera_threads():
command = ["pgrep", "AppleCamera"]
process = subprocess.run(command, capture_output=True, text=True)
pid = process.stdout.replace("\n", "")
command = ["ps", "M", pid]
process = subprocess.run(command, capture_output=True, text=True)
lines = process.stdout
count = len(lines.splitlines()) - 2
return count
def get_device(name):
devices = pywemo.discover_devices()
for device in devices:
if device.name == name:
return device
return None
if __name__ == "__main__":
device = get_device(DEVICE_NAME)
if device is None:
exit(f"Unable to find '{DEVICE_NAME}' on network")
while True:
if count_camera_threads() > 3:
device.on()
else:
device.off()
time.sleep(1)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I want to write a procedure that creates a beep sound on Windows, using assembly language.
How can I do that? Do you have any starting point idea?
In MS-DOS, which is what many assembly novices are targeting without even knowing it, outputting character ASCII 7 (BEL) via interrupt 21h, function AH=2 will do it:
mov ah, 2
mov dl, 7
int 21h
In Windows, call the MessageBeep() API function, passing 0xffffffff as the parameter. The function resides in User[32].dll; depending on your assembler, the sequence for importing an API function might vary.
If by "Windows" you mean "DOS executable running under Windows", which some people occasionally do, then back to int21h.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I would like to generate a stack trace report like one generated by kernel oops.
------------[ cut here ]------------
kernel BUG at /home/administrator/project/systech/bsp_tan/linux-.2.6/arch/arm/include/asm/dma-mapping.h:325!
Internal error: Oops - undefined instruction: 0 [#1] PREEMPT
Modules linked in:
CPU: 0 Not tainted (3.2.6 #67)
PC is at my_func+0x118/0x230
LR is at vprintk+0x3bc/0x440
Where it's defined and how I can trigger it with in my module.
EDIT 1
How to find the line number where the PC (program counter) was when this bug happened.
PC is at my_func + 0x118/0x230
What this means?
Thanks in advance.
this is in the following files:
lib/bug.c
kernel/panic.c
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Is there any command or possible way to know the cpu utilization in windows operating system for use on the command line or in a batch script?
To determine the usage in general, you can use mcstellar and warren's answer. You also have the option of:
List all processes:
typeperf "\Process(*)\% Processor Time" -sc 1
List all processes, take 5 samples at 10 second intervals:
typeperf "\Process(*)\% Processor Time" -si 10 -sc 5
If you want a specific process, Rtvscan for example:
typeperf "\Process(Rtvscan)\% Processor Time" -si 10 -sc 5
I found it extremely useful to just monitor all process activity over a period of time. I could then dump it to a csv file and filter in a spreadsheet to remotely diagnose issues.
The following gives me 5 minutes (at 10 second intervals) of all processes. The data includes not just % Processor Time, but IO, memory, paging, etc.
typeperf -qx "\Process" > config.txt
typeperf -cf config.txt -o perf.csv -f CSV -y -si 10 -sc 60
To monitor at 1 second intervals use:
typeperf "\processor(_total)\% processor time"
For only the current usage, use:
typeperf -sc 1 "\processor(_total)\% processor time"
here's a little vbscript that shows cpu utilization for each process
strComputer ="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_PerfProc_Process",,48)
For Each obj in colProcess
If obj.Name <> "Idle" And obj.Name <> "_Total" Then
WScript.echo obj.Name & "," & obj.PercentProcessorTime
End If
Next
save as showcpu.vbs and run it on the command line as
c:\test> cscript //nologo showcpu.vbs
From the command line? Have a look at PsList in the PsTools suite.