[HOW TO] install erlang, elixir on CentOS 6

Roughly 30 minutes ago I installed Erlang & Elixir into our server. It doesn't matter for everyone but until when everyone need help lolz.

So I write down the shortly instruction below. 

I. What is erlang & elixir? 
Please google to know it.

II. How to install?
Please ensure wget already installed on your server. The next commands retrieve a package that adds a new repository to CentOS's repository.
[@ ~]# wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
[@ ~]## rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
[@ ~]# yum search erlang
[@ ~]# yum install -y erlang.x86_64 
[@ ~]# erl --versionErlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]Eshell V9.0  (abort with ^G)1> 
Well done, you have already installed erlang.

Next you need to download elixir. In this article, I use elixir 1.4.2 and you can download at here . Also you can download from elixir github officially follows:

If you download source code elixir, you don't have to compile. If you download binary on github, you have to install as below:
[@ ~]# git clone https://github.com/elixir-lang/elixir.git
[@ ~]# make clean test
Now, you have to add Elixir's bin path to your PATH environment variable. Otherwise, Elixir will not work. To do so, you open .bash_profile
[teamcity@s04 ~]$ vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
export ELIXIR_HOME=/opt/elixir
export PATH=$PATH:$ELIXIR_HOME/bin
To verify Elixir is work or not, run:
[teamcity@s04 ~]$ iex
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.4.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 
If you see as above, elixir works. Cheer!

III. If you want to install the specify elixir version
You have to go elixir's github , and then you download the specify version of elixir. Next, you need to extract the elixir compression file.

After that, you go to elixir directory & combine as below
cd otp
./otp_build autoconf
./configure
make
make install


Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] set umask for user has /sbin/nologin environment

Come back to the last week, I worked on case "change umask for SFTP/ SSH user"

At that time, I simply thought that it is umask. So I added umask to ~/.bashrc and ~/.bash_profile.

But nothing to change. It means that I need think logically.

User login -> ssh -> pam.d/ssh -> /etc/profile (~/.bash_profile)

Why? 
A few second I see that user's ssh/ sftp has shell environment is /sbin/nologin. So it is not affected by ~/.bash_profile, also /etc/profile

And then I need to add "umask" on "ssh" step of flowchart:
User login -> ssh -> pam.d/ssh -> /etc/profile (~/.bash_profile)

I go to /etc/ssh/sshd_config
# override default of no subsystems#Subsystem      sftp    /usr/libexec/openssh/sftp-serverSubsystem       sftp internal-sftpGatewayPorts no

add "-u 0022" umask as below
# override default of no subsystems
#Subsystem      sftp    /usr/libexec/openssh/sftp-server
Subsystem       sftp internal-sftp -u 0022
GatewayPorts no

After that, I re-login & create a file and I see that umask' file is 0022.
That's cool!

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] check slot RAM information on Linux Operating System

One day you need to increase memory for physical server at Data-center. But you can't shutdown it to check the available slot. What's up next?

Luckily if you are using Linux Operating System. Because Linux has dmidecode to check hardware information.

I will tell you about dmidecode. In general you need to deeply understand what are you doing. I learned this mythology by my close friend.

dmidecode  is a tool for dumping a computer’s DMI (some say SMBIOS) table con-tents in a human-readable format. This table contains  a  description of the system’s  hardware  components,  as well as other useful pieces of information such as serial numbers and BIOS  revision.  Thanks  to  this  table, you  can retrieve  this  information  without  having to probe for the actual hardware. While this is a good point in terms of report speed and  safeness,  this  also makes the presented information possibly unreliable.

Are you know it? ok, let's check.

1. 
#dmidecode
it shows all of mainboard information.

2. 
#dmidecode -t memory
it shows only memory information, both slot available, memory type.

Ok, you get enough.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success