spf13无法输入中文

2015年6月29日 10:14

为gvim安装spf13后,发现无法输入中文,原因是ibus的下拉提示与spf13的下拉提示冲突。最理想的解决办法是spf13下拉提示能够判断输入法状态,处在英文状态用spf13的下拉提示,处在中文状态用ibus下拉提示.
但是不可行。下面是我选择使用fcitx输入法解决这个问题.
  • 安装
sudo yum install fcitx*
sudo yum install im-chooser
  • 设置快捷键
fcitx-configtoool
  • gsettings配置
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
  • 开机设置  
在im-chooser中选择使用fcitx
im-chooser
 

Tags: spf13
评论(41) 阅读(2352)

fedora21防火墙图形界面

2015年5月21日 17:49

fedora21默认未安装firewall的图形界面,需要自己安装
sudo yum install firewall-config
启动
sudo firewall-config

 

评论(2) 阅读(3299)

在fedora21中运行VMware Tools进入死循环

2015年5月21日 15:28

在vmware中安装fedora21,然后安装VMware Tools,执行命令之后,一路回车,结果在下面不断循环
The path "/bin/gcc" appears to be a valid path to the gcc binary.
Would you like to change it? [no] 
Searching for a valid kernel header path...
The path "" is not a valid path to the 3.19.7-200.fc21.x86_64 kernel headers.
Would you like to change it? [yes] 
 
猜测是缺少了dev包,执行下面命令后,就好了
sudo yum install kernel-devel
 

评论(0) 阅读(1734)

shell中怎么注释多行

2015年5月08日 16:27

shell本身没有多行注释,有什么办法达到多行注释效果?
  • 语法
:<<标记

...代码

标记
冒号":"表示什么也不做,即空命令
重定向"<<"是Here Document
表示把文档内容重定向到空命令
  • 示例
:<<EOF
echo "hello world"
...
EOF
再如
:<<BLOCK
echo "hello world"
....
BLOCK
 

Tags: shell
评论(0) 阅读(2333)

ifstat查看网速

2015年3月17日 14:39

安装

sudo yum install ifstat

debian示例

root@DEV-server:~# ifstat
       eth0       
 KB/s in  KB/s out
   73.53     66.34
    1.14      0.99
   89.65     22.87
    5.62      2.62
    1.79      1.15
    2.22      1.46
   62.26     62.24

fedora示例

➜  ~  ifstat
#kernel
Interface        RX Pkts/Rate    TX Pkts/Rate    RX Data/Rate    TX Data/Rate  
                 RX Errs/Drop    TX Errs/Drop    RX Over/Rate    TX Coll/Rate  
lo                     0 0             0 0             0 0             0 0      
                       0 0             0 0             0 0             0 0      
p2p1                   0 0             1 0             0 0            62 0      
                       0 0             0 0             0 0             0 0
  • RX Pkts/Rate  数据包接收流量
  • RX Errs/Drop  丢包
  • TX Pkts/Rate  数据包发送流量
  • RX Data/Rate 数据接收流量
  • TX Data/Rate 数据发送流量
  • lo与p2p1表示两个网卡
 

评论(0) 阅读(3885)

debian7.5设置开机启动(insserv)

2015年3月06日 16:55

  • 示例脚本
在/etc/init.d目录下新建脚本hello.sh
#!/bin/bash
#
### BEGIN INIT INFO
# Provides:          hello
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Should-Start:      $network $time
# Should-Stop:       $network $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Description:       hello world
### END INIT INFO
#

echo "hello world" > /home/wyq/a.log
  • 以update-rc.d命令添加开机启动
wyq@localhost:/etc/init.d$ sudo update-rc.d hello defaults 90
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/hello
在debian7系统中,会出现上面错误,需要该用insserv命令
  • 以insserv命令添加开机启动
wyq@localhost:/etc/init.d$ sudo insserv /etc/init.d/hello.sh
insserv: warning: script 'hello.sh' missing LSB tags and overrides
如果脚本没有添加metadata信息,会出现上面错误.
  • insserv用法
insserv myserver #添加服务
insserv -r myserver #删除服务
insserv -d myserver #使用默认的runlevels
 

评论(224) 阅读(9753)

debian中vim显示中文出现乱码

2015年3月03日 10:23

在/etc/vim/vimrc中添加配置
set termencoding=utf-8
set encoding=utf-8

 

Tags: debian;vim
评论(2) 阅读(2194)

debian创建用户没有宿主目录

2015年2月26日 15:23

在debian系统中,以useradd创建用户,默认不会创建密码和宿主目录. debian建议用adduser创建用户,它会提示创建初始密码和目录.
root@xxxx:/home# adduser wyq
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "zh_CN.UTF-8",
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Adding user `pkadmin' ...
Adding new group `wyq' (1003) ...
Adding new user `wyq' (1002) with group `wyq' ...
Creating home directory `/home/wyq' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for wyq
Enter the new value, or press ENTER for the default
Full Name []:       
Room Number []: 
Work Phone []: 
Home Phone []: 
Other []: 
Is the information correct? [Y/n] y
 

Tags: debian
评论(70) 阅读(4526)

chkconfig用法

2015年2月24日 21:46

chkconfig是一种简单的命令行工具,用于帮助管理员对/etc/rc[0-6].d目录层次下的众多的符号链接进行直接操作。

语法

chkconfig --list [name]
chkconfig --add name
chkconfig --del name
chkconfig [--level levels] name <on|off|reset>
chkconfig [--level levels] name
 
--list 显示系统服务的运行状态(on或off)  
--add  增加系统服务  
--del  删除系统服务  
--level 指定系统服务在哪个执行等级中开启或关闭  
      等级0表示:表示关机  
      等级1表示:单用户模式  
      等级2表示:无网络连接的多用户命令行模式  
      等级3表示:有网络连接的多用户命令行模式  
      等级4表示:不可用  
      等级5表示:带图形界面的多用户模式  
      等级6表示:重新启动  

基本用法

  • 查询当前所有自动启动的服务
chkconfig --list 
chkconfig --list [name] //查询特定服务
  • 开机启动开启/关闭
chkconfig httpd on/off
  • 指定服务运行等级
chkconfig --level 35 httpd on/off
设定httpd在等级3和5为开机运行服务.
  • 新增服务
chkconfig --add httpd
加入到chkconfig列表
  • 删除服务
chkconfig --del httpd
从chkconfig列表移除服务
 

评论(37) 阅读(3256)

chkconfig配置开机启动

2015年2月24日 21:30

  • 新建脚本
touch /etc/init.d/echo_msg
  • 添加内容
#!/bin/zsh
#chkconfig:2345 61 61
#description:runing echo
echo "I am runing"  > /home/wyq/start.txt
前三行是chkconfig的格式,不可以省略,否则会出现"服务echo_msg,chkconfig不支持".
  • 赋予执行权限
chmod a+x echo_msg
  • 加入chkconfig列表
chkconfig --add echo_msg
  • 设置开机启动
chkconfig echo_msg on
重启系统之后, 在/home/wyq目录下发现start.txt文件,表示启动成功.
 

Tags: chkconfig
评论(59) 阅读(4112)