command-line-interface

How to change the path to php.ini in PHP CLI version

℡╲_俬逩灬. 提交于 2019-11-27 12:42:55
The php that run on the webserver and the CLI version is not using the same php.ini file. If I do a command php --ini , it show this Configuration File (php.ini) Path: C:\Windows Loaded Configuration File: C:\wamp\bin\php\php5.3.8\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none) while my web version uses the php.ini in C:\wamp\bin\apache\Apache2.2.21\bin\php.ini . This is probably very common for people using wamp. How do I change the Loaded Configuration File to read from C:\wamp\bin\apache\Apache2.2.21\bin\php.ini so I don't have to maintain 2 different

Lock statement vs Monitor.Enter method

寵の児 提交于 2019-11-27 12:02:05
I suppose that this is an interesting code example. We have a class -- let's call it Test -- with a Finalize method. In the Main method there are two code blocks where I am using a lock statement and a Monitor.Enter() call. Also, I have two instances of the Test class here. The experiment is pretty simple: Null the Test variable within locking block and then try to collect it manually with the GC.Collect method call. So, to see the Finalize call I am calling the GC.WaitForPendingFinalizers method. Everything is very simple, as you can see. By the definition of the lock statement, it's opened

cordova run android executes fine. But Android 4.1.2 doesn't start the app

别来无恙 提交于 2019-11-27 11:55:52
I'm starting to develop and android app using Cordova 5.0.0 (cordova -v prints 5.0.0), and testing it on a Moto Razr D1 with Android 4.1.2. Under Windows 7, btw. cordova build and manually copying the platforms/android/build/output/apk/android-degug.apk to the SD and installing works fine. cordova emulate android runs fine on emulator with android version >4.1.2 cordova run android builds successfully, says using apk platforms/android/build/output/apk/android-debugger.apk, which seems ok, installing app, launching and LAUNCH SUCCESS. however as you can see in this screenshot Razr Screenshot

How to run commands via NodeJS child process?

随声附和 提交于 2019-11-27 11:48:17
I am trying to run commands on Windows via NodeJS child processes: var terminal = require('child_process').spawn('cmd'); terminal.stdout.on('data', function (data) { console.log('stdout: ' + data); }); terminal.stderr.on('data', function (data) { console.log('stderr: ' + data); }); terminal.on('exit', function (code) { console.log('child process exited with code ' + code); }); setTimeout(function() { terminal.stdin.write('echo %PATH%'); }, 2000); When it calls ti.stdin.write , it writes it to the stdin descriptor, but how do I trigger cmd to react at this point? How do I send the "enter" key

What does the 2> mean on the Unix command-line?

老子叫甜甜 提交于 2019-11-27 11:47:55
问题 scriptlist=`ls $directory_/fallback_* 2> /dev/null` What exactly is the purpose of the 2> part of the command? I omitted it and ran the command, it just works fine. And, if the output of ls is getting stored in /dev/null file, what exactly the variable scriptlist will contain. When I executed the code, the output was in the variable and nothing was there in file null . If we remove 2 , then output is in file instead of variable. Any idea what exactly this line of code doing? 回答1: File

How to get tf.exe (TFS command line client)?

早过忘川 提交于 2019-11-27 11:31:18
What's the minimum amount of software I need to install to get the 'tf.exe' program? James Reed You need to install Team Explorer , it's best to install the version of Team Explorer that matches the version of TFS you are using e.g. if you're using TFS 2010 then install Team Explorer 2010. 2012 version http://www.microsoft.com/en-gb/download/details.aspx?id=30656 2013 version http://www.microsoft.com/en-us/download/details.aspx?id=40776 You also might be interested in the TFS power tools . They add some extra command line features (using tfpt.exe ) and also add some extra IDE features. I'm in

How do I identify the particular Linux flavor via command line?

余生颓废 提交于 2019-11-27 10:46:45
问题 I'd like to be able to detect which particular Linux flavor is installed on a computer, e.g. Ubuntu vs Fedora, via a command line command. Some people recommend uname -a , but that only reports the kernel version. 回答1: Try the below command.... It worked for me... cat /proc/version Once you know that you are running Red Hat for example, you can get to the point with: cat /etc/redhat-release Or on Debian: cat /etc/debian_version or in general : cat /etc/*-release Also you could use the

PHP CLI won't log errors

坚强是说给别人听的谎言 提交于 2019-11-27 10:45:40
问题 PHP currently will not log errors produced from the command line. I have : log_errors = On error_log = /var/log/php_errors.log in /etc/php5/cli/php.ini Am I missing a further setting to get this working? 回答1: Please check that the user account running PHP CLI has write access to /var/log/php_errors.log . Additionally, you can verify that you are using the correct php.ini file like this: php -a -c /etc/php5/cli/php.ini 回答2: This question and answer thread was very helpful to me while setting

Are there standards for Linux command line switches and arguments?

让人想犯罪 __ 提交于 2019-11-27 10:44:17
This is more about the invocation of a program, than any language or parser (though I'm sure choice of parser library can depend on this). See, I've used a lot of Linux command-line utilities. And there are some obvious patterns; '-' precedes a single letter for short options, multiple options that don't take arguments can be combined, '--' precedes long versions of options, and so on. However, in some cases, capitalization is used to invert an option. So, '-d' might mean to run as a daemon, but '-D' would be to not run as a daemon. (Why not just omit the option if you don't want it? That's

Parsing arguments to a Java command line program

蓝咒 提交于 2019-11-27 10:26:15
问题 What if I wanted to parse this: java MyProgram -r opt1 -S opt2 arg1 arg2 arg3 arg4 --test -A opt3 And the result I want in my program is: regular Java args[] of size=4 org.apache.commons.cli.Options[] of size=3 org.apache.commons.cli.Options[] #2 of size=1 I would prefer to use Apache Commons CLI, but the documentation is a little unclear about the case I present above. Specifically, the documentation doesn't tell you how to handle options of the 3rd type I specify below: 1. options with a "-