w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Issue while creating maven project using command line behind proxy
It is a network issue. Currently your firewall is blocking maven repo http://repo.maven.apache.org/ I guess you need to update update proxy URL, username and password in setting.xml Also exception is showing Authentication Required so I am assuming that proxy credentials are not configured

Categories : Maven

JLabel wont change when i run from command line
Add the following lines of code System.out.println( "displayOil :" + displayOil ); just after you create each variable. You'll know if your code gets until there. If the message is not output to the console, then an exception is interrupting your code. Otherwise, your method has a throws Exception declaration. this is not good code practice since we don't know anything from what exceptions the method can throw (therefore, where it could have issues). You should rather be more specific in your exception declaration: eg. throws JDBCException, BusinessException that way, you know what to expect from it. Also, never do a catch(Exception ex) {} you can loose hours and days of debugging because of this line (depending on the size of your project). If you really don't know what

Categories : Java

Change a command line argument argv
Did you try debugging? If you do, you will see that it never attempts to erase anything. You can't compare strings (char*) with simple equality, because in reality you're comparing pointers, which will (almost) never be equal. Instead, you should use string comparison functions, like this: if (!strcmp(argv[i], "--item")) { Also, since you're overwriting the argument, you don't need to use a lot of spaces, you can simply set it to an empty string (argv[i] = ""), or modify the existing string to make it empty (argv[i][0] = 0). Alternatively, you could shift the rest of the arguments so you don't end up with gaps which could confuse the rest of your code.

Categories : C++

Change Google Chrome Homepage - Command Line
It's possible to do it on IE and Firefox (with some inline Java manipulation within the batch) but so far I've also not been able to find an answer to this question. There's really nothing to try when the info on how to do it doesn't exist. The closest I've gotten is(run this in the Chrome.exe directory): chrome.exe -homepage "cnn.com" Which spawns chrome and the page cnn.com. But it doesn't actually change the homepage. So the next time you start up Chrome, it's back to whatever your home page was originally set to.

Categories : Google Chrome

How can I use python command line arguments that change at run time?
The whole configuration is done at runtime. The examples use string constants for the names, but you are not bound to that. You first load the configuration, then when you have all the elements, simply loop over those and register them as arguments: parser = argparse.ArgumentParser(....) for element in configuration_elements: parser.add_argument('--' + element, type=float, ...) then parse your command line. Alternatively, argparse.ArgumentParser() as a partial parsing mode as well; simply call parser.parse_known_args() to parse everything that argparse does know about, it'll return a namespace object (all the options it could parse) and the remaining arguments it didn't know how to handle: >>> parser = argparse.ArgumentParser() >>> parser.add_argument('--foo')

Categories : Python

Change 'play dist' output file name via command-line
You can modify the output by changing the build.sbt file in your project directory. name := "myname" version := "1.0-SNAPSHOT" Remember to recompile, might have to clean too.

Categories : Scala

System() / windows Command line commands don't change the directory?
Assuming that the C# tag is accurate, this is not the correct way to do that. Look at the Directory class. Specifically Directory.EnumerateFiles().

Categories : C++

Flyway command line filesystem migrations from actual command line input
flyway.cmd -configFile=/path/to/other/configFile.conf should do what you want. I just checked and it seems I forgot to document this on the website (It is in the usage description of the tool itself). Could you file an issue against the website, requesting this to be added?

Categories : Windows

webdriver - Setting a proxy for IE in C#
Have you tried the latest IEDriverServer (version 2.34.0.0)? This is feature is very new to the IEDriverServer. The .NET bindings now expose the Proxy via the InternetExplorerOptions class. This is the change log: https://code.google.com/p/selenium/source/detail?r=084758c6b515a2699b82c6bf5871e29b552cbc8f You should be able to do the exact same thing now after updating the IEDriverServer and .NEt bindings: InternetExplorerOptions options = new InternetExplorerOptions(); Proxy proxy = new Proxy(); proxy.HttpProxy = "http://proxy.com:8080"; proxy.SslProxy = "http://proxy.com:8080"; options.Proxy = proxy;

Categories : C#

Piping output from 1 command to other command in an adb shell command line
One way is to create a shell script containing the commands you want and then run the shell script. Since the Android root filesystem is not writeable at run time (usually, unless you have rooted your device and remount it), you can copy the file to the removable (or emulated) storage, for example /sdcard. Then run the script using the command adb shell sh /sdcard/your-script-name. Because each script runs in its own subshell, both of your commands will be executed in the same shell on the device (you can confirm it with ps).

Categories : Android

TweetSharp setting proxy server
As I was completely unable to specify the authentication details for the proxy server, I was forced to come up with my own workaround. I installed ccproxy on the server, and had it cascade the authentication to the other proxy server. This is working well as of now.

Categories : Asp Net

Setting proxy settings in CURL
cURL is a third-party cross-platform library wrapping several commonly used Internet protocols (HTTP, FTP, etc). You don't HAVE to use it if you don't want to. It is just one of MANY choices available to developers. You can certainly use Microsoft's proprietary WinInet API instead if you want to. Yes, if you use a proxy, you have to configure cURL so it knows about it. Microsoft uses WinInet in Internet Explorer, and WinInet shares certain settings (like proxies) with all apps that use WinInet, so a WinInet-based app usually does not need to configure a proxy (but certain can if needed) if the user has configured a proxy in Windows configuration.

Categories : Windows

Node.js global proxy setting
I finally created a module to get this question (partially) resolved. Basically this module rewrites http.request function, added the proxy setting then fire. Check my blog post http://blog.shaunxu.me/archive/2013/09/05/semi-global-proxy-setting-for-node.js.aspx

Categories : Node Js

Setting proxy authentication on ServiceMix
Since your using ServiceMix you most likely are using Camel with CXF to call this webservice. You need to set this proxy in your Camel context especially for CXF by setting the http-client configuration. Take a look at this link, it shows you how to configure the http conduit of CXF. I'm sure your also able to set the proxy this way.

Categories : Misc

setting variables inside a compound command in bash fails (command group)
I think, you miss that /bin/true returs 0 and /bin/false returns 1 $ r='res:'; { /bin/true; r+=$?; } 2>/dev/null; echo $r; res:0 And $ r='res:'; { /bin/false; r+=$?; } 2>/dev/null; echo $r; res:1

Categories : Bash

Open browser with proxy setting set from Java
Your code is largely correct which deals with setting the proxy, but in case it is not working there is another way to set the proxy via Java code and that is via the proxy class. SocketAddress addr = new InetSocketAddress("socks.example.com", 1080); Proxy proxy = new Proxy(Proxy.Type.SOCKS, addr); Socket socket = new Socket(proxy); InetSocketAddress dest = new InetSocketAddress("server.example.org", 1234); socket.connect(dest); Here the socket will try to connect to its destination address (server.example.org:1234) through the specified SOCKS proxy. For more detail you can go through the Standard Java Documentation for Proxies Your solution for opening a browser can be improved by adding a check if(Desktop.isDesktopSupported()) { Desktop.getDesktop().browse(new URI("http://www.go

Categories : Java

How to do proxy setting in Android Virtual machine
It seems that Android is not capable of picking a proxy up from DHCP - researched it myself. Using ISC DHCPd with the settings that are working fine with Windows guests an Android virtual machine was totally unable to pick up a proxy. It can be a security "bug/feature", but it's a bogus one, IMHO... Maybe DNS-based auto-discovery method will help you? But be aware of a fact, that DNS-based proxy discovery is not system-wide and depends on application doing it.

Categories : Android

Setting up a Proxy QScriptEngineAgent for script monitoring
Use debugger.standardWindow()->show() to show the debugger's GUI: QScriptEngine engine; QScriptEngineDebugger debugger; debugger.attachTo(&engine); debugger.standardWindow()->show(); engine.evaluate(QScriptProgram("a = 0; b = 0; c = a + d;"));

Categories : C++

unix command line cut and remove new line, unwrap next line
This awk one liner can do it: $ awk '{if ($0 ~ /&$/) {getline a; print $0,a} else {print }}' file it gets the lines ending with & and joins them with the next one. Otherwise just prints the line. Test $ awk '{if ($0 ~ /&$/) {getline a; print $0,a} else {print }}' file A7233334 PALLETS 2 11.000 EACH 2331 Storm Supply 247.5000 2,722.50 2,722.50 4144 Gentro Sales 225.0000 2,475.00 2,475.00 5155 Wacca Outfit 225.0000 2,475.00 2,475.00 6661 Acme Warehouse & Fuller Supply 225.0000 2,475.00 2,475.00 1661 McHugh & Donaldson

Categories : Unix

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authorization Required"
You may not need the domain in front of the username. I had a very similar issue, and I fixed it when I removed the domain in front of the username. Since the proxy server is on a domain, I think it implies that your under the same domain.

Categories : Java

Setting Proxy URL with unicode characters using InternetSetOption function
InternetSetOption is a fairly normal Win32 function. It is available in two flavours, the ANSI and Unicode versions. The need for these different versions comes from the fact that Windows 95/98/ME did not support Unicode and only had support for 8 bit encodings. Since you can safely ignore those ancient versions of Windows, you can use the Unicode versions of the Win32 API. In your case this means that you make sure that you compile your application to target Unicode. This will make sure that InternetSetOption is mapped to InternetSetOptionW, the Unicode version which uses the UTF-16 encoding. Your character arrays should use the Windows 16 bit character type wchar_t as the base character type. You must not use char because that is 8 bit. I'm not sure that this change will resolve your

Categories : C

How to tell Python to automatically use the proxy setting in Windows XP like R's internet2 option?
Set up environment variable http_proxy / https_proxy to http://your-proxy-server-address:proxy-port The urlopen() function works transparently with proxies which do not require authentication. In a Unix or Windows environment, set the http_proxy, or ftp_proxy environment variables to a URL that identifies the proxy server before starting the Python interpreter. For example (the '%' is the command prompt): % http_proxy="http://www.someproxy.com:3128" % export http_proxy % python ... The no_proxy environment variable can be used to specify hosts which shouldn’t be reached via proxy; if set, it should be a comma-separated list of hostname suffixes, optionally with :port appended, for example cern.ch,ncsa.uiuc.edu,some.host:8080.

Categories : Python

Method not found when setting proxy in HttpClientHandler Portable Class Library (PCL)
This error is due to the HttpClient package not being installed on the consuming project. You should be getting a warning similar: All projects referencing [consuming project] must install nuget package Microsoft.Bcl.Build. Basically, every referencing a class library that references HttpClient & Async must also reference HttpClient & Async.

Categories : C#

How to set the proxy server for Exchange in outlook 2007 and other setting automatically using the windows registry?
Below is the READ_ME.txt I made for anyone in my company who wishes to do something similar Task: Set the proxy server for Exchange in outlook 2007 Requirements: -RegFromApp ( asitMSExchangeSetup) -PowerShell Method: -Open Outlook and RegFromApp. -Select outlook as the process to monitor in RegFromApp -Make the appropriate changes to the outlook settings. -The changes to the registry will be recorded in RegFromApp. -Write a Powershell script to make these changes to the registry. -To execute the Powershell script automatically you need to make a .BAT file that changes the execution policy of PowerShell to RemoteSigned temporarily and restores it Restricted for security reasons. Notes: -RegFromApp will provide you with every change made to the registry. Only a few of are actually ne

Categories : Powershell

Command works in command line but gives 'no such file or directory' in bash script
Remove the quotes around line 8. Like this: ./optAlg.exe "$inputFile" 500 2>&1 > "output/$outputFile" By placing quotes around the whole line you tell bash to execute a command which is called exactly ./optAlg.exe $inputFile 500 2>&1 > output/$outputFile and of course there is no such command. In reality you want to run ./optAlg.exe with parameters. Do not forget to place quotes around the variables because otherwise filenames that have whitespace characters are going to be passed as several arguments. Please read about arguments. And you can read about common pitfalls as well.

Categories : Bash

Always given command line before python fabric command is executed on remote
Interesting, I don't have such issue, your code works fine for me (up to adding env.key_filename and env.password) c:work>fab hello [x.x.x.x] Executing task 'hello' [x.x.x.x] run: touch hello.world Done. Disconnecting from x.x.x.x... done. I'm using Fabric 1.7.0 and Paramiko 1.11.0. Possibly it's a problem of the terminal on your server.

Categories : Python

Batch file/command to start a program through command line
I'll edit this if you respond to my comment but if you want to simply execute this command via a batch file (and you know nothing about batch files): Open a text editor (e.g.Notepad) Type in your command (e.g. c: andaotherfoldermyprogram.exe 10 20) Save the file as mybatchfile.cmd Double click the file (in Windows Explorer etc.)

Categories : Windows

How to get command-line equivalent of command entered in Task Scheduler
schtasks /query /? schtasks /create /? the first has an option to export to xml, the second one as an option to import from xml. If you have only one or a few tasks to schedule, I would create them "the hard way" with schtasks /create

Categories : Windows

PHP exec command works in shell and php command line but not on website
You can add the second parameter to help debug, $output will display what the cp command is doing, whether it be an error or not. I would also recommend placing quotes around the files, just in case something with a space gets in there. $src = "/mnt/..."; $dest = "/var/www/..."; exec("cp '$src' '$dest'", $output, $retrun_var); var_dump($output, $retrun_var);

Categories : PHP

php sudo shell_exec command runs from command line, but not from browser
Would it be out of the question to make a shell script that would run your command? #!/bin/sh sudo whoami in the php: $retVal = `/path/to/custom/script/myscript.sh &2>1`; if ($retVal) echo 'SWEET'; else echo 'POOP: ' . $retVal; {command} inside `` means the same as shell_exec('{command}') on a linux server. If I'm not way off base here your goal is to add users to your VPN (among other things perhaps) in which case you could pass command-line parameters for username/password/etc to your custom shell script. It's not exactly a pure shell_exec() answer to your question, but maybe you can run myscript.sh without doing sudo. Just basing this on the fact you said everything you tried worked in shell and path was set in echo $PATH, but not sudo echo $PATH in your PHP script. Seem

Categories : PHP

different order of command line options in a command affecting my output
getoptlong() is doing exactly what it is supposed to do. The format-string "d:g:hv" implies that the parameters d and g require a value. Anything specified following a command-line parameter is consider a value being passed to it. You should run your program as $program --download file --version Checkout this detailed example demonstrating the various aspects of using getoptlong(). How rm can handle the differing position of its cmd-line params? Apparently because rm's parameters (r, v etc.) do NOT accept any values as arguments. Thus directory does not get passed to any of them but rather is a separate cmd-line argument on its own. You can confirm this from the source-code of rm. To do something similar for your program, you will need to modify the optstring to "dghv" a

Categories : C

How to issue a command from the command line of a process running on Linux
If you don't mind waiting for the calls to finish (one at a time) before returning control to your program, you can use the subprocess library. If you want to start something running and not wait for it to finish, you can use the multiprocessing library.

Categories : Python

How do I set a command-line flag when running a Symfony2 Command test?
disabling debug in the kernel You can initialize the kernel in your test's setUp() method with debug set to false. use SymfonyBundleFrameworkBundleTestWebTestCase; class YourCommandTest extends WebTestCase { public function setUp() { static::$kernel = static::createKernel(array('debug' => false)); static::$kernel->boot(); // ... } Have a look at WebTestCase->createKernel(). using enviroments If you don't want the debug output in your logs edit/create app/config/config_test.yml and edit ... monolog: handlers: file: type: stream level: debug # log-level ... ... to another log level that suits your needs. Then execute your command using the test environment with --env=test

Categories : PHP

Defining the command line arguments of a linux command in python
format is your friend: import os, sys if len(sys.argv) == 2: os.system("sudo rtcwake -m off -s {}".format(sys.argv[1])) else: print "usage: ..." so the seconds are command line parameters. Or, you can make it interactive: import os secs = raw_input() os.system("sudo rtcwake off -s {}".format(secs)) to verify that the user input is an integer: try: secs = int(secs) except: print 'usage: '

Categories : Python

Is there a command I can use to sign my modified apk on the command line in Linux?
For this you use standard Java SE tools: jarsigner and keytool. From Android documentation on signing: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name Remember that you should first sign and then align.

Categories : Android

Trouble running android command in command line
What Am I missing? You are missing two ~ characters, perhaps. The exact path is /Users/me/Development/adt-bundle/ That's not what you typed into your PATH. Your PATH says that there is no /Users/me -- instead, PATH is expecting a /Development directory in the root of your volume. Now, in Linux, the solution would be to add a ~ to indicate that /Development is relative to your home directory: export PATH=${PATH}:~/Development/adt-bundle/sdk/platform-tools:~/Development/adt-bundle/sdk/tools My OS X shell experience is rusty, so I forget if ~ will map to /Users/me or not. If it does, use ~, otherwise, go with: export PATH=${PATH}:/Users/me/Development/adt-bundle/sdk/platform-tools:/Users/me/Development/adt-bundle/sdk/tools

Categories : Android

Remote command execution from command line in Windows XP
Maybe you could do that via Windows Scripting Host (WSH) which supported remote execution. See Setting up Remote WSH. The article contains a link to examples. (You may need to use the WshShell object to invoke taskkill from your remote script.)

Categories : Windows

How Can Be Used the Command Line of Developer Command Prompt in Vim on Windows?
You need to setup your PATH, INCLUDE and LIB environment variables. You could do that by running D:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat (or wherever it is located on your installation) in the same prompt you're running vim, or even manually setting these environment variables (here is a list of all values for VS2008 and Windows SDK: Using Visual Studio's 'cl' from a normal command line). However, you just can't run the bat file from vim directly, because it will open another Prompt, so the environment variables will be set only for that new prompt. The other option is just to create bat file which you can put it inside your PATH, for example cvim: call "D:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat" "C:Program Files (x86)Vimvim74g

Categories : C++

how to read multiline output command line by line, in a shell script?
Maybe I found a different solution, where I can use variables also outside the loop I have to change the default IFS to newline echo Searching for android virtual devices ... IFS=$' '; for l in $(${PROGDIR}/android list avd) ; do VAR1=$(echo $l | cut -d: -f1 | sed -e 's/s*//'); #sed removes trailing blanks if [ $VAR1 == "Name" ]; then NUM_AVD=$(($NUM_AVD+1)); fi; done echo "NUM_AVD=$NUM_AVD" In this case NUM_AVD is correctly 2

Categories : Shell

Reading input files by line using read command in shell scripting skips last line
DONE=false until $DONE do read line || DONE=true echo $line done < blah.txt How to use `while read` (Bash) to read the last line in a file if there’s no newline at the end of the file?

Categories : Bash



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.