Skip to content

Instantly share code, notes, and snippets.

@PetrGlad
Last active February 10, 2024 21:30
Show Gist options
  • Save PetrGlad/6492586 to your computer and use it in GitHub Desktop.
Save PetrGlad/6492586 to your computer and use it in GitHub Desktop.
My ubuntu setup
shopt -s histappend
export PATH=$PATH:$HOME/.local/bin:$HOME/bin
stty -ixon
# export PS1='\n\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`__git_ps1` \n\$ '
# export PS1='\n\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[38;5;250m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[38;5;250m\]`__git_ps1`\[\033[00m\] \n\[\033[01;32m\]☯\[\033[00m\] '
# export PS1='\n\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[38;5;243m\]\u@\h\[\033[00m\]:\[\033[38;2;140;140;200m\]\w\[\033[00m\]\[\033[38;5;243m\]`__git_ps1`\[\033[00m\] \n\[\033[01;32m\]☯\[\033[00m\] '
export PS1='\n\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[38;5;243m\]\u@\h\[\033[00m\]:\[\033[38;2;140;140;200m\]\w\[\033[00m\]\[\033[38;5;243m\]`__git_ps1`\[\033[00m\] \n\[\033[01;3`[ $(id -u) == "0" ] && echo 3 || echo 2`m\]☯\[\033[00m\] '
alias Df='df -B1m'
alias Gdc='git svn dcommit'
alias Gg='git gui&'
alias Ggm='A=$(__git_ps1); echo "${A:2:-1} -" > .git/GITGUI_BCK'
alias Gk='gitk&'
alias Gp='git stash pop'
alias Gq='qgit&'
alias Grl='git reflog --decorate --color | grep -E "^\S+ \(" | head -n 20'
alias Gs='git status'
alias Gsh='git stash save'
alias Gsr='git stash && git svn rebase'
alias Gpff='git pull --ff-only'
alias Hi='hoogle --info --color'
alias Ho='hoogle --color'
alias Lr='lein repl'
alias Mc='mc -u'
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
alias Gpsu='git push --set-upstream origin $(git branch --points-at HEAD | sed -E "s/^\s*\*\s*//g")'
alias Gtl='git tag --list --sort=v:refname'
alias TpadOff='synclient TouchPadOff=1'
alias TpadOn='synclient TouchPadOff=0'
export EDITOR=vim
# OpenShift/OKD
source <(oc completion bash)
# https://askubuntu.com/questions/176565/why-does-kworker-cpu-usage-get-so-high
grep . -r /sys/firmware/acpi/interrupts/
# Find ones with high count
crontab -e
### add
@reboot echo disable >/sys/firmware/acpi/interrupts/gpe11
####
# For more diagnostics
powertop
# http://www.brendangregg.com/perf.html
sudo apt install linux-tools-generic
perf -r -a sleep 20
perf report
echo "fs.inotify.max_user_watches = 524288" >>/etc/sysctl.conf
sysctl -p
apt-get remove zeitgeist
apt-get install \
ecryptfs-utils emacs24 vim mc synaptic openjdk-8-jdk openjdk-8-source visualvm \
git git-gui git-svn gitk qgit meld \
subversion maven ant \
tree jq ranger mc sshfs autossh htop byobu rlwrap pv tmux \
wine virtualbox \
vlc keepassx tomboy gimp alacarte chromium-browser \
lm-sensors dstat cpufrequtils
# HEIF support
# https://askubuntu.com/questions/586476/how-to-assign-set-a-mime-type-to-a-file
# https://askubuntu.com/questions/1114127/how-to-display-heic-thumbnails-in-nautilus
apt-get install libheif1 heif-thumbnailer
# Then edit /usr/share/mime/packages/heif.xml
sudo update-mime-database /usr/share/mime
# https://askubuntu.com/a/965306/16193
sudo apt install heif-gdk-pixbuf
apt-get install viewnior gpicview feh
apt-get install \
mysql-client mysql-server mysql-workbench
sudo apt-get install \
xfce4 xubuntu-icon-theme xubuntu-default-settings
# wget lein, gradle
# gsettings set com.canonical.Unity.Lenses disabled-scopes \
# "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope',
# 'more_suggestions-populartracks.scope', 'music-musicstore.scope',
# 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope',
# 'more_suggestions-skimlinks.scope',
# 'more_suggestions-soundcloud.scope']";
git config --global core.excludesfile '~/.gitignore'
# https://docs.docker.com/engine/installation/
apt update
apt upgrade
# apt install apt-transport-https ca-certificates
apt-key adv \
--keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' /etc/apt/sources.list.d/docker.list
apt update
apt-cache policy docker-engine
apt install linux-image-extra-$(uname -r) linux-image-extra-virtual
apt install docker-engine docker-compose debootstrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment