12/9/14

stackoverflow forbidden asking solved

It was "You have reached your question limit:Sorry, we are no longer accepting questions from this account. See the Help Center to learn more.".
I asked people to help me here:http://www.reddit.com/r/stackoverflow/comments/2ldq1y/i_cant_ask_questions_any_more_on_stackoverflow/ and on IRC . But doesn't help much. So I created a new ID and vote the old account's questions up. Now the problem is solved:
"Wait! Some of your past questions have not been well-received, and you're in danger of being blocked from asking any more.
For help formulating a clear, useful question, see: How do I ask a good question?
Also, edit your previous questions to improve formatting and clarity."
I believe the best way to solve a problem is help myself, not depending on others.

10/7/14

Remove the 'WordPress.org' link from my 'Meta' list

Edited /wp-includes/default-widgets.php file at line 296:

$widget_ops = array('classname' => 'widget_meta', 'description' => __( "Login, RSS, &") );



Original code

  • RSS
  • '); ?>
  • RSS
  • '); ?>
  • WordPress.org
  • Edited version commented-out unwanted code
    
    
  • 10/6/14

    Direction

    My direction has changed from the right way. Nowadays mobile is the future. So do all my time on mibile, athough it's tired.

    10/5/14

    wordpress 禁用google字体

    最近国内网络控制,用wordpress制作网站应用到google字体的模板就会一直加载fonts.googleapis.com。网站会很慢,解决的办法就是将字体禁止或者本地。
    字体本地化
    新建google-font.css 放在\wp-includes\css目录中(附该css文件的内容如下)
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 300;
      src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/google/DXI1ORHCpsQm3Vp6mXoaTRa1RVmPjeKy21_GQJaLlJI.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 400;
      src: local('Open Sans'), local('OpenSans'), url(../fonts/google/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 600;
      src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(../fonts/google/MTP_ySUJH_bn48VBG8sNSha1RVmPjeKy21_GQJaLlJI.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 300;
      src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url(../fonts/google/PRmiXeptR36kaC0GEAetxrsuoFAk0leveMLeqYtnfAY.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 400;
      src: local('Open Sans Italic'), local('OpenSans-Italic'), url(../fonts/google/xjAJXh38I15wypJXxuGMBtIh4imgI8P11RFo6YPCPC0.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 600;
      src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(../fonts/google/PRmiXeptR36kaC0GEAetxmWeb5PoA5ztb49yLyUzH1A.woff) format('woff');
    }
    修改 \wp-includes\script-loader.php 文件,找到
    $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";
    替换成
    $open_sans_font_url = "/wp-includes/css/google-font.css";
    
    
    禁止google字体加载
    在wp的后台插件里面搜索安装Disable Google Fonts这款插件后启用即可,如果不想安装插件,也可以使用代码版,在主题的functions.php里面加入下面的代码:
     
    //禁用Open Sans
    class Disable_Google_Fonts {
    public function __construct() {
    add_filter( 'gettext_with_context', array( $this, 'disable_open_sans' ), 888, 4 );
    }
    public function disable_open_sans( $translations, $text, $context, $domain ) {
    if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
    $translations = 'off';
    }
    return $translations;
    }
    }
    $disable_google_fonts = new Disable_Google_Fonts;

    10/4/14

    Think

    There are many cheats and malices in the world. I can't believe in too many guys. Feel sad for it.
    Now I have little money, I'm worried about it every time I think about it. Anyway, continue to do what I should do.

    Use One Email Address with Multiple Twitter Accounts

    There’s however a simple workaround that will let you use the same email address with all your Twitter handles – the only condition is that you should be using a Gmail or Google Apps email address.
    In Gmail, you can add a dot (.) anywhere in the username and all emails address to that new alias will still reach your mailbox. For instance, if your original email address is hello@gmail.com, any emails sent to he.llo@gmail.com or he.ll.o@gmail.com will land in your mailbox because Gmails ignores periods in the email username.
    And that’s what you can use to trick Twitter. Twitter will consider hello@gmail and he.llo@gmail as two separate and valid email addresses even though they point to the same Gmail Inbox.
    Update: Please do that note that you have to enable the catch-all option in your domain setting to use email aliases inside Google Apps. Thus it is a better option to use a free Gmail address for Twitter.
    Another Workaround
    When you open an account in Gmail, you automatically get another valid email address that uses the googlemail.com domain.
    So if you only have two handles on twitter, you can use the gmail.com address with one handle and the googlemail.com address with the second handle.

    10/3/14

    百度账号体系和谷歌的天壤之别

    百度的账号体系一片混乱, 相对于谷歌一个账号全网全google产品通行, 简直就是小学生对大学生的区别.
    百度不注重这种用户体验, 可能也和公司的管理文化有关, 各个部门各自为政, 在业绩压力下互相不全力合作.

    python -m SimpleHTTPServer (Start a http server by python)

    python -m SimpleHTTPServer
    bogon:_video apple$ python -m SimpleHTTPServer
    Serving HTTP on 0.0.0.0 port 8000 ...
    192.168.0.102 - - [04/Oct/2014 01:56:21] "GET / HTTP/1.1" 200 -
    192.168.0.102 - - [04/Oct/2014 01:56:22] code 404, message File not found
    192.168.0.102 - - [04/Oct/2014 01:56:22] "GET /favicon.ico HTTP/1.1" 404 -

    192.168.0.102 - - [04/Oct/2014 01:56:24] "GET /%E4%BD%A0%E8%AF%95%E8%BF%87%E5%8D%81%E4%B8%80%E9%83%BD%E5%9C%A8%E5%96%9D%E5%96%9C%E9%85%92%E5%90%97.mov HTTP/1.1" 200 -

    10/2/14

    git 查看某个文件的修改历史

    1. git log -p filename
    查看文件的每一个详细的历史修改,如果没有-p选项,只显示提交记录,不显示文件内容修改,git log -p -3 filename 显示最近的3次提交。
    2. git log --pretty=oneline filename
    每一行显示一个提交,先显示哈希码,再显示提交说明。
    3. git blame filename
    查看文件的每一行是哪个提交最后修改的。

    progit上的更加详细

    如何查看wordpress版本号


    这里介绍三种方法。
    1进入后台“仪表盘”,该页面的左上角图片显示了wordpress的版本号。
    2 查看网页源代码
    在网站的主页空白处点右键弹出菜单,选择“查看网页源代码”。
    在出现的源码页面里查找
    Content值就是wordpress的版本号。
    3 查看readme文件
    进入wampsever的www目录下网站文件所在的文件夹
    (一般为“C:\wamp\www\example.com”),打开“readme”,该文件的正上方显著的位置写着wordpress的版本。

    WordPress更改域名无需修改数据库的方法

    大家一般都知道,WordPress网站更换域名,在成功导入数据库和转移网站数据库后,还需要修改HOME和SITEURL两个地址。一般人的做法大都是通过修改数据库,其实我们也不用那么麻烦和危险。下面,草根站长网就跟大家讲讲通过修改配置文件的三种方法来解决上述问题。
    方法一:修改wp-config.php1、在wp-config.php中,添加以下两行内容:
    define(‘WP_HOME’,’http://www.bitcall.org/’);
    define(‘WP_SITEURL’,’http://www.bitcall.org/’);

    www.bitcall.org代表你的新地址。 

    9/30/14

    win7左ctrl和左alt键互换

    主要参考这篇文章: http://xyztony1985.blog.163.com/blog/static/3611782011752420104/

    感谢原博主

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
    "Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,38,00,1D,00,1D,00,38,00,00,00,00,00

    在记事本上复制如上代码。之后保存为.reg格式的文件。
    点击执行,选择是。
    之后重启就搞定了。


    以下为对原文的引用。

    重点解读

    重点分析上面代码中的那一长串二进制,为方便分析,拆分为每8位一行,并加上行号,结果如下:
    复制代码
    "Scancode Map"=hex:
    00,00,00,00,
    00,00,00,00,
    03,00,00,00,
    38,00,1D,00,
    1D,00,38,00,
    00,00,00,00
    复制代码
    头两行和最后一行,是固定的,都是8个0。
    第3行,表示共更改了多少个按键,本例为3个,怎么算的?从第4行开始,到最末尾行(虽然严格来说末行不算),每行算1个,4、5、6行,刚好3个。
    第4行,前后各4位,分别代表某个按键。本例为将38,00的按键映射为1D,0038,00代表Left alt键,1D,00代表Left ctrl键。
    第5行,同理,下一行即Left ctrl映射为Left alt。
          第6行,已经讲了,末行,固定8个0。如果需要增加更多的映射,可以在此行之上,不断加类似4、5行格式的。当然,最后的结果,还是要将各行合为一行的。

    附录

    部分按键映射对照表,需要查看全部对照
    复制代码
    Escape             01 00
    Tab              0F 00
    Caps Lock          3A 00
    Left Alt           38 00
    Left Ctrl          1D 00
    Left Shift         2A 00
    Left Windows       5B E0
    Right Alt          38 E0
    Right Ctrl         1D E0
    Right Shift        36 00
    Right Windows      5C E0
    Backspace          0E 00
    Delete             53 E0
    Enter              1C 00
    Space              39 00
    Insert             52 E0
    HOME               47 E0
    End                4F E0
    Num Lock           45 00
    Page Down          51 E0
    Page Up            49 E0
    Scroll Lock        46 00
    复制代码
    还有一个特殊的值——00 00,表示啥也不干,如果要将某个按键禁用,只需映射为00 00。

    正确的删除MySQL log bin日志和禁止产生mysql-bin.00000N文件的办法

    在使用Mysql中发现在Data目录下有很多的日志文件,名称如mysql-bin.000001、mysql-bin.000002….等,这样的文件数量非常多而且占用了很多的空间。
    不过,这种Mysql的日志文件是不能简单地直接删除的,而且这种方式并不是很彻底,下面提供正确的删除Mysql日志文件的方法。
    1.打开Mysql,运行语句:SHOW MASTER LOGS
    2.接下来运行:RESET MASTER; 这语句会直接将那些日志文件删除掉。
    通过以上两步即可简单将那些日志文件清理干净。
    另外,如果你不想让Mysql在使用过程中产生大量的日志文件,可以禁止掉它,其操作方法如下:
    1..关闭Mysql
    2. 找到Mysql配置文件,然后找到以下参数,并将其注释掉:
    #log-bin=mysql-bin
    #log-slow-queries=slowquery.log
    #long_query_time=3
    #binlog_format=mixed
    
    然后再重启Mysql即可。

    Do what I should do

    Tired of working in the poor situation. Had tried something, missed too many good chances, now still fighting for a better life. Time is so quick. Years went so quickly. Everything has changed. I grew older and older, press bigger and bigger, money grow slower and slower. Any way, chances always exist, let me do it and get success!

    Youtube赚钱分析

    http://www.gemag.com.cn/14/16906_1.html
    一万次播放大概7-8美元!

    http://en.wikipedia.org/wiki/Charlie_Bit_My_Finger
    In 2012 it was reported that the profits from the video were over £300,000 (US $500,000). 

    按5亿次播放估算,至多10美元1万次播放.

    mobile app价格ecpm是0.3-3美元

    9/29/14

    修复bash漏洞


    可以使用如下命令来检查系统存在此漏洞:  
    env x='() { :;}; echo vulnerable' bash -c "echo this is a test"   
    受影响的系统包括:  
    CentOS  
    Debian  
    Redhat  
    Ubuntu  
    红帽系可通过更新 bash 并重启系统来解决这个问题:  
    # yum update bash   
    或者:  
    # yum update bash-4.1.2-15.el6_5.1   
    此举只是更新了 bash 包,还需要重启系统才能生效。  
    Ubuntu 用户可以通过如下命令打补丁,无需重启:  
    apt-get update   
    apt-get install bash

    Centos install easy_install

    yum install python-setuptools