.bash-profile

To use bash --login by default with capistrano 3 + sshkit + rvm

☆樱花仙子☆ 提交于 2019-12-06 13:37:15
I have following cap3 task task :gemset do on roles(:all) do if remote_dir_exists?(".rvm") execute :rvm, :gemset, :use, "#{ Configs.rvm.ruby }@#{ Configs.rvm.gemset } --create" else info "RVM not installed" end end end for settings rvm: ruby: ruby-2.0.0-p247 gemset: cap3 it should execute on my server following command rvm gemset use ruby-2.0.0-p247@cap3 --create but it gives to me DEBUG [9bd5fc11] RVM is not a function, selecting rubies with 'rvm use ...' will not work. DEBUG [9bd5fc11] DEBUG [9bd5fc11] You need to change your terminal emulator preferences to allow login shell. DEBUG

A bash function that runs script

社会主义新天地 提交于 2019-12-06 13:17:51
I'm trying to write a bash function named myrun , such that doing myrun script.py with a Python file: #MYRUN:nohup python -u script.py & import time print 'Hello world' time.sleep(2) print 'Once again' will run the script with the command specified in the first line of the file, just after #MYRUN: . What should I insert in .bashrc to allow this? Here is what I have now: myrun () { [[ "$1" = "" ]] && echo "usage: myrun python_script.py" && return 0 <something with awk here or something else?> } A minimalist version: $ function myrun { [[ "$1" = "" ]] && echo "usage: myrun python_script.py" &&

Creating a 'git log' alias with formatting

血红的双手。 提交于 2019-12-06 08:16:55
I have a bunch of git aliases already set up in my .bash_profile that work correctly: alias gst="git status" alias gl="git pull" alias gp="git push" alias gd="git diff | mate" alias gc="git commit -v" alias gca="git commit -v -a" alias gb="git branch" alias gba="git branch -a" I'm trying to add an alias for the following command, but keep running into an error: git log --all --pretty=format:'%h %cd %s (%an)' --since='7 days ago' What I'd like to do, is be able to type: glog 'some amount of time' So, being new at both aliases and git, I figured this would work: alias glog="git log --all -

No command 'ember' found

房东的猫 提交于 2019-12-06 06:43:44
问题 Seems like I messed up with my ember-cli install. I had installed the npm using sudo, but after reading some issues with ember-cli and sudo on npm I went for uninstall and reinstall following the instruction here https://gist.github.com/isaacs/579814. Now I have installed ember-cli through npm install -g ember-cli but when I do an ember new <name> I get No command 'ember' found, did you mean: Command 'enber' from package 'asn1c' (universe) ember: command not found I can do which node $ which

How do sudo environment variables work in linux?

Deadly 提交于 2019-12-06 05:30:50
I'm currently perplexed by the following: sudo echo $MYVAR outputs my variable from my .bashrc, but sudo ./test.sh does not, where test.sh is the below executable: #!/bin/sh echo $MYVAR I'm running Ubuntu 14.04. Can someone enlighten me as to what's going on here? When you run sudo echo $MYVAR , the environment variable is expanded in your shell ... before the sudo command gets to see it. When you run a script using sudo , that script only sees the environment variables that sudo has included in the environment. The default is to not to include them ... for security reasons. The sudo command

NGINX brew install command not found

给你一囗甜甜゛ 提交于 2019-12-05 03:53:05
I do $ brew install nginx and get: ==> Downloading http://nginx.org/download/nginx-1.2.2.tar.gz Already downloaded: /Library/Caches/Homebrew/nginx-1.2.2.tar.gz ==> Patching patching file conf/nginx.conf ==> ./configure --prefix=/usr/local/Cellar/nginx/1.2.2 --with-http_ssl_module --with-pcre --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf ==> make ==> make install ==> Caveats In the interest of allowing you to run `nginx` without `sudo`, the default port is set to localhost:8080. If you want to host pages on your local machine to the public, you should

How to deactivate bash_history stats print when opening a new terminal window on my mac?

与世无争的帅哥 提交于 2019-12-04 17:51:38
I just reinstalled MacOS (OSX 10.12) and as I'm redoing my IDEs and such I get this strange bash_history stats object that prints to every new terminal window! It's driving me bonkers, and after looking through all the preferences an settings I can't seem to turn it off! Does anyone know why this is suddenly happening? Is it something to do with iCloud Profile Syncing? Here's s picture below. Thanks so much for your help! Screenshot of bash terminal history stats Last login: Wed Jul 5 03:23:51 on ttys005 /Users/admin/.bash_sessions/5D8EB886-1FE8-4DF6-AC4C-6ACE7B8CF803.historynew Stats { dev:

How to add export statement in a bash_profile file?

旧街凉风 提交于 2019-12-04 16:58:05
问题 I'm trying to learn that if I have to add export statement to set a variable in a bash_profile file . How would I do that ? For example if I have to add export AX = 'name' then should I simply write it at the end of file or do I need to write anything else as well 回答1: Simply write export AS='name' anywhere in your ~/.bash_profile file: # Append to the end of the file $ echo "export AS='name'" >> ~/.bash_profile # Update shell $ source ~/.bash_profile This first command adds the line you want

No command 'ember' found

让人想犯罪 __ 提交于 2019-12-04 14:56:34
Seems like I messed up with my ember-cli install. I had installed the npm using sudo, but after reading some issues with ember-cli and sudo on npm I went for uninstall and reinstall following the instruction here https://gist.github.com/isaacs/579814 . Now I have installed ember-cli through npm install -g ember-cli but when I do an ember new <name> I get No command 'ember' found, did you mean: Command 'enber' from package 'asn1c' (universe) ember: command not found I can do which node $ which node /home/[user]/local/bin/node and which npm $ which npm /home/[user]/local/bin/npm , but I can see

Setting path in bash_profile

主宰稳场 提交于 2019-12-04 10:56:07
问题 Why does setting a PATH require the :${PATH} at the end? PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" When I append a path to this I would do PATH=$PATH:... How do I append a PATH without going to a new line. That is, how would I append a PATH to the original PATH statement. If I wanted to put the following all in the first line, for instance. How does this interact with the :${PATH} part? PATH=$PATH:/usr/local/mysql/bin 回答1: There's a difference between appending an