转:Linux下使用mail命令发送邮件

[转载声明] 转载时必须标注:本文来源于铁木箱子的博客http://www.mzone.cc [本文地址] 本文永久地址是:http://www.mzone.cc/article/317.html       因为需要经常备份网站的数据,所以了解并学习了下linux下如何通过shell来发送邮件,这里以CentOS为例,使用mail命令来进行外部邮件的发送。mail命令的语法如下: Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr … [-- sendmail-options ...] mail [-iInNv] -f [name] mail [-iInNv] [-u user] 使用mail命令发送邮件,有如下三种方式: 1、直接使用shell当编辑器 mail -s “Hello from mzone.cc by shell” admin@mzone.cc hello,this is the …

继续阅读 »

CentOS yum时出现”Could not retrieve mirrorlist”的解决办法

CentOS yum时出现“Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error ”错误:[root@server mysql-5.0.56]# yum install gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error was [Errno 4] IOError: Error: Cannot find a valid baseurl for repo: addons …

继续阅读 »

50个必备的实用jQuery代码段

本文会给你们展示50个jquery代码片段,这些代码能够给你的javascript项目提供帮助。其中的一些代码段是从jQuery1.4.2才开始支持的做法,另一些则是真正有用的函数或方法,他们能够帮助你又快又好地把事情完成。如果你发现你任何可以做得更好的地方的话,欢迎把你的版本粘贴在评论中! 1. 如何修改jQuery默认编码(例如默认UTF-8改成改GB2312): $.ajaxSetup({ ajaxSettings:{ contentType:”application/x-www-form-urlencoded;chartset=GB2312″} }); 2. 解决jQuery, prototype共存,$全局变量冲突问题: <script src=”prototype.js”></script> <script src=”http://blogbeta.blueidea.com/jquery.js”></script> <script type=”text/javascript”> jQuery.noConflict(); </script> 注意:一定要先引入prototype.js 再引入jquery.js,先后顺序不可错。 3. jQuery 判断元素上是否绑定了事件 //jQuery event封装支持判断元素上是否绑定了事件,此方法只适用于jQuery绑定的事件 var $events = $(“#foo”).data(“events”); if( $events && $events["click"] ){ //your code } 4. 如何使用jQuery来切换样式表 //找出你希望切换的媒体类型(media-type),然后把href设置成新的样式表。 …

继续阅读 »

js获取某月天数

//获得月份天数 function getMonthDays(year,month){ if(year&&month){ var d=new Date(year,month,0); return d.getDate(); }else{ var d= new Date(); return new Date(d.getFullYear(), d.getMonth()+1,0).getDate(); } }

php获取当前时间的前几个月份

php获取当前时间的前几个月份,不知道有没有内置函数可以获取,献丑了! $month=array(); $m=date(“m”); for($i=0;$i

PHP截取中文,计算中英文混合字符串长度

找了很多截取中文字符串的方法,大多不能实现按中文个数来截取所要的字符, 以下代码可以实现: <?php mb_internal_encoding(‘UTF-8′); $str = "中文测试chineseTest"; header(‘content-type:text/html; charset=UTF-8′); echo mb_strlen($str); echo ‘<br/>’; echo mb_substr($str,1,6); ?> 输出结果: 15文测试chi

mysql log_bin_trust_function_creators

在数据库存添加function时,出现以下错误: #1418 – This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) 在要执行的SQL前加入:SET GLOBAL log_bin_trust_function_creators = 1;即可顺利导入function

httpd.exe: Could not reliably determine the server’s fully qualified domain name

查看系统日志,看到这个错误: httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.xx for ServerName 虽然apache能正常运行,但是觉得不爽,查了一下原来是因为DNS没配置好.在httpd.conf , 在最前加入 ServerName localhost:80 即可。

jQuery的md5加密插件

下载:http://blog.greycode.cn/labs/jqmd5/jquery.md5.js 演示:http://blog.greycode.cn/labs/jqmd5/jquery.md5.html /** * jQuery MD5 hash algorithm function * * <code> * Calculate the md5 hash of a String * String $.md5 ( String str ) * </code> * * Calculates the MD5 hash of str using the » …

继续阅读 »

eclipse某些快捷键无效

在使用eclipse的svn时,每次提交代码到版本库都觉得很麻烦,每次都要找到Team->Commit(ctrl+alt+c),看到有快捷键,但是按快捷键时却又没有反应,还以为和别的软件冲突了,原来是eclipse没启用某些快捷键,设置一下就行了,Window->Custemize Perspective->Command Groups Availability,找到SVN,打上勾就可以用了!

无觅相关文章插件,快速提升流量