command-line-interface

Attach to a processes output for viewing

折月煮酒 提交于 2019-11-28 02:42:14
How would I 'attach' a console/terminal-view to an applications output so I can see what it may be saying? How would I detach from an applications output without killing the application? Normally if you fire up a talkative application using the command line you get to see all kinds of wonderful output. However, let’s say I have a particularly chatty programming running, like KINO, and I want to view its output at any given moment without restarting it through the command line. I cannot; at least I don't know how. There are a few options here. One is to redirect the output of the command to a

Pretty print in MongoDB shell as default

旧巷老猫 提交于 2019-11-28 02:32:13
Is there a way to tell Mongo to pretty print output? Currently, everything is output to a single line and it's difficult to read, especially with nested arrays and documents. ( note: this is answer to original version of the question, which did not have requirements for "default" ) You can ask it to be pretty. db.collection.find().pretty() staackuser2 You can add DBQuery.prototype._prettyShell = true to your file in $HOME/.mongorc.js to enable pretty print globally by default. Bhanu Chawla (note: this is answer to the updated question) You can just do this on the CLI: echo DBQuery.prototype.

How to create a file in Linux from terminal window?

丶灬走出姿态 提交于 2019-11-28 02:31:34
What's the easiest way to create a file in Linux terminal? Eugen Rieck Depending on what you want the file to contain: touch /path/to/file for an empty file somecommand > /path/to/file for a file containing the output of some command. eg: grep --help > randomtext.txt echo "This is some text" > randomtext.txt nano /path/to/file or vi /path/to/file (or any other editor emacs,gedit etc ) It either opens the existing one for editing or creates & opens the empty file to enter, if it doesn't exist Use touch touch filename Create the file using cat $ cat > myfile.txt Now, just type whatever you want

Meteor Settings in a Deployed App

孤街醉人 提交于 2019-11-27 23:45:23
问题 This is probably a very basic question, but this is my first time using Meteor + Heroku and I can't seem to figure out how to use the settings.json file after deploying a Meteor app (currently using heroku). From my hours of research on web, it seems that in order to use the settings in a deployed app, I have to do... export METEOR_SETTINGS="$(cat settings.json)" At first I thought that this is meant to go to a boostrap file... Then I realized I was wrong when I started get reserved word

No output from PHP interactive on Windows

假如想象 提交于 2019-11-27 22:10:30
问题 I'm running php interactively from xampp (5.4.7) on my Win 7 machine and cannot get any output from the window. I searched around various solutions and nothing so far has worked. Here's a sample: C:\xampp>php -v PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies C:\xampp>php -a Interactive mode enabled <? echo "hi"; printf "hi"; fwrite (STDOUT, "hi"); any other ideas??? I also tried php -an and

How to upload file from command line as file parameter in jenkins

谁都会走 提交于 2019-11-27 21:43:04
问题 I am triggering builds with string parameters from the command line in Jenkins with: curl http://jenkins:8080/job/Build/buildWithParameters?PARAM=value&token=token I now want to trigger a build with a file as a file parameter from the command line. For example if my project builds main.c then I would like to be able to trigger a build and upload my main.c from the command line. Is this possible? 回答1: This is described in the Jenkins Remote access API page: curl http://jenkins/job/$JOB_NAME

How to change the output folder for migrations with asp.net Core?

自闭症网瘾萝莉.ら 提交于 2019-11-27 21:06:13
问题 Does anyone know how to change the output directory of the following command: dotnet ef migrations add Initial --context EsportshubApi.Models.ApplicationDbContext ?? i tried to add the option: --content-root-path 'Migrations/Identity' but that doesn't do anything. There is a --data-dir option aswell and something else with directory, but none of them is the output for migrations. My problem is that i have 2 DbContexts so i want their migrations separated. 回答1: dotnet ef migrations add Initial

Create cronjob with Zend Framework

こ雲淡風輕ζ 提交于 2019-11-27 20:18:29
问题 I am trying to write a cronjob controller, so I can call one website and have all modules cronjob.php executed. Now my problem is how do I do that? Would curl be an option, so I also can count the errors and successes? [Update] I guess I have not explained it enough. What I want to do is have one file which I can call like from http://server/cronjob and then make it execute every /application/modules/*/controller/CronjobController.php or have another way of doing it so all the cronjobs aren't

CLR and CLI - What is the difference?

心已入冬 提交于 2019-11-27 18:41:47
I want to know what exactly is the difference between CLR & CLI? From whatever I have read so far, it seems to indicate that CLI is a subset of CLR. But isn't everything in the CLR mandatory? What exactly may be left out of CLR to create a CLI? The CLR is Microsoft's implementation of the CLI standard . CLR is the execution environment in which a .NET application is safely hosted/run. You can see it as .NET's private Operating System that initiates and loads just before a .NET application starts. The CLR takes care of certain essential requirements of any .NET application that otherwise would

SQLite Data Change Notification Callbacks in Python or Bash or CLI

♀尐吖头ヾ 提交于 2019-11-27 18:06:40
问题 SQLite has Data Change Notification Callbacks available in the C API. Can these callbacks be used from the SQLite CLI, or from Bash or from Python? If so, how? 回答1: Can these callbacks be used from the SQLite CLI... Reading through the SQLite source code, it doesn't look like that function is used anywhere in the CLI source code, so I doubt you can do it via the CLI. ...or from Bash... Not sure what you mean by that. ...or from Python? It's not exposed via the standard sqlite3 module, but you