Category: Web

  • vmware workstation是否可以装x64检测工具

    今天想在这台电脑上装一个x64位的linux,无法安装

    下载了检测工具,果然不支持

    vmware 64bit checker

    https://my.vmware.com/group/vmware/details?downloadGroup=PROCESSOR-CHECK-5.5-DT&productId=26

    需要注册

  • wordpress设置permalink出现403 fobidden

    你可能以前动过.htaccess,最有可能是删除过.htaccess

    资料:http://faq.wordpress.net/view.php?p=20

    出现这个错误,请按下列次序检查

    httpd的配置文件

    目录权限设置为755

    文件权限设为644

    博客根目录下的.htaccess第一行加入

    Options +SymLinksIfOwnerMatch

    Options +FollowSymLinks
  • 默认主题Twenty Eleven 1.3的blockquote,pre标签

    修改wordpress主题的style.css文件

    找到blockquote { ** } 并注释掉

    /*注释掉
    blockquote {
     font-family: Georgia, "Bitstream Charter", serif;
     font-style: italic;
     font-weight: normal;
     margin: 0 3em;
    }
    */

    替换为

    blockquote { 
     font-family: 微软雅黑,Georgia, "Bitstream Charter", serif;
     font-weight: normal;
     border-left: 4px solid #ccc;
     margin: 0 1em;
    }

    同理pre替换为

    pre {
     background: #f4f4f4;
     font: 13px "Courier 10 Pitch", Courier, monospace;
     line-height: 1.5;
     margin-bottom: 1.625em;
     overflow: auto;
     padding: 0.75em 1.625em;
    }

    2012年10月添加code样式

    code {
        background: none repeat scroll 0 0 #FFFFFF;
        border: 1px solid #DDDDDD;
        border-radius: 0.4em 0.4em 0.4em 0.4em;
        color: #555555;
        display: inline-block;
        font-size: 0.8em;
        line-height: 1.5em;
        margin: -1px 0;
        padding: 0 0.3em;
    }

     

  • 解决ftp 连接错误 421 Sorry, cleartext sessions are not accepted on this server

    用filezilla连接一虚拟主机的ftp
    响应: 421 Sorry, cleartext sessions are not accepted on this server.
    错误: 无法连接到服务器
    这个是服务器要求加密方式的,选择“要求显式的 FTP over TLS”

    如图:

    filezilla显示的ftp

  • PHP5利用simpleXML获取Google天气XML数据

    http://weather.raychou.com/?/detail/58343 这个天气已经

    先写一个phpinfo();

    查看simpleXML和PHP函数 allow_url_fopen 是否都安装和开启

    参考:http://blog.e8it.net/php5-google-xml-api/

    里面第一句没有加分号 ,不知道作者怎么能顺利显示 .当我下载好 Smarty ,主要学习查找如何显示数组 .用了两三个小时 .能显示基本的数据.接下来美化美化 ,但我的最终目的是定时发送到我的邮箱 ,以便我用黑莓收取的时候能及时得到最新天气.

     

     

  • 使用xmlstarlet分析处理xml的数据

    现有需求:有了黑莓手机,装了smartmail,可以收邮件,于是想把每天的天气数据用vps自动发送到邮箱里,这样手机自动去收取,就可以了解最近的天气。

    第一步获取天气数据:最近打算把所有google能办到的事都让google来办,所以现在用的是google的天气数据,http://www.google.com/ig/api?weather=CHANGZHOU&hl=zh-cn

    API有了,是xml,接下来就是如何把xml的数据搞下来

    于是找到了xmlstarlet – command line XML toolkit 分析xml的命令行工具

    #apt-get install xmlstarlet

    这里用curl得到一个xml文件,可以用xml处理调用里面的数据,但不能得到中文,这让我要想其他办法,后来网上找到了资料,后面加 &ie=utf-8&oe=utf-8,如下

    curl -g “http://www.google.com/ig/api?weather=changzhou&hl=zh-cn&ie=utf-8&oe=utf-8”

    参考:http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.pdf 一步步学习,这要花上几个小时。

    学了半天,处理后的xml数据,中文还是出不来。又回到先用英文来搞,专心把pdf里的命令实践。得到的xml

    用如下命令查得结构

    xmlstarlet el -v weather.xml

    从手册上得到的知识处理

    xmlstarlet sel -T -t -m /xml_api_reply/weather/current_conditions/condition -v "@data" weather.xml

    这时显示Mostly Cloudy,至此可以得到需要的当日的数据了,只是很烦,而且没有中文。