[Ubuntu] Networking service

Environment : Ubuntu 14.04

Problem :

  1. Failure to restart networking service
  2. Interface eth# not configured

Continue reading


[svn] svn works with proxy in ubuntu

Background : svn checkout project under ubuntu using proxy

With natif configuration of svn (which is installed by apt-get), svn checkout return an error :

svn co --username your_username https://your_svn_url/
svn: OPTIONS of 'your_svn_url': Could not resolve hostname ... : Host not found

The solution is to add proxy to the defaut configuration of svn.

Edit : ~/.subversion/servers by adding :

http-proxy-host = your_proxy_host
http-proxy-port = your_proxy_port (3128 or 8080 etc)
http-proxy-username = your_proxy_username
http-proxy-password = your_proxy_password




[ubuntu] Change OpenJDK/OpenJRE to SunJDK/SunJRE

Here is very good article about how to change OpenJDK/OpenJRE to SunJDK/SunJRE

I list several commands for me :

Installing Sun Java on Newer versions of Ubuntu (10.04 an above)
Open the terminal and type the following:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update   
sudo apt-get upgrade   
sudo apt-get install oracle-java7-installer

That should install the Sun Java version on your system. To change to it simply do the following in case you have other java alternatives:

sudo update-java-alternatives -s java-7-oracle  

[Apache2] SSLSessionCache: ‘shmcb’ session cache not supported

Background :

$ lsb_release
Distributor ID : Ubuntu
Description : Ubuntu 14.04.1 LTS

Problem :

$ sudo service apache2 restart
 * Restarting web server apache2                       <wbr />                              <wbr />                              <wbr />   [fail] 
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 43 of /etc/apache2/mods-enabled/ssl.<wbr />conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).
Action 'configtest' failed.
The Apache error log may have more information.

Continue reading

[VIM] configure VIM with .vimrc in Ubuntu

In Ubuntu, to install VIM (if it is not installed by default)

sudo apt-get install vim

In my PC, there is no configuration file which is called .vimrc, what we have to do is just create it.

cd ~
vim .vimrc

The configuration (it will work automatically) :

set nocompatible        "不使用vi默认键盘布局   (Not use default keyboard configue)
set number              "显示行号 (Show line number)
set autoindent          "自动对齐 
set smartindent         "智能对齐
set showmatch           "括号匹配模式
set ruler               "显示状态行
set incsearch           "查询时非常方便,如要查找book单词,当输入到/b时,会自动找到   第一个b开头的单词,当输入到/bo时,会自动找到第一个bo开头的单词,依次类推,进行查找时,使用此设置会快速找到答案,当你找要匹配的单词时,别忘记回车.
set tabstop=4           "tab键为4个空格
set shiftwidth=4        "换行时行间交错使用4个空格
set softtabstop=4       "设置(软)制表符宽度为4
set cindent             "C语言格式对齐
set nobackup           	"不要备份文件
set clipboard+=unnamed  "与windows共享剪贴板