Skip to content

Instantly share code, notes, and snippets.

@murat
Last active October 22, 2023 12:29
Show Gist options
  • Save murat/b12636fbb17342e94637b76c412dd17e to your computer and use it in GitHub Desktop.
Save murat/b12636fbb17342e94637b76c412dd17e to your computer and use it in GitHub Desktop.
Post install popos

Get updates

sudo apt update && sudo apt upgrade -y

Install utilities

sudo apt install -y curl wget git httpie jq vim unzip

Other tools: exa, bat, ripgrep, fasd

Install asdf version manager

git clone https://github.com/asdf-vm/asdf.git ~/.asdf
cd ~/.asdf
git checkout "$(git describe --abbrev=0 --tags)"

Add it to ~/.bashrc

. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

And reload ~/.bashrc

source ~/.bashrc

Install programming languages

Ruby

sudo apt install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev

asdf plugin-add ruby
asdf install ruby 2.7.1
asdf global ruby 2.7.1

gem install bundler
gem install rails
gem install rubocop solargraph ruby-debug-ide debase

asdf reshim

.gemrc

---
:update_sources: true
:sources:
- http://rubygems.org
:benchmark: false
:backtrace: false
:verbose: true
gem: --no-document

Erlang

It's required to install elixir

sudo apt install -y libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev openjdk-14-jdk

asdf plugin-add erlang
asdf install erlang 23.3.1
asdf global erlang 23.3.1

asdf reshim

Elixir

asdf plugin-add elixir
asdf install elixir 1.11.4-otp-23
asdf global elixir 1.11.4-otp-23

asdf reshim

Golang

asdf plugin-add golang
asdf install golang 1.16.3
asdf global golang 1.16.3

asdf reshim

Nodejs && Yarn

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt install -y nodejs yarn

Install snapd and some snaps

sudo apt install snapd

# Chat apps
sudo snap install discord
sudo snap install zoom-client
sudo snap install telegram-desktop
sudo snap install mailspring # aka nylas

# Media apps
sudo snap install spotify
sudo snap install vlc
sudo snap install gimp
sudo snap install obs-studio

# Security apps
sudo snap install bitwarden
sudo snap install authy --beta

# IDEs Editors and dev tools
sudo snap install code --classic
sudo snap install phpstorm --classic
sudo snap install rubymine --classic
sudo snap install goland --classic
sudo snap install datagrip --classic
sudo snap install gitkraken --classic
sudo snap install postman

Torrent

sudo apt install transmission

Audio composing

sudo apt install lmms

Keybase

Download https://prerelease.keybase.io/keybase_amd64.deb and install it.

Terminal

ZSH and Powerlevel10k

sudo apt install -y zsh zsh-autosuggestions
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# Make zsh default shell
chsh -s $(which zsh)

# And do not forget add asdf scripts and other dotfile links in ~/.zshrc
. $HOME/.asdf/asdf.sh
. $HOME/.aliases.sh

Alacritty && Byobu

sudo apt install -y alacritty byobu
cp ./alacritty.yml ~/.config/alacritty.yml
# it includes start command as /usr/bin/byobu
# and also colorschemed via material colors

Now win+t key combination launchs alacritty fullscreen.

Customize byobu

Add following lines to ~/.byobu/profile.tmux for better tmux panes

set -g mouse on
set -g pane-border-style fg=colour235,bg=default
set -g pane-active-border-style fg=colour208,bg=default

And you can use f1 func key to open custom byobu settings.

Fonts

sudo apt install fonts-noto fonts-noto-color-emoji fonts-firacode

Or you can install a nerdfont https://www.nerdfonts.com/font-downloads download and add them into ~/.local/share/fonts

