command-line

Remote Desktop / RDP credentials check from command line (no GUI)

北城余情 提交于 2021-01-24 11:32:05
问题 We're currently writing a tool aimed at checking the validity of credentials over various applications (http, ssh, smb, rdp). No problem for the 3 former. But for RDP, I couldn't find a single way of doing this easily. The tool is embedded within a web app hosted on a linux box, therefore there is no X Server available. The only tool I have successfully used to validate RDP credentials from the command line is THC-Hydra, by supplying a single username and password, it works correctly for

Gradle build - add module path

一笑奈何 提交于 2021-01-18 19:49:25
问题 My question: How do I set a module path for gradle build ? I've become comfortable working with Java modules from the command line. I do a frequent exercise in Powershell which results in these source files. └───src ├───appMod │ │ module-info.java │ │ │ └───appPack │ Entry.java │ └───greetMod │ module-info.java │ └───greetPack Hello.java appMod/module-info module appMod { requires greetMod; } appMod/appPack.Entry package appPack; import greetPack.Hello; public class Entry { public static void

Call Ghostscript in Windows by its invocation name?

筅森魡賤 提交于 2021-01-18 05:39:30
问题 What should I do to be able to call Ghostscript in Windows by its invocation name? I added Ghostscript bin folder to Windows PATH and Path variables but it doesn't work, neither does 'gswin32c.exe' nor 'gswin32c'. Logging out and then logging back in also didn't help. How do I solve this issue? Maybe I'm using the wrong invocation name? 回答1: There are several possibilities. To list the two most frequent ones: c:\full\path\to\gswin32c.exe should always work. For 64bit systems, use c:\full\path

Call Ghostscript in Windows by its invocation name?

家住魔仙堡 提交于 2021-01-18 05:38:25
问题 What should I do to be able to call Ghostscript in Windows by its invocation name? I added Ghostscript bin folder to Windows PATH and Path variables but it doesn't work, neither does 'gswin32c.exe' nor 'gswin32c'. Logging out and then logging back in also didn't help. How do I solve this issue? Maybe I'm using the wrong invocation name? 回答1: There are several possibilities. To list the two most frequent ones: c:\full\path\to\gswin32c.exe should always work. For 64bit systems, use c:\full\path

pip install osmnx giving error code 1

牧云@^-^@ 提交于 2021-01-07 04:58:24
问题 I am trying to install osmnx using the command python -m pip install osmnx but it gives the following error: 'Command "python setup.py egg_info" failed with error code 1 in C:\Users\myname\AppData\Local\Temp\pip-install-o3ha6gld\Shapely\' 回答1: For some reason you need to download the wheel for that specific module and install separately: Install Shapely: OSError: [WinError 126] The specified module could not be found Then OSMnx will continue to install normally 回答2: Installation You can

What does the -m option stand for in python?

百般思念 提交于 2021-01-05 12:29:14
问题 When creating a virtual environment, I run: python3 -m venv env I understand that -m executes a module ( venv in this case). However, what does the -m flag actually stand for? Is it -m for module , or -m for __main__ ? I couldn't find an unambiguous explanation. Here are some resources I investigated: https://docs.python.org/2/using/cmdline.html#cmdoption-m https://www.python.org/dev/peps/pep-0547/ Execution of Python code with -m option or not 回答1: in section 1.1.1 It clearly says -m is the

What does the -m option stand for in python?

大城市里の小女人 提交于 2021-01-05 12:29:09
问题 When creating a virtual environment, I run: python3 -m venv env I understand that -m executes a module ( venv in this case). However, what does the -m flag actually stand for? Is it -m for module , or -m for __main__ ? I couldn't find an unambiguous explanation. Here are some resources I investigated: https://docs.python.org/2/using/cmdline.html#cmdoption-m https://www.python.org/dev/peps/pep-0547/ Execution of Python code with -m option or not 回答1: in section 1.1.1 It clearly says -m is the

Argparse tutorial example doesn't work in windows command line

随声附和 提交于 2021-01-05 08:58:20
问题 So I'm trying to teach myself how to use the python library argparse via the tutorial here. The example is given by the following piece of code which is saved as tut.py . import argparse parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') parser.add_argument('--sum', dest='accumulate', action='store_const', const=sum, default=max, help='sum the integers (default: find

Right usage of 2>&1 | tee or | tee with powershell

て烟熏妆下的殇ゞ 提交于 2021-01-04 07:43:51
问题 I want to see the output of the command in the console and save it in a file so I have these two options: When I use command | tee output.txt somehow it generates no output file at all but it works as usual in the console. When I use command 2>&1 | tee output.txt it generates a fine output file but the text in the console appears in red. Is there any way to either fix the first option or let the text appear as usual in the second one? I am using Windows PowerShell (Windows 10) and the

Python Subprocess: Command Fails in Python but Works in Shell

心已入冬 提交于 2021-01-04 05:59:51
问题 I am trying to run a command through Python's subprocess, but it won't run properly. If I type into the shell: pack < packfile.dat where pack is my software and packfile is the input file, then the software runs fine. If I try this in python: import subprocess as sp import shlex cmd = 'pack < packfile.dat'.split() p = sp.Popen(cmd) The software complains: Pack must be run with: pack < inputfile.inp Reading input file... (Control-C aborts) and it hangs there. This last part is specific to my