Skip to main content

Ch01: Preparation

VirtualBox

This OVA file was explicitly developed for Docusaurus.

OVA Debian 11.7

#!/bin/bash
# REV01: Thu 02 Jun 2023 14:00
# START: Thu 01 Jun 2023 17:00
# FILE: 01-wgetOVA.sh
# PRIV: USER

FILENAME="DOCUDEMO-00.ova"
FILEID="1I6q--JE4AQ44kuOTPydFOKfiYj0-2qyw"
SHA256SUM="d29c355255b14e3832e1ff0b900323f956568dac2ef2d1b6d9b225d2da40f448"
wget -c --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=$FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$FILEID" -O $FILENAME && rm -rf /tmp/cookies.txt
echo $(sha256sum -c <<< "$SHA256SUM $FILENAME") '(SHA256SUM)'

OVA Default Settings

Please change the configuration according to the hardware specifications used.

  • Memory : 4 GB
  • Disk : 24 GB
  • Cores : 6
  • usr/passwd : root/cbkadal and cbkadal/cbkadal
  • NAT :
    • 127.0.0.1:6022/10.0.2.15:22 (SSH)
    • 127.0.0.1:5001/10.0.2.15:3000 (Docusaurus)

NAT Port Forwarding (port 3000 to 5001)

Port Forwarding

References

GitHub

Debian 11 sources.list (root)

References

#!/bin/bash
# (ROOT)
[ -f /etc/apt/sources.list ] && mv /etc/apt/sources.list /etc/apt/sources.list.zold
cat > /etc/apt/sources.list << EOF
deb https://deb.debian.org/debian/ bullseye main contrib non-free
deb https://security.debian.org/ bullseye-security main contrib non-free
deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb https://deb.debian.org/debian/ bullseye-backports main contrib non-free
EOF
apt-get update && apt-get upgrade -y

Debian Packages (root)

#!/bin/bash
MYUSER="cbkadal"
export DEBS="
aptitude
git
sudo
vim
"
date;
time apt-get install $DEBS -y
[ -d /etc/sudoers.d/ ] && echo "$MYUSER ALL=(ALL:ALL) ALL" > /etc/sudoers.d/$MYUSER
time (aptitude update&&echo " =1= "&&aptitude safe-upgrade -y&&echo " =2= "&&aptitude autoclean -y;)

Default Shell: BASH (root)

  • say “NO” for DASH
#!/bin/bash
dpkg-reconfigure dash

Setting Debian

#!/bin/bash
touch $HOME/.bash_profile
ls -al $HOME/.bash_profile
sleep 2
cat > $HOME/.bash_profile << EOF
# Thu 15 Jul 2021 15:16:28 WIB
umask 022

# If running bash
[ -n "\$BASH_VERSION" ] && {
# include .bashrc if it exists
[ -f \$HOME/.bashrc ] && . \$HOME/.bashrc
}

# Local PATH
[ -d "\$HOME/bin" ] && PATH="\$HOME/bin:\$PATH"
[ -d "\$HOME/.local/bin" ] && PATH="\$HOME/.local/bin:\$PATH"

EOF

ls -al $HOME/.bash_profile
sleep 2
source $HOME/.bash_profile

  • Set .bash_aliases (too keep the original .bashrc) and .vimrc
#!/bin/bash
cat > $HOME/.vimrc << EOF
syntax off
EOF

cat > $HOME/.bash_aliases << EOF
# REV02: Fri 05 May 2023 09:00
# REV01: Wed 08 Feb 2023 17:00
# START: Sun 09 Jan 2022 15:00

alias cl='clear;echo ""'
alias h='history'
alias gac='git add -A && git commit'
alias ggg='git pull; git add -A; git commit -m "OS231 cbkadal"; git push;'
alias glog='git log --all --decorate --oneline --graph'
alias mv='mv -i'
alias rm='rm -i'
alias sss='. ~/.bash_profile'
export EDITOR=/usr/bin/vi
export HISTSIZE=2000
export HISTFILESIZE=2000
EOF

source $HOME/.bash_profile

NVM (node.js)

  • Get node.js
#!/bin/bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# FIRST TIME ONLY or EXIT
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

  • Check it out!
    • E.g. version v18.16.0
nvm ls-remote

  • Install and Check Version (e.g. v18.16.0)
#!/bin/bash
nvm install v18.16.0
sleep 2
node -v

Install Yarn and Check Version

#!/bin/bash
npm install -g yarn
sleep 2
yarn --version

  • Follow the notice (if available). E.g.,
#!/bin/bash
npm install -g npm@9.6.6

Install Docusaurus(docusaurus.md)

This is the Way!


REV19: Tue 25 Jul 2023 11:00