fedora中安装httpsqs

2015年3月04日 09:06

依赖包

  • libevent事件驱动
sudo yum install libevent  libevent-devel
 
  • tokyocabinet日本人开发的dbm数据库
sudo yum install tokyocabinet  tokyocabinet-devel
 
  • * zlib数据压缩的函数库, bzip2压缩工具
sudo yum install zlib zlib-devel bzip2-devel bzip2 bzip2-libs

安装

  • 下载
wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz
 
  • 编译安装
make
make install
 

Tags: httpsqs;队列
评论(31) 阅读(2597)

debian中vim显示中文出现乱码

2015年3月03日 10:23

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

 

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

Host '10.0.2.2' is not allowed to connect to this MariaDB server

2015年2月27日 16:01

Host '10.0.2.2' is not allowed to connect to this MariaDB server
mysql的root用户,默认只允许本地访问。当使用客户端连接远程mysql服务器,出现上面错误。只要在mysql.user表添加远程用户即可.
  • 进入mysql命令行界面
➜  ~  mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 5.5.41-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  • 执行下面insert
insert into mysql.user(Host,User,Password) values("%","root",password("root"));insert into mysql.user(Host,User,Password) values("%","root",password("root"));
 

评论(341) 阅读(19906)

内外网同时访问阿里rds数据库

2015年2月26日 16:42

阿里对它的rds数据库作了访问限制,内外网不能同时使用,并且切到外网访问,会收取流量费。每次更新数据库时,要先切到外网模式,再链接rds进行操作,太麻烦了. 怎么做可以让内网、外网同时访问? 想到了将rds的端口映射到ecs,再访问ecs,即可访问rds.
 
在ecs主机上,运行下面命令,将rds映射到外网
ssh -NfgT  -L 3306:rds地址:3306 用户名@localhost
 
更新完之后,再kill掉上面命令.
 

Tags: rds
评论(221) 阅读(7912)

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
评论(36) 阅读(4269)

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) 阅读(3156)

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
评论(55) 阅读(3953)

$('a').click()无法触发页面跳转

2015年2月14日 22:55

描述

在用$("a").click()方法, 触发a元素点击事件,进行页面跳转效果. 结果发现页面未发生跳转.

示例

<html>
<meta charset='utf-8'>
<body>
<button id="btn">按钮</button>
<a href="http://www.baidu.com" target="_blank" id="link">链接</a>
</body>
<script src="/jquery1.91.js" type="text/javascript"></script>
<script>
$(function(){
    $("#btn").click(function(e){
        //触发点击事件
        $("a").click();
    });
</script>
</html>

解决方法

  • 第一种: 用原生的a对象触发事件
$("a")[0].click();
  • 第二种: 通过事件冒泡触发事件
<a href="http://www.baidu.com" target="_blank" id="link"><span id="link">链接</span></a>

$(function(){
    $("#btn").click(function(e){
        //触发点击事件
        $("#link").click();
    });
</script>
 

Tags: jquery
评论(133) 阅读(21253)

git免密码(https方式)

2015年2月14日 17:33

    使用git push提交时,每次都要输入密码,次数多了,感觉挺麻烦. 如果git以ssh协议通讯,免密码可以用ssh公钥设置免登录。如果git时以https方式访问呢,该怎么办?下面方式可以解决这个问题.

 
* 新建文件并保存密码
touch ~/.git-credentials
vim ~/.git-credentials
添加内容
https://{username}:{passwd}@github.com
 
* 添加git配置
 
执行下面命令添加配置
git config --global credential.helper store
 
* 查看~/.gitconfig文件变化
 
~/.gitconfig文件多出下面配置项
[credential]
    helper = store
 
再尝试git push不再需要输入密码.
 

评论(953) 阅读(47337)

《若要佛法兴唯有僧赞僧》

2015年1月14日 13:50

    改善命运的方法中,有一个很重要的秘诀,就是改善人际关系,如何改善人际关系,方法很简单,就是“礼敬赞叹”,祖师大德有一句话:“若要佛法兴,唯有僧赞僧”,所以,僧赞僧时佛法兴,人赞人时事业旺!“赞叹”是改善命运的秘诀。此书汇集了当今高僧净空老法师与各宗派大德高僧的互相赞叹,读完此书,你就会明白,为什么净空老法师能把原来贫穷短命的命运转变为富有、长寿、令全世界尊敬的命运,原因之一就是“赞叹”!得此秘诀,您的命运亦将从此改变。

http://pan.baidu.com/s/1ntICwLb

评论(208) 阅读(20052)