Skip to content

Instantly share code, notes, and snippets.

@ondt
Last active February 6, 2021 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ondt/d6a3bd1f2ea78dc326a360fbcf224571 to your computer and use it in GitHub Desktop.
Save ondt/d6a3bd1f2ea78dc326a360fbcf224571 to your computer and use it in GitHub Desktop.
Blbuntu installation scripts
#!/bin/bash
# install Ubuntu (full install install)
# --> full install
# --> no swap
# setup wifi
# mount /data
gnome-disks
# --> 1,0 TB Hard Disk
# --> Data partition
# --> gears
# --> Edit Mount Options...
# --> User Session Defaults: false
# --> Mount Point: /data
# --> Identify As: /dev/disk/by-uuid/...
# create symlinks
/data/links.sh
################################################################################
sudo systemctl disable NetworkManager-wait-online.service
################################################################################
# update the system
sudo apt -y update
sudo apt -y upgrade
# # add chromium ppa
# sudo add-apt-repository ppa:saiarcot895/chromium-beta
# # add alacritty ppa (change to eoan (for older version))
# sudo add-apt-repository ppa:mmstick76/alacritty
# add spotify ppa
sudo apt install curl
# !!! check the website https://www.spotify.com/us/download/linux/
curl -sS https://download.spotify.com/debian/pubkey_0D811D58.gpg | sudo apt-key add -
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
# # pin the ppa-chromium
# echo "Package: *
# Pin: release o=LP-PPA-saiarcot895-chromium-beta
# Pin-Priority: 700" | sudo tee /etc/apt/preferences.d/chromium
# sync package lists from ppas
sudo apt -y update
################################################################################
# gpu
# sudo apt install intel-media-va-driver-non-free mesa-utils
# remove spying
sudo apt -y purge ubuntu-report popularity-contest apport whoopsie
# install the main packages
sudo apt -y install git wget curl mlocate
# install development tools
sudo apt -y install gcc clang make cmake ccache valgrind linux-tools-common linux-tools-generic manpages-posix manpages-posix-dev
# install editors
sudo apt -y install vim nano kakoune
sudo snap install micro --classic
# install x things
sudo apt -y install xsel xclip xdg-utils xdotool wmctrl xbacklight xtrlock xsecurelock xss-lock hsetroot xprintidle xvfb
# install stats, tops, fetches, monitors
sudo apt -y install progress gpustat sysstat ifstat powerstat tcpdump powertop iotop htop iftop s-tui speedtest-cli screenfetch neofetch
# install cli tools
sudo apt -y install smartmontools fscrypt net-tools lm-sensors stress sshfs socat nmap acpi inotify-tools jq gcal renameutils
# install cli apps
sudo apt -y install tmux atool pulsemixer imagemagick ranger httpie ripgrep youtube-dl pass webext-browserpass pass-extension-otp zbar-tools bluetooth blueman ffmpeg ffmpegthumbnailer node-less fzf
# install gui apps
sudo apt -y install kitty spotify-client gparted baobab gthumb gnome-tweak-tool gedit-plugins chrome-gnome-shell dconf-editor gnome-documents gnome-photos gnome-music gnome-mines gnome-maps gnome-gmail gnome-contacts gnome-clocks gnome-dictionary gnome-sushi peek celluloid
# install games
sudo apt -y install supertuxkart extremetuxracer beneath-a-steel-sky flight-of-the-amazon-queen
# install bspwm
sudo apt -y install bspwm sxhkd xdo dmenu suckless-tools playerctl j4-dmenu-desktop dunst
# install colors
sudo apt -y install grc highlight fzy sl
# install gnome plugins
sudo apt -y install policykit-1-gnome
# install x11 libraries
sudo apt -y install libx11-dev libx11-xcb-dev libx11-doc libxcb-doc libxext-dev libxext-doc libxss-dev libxmu-dev libxcb-shape0-dev libxcb-xkb-dev libxrandr-dev libice-doc libsm-doc libxt-doc
# install python things
sudo apt -y install python3 python3-pip python3-venv python3-tk isympy3 ipython3 python3-systemd
sudo pip3 install ueberzug
pip3 install -U mypy
# install java things
sudo apt -y install default-jre default-jdk
# install rust (default)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# install google chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
# install codecs
sudo apt -y install ubuntu-restricted-extras libmpv1
# install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt install docker-ce docker-ce-cli containerd.io aufs-tools
# install signal-desktop
wget -O- https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list
sudo apt update && sudo apt install signal-desktop
################################################################################
# install nix
sh <(curl -L https://nixos.org/nix/install) --daemon
nix-env --install chromium
################################################################################
# connect the mouse
################################################################################
# npm-install insect
sudo apt install npm
sudo npm install -g insect
# rust-install shotgun
sudo apt -y install libxcb-shape0-dev libxcb-xkb-dev libxrandr-dev
cargo install hacksaw
cargo install shotgun
# rust-install alacritty
sudo apt -y install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3
cargo install alacritty
# rust-install lemonade
sudo apt install librust-pango-dev librust-gdk-pixbuf-dev librust-gdk-dev
git clone --depth 1 https://github.com/ondt/lemonade.git ~/.clone/lemonade
cd ~/.clone/lemonade
cargo build --release
sudo mkdir -p /usr/local/bin
sudo cp -p target/release/lemonade /usr/local/bin
################################################################################
# git-install kakoune (skipped) TODO: kakoune plugins...
sudo apt -y purge kakoune
sudo apt -y install libncursesw5-dev pkg-config
git clone https://github.com/mawww/kakoune.git ~/.clone/kakoune
cd ~/.clone/kakoune
make
PREFIX=$HOME/.local make install
# git-install xtitle
sudo apt -y install gcc make libxft-dev xcb libxcb-util0-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libasound2-dev libxcb-xtest0-dev libxcb-shape0-dev
git clone --depth 1 https://github.com/baskerville/xtitle.git ~/.clone/xtitle
cd ~/.clone/xtitle
make && sudo make install
# git-install lemonbar-xft
sudo apt -y purge lemonbar
sudo apt -y install gcc make libx11-xcb-dev libxft-dev xcb libxcb-util0-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libasound2-dev libxcb-xtest0-dev libxcb-shape0-dev
git clone --depth 1 https://github.com/drscream/lemonbar-xft.git ~/.clone/lemonbar-xft
cd ~/.clone/lemonbar-xft
make && sudo make install
# git-install clipnotify (clipmenu dependency)
sudo apt -y install libxtst-dev
git clone --depth 1 https://github.com/cdown/clipnotify.git ~/.clone/clipnotify
cd ~/.clone/clipnotify
make && sudo install -D -m755 clipnotify /usr/bin/clipnotify
# git-install clipmenu
git clone --depth 1 https://github.com/cdown/clipmenu.git ~/.clone/clipmenu
cd ~/.clone/clipmenu
sudo make # installs as well
# git-install xvisbell
git clone --depth 1 https://github.com/ondt/xvisbell.git ~/.clone/xvisbell
cd ~/.clone/xvisbell
make && sudo make install
# git-install acpilight
sudo apt remove xbacklight
git clone --depth 1 https://gitlab.com/wavexx/acpilight.git ~/.clone/acpilight
cd ~/.clone/acpilight
sudo make install
# git-install scim
sudo apt -y install gnuplot
sudo apt -y install bison libncurses5-dev libncursesw5-dev libxml2-dev libzip-dev zlib1g-dev
git clone --depth 1 https://github.com/jmcnamara/libxlsxwriter.git ~/.clone/libxlsxwriter
cd ~/.clone/libxlsxwriter
make && sudo make install
sudo ldconfig
git clone --depth 1 https://github.com/andmarti1424/sc-im.git ~/.clone/sc-im
cd ~/.clone/sc-im/src
make && sudo make install
# go back
cd
################################################################################
# git-install flamegraph
#git clone https://github.com/brendangregg/FlameGraph ~/.flamegraph
################################################################################
# install zsh
sudo apt -y install git zsh zsh-doc
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
chsh -s $(which zsh)
# git-install zsh plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-completions.git ~/.oh-my-zsh/custom/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-history-substring-search.git ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search
git clone https://github.com/ondt/solarized-man.git ~/.oh-my-zsh/custom/plugins/solarized-man
# download my zsh theme TODO: rename the file?
wget https://ondrej.xyz/s/resources/xondtx.zsh-theme -O ~/.oh-my-zsh/custom/themes/xondtx.zsh-theme
rm .shell.pre-oh-my-zsh
################################################################################
# install lenovo-fix
sudo apt -y install git build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev python3-venv python3-wheel
git clone https://github.com/erpalma/lenovo-throttling-fix.git ~/.clone/lenovo_fix
cd ~/.clone/lenovo_fix
sudo ./install.sh
sudo systemctl stop thermald.service
sudo systemctl disable thermald.service
sudo systemctl mask thermald.service
cd
# todo> upda
# cd ~/.clone/lenovo_fix
# git pull
# sudo ./install.sh
# sudo systemctl restart lenovo_fix.service
################################################################################
# install autofs
sudo apt -y install autofs
echo "/net -hosts" | sudo tee /etc/auto.master.d/nfs.autofs
sudo systemctl restart autofs.service
################################################################################
# download xorg.conf
sudo wget https://ondrej.xyz/s/resources/xorg.conf -O /etc/X11/xorg.conf
# skipped: update psmouse module options
# echo "options psmouse synaptics_intertouch=1" | sudo tee -a /etc/modprobe.d/psmouse.conf
################################################################################
cd ~
wget "https://ondrej.xyz/s/resources/dotmgr"
chmod +x dotmgr
rm .profile .zshrc
./dotmgr clone
zsh # reload
# get ~/.zsh_history (make sure it will not get truncated)
################################################################################
# install python-validity
sudo apt -y remove fprintd
sudo add-apt-repository ppa:uunicorn/open-fprintd
sudo apt -y update
sudo apt -y install open-fprintd fprintd-clients python3-validity
fprintd-delete ondrej
fprintd-enroll
fprintd-verify
sudo pam-auth-update # enable fingerprint
################################################################################
# reboot to load the chromium api keys
reboot
# configure chromium extensions
# open chrome://extensions/shortcuts in chromium
# set ctrl-i for browserpass
# disable popup window for Google Translate extension
# shortkeys config:
[
{
"key": "ctrl+s",
"action": "disable",
"sites": "",
"sitesArray": [
""
],
"activeInInputs": true,
"blacklist": false
}
]
# flags:
#todo
# ENABLE: chrome://flags/#pdf-viewer-update
################################################################################
# install gnome extensions
chromium-browser --new-window $(wget https://ondrej.xyz/s/extensions -qO- | tr "\n" " ")
################################################################################
# install icon theme
sudo add-apt-repository ppa:papirus/papirus
sudo apt -y update
sudo apt -y install papirus-icon-theme papirus-folders
papirus-folders --color bluegrey --theme Papirus-Dark
# install gtk theme
sudo apt -y install gtk2-engines-murrine gtk2-engines-pixbuf
sudo apt -y install materia-gtk-theme
git clone https://github.com/vinceliuice/vimix-gtk-themes.git ~/.clone/vimix-theme
sudo ~/.clone/vimix-theme/install.sh --theme doder
sudo ~/.clone/vimix-theme/install.sh --theme beryl
sudo ~/.clone/vimix-theme/install.sh --theme ruby
sudo ~/.clone/vimix-theme/install.sh --theme amethyst
# todo: update this
# install cursor theme
sudo add-apt-repository ppa:snwh/ppa
software-properties-gtk --open-tab=1 # change focal to disco
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install paper-icon-theme
# change the themes using gnome-tweaks (dconf, later?)
# apps: vimix-dark-laptop-beryl
# cursor: paper
# icons: papirus-dark OR paper
# shell: materia-dark-compact
# sound: yaru
gnome-tweaks
# SKIPPED
cat > ~/.config/gtk-3.0/settings.ini << EOF
[Settings]
gtk-application-prefer-dark-theme=true
gtk-theme-name=vimix-dark-laptop-beryl
gtk-icon-theme-name=Paper
EOF
################################################################################
# load dconf settings
dconf load / < ~/.config/dconf/defaults
################################################################################
# install nvidia driver
software-properties-gtk --open-tab=4
# remove splash screen
# remove quiet splash on line 10
sudo e /etc/default/grub
sudo update-grub
################################################################################
# install tlp
sudo apt -y install tp-smapi-dkms acpi-call-dkms tlp
sudo tlp setcharge 67 71 BAT0
sudo tlp setcharge 67 71 BAT1
################################################################################
# install ssh server
sudo apt -y install openssh-server autossh
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
sudo systemctl restart ssh
# the file should be already there
systemctl --user enable tunnel-laptop.service
systemctl --user start tunnel-laptop.service
systemctl --user status tunnel-laptop.service
################################################################################
# set spotify cache
# https://community.spotify.com/t5/Desktop-Mac/How-to-limit-cache-size/td-p/2907725
echo "storage.size=1024" >> ~/.config/spotify/prefs
# install Maple
https://download.cvut.cz/maple-2020-for-students/
# install folder: /home/ondrej/.local/share/maple2020
# install jetbrains
# https://www.jetbrains.com/toolbox-app/
# install drawio (deb)
# https://github.com/jgraph/drawio-desktop/releases/tag/v13.7.9
sudo dpkg -i Downloads/draw.io-amd64-13.7.9.deb
# install teams
# https://www.microsoft.com/en-us/microsoft-365/microsoft-teams/download-app#desktopAppDownloadregion
# install discord
wget -O discord.deb "https://discordapp.com/api/download?platform=linux&format=deb"
sudo dpkg -i discord.deb
rm discord.deb
sudo apt --fix-broken install
################################################################################
################################################################################
reboot
sudo update-alternatives --all
#xdg-settings set default-web-browser chromium-browser.desktop
#!/bin/bash
echo todo
apt -y install autossh # and openssh
# X11Forwarding yes
pkg install xorg-xauth
mkdir -p $PREFIX/var/service/tunnel/log
ln -sf $PREFIX/share/termux-services/svlogger $PREFIX/var/service/tunnel/log/run
echo '#!/bin/sh' > $PREFIX/var/service/tunnel/run
echo 'while true; do autossh -M 22100 -N -R 0.0.0.0:22001:localhost:8022 ondrej.xyz; sleep 10; done' >> $PREFIX/var/service/tunnel/run
chmod +x $PREFIX/var/service/tunnel/run
sv-enable tunnel
# todo...
# linode
visudo # %sudo ALL=(ALL:ALL) NOPASSWD: ALL
useradd -s /bin/bash -m ondrej
usermod -a -G sudo ondrej
vim /etc/shadow # disable login for root, ondrej
# git
useradd -s /bin/bash -m git
su git
cd
git init --bare dotfiles.git
exit
cd
mkdir -p /home/git/.ssh/
cp ~/.ssh/authorized_keys /home/git/.ssh/authorized_keys
chown git:git -R /home/git/
# tunnel
useradd -s /bin/bash -m tunnel
mkdir -p /home/tunnel/.ssh/
#get the keys
#cp ~/.ssh/authorized_keys /home/tunnel/.ssh/authorized_keys
chown tunnel:tunnel -R /home/tunnel/
# sshd config
vim /etc/ssh/sshd_config
# PasswordAuthentication no
# GatewayPorts clientspecified
systemctl restart ssh
hostnamectl set-hostname server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment