Skip to content

Instantly share code, notes, and snippets.

View userdocs's full-sized avatar

Userdocs userdocs

View GitHub Profile
@userdocs
userdocs / get_python3_version.sh
Created March 7, 2020 23:49
get latest python 3 version
export python_version="$(curl -sNL https://www.python.org/downloads/source/ | sed -rn 's|(.*)Latest Python 3 Release - Python (.*)</a></li>|\2|p')"
export python_url="https://www.python.org/ftp/python/$python_version/Python-$python_version.tgz"
@userdocs
userdocs / install_node.sh
Created February 23, 2020 17:52
install node lts to local dir.
mkdir -p ~/bin && source ~/.profile
wget -qO ~/node.js.tar.gz "$(curl -sNL https://nodejs.org/en/download/ | grep -Po 'https://nodejs.org/dist/(.*)/node-v(.*)-linux-x64.tar.xz')"
tar xf ~/node.js.tar.gz --strip-components=1 -C ~/
cd && rm -rf node.js.tar.gz README.md LICENSE CHANGELOG.md
@userdocs
userdocs / useful_functions.sh
Last active November 17, 2020 11:12
useful functions
#! /usr/bin/env bash
#
update () {
apt update
apt upgrade -y
apt -t buster-backports update
apt -t buster-backports upgrade -y
apt autoremove -y
[[ -f /var/run/reboot-required ]] && echo -e "\n\e[31mThis machine requires a reboot to continue installation. Please reboot now.\e[0m\n" || :
}