command-line-interface

What are some common HDFS commands that can be mapped in the bash files?

妖精的绣舞 提交于 2020-01-05 05:54:27
问题 I am relatively new to Hadoop and I have been using HDFS CLI a lot. Commands like hdfs dfs -ls are becoming redundant to type. Is it possible to create an alias to this command (i.e., h -ls ) in either the .bashrc or .bash_profile files? Are there any other useful commands that I can map here? 回答1: The good practice is to put aliases in .bash_aliases . For your problem, I'd put alias h="hdfs dfs" in my .bash_aliases file (create it if it doesn't exist) Most distribs will already have this in

PHP CLI has a few seconds delay

梦想与她 提交于 2020-01-04 21:16:22
问题 When I run PHP in the CLI mode (PHP 5.6.6 under CentOS 6.5 running as VM using VirtualBox) it has a few seconds of delay even if I only check version and there is php.ini file disabled: time php -n -v PHP 5.6.6 (cli) (built: Apr 2 2015 14:18:24) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies real 0m5.066s user 0m0.012s sys 0m0.006s 回答1: The problem is related to DNS call PHP is doing. See here and here. The solution is to add hostname [root

Generate random BMP in CLI

六月ゝ 毕业季﹏ 提交于 2020-01-04 16:58:07
问题 I need a truly random BMP in order to test various lossy image compression algorithms. Ideally, this would not rely on any library and run in a Linux CLI. It should generate a random BMP given a certain width and height . 回答1: You can use ImageMagick (which is installed on most Linux distros by default) to generate an image of random noise like this: convert -size 300x200 xc:gray +noise random out.bmp where 300 is the width and 200 is the height (just examples). Other types of noise are

Running “who -m” command from Java yields empty result

我们两清 提交于 2020-01-04 09:37:12
问题 I am trying to find the current logged in username from Java. Process p; try { p = Runtime.getRuntime().exec("who -m"); p.waitFor(); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = ""; while ((line = reader.readLine()) != null) System.out.println(line); } catch (Exception e) { } The above code does not print any result. However if i remove -m option, it prints user name and other details. And also i tested with other options like -s, -u. It

PHP extensions loading in apache module, but not in CLI

不想你离开。 提交于 2020-01-04 06:26:11
问题 I've just performed a fresh install of php 5.5(.19) on Mac OSX 10.10.1 through Brew and symlinked libphp5.so from the Brew install to /usr/libexec/apache2/libphp5.so . Firing up a script through Apache with phpinfo() tells me that the loaded php.ini file is located at /usr/local/etc/php/5.5/php.ini . I've added this to the bottom of the php.ini : extension=memcache.so extension=memcached.so extension=imagick.so extension=mongo.so extension=mcrypt.so I should mention that these modules are

I can only close a form once, InvalidOperation Exception Invoke or BeginInvoke cannot be called on a control until the window handle has been created

你说的曾经没有我的故事 提交于 2020-01-04 05:41:11
问题 Hi I'm opening a form like this from my main form when the user makes a selection of a menu item. private void commToolStripMenuItem_Click(object sender, EventArgs e) { Command_Form Command_Form1 = new Command_Form(); Command_Form1.ShowDialog(); // Command_Form1.Dispose(); this didn't help } Inside the form "Command_Form1" I close it like this when the user clicks on the close button private void Close_button_Click(object sender, EventArgs e) { this.Close(); //I get the exception here } This

Pyexpat import error when running aws cli

我只是一个虾纸丫 提交于 2020-01-04 03:51:13
问题 I am having some problems running the aws cli on ubuntu 14.04 I keep getting the following error Traceback (most recent call last): File "/usr/local/bin/aws", line 15, in <module> import awscli.clidriver File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 16, in <module> File "/usr/local/lib/python2.7/dist-packages/botocore/session.py", line 27, in <module> import botocore.credentials File "/usr/local/lib/python2.7/dist-packages/botocore/credentials.py", line 23, in

Oclif prompt testing

痴心易碎 提交于 2020-01-04 02:47:11
问题 I'm attempting to write a unit test for an Oclif hook that contains a simple prompt. I want to test the output of the hook, given a 'Y' or 'N' response to the prompt. import {Hook} from '@oclif/config' import cli from 'cli-ux' const hook: Hook<'init'> = async function () { const answer = await cli.prompt("Y or N?") if(answer === 'Y') { this.log('yes') } else { this.log('no') } } export default hook I'm using the 'fancy-test' and '@oclif/test' test frameworks described here: https://oclif.io

How to get corresponding build artifacts of a job in jenkins ?

血红的双手。 提交于 2020-01-03 17:21:26
问题 I create Jenkins jobs using hudson.cli.CLI jar . I have selected "Archive the artifacts" option in the "Post-build steps" section. It archives the artifacts on each succesfull build. I am using jenkins remote access api http://localhost:8080/job/job_name/api/json to get details about jobs . and http://localhost:8080/job/job_name/job_number/api/json to get details about builds . When I delete a build corresponding archived artifacts are not deleted. I'd like to make sure that they are deleted.

How to get corresponding build artifacts of a job in jenkins ?

怎甘沉沦 提交于 2020-01-03 17:21:14
问题 I create Jenkins jobs using hudson.cli.CLI jar . I have selected "Archive the artifacts" option in the "Post-build steps" section. It archives the artifacts on each succesfull build. I am using jenkins remote access api http://localhost:8080/job/job_name/api/json to get details about jobs . and http://localhost:8080/job/job_name/job_number/api/json to get details about builds . When I delete a build corresponding archived artifacts are not deleted. I'd like to make sure that they are deleted.