command-line-interface

XMLStarlet does not select anything

六月ゝ 毕业季﹏ 提交于 2019-12-03 01:53:29
I have a typical pom.xml, and want to print the groupId, artifactId and version, separated by colon. I think that XMLStarlet is the right tool for that. I tried several ways, but I always get an empty line. xml sel -t -m project -v groupId -o : -v artifactId -o : -v version pom.xml Expected output: org.something.apps:app-acct:5.4 Real output: empty line Even if I try to print just the groupId I get nothing: xml sel -t -v project/groupId pom.xml I am sure that the tool sees the elements because I can list them without problem: xml el pom.xml prints the following (correctly): project project

How to change the project in gcp using cli commands

老子叫甜甜 提交于 2019-12-03 00:35:42
问题 How can i change the current running project to another project in GCP ( Google Cloud Platform ) account using cli commands other than using gcloud init manually. $gcloud projects list will list the projects running on my account. I want to change the current project to any other project from the list using a cli command. 回答1: gcloud config set project my-project You may also set the environment variable $CLOUDSDK_CORE_PROJECT . 回答2: Make sure you are authenticated with the correct account:

How do I avoid typing “git” at the begining of every Git command?

孤街浪徒 提交于 2019-12-03 00:29:22
问题 I'm wondering if there's a way to avoid having to type the word git at the beginning of every Git command. It would be nice if there was a way to use the git command only once in the beginning after opening a command prompt to get into "Git mode" . For example: git> After which every command we type is by default interpreted as a Git command. In a way similar to how we use the MySQL shell to write database commands: mysql> This will save me from having to type git hundreds of times a day.

Linux: create random directory/file hierarchy

别来无恙 提交于 2019-12-03 00:18:15
For testing a tool I need a directory with a whole bunch of different Office files in a deep nested structure. I already have the files in a directory, but now need to create some random nested sub directories and spread out the files in them. I could sit down and write a proper program in a programming language of my choice, but I wonder if there might be a clever combination of Linux command line tools + Bash to achieve what I want. Edit: to clarify, my input is a directory with a about 200 files. The output should be a directory hierarchy containing these files more or less evenly spread.

Highlight text similar to grep, but don't filter out text [duplicate]

萝らか妹 提交于 2019-12-03 00:04:37
问题 This question already has answers here : Colorized grep — viewing the entire file with highlighted matches (17 answers) Closed 3 years ago . When using grep, it will highlight any text in a line with a match to your regular expression. What if I want this behaviour, but have grep print out all lines as well? I came up empty after a quick look through the grep man page. 回答1: Use ack. Checkout its --passthru option here: ack. It has the added benefit of allowing full perl regular expressions. $

Unable to use heroku gem cli after password changes

扶醉桌前 提交于 2019-12-02 21:29:27
I changed my password via the web interface. And now I can't run any command that requires authentication. Password is using plain ASCII, nothing fancy, no Unicode, weird non-printable characters, etc. Anyone had similar experience and how you manage to resolve. How do I even begin to go about debug this? Any verbose cli option, log I can review? % sw_vers ProductName: Mac OS X ProductVersion: 10.6.8 BuildVersion: 10K549 % rvm --version rvm 1.10.3 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/ % ruby --version ruby 1.9.3p125 (2012

Email piping with php script

与世无争的帅哥 提交于 2019-12-02 21:14:19
Hi' I want to forward all the emails(which are come to my inbox) to php script and retrieve email content and save it in a file. So do that I was add email forwarder with piping path correctly. Address to Forward :tickets@ana.stage.centuryware.org Pipe to a Program : /home/centuryw/public_html/stage/ana/osticket/upload/api/pipe.php I have used following script as pipe.php #!/usr/bin/php –q <? /* Read the message from STDIN */ $fd = fopen("php://stdin", "r"); $email = ""; // This will be the variable holding the data. while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); /* Saves the

Find nginx version?

a 夏天 提交于 2019-12-02 21:01:18
I have installed nginx on Debian 7 with the following steps sudo apt-get update sudo apt-get upgrade sudo apt-get install nginx sudo service nginx start I have confirmed that this starts nginx by accessing the hostip from the browser. How do I find out the version of nginx? nginx -v fails with the ' command not found error I verified that nginx exists in the usr/sbin directory and that directory is added to the $PATH variable It seems that your nginx hasn't been installed correctly. Pay attention to the output of the installation commands: sudo apt-get install nginx To check the nginx version,

sending a cmdarray for exec to process — hello world

我是研究僧i 提交于 2019-12-02 20:51:04
问题 Am I not sending an array of commands, "hello world ", to exec() correctly? correct output, hello world: thufir@mordor:~$ thufir@mordor:~$ java -jar NetBeansProjects/HelloExec/dist/HelloExec.jar Apr 05, 2016 7:11:23 AM net.bounceme.mordor.telnet.Main run INFO: starting.. Apr 05, 2016 7:11:23 AM net.bounceme.mordor.telnet.Telnet <init> INFO: connecting.. Apr 05, 2016 7:11:23 AM net.bounceme.mordor.telnet.Telnet connect INFO: connect.. Apr 05, 2016 7:11:23 AM net.bounceme.mordor.telnet.Telnet

How to solve InnoDB: Unable to lock ./ibdata1 mysql error?

北城以北 提交于 2019-12-02 20:46:37
2016-03-14 02:30:29 58150 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 35 2016-03-14 02:30:29 58150 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. First, list MySQL processes using the ps command: ps aux | grep mysql And then kill the process sudo kill 56311 Believe it or not, the solution is elsewhere. The problem stems from AppArmor misconfiguration apparently. So just do: $ apt install apparmor-profiles and then restart MySQL (notice how fast it'll restart). I noticed a file missing related to AppArmor when doing: $