您的位置:首页 > 其它

工作tips

2015-06-11 18:36 204 查看
linux:

1.设置定时任务:crontab -e

2.发送邮件:mail -s "test" user@sohu.com <content.txt 其中-s后面的是邮件标题,user@sohu.com是收件人地址,content.txt里面是邮件正文

3.发送带附件邮件:echo "this is content" | mutt -s "this is subject" -a /path/yourfileabc@local.domain -cbbb@local.domain

   s是主题

  -a是附件

  -c是抄送,多个抄送就是多个-c,
4.去文件中的^M

  :%s/\r//gc          (多个^M,提示时先a)

  同理:如果出现^V则用:%s/^V//gc替换

mysql:

1.查看表字段的所有信息:show full columns from  表名

2.新增用户:create user name IDENTIFIED by 'password';

3.授予读权限:grant select on database.* to name;

4.立即生效:flush privileges;

python

计算中文长度:len('哈哈'.decode('utf-8'))

过滤html标签:

re_h=re.compile('</?\w+[^>]*>')

s=re_h.sub('',htmlstr)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: