tutorial

Packer - tutorial

Install https://learn.hashicorp.com/tutorials/packer/get-started-install-cli I installed pre-compiled version from the official download page (just download a binary). cd /usr/local/src sudo curl https://releases.hashicorp.com/packer/1.7.6/packer_1.7.6_linux_amd64.zip -O sudo unzip packer_1.7.6_linux_amd64.zip sudo mv packer /usr/bin/ packer version Use Build a Docker image mkdir packer_tutorial cd packer_tutorial touch docker-ubuntu.pkr.hcl In the file docker-ubuntu.pkr.hcl, we define how to set up Pakcer environment and how to build artifacts (images/containers/VMs/etc.). docker-ubuntu.pkr.hcl: packer { required_plugins { docker = { version = ">= 0.

QEMU+KVM - Tutorial

Overview QEMU https://de.slideshare.net/ChiaweiWang3/qemu-introduction ISA: Instruction Set Architecture Virtualization:Emulation = (Host ISA = GuestISA):(Host ISA can be differ from Guest ISA) QEMU stands for Quick EMUlator. Guest ISA -> TCG (Tiny Code Generator, IR code) -> Host ISA Code-Block based Translation -> effective (not one to one translation) Translation Block cache is also the reason QEMU is “fast”. KVM https://searchservervirtualization.techtarget.com/feature/Whats-the-difference-between-Type-1-and-Type-2-hypervisors https://www.how2shout.com/linux/how-to-install-qemu-kvm-and-virt-manager-gui-on-ubuntu-20-04-lts/ KVM stands for Kernel Virtual Machine.

Rust - Getting Started (May. 2021. updating continuously)

What’s this page? As of Jan. 2021, I work as a DevOps (or infrastructure) engineer, but I like to solve problems with codes (front, back, whatever. it depends on the purposes.) For a year, my motivation abour learning Rust surges enough. This page is a memo while I’ve learned with Rust official document so that I can easily reminde the key feafures of Rust. Most part of this post consist of quotes from the document, but I also leave my opinions (could be wrong.

Use Decorator in Python

Let’s grasp the concept of decorator in Python PEP 318 with short snippets. Step 1: Function as a parameter def f1(): print("Called f1.") def f2(f): f() f2(f1) # Called f1 f2 takes a function (object) as a parameter. Step 2: Wapping function def f1(fun): def wrap(): print("Start wrap") fun() print("End wrap") return wrap def f(): print("In function f") f1(f)() ### python test.py #Start wrap #In function f #End wrap Step 3: Use decorator def f1(fun): def wrap(): print("Start wrap") fun() print("End wrap") return wrap @f1 def f(): print("In function f") f() ### python test.

NVM

What’s nvm Node.js Version Manager. Like pyenv in Python. One difference from Pyenv is, you can’t label a name to the environment. package.json manage the libraries. Install nvm Follow the official document. https://github.com/nvm-sh/nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ..... (simple results) Check. $ nvm --version 0.39.0 $ node Command 'node' not found, but can be installed with: sudo apt install nodejs Install Node.js and switch versions # Current available Node.

Serverless framework - Getting Started with Python

I tried Serverless framework with Python AWS Lambda. Prerequirement Node.js and npm. $ node -v v10.19.0 $ npm -v 7.5.2 Install I created my serverless account with Google SSO. sudo npm install -g serverless Hello world Create a project: $ serverless Serverless: No project detected. Do you want to create a new one? Yes Serverless: What do you want to make? AWS Python Serverless: What do you want to call this project?

Cognito - tutorial

First thing you should decide We should decided “User pool” or “Identity pool”. Here is the official blog post about the differences. https://aws.amazon.com/de/premiumsupport/knowledge-center/cognito-user-pools-identity-pools/ In a nut shell, User pools are for authentication (identify verification), and Identity pools are for authorization (access control). I’ll try an User pool. Future scope: integrate with AppSync. Tutorial 1. Create an User pool I followed the link. Very easy. https://docs.aws.amazon.com/cognito/latest/developerguide/tutorial-create-user-pool.html Choose Manage User Pools. Manage User Pools.

MongoDB - Tutorial

Good tutorial video https://www.youtube.com/watch?v=pWbMrx5rVBE Handson Install on Ubuntu sudo su wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list apt update sudo apt install -y mongodb-org systemctl start mongodb Playground in local Docker container docker run -p 27017:27017 -d mongo:4.0-xenial Toolkit curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.3.0.deb -O sudo apt install ./mongodb-database-tools-ubuntu2004-x86_64-100.3.0.deb Mongo shell mkdir mongosh cd mongosh curl https://downloads.mongodb.com/compass/mongosh-0.8.3-linux.tgz -O tar -zxvf mongosh-0.

WASM by Rust - Tutorial

Tutorial The URL I followed. https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm Pre-requirement You should install npm beforehand. To compile wasm-pack, apt install -y build-essential and install gcc. In case of Ubuntu, apt install -y libssl-dev pkg-config. Download wasm-pack To build the package, we need an additional tool, wasm-pack. This helps compile the code to WebAssembly, as well as produce the right packaging for npm. $ cargo install wasm-pack $ cargo new --lib hello-wasm $ cd hello-wasm Write codes src/lib.

AppSync - Tutorial

Getting started Set up Go to AppSync Page. Create API. Getting Started. Customize your API or import from Amazon DynamoDB -> Create with wizard Click Start Create model Model Name: Atlex00Model Configure model fields: Name: uid, Type: ID, Required. Name: first_name: Type: String Name: last_name: Type: String Name: gender: Type: Int Name: age: Type: Int Name: email: Type: Email Configure model table (optional) Table Name: Atlex00ModelTable Primary Key: uid, Sort key: first_name Create resources API configuration API name: atlex00AppSync Your API is almost ready… Updating the schema.