Windows Terminal

Terminal for WSL I want a cool terminal for WSL, and “Windows Terminal” is easy to install and seems good. How to install From Microsoft Store. Change default terminal from PowerShell to WSL https://medium.com/@callback.insanity/windows-terminal-changing-the-default-shell-c4f5987c31 Open settings. It is a json file. Find defaultProfile. In my case, it is "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}" In list, find your Linux config line. Here is my sample. "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl" Change the default Profile value as your Linux guid.

Install Go (Golang) from source

Environment I wrote this article while installing go on WSL. Install Go lang $ curl https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz -o golang.tar.gz $ sudo tar -C /usr/local -xzf golang.tar.gz $ vim ~/.bashrc ## Add /usr/local/go/bin/ to path ## export PATH=/usr/local/go/bin:$PATH $ source ~/.bashrc ## Check $ go version go version go1.15.5 linux/amd64 Upgrade the version Just delete the current version like rm -rf /usr/local/go, and replace it with new version. Tips: Installing Hugo on this setup (on WSL) GCC and G++ are required (sudo apt install gcc g++).

My simple Vim environment

Environment I wrote the article while installing on WSL. But this instruction works in any Linux environment basically. Color scheme - jellybeans If you don’t install git, please install it first. sudo apt install -y git git config --global user.email {{ my_email_address }} git config --global user.name {{ my_handle_name }} Download a color scheme jellybeans and put it to correct path. mkdir ~/.vim cd ~/.vim mkdir colors git clone https://github.com/nanotech/jellybeans.vim mv jellybeans.

MySQL snippets

Create a temporary Docker MySQL container docker run \ --detach \ --name=mysqltest \ --env="MYSQL_ROOT_PASSWORD=FoOPass123" \ --publish 3306:3306 \ mysql PhpMyAdmin (Docker) Before run this command, check the network of MySQL container with docker inspect mytestest. docker run --name myadmin -d -e PMA_HOST=172.17.0.2 -e PMA_PORTS=3306 -p 8080:80 phpmyadmin Open the browser and go http://localhost:8080. The user is MySQL user (root and FoOPass123 in my case). MySQL workbench (Docker, I don’t use this way) I found this image.

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 .

7-Zip

Why(When) I use 7-zip 7-zip can unarchive large files (more than 4 GB.) Compatibility with many formants (zip, tar, rar, gz, etc.). Install sudo apt install p7zip-full sudo apt install p7zip-rar # For extracting RAR file Unarchive 7-zip can extract from a lot of archived or zipped format in the same command. 7z x {{ archived_file }}

ssh troubleshootings

Create a key pair for ssh RSA 4096 bits ssh-keygen -b 4096 ECDSA ssh-keygen -t ecdsa -b 521 ssh-keygen -t ed25519 Key format Note that the commands above issue OpenSSH Format (starts with -----BEGIN OPENSSH PRIVATE KEY-----). Some SSH client can’t read this format, and in that case, append -m PEM option. ssh-keygen -t rsa -b 4096 -m PEM Create only a RSA private key and out the public key openssl genpkey -algorithm RSA -out .

GitLab on Docker

Install GitLab running on Docker Here is the official document. I followed it. Caution: I’m using my GitLab on VM, not Docker image. Because the official image doesn’t contain e-mail client, and it is a little bit hard to understand. For me, deploying it on premise or VM is easy. Install docker apt install -y docker.io Set path export GITLAB_HOME=/srv/gitlab Configurations and repositories would be stored in this path. Run a container sudo docker run --detach \ --hostname {{ your_hostname }} \ --publish 443:443 --publish 80:80 --publish 2222:22 \ --name gitlab \ --restart always \ --volume $GITLAB_HOME/config:/etc/gitlab \ --volume $GITLAB_HOME/logs:/var/log/gitlab \ --volume $GITLAB_HOME/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest I changed git port to 2222 because the server should be access by ssh.

SolrCloud - set up

Install Solr Install environment Ubuntu 20.04 Pre-installation Linux settings Create an user solr. sudo useradd -r -s /bin/bash solr Change several kernel parameters in /etc/security/limits.conf. solr hard nofile 65535 solr soft nofile 65535 solr hard nproc 65535 solr soft nproc 65535 Turn off swaps. sudo swapoff -a Relogin so that the change will takes a place. Install Java Install Java. sudo apt install -y openjdk-11-jdk Install ZooKeeper Install Apache ZooKeeper.

Setting up Apache ZooKeeper cluster

What is ZooKeeper (very rough) Apache ZooKeeper storage hierarchal structure. Refer to ZNode. https://de.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper Install ZooKeeper My environment Ubuntu 20.04 Pre-installation Install java first. sudo apt update sudo apt upgrade -y sudo apt install -y openjdk-11-jdk Crete ZooKeeper user. sudo useradd -r -s /bin/bash zk Install ZooKeeper on nodes Download link https://zookeeper.apache.org/releases.html sudo su cd /opt curl https://mirror.netcologne.de/apache.org/zookeeper/zookeeper-3.6.2/apache-zookeeper-3.6.2-bin.tar.gz -O tar xvf apache-zookeeper-3.6.2-bin.tar.gz mkdir /var/lib/zookeeper cd apache-zookeeper-3.6.2-bin cp conf/zoo_sample.cfg conf/zoo.cfg Edit conf/zoo.