0%

What make people become good game players? They get the game instruction, start practicing and then learn from failure. How about a computer? Can we train it to play a game? The answer is absolutely! And the process of teaching or training the computer to play game is super interesting. This post is written to guide you, step by step, to create your own Game AI that is able to learn to play this game without any hardcoded rules.

Read more »

Hey tech enthusiasts!

Ever thought of a year-end company trip as a system reboot? That's exactly what my getaway to Ho Coc - Ho Tram in Ba Ria - Vung Tau felt like – a perfect blend of team spirit and sea breeze.

The Epic Year-End Logout:

Our journey began not with code pushes but with packed bags, as nearly 100 of us, myself and my family included, set off for a year-end company trip. It was time to exchange our usual digital tools for some real-world team building and family bonding.

Read more »

1. Load environment from .env file

  • Let say we have a .env file:

    WEBSITE_URL=https://hienhoang.ml
    USERNAME=hienhoang
    PASSWORD=p@ssword

  • Then run this script will load all environment variables to current shell terminal

    export $(grep -v '^#' .env | xargs)

  • You can also unset variables using below script

    unset $(grep -v '^#' .env | sed -E 's/(.*)=.*/\1/' | xargs)

2. Substitute all environment variables in a file

  • template.yml

    website: ${WEBSITE_URL}
    username: ${USERNAME}
    password: ${PASSWORD}

  • Run this script to substitute variable in the template.yml file and output to config.yml

    envsubst < template.yml > config.yml

  • Result is the config.yml

    website: https://hienhoang.ml
    username: hienhoang
    password: p@ssword

What's Vagrant?

Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the "works on my machine" excuse a relic of the past.

Why Vagrant?

Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team.

Getting Started

sudo apt update
sudo apt install virtualbox

curl -O https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb
sudo apt install ./vagrant_2.2.9_x86_64.deb
Read more »