Default
Installing Jekyll On Debian
C. BinKadal --- Sendirian, Berhad





PART 2: User Mode

(user) Test X11 with xclock

  • You should have installed “xclock” (x11-apps) on your Debian guest.
  • You should enable option X11 when ssh to the virtual guest.
  • Your NAT ports may be different. Assuming user “cbkadal” with local port is “6023”.
ssh -X -p 6023 cbkadal@localhost

  • Test it if you can display “xclock” on your host.
xclock


assets/scripts/clean-home.sh

  • This script (clean-home.sh) purges whatever was installed previously (but failed) at $HOME.
#!/bin/bash
# REV05: Sun 31 Jul 2022 09:00
# REV04: Mon 15 Feb 2021 23:00
# START: Tue 18 Jun 2019 14:00
#
# clean-home.sh purges whatever was installed 
#               previously at $HOME.
# 
# Copyright (C) 2019-2022 C. BinKadal, Sdn. Bhd.
# This is a free script. It is distributed in the 
# hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY 
# or FITNESS FOR A PARTICULAR PURPOSE.

RMOPT="-rfv"

DELETE="
   $HOME/.bundle/
   $HOME/.gem/
   $HOME/.gemrc
   $HOME/gems/
   $HOME/.rvm/
   $HOME/.rbenv/
"

for II in $DELETE ; do
   [ -f $II ] && (echo "Delete file   $II"; rm $RMOPT $II)
   [ -d $II ] && (echo "Delete folder $II"; rm $RMOPT $II)
done

exit 0

  • You might “copy and paste” that file or fetch it with:
wget https://doit.vlsm.org/assets/scripts/clean-home.sh

  • Run the script:
bash clean-home.sh


  • Append (“copy and paste”) this following to either file:
    • $HOME/.bash_profile or
      • $HOME/.profile (if .bash_profile not exists).
    • DO IT NOW!
export PATH="$HOME/.rbenv/bin:$PATH"
[ -d $HOME/.rbenv/bin/ ] && eval "$(rbenv init -)"


RBENV

  • Script#1 to install RUBY with RBENV
#!/bin/bash
# REV23: Wed 04 Sep 2024 21:00
# REV19: Mon 04 Sep 2023 20:00
# REV09: Sun 12 Feb 2023 15:00
# REV07: Sun 31 Jul 2022 21:00
# REV05: Mon 26 Jul 2021 15:00
# START: Tue 18 Jun 2019 16:00
# 
# set-rbenv1.sh installs rubby using rbenlv.
#                       
# Copyright (C) 2019-2024 C. BinKadal, Sdn. Bhd.
# This is a free script. It is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.

# See also set-rbenv2.sh
# Try one by one "RUBY"; until it works.
# RUBY="3.1.6"
# RUBY="3.2.5"
RUBY="3.3.5"

[ -d $HOME/.rbenv ] || git clone https://github.com/rbenv/rbenv.git $HOME/.rbenv
echo "==== ==== ==== ==== ==== ==== ==== source .bash_profile or .profile"
if   [ -f $HOME/.bash_profile ] ; then
  source $HOME/.bash_profile
elif [ -f $HOME/.profile ] ; then
  source $HOME/.profile
fi
echo "==== ==== ==== ==== ==== ==== ==== rbenv init"
[ -d $HOME/.rbenv/bin/ ] && eval "$(rbenv init -)"
sync
echo "==== ==== ==== ==== ==== ==== ==== type rbenv"
type rbenv
echo "==== ==== ==== ==== ==== ==== ===="
[ -d $HOME/.rbenv/plugins/ ] || git clone https://github.com/rbenv/ruby-build.git $HOME/.rbenv/plugins/ruby-build
echo "==== ==== ==== ==== ==== ==== ==== rbenv install -l"
rbenv install -l
echo "==== ==== ==== ==== ==== ==== ==== rbenv install $RUBY"
rbenv install $RUBY --verbose

exit 0

  • You might “copy and paste” that file or fetch it with:
wget https://doit.vlsm.org/assets/scripts/set-rbenv1.sh

  • Run the script:
if   [ -f $HOME/.bash_profile ] ; then
  source $HOME/.bash_profile
elif [ -f $HOME/.profile ] ; then
  source $HOME/.profile
fi
bash set-rbenv1.sh


  • Script#2
#!/bin/bash
# REV25: Wed 04 Sep 2024 21:00
# REV19: Sun 31 Jul 2022 22:30
# REV15: Mon 31 Jan 2022 17:00
# REV14: Mon 26 Jul 2021 15:00
# REV10: Wed 17 Feb 2021 15:00
# START: Tue 18 Jun 2019 16:00
#
# set-rbenv2.sh installs the bundler.
#
# Copyright (C) 2019-2024 C. Binkadal, Sdn. Bhd.
# This is a free script. It is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.

# See also set-rbenv1.sh
# Try one by one "RUBY"; until it works.
# RUBY="3.1.6"
# RUBY="3.2.5"
RUBY="3.3.5"

echo "==== ==== ==== ==== ==== ==== ==== rbenv init"
[ -d $HOME/.rbenv/bin/ ] && eval "$(rbenv init -)"
echo "==== ==== ==== ==== ==== ==== ==== rbenv global $RUBY"
rbenv global $RUBY
echo "==== ==== ==== ==== ==== ==== ==== ruby -v"
ruby -v
echo "==== ==== ==== ==== ==== ==== ==== .gemrc"
echo "gem: --no-document" > $HOME/.gemrc
echo "==== ==== ==== ==== ==== ==== ==== gem install bundler"
gem install bundler jekyll
# gem install bundler rails

exit 0

  • You might “copy and paste” that file or fetch it with:
wget https://doit.vlsm.org/assets/scripts/set-rbenv2.sh

  • Run the script:
    • If .bash_profile does not exists, try .profile
if   [ -f $HOME/.bash_profile ] ; then
  source $HOME/.bash_profile
elif [ -f $HOME/.profile ] ; then
  source $HOME/.profile
fi
bash set-rbenv2.sh


Test: Clone a GitHub Page

INPUT

mkdir -pv $HOME/git/
cd        $HOME/git/
rm -rf    $HOME/git/template/
git clone git@github.com:/yforku/template.git
cd        template/
bundle install
bundle clean --force
if   [ -f $HOME/.bash_profile ] ; then
  source $HOME/.bash_profile
elif [ -f $HOME/.profile ] ; then
  source $HOME/.profile
fi
bundle exec jekyll serve -H 0.0.0.0

Test “localhost:5000” on Host

On VirtualBox, do not forget to redirect port 127.0.0.1:5000 (Host) to port 10.0.2.15:4000 (Guest).



© 2021-2024 --- C. BinKadal --- About --- Revision: Mon 18 Nov 2024 17:00.