windows

Windows docker: permission denied /var/run/docker.sock

你离开我真会死。 提交于 2021-02-18 11:30:10
问题 When I try to run filebeat with autodiscover I get the following error: Exiting: error in autodiscover provider settings: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.22/containers/json?limit=0: dial unix /var/run/docker.sock: connect: permission denied I exposed the daemon on tcp://localhost:2375 from docker settings. I checked that my user is member of "docker-users" group. docker-compose

How to detect when subprocess asks for input in Windows

南笙酒味 提交于 2021-02-18 10:35:28
问题 I have a subprocess that either quits with a returncode, or asks something and waits for user input. I would like to detect when the process asks the question and quit immediately. The fact that the process asks the question or not is enough for me to decide the state of the system. The problem is that I cannot read the question because the child process probably does not flush standard output. So I cannot rely on parsing subprocess.Popen().stdout : when trying to read it, well, it blocks

MinGW g++ doesn't find headers in its own include directory

十年热恋 提交于 2021-02-18 10:34:22
问题 So I recently installed MinGW via the latest version of nuwen's MinGW distribution that includes the boost C++ libraries. Specifically, I was after the scoped_ptr that the boost library provides. However, when I try to include the scoped_ptr ( #include <boost/scoped_ptr.hpp> ) in my header, the compiler throws error: boost/scoped_ptr.hpp: No such file or directory Makefile: compile: g++ -o gen/cavestory src/**.cc run: gen/cavestory Also, I added a back version of SDL to MinGW's include

Python 3.4 multiprocessing Queue faster than Pipe, unexpected

冷暖自知 提交于 2021-02-18 08:56:50
问题 I am doing an audio player that received samples from an udp socket, and everything was working fine. But when I implemented an Lost Concealment algorithm, the player failed to keep producing silence at the excepted rate (each 10ms send a list of multiple 160 bytes). When playing audio with pyaudio, using the blocking call write to play some samples, I noticed it blocked on average for duration of the sample. So I created a new dedicated process to play the samples. The main process processes

Windows - Wait on event and socket simulatenously

烂漫一生 提交于 2021-02-18 07:47:59
问题 I'm writing Win32-API C code that needs to wait for new TCP connections and on the other side can be closed at any time by any other process/thread. Therefore, I need to somehow WaitForSingleObject on the stop event and wait for connections using WSAAccept simultaneously. I tried WaitForMultipleObjects on both socket and handle but new connection won't trigger the function (also WaitForSingleObject on the socket won't be triggered on a new connection). Any idea? 回答1: You need to use

Powershell: What's the difference between Alias and Function?

岁酱吖の 提交于 2021-02-18 07:04:30
问题 Im setting up my powershell profile to create aliases of commonly used commands. On Microsoft's documentation it says, if I want to make an alias for a command with parameters, I should make the value of the alias a Function that does that.. However, when I type the name of the function in the command line it works just as well as an alias. In other words, in the above picture, if I typed CD32 it would behave the same as if I typed Go in the command line So my question is: Why do I use

Why is setx path not working?

戏子无情 提交于 2021-02-18 06:27:32
问题 Can someone explain this result? After setting path, it did not change. This was run in an Administrator command-line: C:\Windows\system32>setx path "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin" SUCCESS: Specified value was saved. C:\Windows\system32>path PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:

win32gui get the current active application name

我的梦境 提交于 2021-02-18 06:01:29
问题 I am just learning python and I am relativity new to it. I created the following script that will get the current active windows title and print it to the window. import win32gui windowTile = ""; while ( True ) : newWindowTile = win32gui.GetWindowText (win32gui.GetForegroundWindow()); if( newWindowTile != windowTile ) : windowTile = newWindowTile ; print( windowTile ); The above code snippet works. I am now trying to get the application name for the active window ( Foreground Window ) My

Why is time.sleep() accuracy influenced by Chrome?

蹲街弑〆低调 提交于 2021-02-18 03:48:32
问题 I've noticed some strange behaviour that may or may not be specific to my system. (lenovo t430 running windows 8) With this script: import time now = time.time() while True: then = now now = time.time() dif = now - then print(dif) time.sleep(0.01) I get the following output (what I would consider nominal) with a browser open. However without a browser open I observe a severe per loop latency. Obviously this is counter-intuitive as I think anyone would expect better performance when you have

How can I compare against FileSystemRights using Powershell?

♀尐吖头ヾ 提交于 2021-02-18 03:22:30
问题 I want to check whether a given user has access to a given folder - by checking if they have "Modify" access assigned to them. I thought that the PS for that would be: (Get-Acl .\myfolder).Access | ?{$_.IdentityReference -eq "BUILTIN\Users"} |?{$_.filesystemrights.value -contains "Modify"} But the final part of that isn't working - I get back no result. But I know that they have Modify access - if I put in: (Get-Acl .\myfolder).Access | ?{$_.IdentityReference -eq "BUILTIN\Users"} | select