Skip to content

Instantly share code, notes, and snippets.

@instance-id
Last active January 5, 2021 09:21
Show Gist options
  • Save instance-id/95543a830e31f7ee19ad527b07194d31 to your computer and use it in GitHub Desktop.
Save instance-id/95543a830e31f7ee19ad527b07194d31 to your computer and use it in GitHub Desktop.
Useful Linux stuff
cat ~/.ssh/id_rsa.pub | ssh name@server_ip_address "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
sudo apt install timeshift
sudo timeshift --create --comments "A new backup" --tags D
# --tags D stands for Daily Backup
# --tags W stands for Weekly Backup
# --tags M stands for Monthly Backup
# --tags O stands for On-demand Backup
# sudo timeshift --restore
# -- Docker --------------------------
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
# -- Compose --------------------------
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
mkdir -p ~/.ssh && chmod 700 ~/.ssh
touch ~/.ssh/config
chmod 600 ~/.ssh/config
sudo git clone https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp
sudo fc-cache -f -v
// --- Install Linux Brew --------------
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
// --- Relocate NPM global to remove need for sudo --------
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
npm install -g jshint
sudo chown -R $USER ~/.npm-global
// --- install and setup zsh -------------------
cp .bashrc .bashrc-bak
sudo apt install zsh
zsh
// --- install Oh-my-zsh -------------------
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.zshrc ~/.zshrc-bak
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
// --- oh-my-zsh addons -------------------
curl -sfL git.io/antibody | sh -s - -b /usr/local/bin
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
micro .zshrc -> plugins=(zsh-autosuggestions) [put on line 66]
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"
source .zshrc
sudo chsh -s /bin/zsh
sudo restart
// --- Restore Bash -------------------
chsh -s /bin/bash
# // --- Commands ----------------------------
Boot issues / cryptswap
sudo apt install ecryptfs-utils --reinstall
sudo update-grub
# // --- Micro editor ------------------------
sudo curl https://getmic.ro | bash
sudo mv micro /usr/local/bin/micro
sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/micro 0
sudo update-alternatives --config editor
# // --- Video related -----------------------
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get install nvidia-driver-418
apt install nvidia-cuda-toolkit
lshw -numeric -C display
sudo ubuntu-drivers autoinstall
# // --- KDE Plasma --------------------------
sudo apt install kwin qml-module-org-kde-kcm
sudo apt install kde-plasma-desktop kscreen plasma-pa plasma-nm
sudo apt-get install autoconf autogen automake libgtk2.0-dev libtool
# // --- Snapcraft ---------------------------
sudo apt install snapd
sudo apt install libqt5svg5 qml-module-qtquick-controls
sudo snap install snap-store
# // --- imgur-screenshot --------------------
git clone https://github.com/jomo/imgur-screenshot.git
# // --- Theme stuff -------------------------
git clone https://github.com/freefreeno/Epidemic-Dark-Plasma-Theme-and-color-scheme-with-GTK-theme-to-match.git
# // --- thefuck -----------------------------
sudo apt install python3-dev python3-pip python3-setuptools
sudo pip3 install thefuck
# // --- Sysget ------------------------------
sudo wget -O /usr/local/bin/sysget https://github.com/emilengler/sysget/releases/download/v2.2/sysget && sudo chmod a+x /usr/local/bin/sysget && sudo wget -O /etc/bash_completion.d/sysget https://raw.githubusercontent.com/emilengler/sysget/v2.1/bash/bash-completion.bash && echo "Done"
sysget update
# // --- Autokey -----------------------------
sudo add-apt-repository ppa:sporkwitch/autokey
sudo apt update
sudo apt install autokey-gtk
# // --- HR ----------------------------------
git clone https://github.com/trapd00r/hr.git
perl Makefile.PL
make
make install
# // --- Gnome extensions --------------------
https://extensions.gnome.org
# // --- System Monitor ----------------------
sudo apt-get install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0 gir1.2-clutter-1.
sudo apt-get install nvidia-smi
git clone git://github.com/shemgp/gnome-shell-system-monitor-applet.git
cd ~/.local/share/gnome-shell/extensions
ln -s ~/_dev/github.com/gnome-shell-system-monitor-applet/system-monitor@paradoxxx.zero.gmail.com
gnome-shell-extension-tool --enable-extension=system-monitor@paradoxxx.zero.gmail.com
sudo apt install lm-sensors
# // --- Yakuake Console ---------------------
// Skin - https://www.gnome-look.org/p/1229144/
# // --- Dash to Dock (Awesome) --------------
https://extensions.gnome.org/extension/307/dash-to-dock/
# // --- BorgBackup --------------------------
sudo apt-get install python3 python3-pip python3-dev python3.6-dev python-pip python-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev openssl1.0 openssl libmysqlclient-dev Cython
sudo python3 -m pip install --upgrade setuptools pip
sudo pip3 install --upgrade pip setuptools wheel
sudo pip3 install "borgbackup==1.1.9" # : D yay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment