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

Tuesday, December 19, 2017

Wednesday, December 6, 2017

Linux environment variables

$PATH
the path referred by shell

$SHELL
shell name

$USER
login name

$PWD
current directory

$HOSTNAME, $HOST
machine host name

$TERM
terminal name

$MACHTYPE
machine name

$PS1
prompt display format

Thursday, October 19, 2017

How to use nkf

What's nkf?
The tool to estimate a character code or to exchange a character code.

Basic syntax
nkf <options> <file name>


options




Wednesday, October 11, 2017

The difference of .bash_profile, .bashrc

Brief

Detail about .bash_profile and .bashrc on CentOS


The differences of .bashrc and .bash_profile

When login to Linux, both $HOME/.bash_profile and $HOME/.bashrc are executed.

When a shell is run, an only .bahsrc is executed.

So if you want to run only when login, write the process to $HOME/.bash_profile
If you want to run every time bash is run, write the process to $HOME/.bashrc

Friday, September 8, 2017

Memory segment

Brief
Summarize memory segment

Basic memory segment
Nevertheless any languages, basic memory segment is like the below.

The roles of respective segments are like the below.

Stack segment
Contains stack. Stack is basically used for function calling. Nested functions are put in stack.

Heap segment
Contains heap. Heap is used for dynamic data which is not put in stack.

BSS segment
Contains uninitialized variables including static.
e.g.
int a;
static int a;

Data segment
Contains variables which have a pre-defined variables.
e.g.
int a = 8;
static int a = 8;
char String[] = "hoge";

Text segment
Contains mechanical languages. Data in this segment is always read only.




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

Front End Development Tools

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