From : https://gist.github.com/ankurk91/2efe14650d54d7d09528cea3ed432f6d
#Git branch in prompt.
git branch 2> /dev/null | sed -e '/^[^]/d' -e 's/ (.*)/ (\1)/'
export PS1="\u@\h \W[\033[32m]\$(parse_git_branch)[\033[00m] $ "
Want to find out more about these escaped codes and ANSI escape sequence color codes, here’s a good reference.
The AWS instructions to install the AWS CLI using Python and pip work on MacOS 10.13 (High Sierra) up to the point of adding the Python install location to your path – I found that on 10.13, following the steps didn’t result in the aws command being found.
At the step to addto your path:
- running ‘which python’ showed:
$ which python
but, ls -la did not show that this was a symbolic link in my install per the docs, so this location is also not the same location where the pip installed aws command is.
This post has an answer that suggests the issue is because AWS CLI instructions tell you to do:
pip3 install awscli --upgrade --user
but the –user option specifies a user location. To find where the pip install is installing to, do:
python3 -m site --user-base
This told me:
So taking a looking in the bin dir in this location, this is where the aws cli ended up. Adding this path to my PATH in my ~/.bash_profile and now aws command works as expected.
rm -r deletes matching directories recursively, but not matching filenames. To delete matching files recursively, use:
find . -type f -name ‘pattern’ -delete
I already have the Anniversary Update on my Windows 10 install, and I needed to ssh into one of my Raspberry Pis. I normally do this from my Mac, but since I’m in Windows 10 working on something, I thought this would be a great opportunity to install the new Ubuntu Bash support and then I can ssh from there right? (I could just install Putty, but then I wouldn’t have a reason to check out the Ubuntu Bash support, right?)
First attempt following instructions here, the bash windows opened and closed quick, too quick to read whether there was an error or not.
Second attempt, from a Command Prompt, entering bash, I got this:
Ok, to enable Developer Mode, into Settings, and click the radio button under ‘Use Developer Features’:
Then I got this error:
Hmm. Not very helpful. Clicking on Learn More opened a browser to a help page, but it didn’t load – I’d reconfigured my ip address to a static address on a local network for testing, and I didn’t have internet access. 0x80004005 probably could be a little more helpful, but enabling DHCP to get an internet connection and then tried selecting the Developer Mode option again, it downloaded, said ‘Some features may not be available until your PC is rebooted’. Rebooted, ran bash from Command Prompt, and now it prompted to download the Ubuntu Bash support. Why it couldn’t have done this already is beyond me, and I’ve already rebooted once, but answering ‘y’ it starts downloading:
After it completes you create a unix user and then you’re all set, and it even has ssh included.