command-line-interface

Ionic build android in CLI does nothing

耗尽温柔 提交于 2019-12-07 12:25:27
问题 I really tried to avoid having to ask this question but I've been stuck on this for a good two days. The problem is that when I try to run the command " ionic build android " I get nothing. No error response, no warning, nothing. I installed node.js and made my npm global so I can access it anywhere. I installed ionic and cordova via npm install and I was able to start the application and see it on the web but when I try to run it on my device, I don't get any response at all. What am I

Send email when error occurs in console command of Symfony2 app

折月煮酒 提交于 2019-12-07 12:08:27
问题 How is it possible to send email with log when something wrong in console command? Currently I've configured my app to send emails from web interface and it works correctly. Swiftmailer spool is disabled. My config is: monolog: handlers: main: type: fingers_crossed action_level: critical handler: grouped grouped: type: group members: [streamed, buffered] streamed: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug buffered: type: buffer handler: swift swift: type:

PHP 5 second countdown (CLI, not JavaScript)

拥有回忆 提交于 2019-12-07 12:05:16
问题 I am writing a PHP CLI (command line) script that will do some irreversible damage if it is run by accident. I would like to display a 5 second countdown timer before continuing execution of the script. How can I do this with PHP? 回答1: To add my two cents, here's how you can add a confirmation prompt. <?php echo "Continue? (Y/N) - "; $stdin = fopen('php://stdin', 'r'); $response = fgetc($stdin); if ($response != 'Y') { echo "Aborted.\n"; exit; } $seconds = 5; for ($i = $seconds; $i > 0; --$i)

mv: invalid option — '0'

怎甘沉沦 提交于 2019-12-07 11:56:48
问题 How can I rename files with "-" in front of the filename, for example: "-0001.jpg" Everyime I try to run: for i in *; do mv "$i" "${i//-/}"; done or: for i in *; do mv "$i" "${i#*-}"; done I got this error: mv: invalid option -- '0' Try `mv --help' for more information. Thanks for any light! 回答1: mv ./-00008.jpg to/some/where.jpg ^ - start with path... 回答2: as with most gnu commands, use the -- switch before the filename with the hyphen. it signifies "end of switches". 回答3: Put a double -

Is there a way to open files with Notepad++ in Bash on Ubuntu on Windows?

谁说我不能喝 提交于 2019-12-07 11:37:36
问题 I am on Windows 10 but I am using Bash on Ubuntu on Windows (WSL) to familiarize myself with the Linux command line. I am trying to take full advantage of its capabilities and was thinking it would be awesome to be able to open, say, index.html from the CLI in Notepad++. Is this possible? If so, how would I go about setting it up? I am pretty new to the command line in general, much less Linux commands. 回答1: It is absolutely possible to use Notepad++ in WSL. In fact, you can use it in

angular 7 does not ask if to use routing when i create a new project

 ̄綄美尐妖づ 提交于 2019-12-07 10:00:55
问题 I was formerly using Angular version 6, now I have upgraded to 7. But when I try to create a new project in CLI using ng new [app-name] it just starts without asking if I want to include routing in my project or the styling. P.S: I have the latest version of Angular i.e 7.0.2. 回答1: ng new {Project-name} command by default creates project without routing. You need to set routing flag as true while creating project as below(by default this routing flag will be false), ng new {Project-name} -

pass results to another command in redis

谁说我不能喝 提交于 2019-12-07 07:38:09
问题 Is there a way to pass the return value of one function to another in Redis? Of course, if you're using a language wrapper (like Ruby), it's easy — but what about from the CLI? e.g. something like this, bash style redis 127.0.0.1:6379> keys student* | mget or something like this redis 127.0.0.1:6379> mget(keys student*) keys student* will return a list of keys, but I've no idea how to fetch all the values for those keys. Thoughts? 回答1: From the CLI, you just have to let the shell do its job.

JBoss 7 CLI to query all the deployed applications

浪尽此生 提交于 2019-12-07 06:24:15
问题 Using JBoss 7's jboss-cli I can query the deployed applications: [standalone@localhost:9999 /] deployment-info --headers= NAME RUNTIME-NAME PERSISTENT ENABLED STATUS jboss-ejb-in-ear.ear jboss-ejb-in-ear.ear true true OK singleton_in_war.war singleton_in_war.war true true OK Programatically I can query any CLI query starting with /, for example this: /path=jboss.server.log.dir:read-attribute(name=path) where the address is /path=jboss.server.log.dir and the operation is read-attribute(name

Determining whether STDERR is going to terminal

不羁的心 提交于 2019-12-07 06:14:03
问题 I have a suite of Java programs which are used as command-line tools on our Linux servers. Most of them use a class that prints a progress bar on STDERR, similar to Perl's Term::ProgressBar . I'd like to have the progress bar shown whenever STDERR is going to the terminal and automatically disable itself when STDERR is redirected so that there aren't all sorts of progress bar pieces in the redirected data. Checking System.console() == null was my first thought, but redirecting STDOUT is

git aws.push: 'aws.push' is not a git command

牧云@^-^@ 提交于 2019-12-07 06:13:42
问题 From my site/application directory: $ git aws.push git: 'aws.push' is not a git command. See 'git --help'. git --help doesn't help. All the posts I have read were written before EB Command Line Interface (CLI) 3.x was a thing. I followed the official instructions here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-getting-set-up.html And here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_eb.sdlc.html Unfortunately, the latter still says to: $ export