Skip to content

Instantly share code, notes, and snippets.

@marek-panek
marek-panek / CurrentGitBranchInBash
Created October 18, 2020 14:20
Add current git branch name to bash prompt
1. Edit .bashrc file and and the following entries
parse_git_branch() {
git rev-parse --abbrev-ref HEAD 2> /dev/null | sed -e 's/^/(/' -e 's/$/) /'
}
if [ "$color_prompt" = yes ]; then
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \[\e[91m\]\$(parse_git_branch)\[\033[00m\]\$ "
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
@marek-panek
marek-panek / SonarQubeConfig.txt
Last active May 9, 2024 18:34
SonarQube configuration with PostgreSQL
1. In PostgreSQL database
1.1 Create user
create user <user_name> with password '<password>';
1.2 Create database
create database <db_name> with owner <user_name> encoding 'UTF8';
2. Edit <sonar_install_dir>/conf/sonar.properties