@shellex说: 对对,他们上辈子都是折翼的新奥尔良鸡翅

Pages

Topics

随便看看

路边社评论员

  • Keith:
    还能用不. »
  • deepblue:
    测试一下浏览器和系统 »
  • abettor:
    “就和CPU特权级别一样”——这的哥难道是Linus的表弟?! »
  • 董英男:
    为什么总提示确认是相册首页呢 到底哪个才是相册首页啊 »
  • kendisk:
    作为一个轻度Linuxer,刚分手后,感觉木有鸭梨。 »
  • MS IE:
    THIS SITE REALLY SUCK! »
  • Alex:
    gnome-women... »
  • liangsuilong:
    GNOME 自己也有鼓励女性参与项目的计划啊.. »
  • infinte:
    对不起,你的“解ban”版本算得有点问题,可以下(9)pp4 测试。ACID3可有95分啊……另外同... »
  • Alex:
    »
  • Randee Saadat:
    Glad you solved your problem, but what is your que... »
  • LinuxRock:
    没想到你也有一台和我一样的破机子......还好现在高三没怎么用,受不了它的发热量.. »

今天挖掘到两个趁手的语句

via: Python-cn

很帅。

1. 和朋友共享局域网内的文件:

python -mSimpleHTTPServer

记得以前还煞费苦心想自己用SocketServer写一个…完全没有必要.

2. 快速发送邮件以及附件

稍微配置一下mutt,然后写一个小脚本叫sendfile,内容如下

#!/bin/bash
if [ $# -lt 2 ]
then
    echo "usage:"
    echo "      $0 [Email Addr] [Content] "
    exit
fi

files=""
if [ $# -gt 2 ]
then
    count=0
    for param in $@
    do
        if [ $count -ge 2 ]
        then
            files="$files -a $param"
        fi
        count=$[ $count + 1 ]
    done
fi
echo "$2" | mutt -s "Hi, Here is a MSG from Shellex :) " $files $1

这样我只需要打一个命令就OK了。

~/sendfile target@xx.com Hi appendix

这样,主题为”Hi, Here is a MSG from Shellex :) ”,内容为”Hi”,附件为appendix的邮件就发到target@xx.com去咯~

Leave a Reply