2015年5月29日星期五

How to install Julia language in Linux/CentOS

I installed Julia in my minimal CentOS 7.

First, make sure you have already installed these packages:
yum install -y gcc
yum install -y gcc-c++
yum install -y gcc-gfortran
yum install -y git
yum install -y patch
yum install -y bzip2
yum install -y m4

Then,
git clone -b release-0.3 git://github.com/JuliaLang/julia.git
cd julia
make
ln -s usr/bin/julia /usr/local/bin/julia

Enjoy!

More information: Julia in Github

2015年5月21日星期四

Things need to do after minimal CentOS 7 installation. Cent OS 7最小化安装之后要做的几件事.

English version:

Before doing this, you need to know something about vi and vim first.

1. Connect to the network.
vi /etc/sysconfig/network-scripts/ifcfg-enoxxxxxxxx
Change the item ONBOOT=yes, then save and reboot.
Attention, we choose NAT network connection here. If you choose Bridge, you need to configure the IP address and others manually. Later I will talk about this.

2. Install ifconfig command
yum search ifconfig, to find the package related to ifconfig which is net-tools.
yum install net-tools

3. Install vim
yum search vim, to find that the package we need to install is vim-X11 and vim-enhanced.
We can just use this command to install all the vim packages:
yum install -y vim*

4. Disable the alarm bell
4.1 The alarm in command line
vim /etc/inputrc
Delete the commont "#" before "set bell-style none", save and reboot.
4.2 The alarm in vi and vim
vim /etc/vimrc
Add "set vb t_vb = " at the end of file.

5. Connect to the Internet using Bridge
vim /etc/sysconfig/network-scripts/ifcfg-enoxxxxxxxx
Add or change the configuration below:
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.xxx
DNS=xxx.xxx.xxx.xxx
If you have multiple DNS addresses, you can write:
DNS1=xxx.xxx.xxx
DNS2=xxx.xxx.xxx
Save and then restart the network service:

systemctl restart network

Chinese version
在这之前,你要清楚vivim最基本的编辑命令。

1、连接网络
vi  /etc/sysconfig/network-scripts/ifcfg-enoxxxxxxxx
把最后一项的ONBOOT = yes,保存。
然后重启,注意,这里的网络连接方式选择为NAT,如果选择为Bridge模式,需要手动配置ip地址,后面会讲到如何配置。

2、安装ifconfig等相关命令
yum search ifconfig,找到需要安装的软件包是net-tools
yum install net-tools

3、安装vim
yum search vim,找到要安装的软件包,安装vim-X11vim-enhanced
用下面命令一步到位:
yum install –y vim*
vim是一个很强大的编辑器,可以给vim加上很多个性化的自定义功能及按键,同时有很多很强大的插件可以使用,有兴趣的可以了解一下vim的配置。

4、删除讨厌的警告音
4.1 Tab键总是有讨厌的警告音,修改以下文件:
vim /etc/inputrc
将第二行“#set bell-style none”前面的注释“#”去掉,保存,重启之后生效。
4.2 vivim中讨厌的警告音
vim /etc/vimrc
在文件最后添加配置“set vb t_vb =

5、修改系统时间
CentOS系统默认的系统时区是美国时区,我们把改成中国时区:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

6、使用Bridge模式上网,使得外网的电脑能ping通本机
vim  /etc/sysconfig/network-scripts/ifcfg-enoxxxxxxxx
改变或增加以下配置:
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx    #你需要设置的静态ip地址
NETMASK=xxx.xxx.xxx.xxx    # 子网掩码
GATEWAY=XXX.XXX.XXX.xxx    # 网关
DNS=XXX.XXX.XXX.XXX    # DNS地址
如果有多个DNS地址,可以写成:
DNS1=xxx.xxx.xxx.xxx
DNS2=xxx.xxx.xxx.xxx
保存。然后重启网络服务:
systemctl restart network

7、自己的电脑,为了省事,直接关闭了防火墙:
systemctl stop firewalld
关闭开机启动:systemctl disable firewalld

2015年5月20日星期三

How to install scs in matlab

My scs version: 1.1.0

First, add your scs/matlab folder to MATLAB search path, i.e. >> addpath xxx/scs-master/matlab;
Second, run make_scs.m file;
Last, rerun cvx_setup.m to add the scs solver into cvx.

One more thing, Xcode should be install first if you are using macbook.