command-line-interface

Trying to understand Bash file setups/structure

倖福魔咒の 提交于 2019-12-24 19:04:19
问题 This is an extension of a previously asked question: What are some common HDFS commands that can be mapped in the bash files? I notice that the .bashrc and .bash_profile that I was initially provided are slightly different that what you have provided. Is this OK or some kind of different pattern? The files that were copied over when I started are as follows: .bashrc .bash_profile .bashrc source /etc/bashrc ...and a lot of other folder mappings .bash_profile # .bash_profile # Get the aliases

How to make my video in landscape mode using ffmpeg

纵饮孤独 提交于 2019-12-24 18:15:12
问题 I have four video chats. Somehow I have managed to cut videos into pieces , stored in array then stacked and finally concat the video which is in the youtube link down below. I have used the size in the portrait view is 640*480. But I need to show them in the landscape. Suggest me any ideas. Landscape view: https://youtu.be/u8tmL2-CdK0 Portrait view: https://youtu.be/lO-Q3I9X8OA These are my inputs Input #0, matroska,webm, from 'PA473fbf06ed1f952f95c88b9cf22ed0ba_pre.mkv': Metadata: encoder :

How to make my video in landscape mode using ffmpeg

为君一笑 提交于 2019-12-24 18:14:12
问题 I have four video chats. Somehow I have managed to cut videos into pieces , stored in array then stacked and finally concat the video which is in the youtube link down below. I have used the size in the portrait view is 640*480. But I need to show them in the landscape. Suggest me any ideas. Landscape view: https://youtu.be/u8tmL2-CdK0 Portrait view: https://youtu.be/lO-Q3I9X8OA These are my inputs Input #0, matroska,webm, from 'PA473fbf06ed1f952f95c88b9cf22ed0ba_pre.mkv': Metadata: encoder :

Pass sudo password prompt to stdout of spawned process in Node.js

孤街醉人 提交于 2019-12-24 17:56:08
问题 I have built a GUI with Node.js that allows a user to run custom binaries, designed for CLI. These binaries are spawned with child_process module. A user is able to write to stdin and read from stdout of those child processes. Yet, when a binary uses sudo command, a password prompt bypass stdout and is headed for (pseudo-)terminal device, therefore I can't catch it programmatically and ask user for a password with a fancy GUI notification. I am aware, that -S argument allows sudo to expect

Bash Script with AWK output to CSV

大城市里の小女人 提交于 2019-12-24 13:34:06
问题 I had amazing help on an AWK script here and thought to myself it would be really cool to have the exact same output I am monitoring on the CLI to go to a CSV file. I did research and found a great answer here, it basically showed code like this: awk '{print $1","$2","$3","$4","$5}' < /tmp/file.txt > /tmp/file.csv The first issue I have is /tmp/file.txt is not needed as my code is already producing the string with separated values. I don't know if my variables would work without running all

How to lie to program about `process.platform`?

99封情书 提交于 2019-12-24 12:55:00
问题 There is a CLI that runs on Node and can be executed via command on the command line. In its code, some functionality is deactivated for Windows users by if (process.platform === 'win32') { process.exit(1); } . Now I want to disable this check, and allow Windows users to use the "hidden" functionality (usually the the required software is not installed on Windows, but I have a special setup where it is). Is there some way, to lie to this CLI and simulate that it is running on e.g. Linux or

Running 'dpd keygen' throws an 'ENOENT' error on heroku

微笑、不失礼 提交于 2019-12-24 12:53:53
问题 I installed deployd on Heroku. When trying to access the dashboard, I get the following message: Use dpd showkey to get your app's key. But running: heroku run dpd keygen gives the following error: { [Error: ENOENT, open '.dpd/keys.json'] errno: 34, code: 'ENOENT', path: '.dpd/keys.json' } Any help would be greatly appreciated. Thanks in advance. 回答1: I solved this issue by adding a ".dpd" folder in my heroku root folder. To be able to commit, you also have to add the following file: ".add/

com.datastax.driver.core.exceptions.InvalidQueryException using Datastax Java driver

本小妞迷上赌 提交于 2019-12-24 12:39:50
问题 I created my column family like this from the CLI- create column family profile with key_validation_class = 'UTF8Type' and comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' and column_metadata = [ {column_name : account, validation_class : 'UTF8Type'} {column_name : advertising, validation_class : 'UTF8Type'} {column_name : behavior, validation_class : 'UTF8Type'} {column_name : info, validation_class : 'UTF8Type'} ]; Now I was trying to insert into this column family using

Using Apache common-cli to parse arguments

ⅰ亾dé卋堺 提交于 2019-12-24 11:12:24
问题 Apache common-cli has a example on its web site for ls command: options.addOption( "a", "all", false, "do not hide entries starting with ." ); options.addOption( "A", "almost-all", false, "do not list implied . and .." ); options.addOption( "b", "escape", false, "print octal escapes for nongraphic " + "characters" ); options.addOption( OptionBuilder.withLongOpt( "block-size" ) .withDescription( "use SIZE-byte blocks" ) .hasArg() .withArgName("SIZE") .create() ); This shows help like this: -a,

PHP CGI replaces name of called file in command line exec calls, causing infinite loop

一曲冷凌霜 提交于 2019-12-24 10:45:09
问题 I'm transfering an application to a new server. The application uses command line calls, and the new server runs PHP as CGI/FastCGI. Problem: The script that gets executed on command line is not the file mentioned in the exec command, but the calling file itself. The application uses exec() to run scripts on the command line. Entire code of calling_script.php (scaled down from actual application to demonstrate the issue) is: <? echo __FILE__; $test = 1; shell_exec("/usr/bin/php /path/called