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