Skip to content

Instantly share code, notes, and snippets.

@dev117uday
Last active June 2, 2022 13:17
Show Gist options
  • Save dev117uday/da1c6b0a95ad23fe2d0ef499b4ea7698 to your computer and use it in GitHub Desktop.
Save dev117uday/da1c6b0a95ad23fe2d0ef499b4ea7698 to your computer and use it in GitHub Desktop.
My PC Setup

Setup.txt

OS setup

gedit admin:///etc/sysctl.conf

vm.swappiness=10
gedit admin:///etc/fstab

# add this before "errors" (without spaces): 
noatime,

Initial setup

apt-get installs

sudo apt-get install build-essential cmake g++ curl libssl-dev lm-sensors synaptic tlp tlp-rdw tp-smapi-dkms acpi-call-dkms thermald python2 git psensor gufw tldr htop gnome-tweaks openjdk-17-jdk terminator openvpn micro gnome-calendar flameshot cheese filezilla nomacs indicator-cpufreq dialog qbittorrent rhythmbox libfuse2 simple-scan gnupg vlc python3-pip golang python3-setuptools neofetch stacer tree apt-transport-https uidmap papirus-icon-theme ubuntu-restricted-extras fonts-roboto aptitude psensor ffmpeg python3-virtualenv python3-venv maven obs-studio mono-mcs mono-runtime fbreader && sudo add-apt-repository ppa:appimagelauncher-team/stable && sudo apt-get update && sudo apt-get install appimagelauncher && sudo systemctl enable tlp.service && git config --global user.name "Uday Yadav" && git config --global user.email "dev117uday@gmail.com" && git config --global core.editor "nano" && git config --global alias.mylog "log --decorate --oneline --graph"

snap store

sudo snap install code --classic && sudo snap install sublime-text --classic && sudo snap install code-insiders --classic && sudo snap install postman && sudo snap install intellij-idea-community --classic && sudo snap install gitkraken --classic && sudo snap install chromium && sudo snap install telegram-desktop && sudo snap install bitwarden && sudo snap install discord && sudo snap install onlyoffice-desktopeditors

Docker

curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh && sudo groupadd docker && sudo usermod -aG docker $USER

Zsh

sudo apt install zsh
chsh -s $(which zsh) 
# configure zsh
zsh
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# nano .zshrc

alias pp="cd program"
alias pc="code ."
alias file="xdg-open ."
alias ns="npm run start"
alias nr="npm run dev"
alias pci="code-insiders ."
alias pp="cd programm"

add this to .profile

nano .profile

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Manual installation

Other Install

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install --lts
npm i -g typescript ts-node nodemon yarn firebase firebase-tools sass pnpm

# https://go.dev/dl/
go install golang.org/x/tools/gopls@latest && go install golang.org/x/tools/cmd/godoc@latest

# github cli login
gh auth login

sudo sensors-detect

bluetooth

sudo apt-get install pulseaudio pulseaudio-module-bluetooth pavucontrol bluez-firmware
systemctl restart bluetooth
sudo apt-get install blueman

update

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt-get autoclean && sudo snap refresh && sudo ./software/snap.sh

sudo fstrim -a

snap and flathub

sudo snap refresh && sudo ./software/snap.sh
flatpak update -y && flatpak uninstall --unused 
set -eu

LANG=C snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
        snap remove "$snapname" --revision="$revision"
    done

sudo ./remove.sh exec

#!/bin/bash
# Run this script without any param for a dry run
# Run the script with root and with exec param for removing old kernels after checking
# the list printed in the dry run

uname -a
IN_USE=$(uname -a | awk '{ print $3 }')
echo "Your in use kernel is $IN_USE"

OLD_KERNELS=$(
    dpkg --list |
        grep -v "$IN_USE" |
        grep -Ei 'linux-image|linux-headers|linux-modules' |
        awk '{ print $2 }'
)
echo "Old Kernels to be removed:"
echo "$OLD_KERNELS"

if [ "$1" == "exec" ]; then
    for PACKAGE in $OLD_KERNELS; do
        yes | apt purge "$PACKAGE"
    done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment