This blog moved to medium->https://medium.com/@cocoamaemae

Saturday, September 3, 2016

Hot install vim plug-ins by using dein

# After dein install is done, set dein to .vimrc. 
Regarding dein install, refer the blow.
https://cocoamaemae-tec-diary.blogspot.jp/2018/01/how-to-install-dein-for-vim-plugin.html

OS: Linux(Debian, Ubuntu, RHEL, CentOS or etc)

# Add the blow sample to $HOME/.vimrc



dein configuration sample
# Please attach the blow to $HOME/.vimrc

" dein setting
if &compatible
set nocompatible
endif
set runtimepath+=~/.dein/repos/github.com/Shougo/dein.vim

call dein#begin('~/.vim')

" Write plug-ins you want to install
call dein#add('~/.dein/repos/github.com/Shougo')
call dein#add('tpope/vim-fugitive')
call dein#add('vim-scripts/vim-auto-save')
call dein#add('vim-scripts/grep.vim')
call dein#end()

" You can add more plug-ins
call dein#save_state()

filetype plugin indent on
syntax enable

" auto save
let g:auto_save = 1



# After .vimrc is set, execute dein install on vim command mode.
:call dein#install()




Wednesday, August 24, 2016

How to confirm MySQL or MariaDB slave status

When you want to check MySQL or MariaDB slave status, run the below command

[linux ~]$ show slave status\G;
************ 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: ***
                  Master_User: ***
                  Master_Port: ****
                Connect_Retry: 60
              Master_Log_File: sm-bin.*****
          Read_Master_Log_Pos: *****
               Relay_Log_File: db104-relay-bin.****
                Relay_Log_Pos: 287813229
        Relay_Master_Log_File: sm-bin.****
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: ******
              Relay_Log_Space: ******
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: ******
               Master_SSL_Crl:
           Master_SSL_Crlpath:
**************abbreviation**************

If you want to whether slave works well or not, check these status.
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
Also, there is no error displayed on slave status, slave is no problem to work..

Regarding the meanings of respective parameters, refer the official documents
https://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html
https://mariadb.com/kb/en/library/show-slave-status/



Tuesday, August 9, 2016

How to use ssh-keygen

Brief
Surmise about ssh-keygen

What is ssh-keygen?
create ssh key pairs, a secret key and a public key

Environment 
CentOS

Basic Syntax
ssh-keygen <options>

e.g.
# create a secret key and a public key
# The keys are created in the folder of /root/.ssh/ at the default
ssh-keygen -t 'algorithm name' -m 'comment'

# create a public key from a secret key
ssh-keygen -yf ${private_key_file} > ${public_key_file}

Tuesday, July 26, 2016

Linux file permission

Brief
Surmise about Linux file permission

If you run 'ls -alt', and then the file permission is displayed.
ls -alt
drwxr-xr-x 2 root root 6 Jul 24 14:03 tmp


The status from left means
# File type. d means a direcory.
d

# a file mode of a file owner
rwx

# a file mode of a file group
r-x

# a file mode of another group users
r-x

# the number of link to files
2

# a owner name of a file or a directory
root

# a group name of a file or a directory
root

# used bytes
6

# last updated date
Jul 24 14:03

# a file name or a directory name
tmp

The meanings of r and w and x is like the below.
r: enable to refer
w: enable to change
x: enable to execute

r and w and x are allocated numbers.
r=4
w=2
x=1



Tuesday, June 21, 2016

How to do ssh login by root on Linux

Brief

It can't be done ssh login by root on Linux default configuration.
The below is the solution.

Environment

CentOS[6-7]

Procedure

1. Put id_rsa under /root/.ssh/ on a client side and authorized_key under /root/.ssh/ on a server side

2. Comment the below portion on /etc/ssh/sshd_config
#PermitRootLogin no

3. Add the below on /etc/ssh/sshd_config
PermitRootLogin without-password

4. Restart sshd
(CentOS7)
sudo systemctl restart sshd

(CentOS6)
sudo service restart sshd

Wednesday, May 18, 2016

How to create or remove symbolic link

What's symbolic link?
Symbolic link is a special kind of link that points to another file.
After created, a link target file is replaced as source file.

How to create symbolic link
ln -s <source file name> <link target file name>

e.g.
$ ln -s /usr/local/bin/ruby /usr/bin/ruby

$ ls -alt /usr/bin/ruby
/usr/bin/ruby -> /usr/local/bin/ruby

How to remove symbolic link

use unlink or rm

e.g.
unlink /usr/bin/ruby
rm /usr/bin/ruby

Monday, May 16, 2016

How to use telnet

What's telnet?
A simple CUI telnet client. 
Telnet itself is the abbreviation of "telecommunication network". 
It means a protocol originally.

Basic syntax
telnet <a IP address or a host name> <a port number> 

e.g.

# Connect to 189.0.0.3 by port 30
telnet 189.0.0.3 80
Trying 189.0.0.3...
Connected to 189.0.0.3.
Escape character is '^]'.

# After the connection is successful,  you can exit by running Ctrl + ] and Ctrl + d.

Front End Development Tools

TaskRunner Tool executing multiple tasks by only one execution. Tasks are like CSS preprocessor, Transpire, Module Bundler, etc... e.g. ...