Posts

Showing posts from April, 2016

Git: display current branch name in the terminal

Image
As simple as beautiful trick for me. Add following lines to ~/.bashrc to allow your terminal to display the current branch name in the command line : get_git_branch () { git branch 2 > /dev/ null | sed - e '/^[^*]/d' - e 's/* \(.*\)/(\1)/' } PS1 = "[\u@\h \W\[\033[31m\]\$(get_git_branch)\[\033[00m\]]$ " Written with StackEdit .

Maybe? Run any command or script without a risk to loose your data

Image
Maybe it’s a simple Python tool that allows you to run any console command without changing your local files. Actually your command runs as usual except system calls that are about to make changes to file system - maybe tool intercepts them and your files stay untouched. Recommended to find detailed description how it works on the project page on GitHub . For example, you can see what happens when you want to create new file: .. or run some script: Installation First you need to install pip . Download it from here (safely): https://pip.pypa.io/en/stable/installing/#id8 and then run sudo python get-pip.py Then install maybe with: sudo pip install maybe Now you can try maybe : maybe touch new_file .txt Enjoy!!! Written with StackEdit .