tutorial

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.

Slow query - MySQL

What is slow query? https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html The definition “slow query” is “SQL statements that take more than long_query_time seconds to execute and require at least min_examined_row_limit rows to be examined”. Configure Check current status SHOW VARIABLES LIKE "slow_query_log"; SHOW VARIABLES LIKE "slow_query_time"; SHOW VARIABLES LIKE "slow_query_log_file"; Enable to log slow queries Logging slow queries which take more than 10 seconds. SET GLOBAL slow_query_log = 'ON'; SET GLOBAL long_query_time = 10; SET GLOBAL slow_query_log_file = '/path/filename'; A sample line in the log file:

Elastic Search - Getting started (Draft)

Install (for test) I used Docker image for test purpose. https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html docker run \ -d --rm \ -p 9200:9200 \ -p 9300:9300 \ -e "discovery.type=single-node" \ docker.elastic.co/elasticsearch/elasticsearch:7.12.1 Check the status $ curl localhost:9200 { "name" : "cfd8f0ec08e2", "cluster_name" : "docker-cluster", "cluster_uuid" : "f5fi-57iSVWngx0slmijPA", "version" : { "number" : "7.12.1", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "3186837139b9c6b6d23c3200870651f10d3343b7", "build_date" : "2021-04-20T20:56:39.040728659Z", "build_snapshot" : false, "lucene_version" : "8.8.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.

GCP Tutorial - Create VM

Get API key (not used so far) Project erstellen. API & Services -> Anmeldedaten -> Anmeldendaten erstellen. Add IP restriction to the API key. Schränken: Google Cloud APIs. Install SDK Install Python on your local environment. Install Google Cloud SDK. Configure the SDK with gcloud init. <- need to check which credentials are used for SDK auth. Install Python Refer to the instructions (on pyenv.) I installed v3.8.6 at this time.

ConfigMap - with Nginx

Motivation I want to mount Nginx configuration as ConfigMap. The simplest example Original Here is the default /etc/nginx/conf.d/default.conf in Nginx Docker image (comment outs were removed.) server { listen 80; listen [::]:80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } Overwritte - return a message I’ve changed location / to return the message Have a nice day!

EKS Tutorial

Install AWS CLI My environment WSL Python is installed wiht pyenv. Install aws-cli. curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install Check. $ aws --version aws-cli/2.0.61 Python/3.7.3 Linux/4.19.104-microsoft-standard exe/x86_64.ubuntu.20 Issue AWS access key Log in to Dashboard. Navigate to IAM. In the left pane, “Access management” -> “Users” Click an user, and go to tab “Security credentials” Access keys -> Create access key. You can get credentials, and don’t forget to save “Secret access key,” or download CSV.

CI/CD and GitLab implementations

Definitions of CI/CD (rough) https://docs.gitlab.com/ee/ci/introduction/ CI (Continuous Integration): Building and testing codes are automated. CD Continuous Delivery: One-click deploy enabled. Continuous Deployment: Auto deploy enabled. Facts about GitLab implementation GitLab Runner is an environment in which the CI/CD scripts run. We write the procedures in the file .gitlab-ci.yml normally. You need a GitLab Runner first. Install and configure a Runner Please refer my GitLab Runner install post :) How to write .

Helm

What is Helm https://www.youtube.com/watch?v=fy8SHvNZGeE Install https://helm.sh/docs/intro/install/ From built code - I prefer this way personally curl https://get.helm.sh/helm-v3.8.2-linux-amd64.tar.gz -o helm.tar.gz tar -xzvf helm.tar.gz sudo mv ./linux-amd64/helm /usr/local/bin/ rm -rf ./linux-amd64 Via apt curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list sudo apt-get update sudo apt-get install helm Use Quickstart https://helm.sh/docs/intro/quickstart/ Added 20.

NFS - Tutorial

Install and setup NFS server on Ubuntu 20.04 sudo su apt update apt upgrade -y apt install -y nfs-kernel-server Create export directory (NFS directory). sudo mkdir -p /mnt/nfs_dir chown {{ your_user }}:{{ your_user_group }} /mnt/nfs_dir chmod 777 /mnt/nfs_dir Configuring NFS server. vim /etc/exports # Add the line follows /mnt/nfs_dir 192.168.100.0/24(rw,sync,no_subtree_check) Open port for NFS (TCP 2049) ufw allow from 192.168.100/24 to any port nfs Apply the cofiguration and start NFS.