terminal

Install oAuth PECL error: Cannot install, php_dir for channel “pecl.php.net” is not writeable by the current user

痞子三分冷 提交于 2019-12-21 03:48:18
问题 I'm trying to instal oAuth on OS X, but I am getting this error in the Terminal: Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user How do I allow it to be writable? 回答1: First find out where the php_dir is. You can do this by using the 'config-get' command: pecl config-get php_dir After this you can either: Change the ownership of that folder (and any needed child folders) sudo chown <username> <php_dir> or Set the php_dir to a different folder pecl

How do command line tools change their output after outputting it?

空扰寡人 提交于 2019-12-21 03:46:30
问题 I've noticed that a lot of command line tools, wget for example, will show progress as a number or progress bar that advances as a process is completed. While the question isn't really language-specific, out of the languages I use most often for command line tools (C++, Node.js, Haskell) I haven't seen a way to do this. Here's an example, three snapshots of a single line of Terminal as wget downloads a file: Along with other information, wget shows a progress bar (<=>) that advances as it

“ps aux” works but “ps -aux” doesn't

╄→гoц情女王★ 提交于 2019-12-21 03:32:39
问题 This might seem like a silly question but I haven't been able to find a clear answer. This website states that the dash is optional in ps aux However, ps aux works but ps -aux brings up the error no user named 'x' . Any ideas what the issue may be here? Running Mac 10.8.2. Thanks 回答1: man ps will give you this: The biggest change is in the interpretation of the -u option, which now displays processes belonging to the specified username(s). Thus, "ps -aux" will fail (unless you want to know

git with --git-dir= results in 'not a git repository'

依然范特西╮ 提交于 2019-12-21 03:14:24
问题 I have a script in one of my iOS apps that should get the git revision hash and put it in the version number. In this script I run git --git-dir="$PROJECT_DIR" show -s --pretty=format:%h for that. However, I get the message that the directory isn't a git repository. If I echo the PROJECT_DIR var and go to the terminal the following works: cd projectDirPath git show -s --pretty=format:%h What doesn't work is: git --git-dir=projectDirPath show -s --pretty=format:%h Am I missing something? The

git with --git-dir= results in 'not a git repository'

匆匆过客 提交于 2019-12-21 03:14:07
问题 I have a script in one of my iOS apps that should get the git revision hash and put it in the version number. In this script I run git --git-dir="$PROJECT_DIR" show -s --pretty=format:%h for that. However, I get the message that the directory isn't a git repository. If I echo the PROJECT_DIR var and go to the terminal the following works: cd projectDirPath git show -s --pretty=format:%h What doesn't work is: git --git-dir=projectDirPath show -s --pretty=format:%h Am I missing something? The

Mount an FTP server locally

六月ゝ 毕业季﹏ 提交于 2019-12-21 02:54:24
问题 I do a lot of work with files hosted on an FTP server. Currently to edit a file on the server I have to open the server in Cyberduck, navigate with the mouse to the folder I want and then click "Edit," which opens a temporary file. Anyway, editing files on the server would be way easier if I could use the terminal to navigate through the file directory and edit files. Is there a way to create a symbolic link in my home directory to an FTP server? edit: I'm on a Mac 回答1: If your using linux

Unix: Getting Export PATH to “Stick”

*爱你&永不变心* 提交于 2019-12-21 01:08:33
问题 When setting the export path in Unix, example: export PATH=$PATH: $EC2_HOME/bin If I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time. I'm wondering how I can set the path and have it "stick" so my system knows where to find everything the next time I open terminal without having to do it all over again. Thanks! 回答1: Open ~/.bashrc. This file is loaded every time you start up a new shell (if you're using Bash,

Error starting apache from terminal after removing MAMP

让人想犯罪 __ 提交于 2019-12-21 00:45:13
问题 I removed MAMP recently. When I try to start apache from Terminal using: sudo apachectl -k restart I am getting the message Warning: DocumentRoot [usr/docs/dummy-host.example.com] does not exist. 回答1: First, make sure you're actually trying to execute the proper version of apachectl by issuing the following command: which apachectl (You don't want to see any MAMP references there). Next, find your virtual hosts config (which is likely here if your MAMP references are gone) /etc/apache2/extra

Modifying $PATH variable

筅森魡賤 提交于 2019-12-20 23:19:41
问题 Trying to install node.js. Did brew install node It seems to have worked. However, received this message upon its completion Homebrew installed npm. We recommend prepending the following path to your PATH environment variable to have npm-installed binaries picked up: /usr/local/share/npm/bin Ok ... so, I open my bash_profile ... And this is what I have in it: export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load

How do I create a line-break in Terminal?

不羁岁月 提交于 2019-12-20 20:31:38
问题 I'm using Python in Terminal on Mac OSX latest. When I press enter, it processes the code I've entered, and I am unable to figure out how to add an additional line of code e.g. for a basic loop. 回答1: In the python shell, if you are typing code that allows for continuation, pressing enter once should not execute the code... The python prompt looks like this: >>> If you start a for loop or type something where python expects more from you the prompt should change to an elipse. For example: >>>