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

Wednesday, June 14, 2017

How to refurbish tmux

Brief
Surmise how to refurbish tmux

Requirements
OS: CentOS, Ubuntu

How to refurbish

Create $HOME/.tmux.conf

The blow is a sample of .tmux.conf
https://gist.github.com/cocoa-maemae/5e00a4d696d69e7b410d133714771d5d


Debug

If $HOME/.tmux.conf is not reflected, kill a tmux process then run tmux again.

e.g.
# Look into a tmux process
ps aux | grep tmux
25718 ? Ss 1:37 tmux
18937 pts/8 S+ 0:00 grep tmux

# kill a tmux process
kill -9 25718




Tuesday, June 13, 2017

How to use tmux

What is tmux?
Multiple virtual console tools

How to install

(CentOS)
sudo yum install -y tmux
Basic Usage
# Create windows
Ctrl-b,c

# Move to a next window
Ctrl-b,n

# Move to a previous window
Ctrl-b,p

# Divide a pane
Ctrl-b,%

# Move a pane
Ctrl-b,o

Sunday, May 14, 2017

How to use gitmumerge, merge multiple git branches automatically


Brief

Explain about gitmumerge which is introduced in consideration about how to merge multiple git branches.


gitmumerge


It's just a wrapper of cui git client. It is possible to make executing multiple "git merge" automation. 'mu' means 'mutual'.
https://github.com/cocoa-dev-maemae/gitmumerge

Requirements

Currently, it can work only on bash. Whatever OS is ok. CUI git clinent is essential. Install before using.


(debian)
sudo apt-get install git
(redhat)
sudo yum install git



Install gitmumerge

clone with git and create path

git clone git@github.com:cocoamaemae/gitmumerge.git ~/.gitmumerge
echo 'export PATH="$HOME/.gitmumerge/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc


# confirm version
gitmumerge -v


How to use gitmumerge


At first, clone a git repository which you want to merge, and move to a clone directory.

(e.x.)
git clone <target repository paty>
cd <clone directory>

And then, gitmumerge chance.  Specify the final merge target branch after -d(--destination-branch) and specify the development branches after -c(--candidate-branches)

(exp)

gitmumerge -d master -c dev1 dev2 dev3

Executing the exp, master->dev1, dev1->master, master->dev2, dev2->master, master->dev3, dev3->master order merging is executed. Before merging is executed, [Y/n] is displayed. If the conflict occurs, exit forcibly.


"Merging branches has done" is the exit message. The merging is executed only on client side. So push the branch which is specified after -d(--destination-branch). The operation is manual currently.





Tuesday, May 9, 2017

Best practice when merging multiple git branches


It is general to create multiple branches and manage them parallel when we do the development by using git. Multiple branches should be merged to one branch after the development has done. Here, think about how to merge git multiple branches to one branch finally.

Basic merging way

For example, there would be multiple branches, dev1, dev2 and dev3, which are created from master branch. Have you ever merged them to master branch like Fig.1?

Fig.1


Very simple merging way, so a lot of developers might have merged branches like this. However, this way has a fault. There is a possibility to remove other's modifications.
In Fig.1, dev1 branch is merged at first. So dev2 branch merging may remove dev1 modification, or dev 3 branch merging may remove dev1 or dev2 modifications.

To avoid overwriting to other branch modifications

If you avoid overwriting to other branch modifications, doing like Fig.2 is correct.

Fig.2

















In this way, dev1 modifications are merged to dev2 branch before dev2 branch would be merged. dev1 and dev2 modifications are merged to dev3 branch before dev3 branch would be merged. There is no possibility to remove other modifications.

The rest issues

If we user Fig.2 way, we can avoid overwriting to other branch modifications However, the procedure will be complex. 
So I created gitmumerge which is created by ShellScript, to make Fig.2 procedure automation. It will be introduced in the another post.




Thursday, April 13, 2017

How to add an original yum repository


Add **.repo file under /etc/yum.repos.d/


e.g.
[new-repo] //a repository name
name=nae repository RPM packages // a repository explanation
baseurl=http://new.repository/repo/ // a repository url
gpgcheck=0 // Abbreviate a signature validation
enabled=1 // Abbreviate --enablerepo=***

notice:

Before yum install, "createrepo" execution is on a yum repository server side,

Tuesday, April 11, 2017

C Fundamental Data Types

Brief
Note of date types of C

Interger Types
Type Bits Range Format Specifiers
int, int32_t 4 byts From -2,147,483,647 to 2,147,483,647 %d
long int 4 bytes From -2,147,483,647 to 2,147,483,647 %li
short int 2 bytes From -32,767 to 32,767 %hi
long long int 8 bytes From -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807 %lli
long 4 bytes From -2,147,483,648 to 2,147,483,647 %li
short, int16_t 2 bytes From -32,767 to 32,767 %hi
char, uint8_t 1 byte From 0 to 255 %c
signed char, int8_t 1 byte From -128 to 127 %c

Floating Types
float 4 byte From 1.2E-38 to 3.4E+38 %g, %G
double 8 byte From 2.3E-308 to 1.7E+308 %lf, %LF
long double 10 byte From 3.4E-4932 to 1.1E+4932 %Lf, %LF

Front End Development Tools

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