unzip ~/Downloads/FiraCode.zip
mkdir -p ~/.local/share/fonts
mv ~/Downloads/FiraCode/* ~/.local/share/fonts/
fc-cache -fv

Gitconfig

[color]
	ui = true
[color "branch"]
	current = yellow reverse
	local = yellow
	remote = green
[color "diff"]
	meta = yellow bold
	frag = magenta bold
	old = red
	new = green
[alias]
	# add
	a = add                           # add
	chunkyadd = add --patch           # stage commits chunk by chunk

	# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
	snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
	snapshots = !git stash list --grep snapshot

	#via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
	recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)'

	# branch
	b = branch -v                     # branch (verbose)

	# commit
	c = commit -m                     # commit with message
	ca = commit -am                   # commit all with message
	ci = commit                       # commit
	amend = commit --amend            # ammend your last commit
	ammend = commit --amend           # ammend your last commit

	# checkout
	co = checkout                     # checkout
	nb = checkout -b                  # create and switch to a new branch (mnemonic: "git new branch branchname...")

	# cherry-pick
	cp = cherry-pick -x               # grab a change from a branch

	# diff
	d = diff                          # diff unstaged changes
	dc = diff --cached                # diff staged changes
	last = diff HEAD^                 # diff last committed change

	# log
	l = log --graph --date=short
	changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
	short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
	simple = log --pretty=format:\" * %s\"
	shortnocolor = log --pretty=format:\"%h %cr %cn %s\"

	# pull
	pl = pull                         # pull

	# push
	ps = push                         # push

	# rebase
	rc = rebase --continue            # continue rebase
	rs = rebase --skip                # skip rebase

	# remote
	r = remote -v                     # show remotes (verbose)

	# reset
	unstage = reset HEAD              # remove files from index (tracking)
	uncommit = reset --soft HEAD^     # go back before last commit, with files in uncommitted state
	filelog = log -u                  # show changes to a file
	mt = mergetool                    # fire up the merge tool

	# stash
	ss = stash                        # stash changes
	sl = stash list                   # list stashes
	sa = stash apply                  # apply stash (restore changes)
	sd = stash drop                   # drop stashes (destory changes)

	# status
	s = status                        # status
	st = status                       # status
	stat = status                     # status

	# tag
	t = tag -n                        # show tags with <n> lines of each tag message

	# svn helpers
	svnr = svn rebase
	svnd = svn dcommit
	svnl = svn log --oneline --show-commit
[format]
	pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
[mergetool]
	prompt = false
[merge]
	summary = true
	verbosity = 1
[apply]
	whitespace = nowarn
[branch]
	autosetupmerge = true
[push]
	# 'git push' will push the current branch to its tracking branch
	# the usual default is to push all branches
	default = upstream
[core]
	autocrlf = false
	editor = vim
	excludesfile = ~/.gitignore
[advice]
	statusHints = false
[diff]
	# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
	# instead of a/b/c/d as prefixes for patches
	mnemonicprefix = true
	algorithm = patience
[user]
	name = Murat Bastas
	email = muratbsts@gmail.com
	signingkey = PUTGPGKEYID
[gpg]
	program = gpg2
[commit]
	gpgsign = true
[pull]
	rebase = true
sudo apt install gnupg2

.gitignore

# Tags taken from: https://github.com/github/gitignore/blob/master/Global/Tags.gitignore
# ----------------------------------------------------------------------------------------------
# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
TAGS
!TAGS/
tags
!tags/
.tags
.tags1
gtags.files
GTAGS
GRTAGS
GPATH
cscope.files
cscope.out
cscope.in.out
cscope.po.out

# Vim       taken from: https://github.com/github/gitignore/blob/master/Global/vim.gitignore
# ----------------------------------------------------------------------------------------------
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

# SASS
# ----------------------------------------------------------------------------------------------
.sass-cache

Databases

Postgresql

sudo apt install postgresql
sudo su - postgres

postgres@host:~$ createuser --interactive
...

postgres@host:~$ exit

sudo vim /etc/postgresql/12/main/pg_hba.conf # edit host rules, trust for localhost

sudo systemctl enable postgresql
sudo systemctl start postgresql

sudo apt install libpq-dev

Docker, docker-compose

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $(whoami)

## Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Elasticsearch

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch

And you may want to use cerebro

bin/cerebro -Dhttp.port=9201 -Dhttp.address=127.0.0.1 -Dplay.ws.ssl.loose.acceptAnyCertificate=true &

Redis server

sudo apt install redis-server
sudo systemctl enable redis-server
sudo systemctl start redis-server

Soundcard configurations

sudo apt install pavucontrol
sudo vim /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
# find [Element Front] section and change switch is `mute` to `off`
pulseaudio -k && pulseaudio --start

And you can also install sound-output-device-chooser for gnome.

Gnome tweaks

sudo apt install gnome-tweaks

Then install firefox or chrome gnome shell extension, and you can use extensions.gnome.org to manage them.

Useful extensions

Geforce Now

Install https://www.google.com/chrome/

IT'S IMPORTANT: Not chromium, it's only works on google chrome. Chromium browser does not support required codecs.

Troubleshootings

My snap apps won't open

Each problem may have own troubleshooting steps, but disabling, then enabling snaps fixes problems.

I accidently pressed to ctlr+alt+f3 or another fn key

It may opens yhe tty terminal. to return GUI screen you've to press ctrl+alt+f1 or f2, if it's not work, you can try to navigate via alt+left/right key combinations

Bluetooth service

is reporting firmware file rtl_bt/rtl8761b_fw.bin not found

Download nightly firmware from here https://cvh.libreelec.tv/test/fw/rtl_bt.zip and extract files to /lib/firmware/rtl_bt/ add .bin extension to _config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment