自言自语

I'm Wang Xianyuan, writing for myself, more studying, more experience…

树莓派+蜂鸣器=整点报时器

By

试了下用树莓派外加一个有源蜂鸣器,实现了一个简单的报时功能。

对于有源、无源蜂鸣器的区别,简短介绍下:
一、无源蜂鸣器
1.无源内部不带震荡源,所以如果用直流信号无法令其鸣叫。必须用2K~5K的方波去驱动它。
2.声音频率可控,可以做出“多来米发索拉西”的效果。
3.在一些特例中,可以和LED复用一个控制口。

二、有源蜂鸣器
1.有源蜂鸣器内部带震荡源,所以只要一通电就会叫。
2.程序控制方便,单片机一个高低电平就可以让其发出声音,而无源蜂鸣器却做不到。

我采用的是有源蜂鸣器
电压:3.5—5.5V
电流:<25mA
频率:2300±500

Read More →

用 Nginx 反向代理 Google Fonts

By

应对GFW对Google的封锁导致Google Fonts源无法正常使用,本文介绍的是通过海外的服务器来给Fonts源做反向代理的方法。

upstream fonts_google {
    server fonts.googleapis.com:80;
}

upstream fonts_gstatic {
    server fonts.gstatic.com:80;
}

server {
    listen 80;
    listen [::]:80;

    server_name fonts.nxez.com;
    access_log /var/log/nginx/fonts_access_log main;

    valid_referers server_name *.nxez.com nxez.com;
    if ($invalid_referer) {
        return 403;
    }

    location /css {
        sub_filter 'fonts.gstatic.com' 'fonts.nxez.com';
        sub_filter_once off;
        sub_filter_types text/css;
        proxy_pass_header Server;
        proxy_set_header Host fonts.googleapis.com;
        proxy_set_header Accept-Encoding '';
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_pass http://fonts_google;
    }

    location / {
        proxy_pass_header Server;
        proxy_set_header Host fonts.gstatic.com;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_pass http://fonts_gstatic;
    }
}

Read More →

How to recover wordpress from pharma hack 2014

By

What is wordpress pharma hack?

It is when your wordpress hacked in order to publish the hacker content instead of yours and display it on google search results. Especially in your pages that hit google first page, it specifically impact your SEO efforts.

And what make it worse from SEO point of view is that it shows google a different version of your page than you or others see when they visit your pages , which negatively impact your SEO , apart from injected wrong meta discretion which will show in your search results and reduce your click through rate.

So it means loss of money especially for large production site.

One important note is that although it is called “wordpress pharma hack” it is not necessary related to pharma in my case it was related to Casino poker games and other alike stuff.

Various games like slots and video poker of craps online are attracting many players. If you want to earn huge in a short amount of time, try our
poker card ..

Read More →

Posted in Digests | Tagged: , | Comments Off on How to recover wordpress from pharma hack 2014