Pasts

Ansible playbook configuration for MySQL8 (how to change root password etc.)

Ansible playbook configuration for MySQL8 (how to change root password etc.)

MySQL major version 8 was released on April 2018. I introduce how to write MySQL 8 ansible playbook. Motivation I usually use AWS. AWS has a database managed service called RDS, and RDS supports MySQL 5.x series. To conduct in-house training using MySQL 8, I needed to make AMI of MySQL 8 with ansible. Environment CentOS 7 Ansible 2.6.1 Packer 1.1.3 Configuration sample of ansible playbook In this case, I describe only the main task definition part in Ansible, I omit Packer configuration because it becomes redundant.
Install Docker to Amazon Linux2

Install Docker to Amazon Linux2

Migration of Amazon Linux to Amazon Linux 2 causes yum install docker command doesn’t work in Amazon Linux 2, so I investigate how to install docker. Motivation Install Docker to Amazon Linux2 without error My Packer build job stopped with error after AWS announced Amazon Linux 2 LTS Candidate in June 2018, because I migrated my server os Amazon Linux to Amazon Linux2. Fail to execute yum install docker and yum search docker command because yum repository has been changed.

Change Soft/Hard limits and file descriptor limits on Amazon Linux 2(systemd)

Motivation When I migrate Amazon Linux to Amazon Linux2, I investigate how to change file descriptor limits and number of process per user on Linux server working with systemd. This post is technical memo for myself. I try the following procedure after booting the official Amazon Linux 2 AMI as it is. Soft limits and Hard limits Let me review what Soft limits and Hard limits are. Linux limits the number of process per user.

Change system clock on Amazon Linux2(systemd)

Motivation When I migrate Amazon Linux to Amazon Linux2, I investigate how to change system clock on Linux server working with systemd. This post is technical memo for myself. Change system clock System clock is calculated by /etc/adjtime that uses hardware clock. If OS working with systemd dosen’t have /etc/adjtime, UTC is default. cat /etc/adjtime > 0.0 0 0.0 > 0 > UTC Now check the system clock with timedatectl command.
Google Colaboratory is the best tool for machine learning engineer

Google Colaboratory is the best tool for machine learning engineer

For engineer who use Jupyter Notebook in often, web IDE named Colaboratory is the best tool. Try Colaboratory. What is Colaboratory? Colaboratory is a web IDE based on Jupyter notebook and hosted by Google. Not only editor, but also runtime is provided by Google, users don’t need to create the environment for development. Everyone can use Colaboratory without Google account, however, links the account, users earn lots of advantages. The good points of Colaboratory Free of charges About usage fee is written in the FAQ.
Convert a string representing the date or epoch time to datetime and change timezone in Python

Convert a string representing the date or epoch time to datetime and change timezone in Python

Motivation Because I always google the way to convert a string representing the date to datetime and change timezone on the Internet, this is note to self article. There are three types to process date and time in Python. datetime, date, and time. I mainly use datetime in this article. Environment python 3.6 pytz jupyter notebook Convert epoch time to datetime Now convert numeric data types of eopch time to datetime.
Add partitions periodically in AWS RDS Aurora Cluster (MySQL compatible) with the SQL Procedures

Add partitions periodically in AWS RDS Aurora Cluster (MySQL compatible) with the SQL Procedures

Introduction RDS Aurora is a managed service provided by AWS. Aurora is a OSS compatible relational database built on cloud. In this article, I explain table partitioning with date in RDS Aurora MySQL compatible. Goals Create table partitioned by date on RDS Aurora (MySQL compatible) Add a partition for a day periodically (once a day) Drop records after a certain period of time Handle errors in these operation running As an example, I handle the following hoge table.
It's better to use DNS verification for verification of SSL certificate issued by AWS Certification Manager

It's better to use DNS verification for verification of SSL certificate issued by AWS Certification Manager

Domain verification with Route 53 in Certification Manager became available In November 2017, Domain validation by DNS records of Route 53 was supported as a verification method when AWS Certification Manager(ACM) SSL certificate was acquired. This update has a very great advantage not only for acquiring SSL certificates but also for updating SSL certificates. Changes in issuing SSL certificates Validation by email is troublesome Conventionally, in order to verify the domain of SSL certificate at ACM, we click on the link in the body of the received email, and push the approval button in the web page.
Setting to avoid python and anaconda conflict using pyenv and pyenv-virtualenv

Setting to avoid python and anaconda conflict using pyenv and pyenv-virtualenv

Introduction I have been using pyenv only to switch versions of python in local environments. However, recently I use anaconda more often. Since python and anaconda conflict when executing activate command, I decided to use pyenv-virtualenv. Goals Switch python version in one machine Switch the python distribution (anaconda in this case) Resolve conflict between anaconda and pyenv when I execute activate command Activate anaconda without executing the command with full path Both 1 and 2 above are able to solved with pyenv and 3 with pyenv-virtualent.
Start mysql docker container with docker-compose

Start mysql docker container with docker-compose

In the previous article, I can start mysql docker container by using the docker run command after executing docker build. Personally, I like the lesser option of cli, so this time I’d like to start docker-compose a bit easier to start up. Install docker-compose Let’s install docker-toolbox from the following site. Docker-compose is also included in the download. https://docs.docker.com/toolbox/ Docker-compose provides functions to easily manage multiple containers. In this article, only mysql is started with a container, but since setting up system components and controlling the order of activation can only be described in yaml file, it is highly readable and easy to manage even with VCS.