Skip to content

Instantly share code, notes, and snippets.

@Al-un
Last active April 26, 2020 06:46
Show Gist options
  • Save Al-un/c23ddef7ca73b802b576a0812c06b712 to your computer and use it in GitHub Desktop.
Save Al-un/c23ddef7ca73b802b576a0812c06b712 to your computer and use it in GitHub Desktop.
Memo for various installations

Summary

Setup

Mount Windows partition:

# Create target
sudo mkdir -p /home/al-un/{folder name}
# Get drive
lsblk
# Mount FAT32
$ sudo mount -t vfat -o ro /dev/sdb1 /media/al-un/{folder name}
# Mount NTFS
$ sudo mount -t ntfs-3g -o ro /dev/sdb1 /media/al-un/{folder name}

Utilities

Git

  • Install

    sudo apt-get install git
    git config --global user.name "Al-un"
    git config --global user.email "..."
  • After first authentication

    git config credential.helper store

Curl

sudo apt install curl

Vim

sudo apt install vim

Programming

NodeJS

  • Requires curl

  • Install official packages

  • For Node 13.x:

    curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
    sudo apt-get install -y nodejs

To uninstall:

NodeJS (NVM)

https://github.com/nvm-sh/nvm

# Get it
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
# List available version
nvm ls-remote
# Select verison or use "node" for the latest version
nvm install node
nvm install 12.14.0
# Enable installed version
nvm use node
nvm use 12.14.0

# No more sudo \o/
npm install -g @vue/cli surge create-react-app

Go

  • Download Go
  • Extract to /usr/local/go:
    sudo tar -C /usr/local/ -xzf ~/Downloads/go1.13.4.linux-amd64.tar.gz
  • Update environment variables: add export PATH=$PATH:/usr/local/go/bin to ~/.profile
  • Set up $GOPATH: go env -w GOPATH=$HOME/git/go

Ruby (RVM)

Ref:

# Install gpg2 if necessary
sudo apt install gnupg2

# GPG keys
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

# Install RVM
curl -sSL https://get.rvm.io | bash -s stable

# List
rvm list known

# Install rubies
rvm install ruby-head
# Or a specificy version:
rvm install 2.6.5

Databases

PostgreSQL

Source: Ubuntu 18.04 DigitalOcean.net

sudo apt update
sudo apt install postgresql postgresql-contrib

MongoDB

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

sudo apt-get update

sudo apt-get install -y mongodb-org

# Start to test if properly installed
sudo service mongod start

# To start MongoDB when system starts
sudo systemctl enable mongod.service

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

MySql

Source Linuxize

# install
sudo apt update
sudo apt install mysql-server

# check
sudo systemctl status mysql

# init
sudo mysql

Create the padawan user:

CREATE USER 'padawan'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'padawan'@'localhost';

Ops

Docker

To install by setting up the repository:

# Update
sudo apt-get update

# Utilities
sudo apt-get install \
  apt-transport-https \
  ca-certificates \
  curl \
  gnupg-agent \
  software-properties-common

# Docker GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Check
sudo apt-key fingerprint 0EBFCD88

# Install stable release IF ubuntu version is supported
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Linux

Permanently mount Windows partition

https://askubuntu.com/a/1166615/935986

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