Skip to the content.

乱炖

1)使用 rsync 同步的时候,指定 ssh 的端口

ssh -p PORT

rsync -avzP -e 'ssh -p PORT' source_path user@ip:dest_path

2)JavaScript 时间处理的函数

/**
* 字符串转时间(`yyyy-MM-dd HH:mm:ss` | `yyyy-MM-dd`)
* 暂时只满足以上两种格式
*/
String.prototype.rogerStringToDate=function(){
    t = this.split(/[-\ :]/);
    t[1]--;
    return new Date(...t);
};

3)看数据库版本

select * from v$version;

4)pgsql 字符串操作

--把字段outer_code以.0结尾的 替换成字符串 达到去除.0的效果
update product_product set outer_code = replace(outer_code,'.0','') where outer_code like '%.0'

5)linux修改dns配置

vim /etc/resolv.conf

####添加#####

nameserver 114.114.114.114