Monday, January 30, 2012

Filezilla 3.5.3 连接VsFTPd TLS问题

Response arg: error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher

/etc/vsftpd/vsftpd.conf
ssl_ciphers=HIGH

原因是
The default is DES-CBC3-SHA which seems that is not supported anymore by FileZilla

Wednesday, January 18, 2012

MySQL regex_replace Function

[cc lang='mysql' ]
DELIMITER $$
CREATE FUNCTION `regex_replace`(pattern VARCHAR(1000),replacement VARCHAR(1000),original VARCHAR(1000))

RETURNS VARCHAR(1000)
DETERMINISTIC
BEGIN
DECLARE temp VARCHAR(1000);
DECLARE ch VARCHAR(1);
DECLARE i INT;
SET i = 1;
SET temp = '';
IF original REGEXP pattern THEN
loop_label: LOOP
IF i>CHAR_LENGTH(original) THEN
LEAVE loop_label;
END IF;
SET ch = SUBSTRING(original,i,1);
IF NOT ch REGEXP pattern THEN
SET temp = CONCAT(temp,ch);
ELSE
SET temp = CONCAT(temp,replacement);
END IF;
SET i=i+1;
END LOOP;
ELSE
SET temp = original;
END IF;
RETURN temp;
END$$
DELIMITER ;

[/cc]

Friday, January 6, 2012

FreeBSD PF 防火墙简单配置

oif="em0"
block in
pass out
pass in on $oif proto tcp to ($oif) port = 5631
pass in on $oif proto tcp from 192.168.0.0/24 to ($oif) port = 3128
pass in on $oif proto tcp to ($oif) port = 80

Tuesday, December 27, 2011

Gentoo emerge 更新系统方法


  1. 更新Portage树
    [cc lang='text' line_numbers='false']# emerge --sync[/cc]

  2. 更新系统
    [cc lang='text' line_numbers='false']# emerge --update --deep --newuse world[/cc]

  3. 移除依赖包
    [cc lang='text' line_numbers='false']# emerge --depclean
    # revdep-rebuild[/cc]


Tuesday, December 20, 2011

小心重庆美联英语的注册金骗局

上周末去重庆观音桥的美联英语咨询情况,结果被里面的要求交什么注册金,300元(因为我只带了300元)。但我第二天回来在Google、百度上搜索他们情况后发现并不是我理想中的那样。当我提到退款时,就说不能退的啦。我立马打12315电话。我说明情况之后,重庆12315的工作人员,只问了一句“他是培训机构吗?”。我说“是”。“那你打教委的电话”,“请问教委的电话是多少呢?”。“你自己打114查询啊”。

……

天啊,这也叫便民?难道真把我们当便民了?当然我没有打教委的电话,说实话,我是第一次打12315在我心中一直是能够为消费者办事的电话,结果呢?我已经对这些所谓的“服务”失去信心了。以后还是小心点算了吧。

让我们来看看一些有趣的东西吧:

更多相关信息请看留言。

Friday, December 16, 2011

NFS quick howto for centos 5

NFS quick howto for centos 5


To use nfs successfully, you have to configure the server and the client. In this example, the client is 192.168.0.3 and the server is 192.168.0.1. The folder to be shared is /home/sharing, and to be mounted to /mnt on the client

On the server

  1. Make directory that you want to use.


    • # mkdir /home/sharing


  2. Edit /etc/exports, insert the client machine's ip


    • # vi /etc/exports


      • Add this line:




        • /home/sharing 192.168.0.3/255.255.255.255(rw,sync)


      • Save



  3. Edit /etc/hosts.allow


    • # vi /etc/hosts.allow


      • Add this line:


        • portmap: 192.168.0.0/255.255.255.0


      • Save



  4. Start nfs and portmap


    • # /etc/init.d /nfs start

    • # /etc/init.d/portmap start



On the client


  1. Start portmap


    • # /etc/init.d/portmap start


  2. Mount the nfs folder


    • # mount 192.168.0.1:/home/sharing /mnt


  3. Check /var/log/messages for any error that might occur


    • # tailf /var/log/messages


  4. Use mount to check if the folder is mounted properly


    • # mount 


      • This should be the output:


        • 192.168.0.1:/home/sharing on /mnt type nfs (rw,addr=192.168.0.1)




  5. Edit /etc/fstab to mount the shared folder on boot


    • # vi /etc/fstab


      • Add this line


        • 192.168.0.1:/mnt/sdb1/backup /mnt nfs rw,hard,intr 0 0


      • Save




You can use 'man exports' to see the options available for /etc/exports