Skip to content

Instantly share code, notes, and snippets.

@Surzhko
Last active April 15, 2025 12:14
Show Gist options
  • Save Surzhko/e041a609c1a3f62f7298 to your computer and use it in GitHub Desktop.
Save Surzhko/e041a609c1a3f62f7298 to your computer and use it in GitHub Desktop.
Installation bash script
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
alias gg='git gui'
alias gw='github_workflow'
alias be='bundle exec'
__git_color_ps1 ()
{
if [ -n "$(__git_ps1)" ]; then
local COLOR_DIRTY="\033[01;31m"
local COLOR_CLEAN="\033[01;32m"
if git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null; then
echo -n "$COLOR_CLEAN"
else
echo -n "$COLOR_DIRTY"
fi
fi
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[$(__git_color_ps1)\]$(__git_ps1 " (%s)")\[\033[00m\]\$ '
#!/bin/bashs
sudo apt update
snap refresh
sudo apt install -q -y curl git git-gui
snap install gh
snap install telegram-desktop
snap install slack
echo "\pset null 'Ø'" > ~/.psqlrc
echo "legacy_version_file = yes" > .asdfrc
mkdir ~/projects
echo ".ruby-version" > ~/projects/.gitignore
echo ".ruby-gemset" >> ~/projects/.gitignore
echo ".idea" >> ~/projects/.gitignore
echo "temp/" >> ~/projects/.gitignore
git config --global core.excludesfile ~/projects/.gitignore
git config --global color.ui auto
git config --global user.name ''
git config --global user.email ''
# git aliases
git config --global alias.refetch '!git fetch origin && git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)'
git config --global alias.refresh '!git fetch origin && git rebase origin/main'
git config --global alias.cb 'checkout @{-1}'
git config --global alias.fpush 'push --force-with-lease'
# psql> CREATE ROLE $here$ WITH SUPERUSER CREATEDB CREATEROLE LOGIN REPLICATION;
# sudo ln -s ~/.asdf/installs/ruby/2.7.6/openssl/lib/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
# sudo ln -s ~/.asdf/installs/ruby/2.7.6/openssl/lib/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#
__git_color_ps1() {
if [ -n "$(__git_ps1)" ]; then
local COLOR_DIRTY="%F{9}"
local COLOR_CLEAN="%F{10}"
# Check if the working tree and index are clean
if git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null; then
echo -n "$COLOR_CLEAN"
else
echo -n "$COLOR_DIRTY"
fi
fi
}
PROMPT='%F{11}%n@%M%f:%F{33}%~$(__git_color_ps1)$(__git_ps1 " (%s)")%f\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment