STUDY WHILE YOU ARE BORING


  • 首頁

  • 搜索

  • 技术

  • Tags

  • 关于我

使用Rewrite 转发代理请求

發表於 March 25, 2020   |   评论

之前代理使用的是
ProxyPass
ProxyPassReverse

按照目录转发比较简单,如下:

ProxyPass /img/ http://target.com/img/
ProxyPassReverse /img/ http://target.com/img/

如果是需要根据详细的请求URI来转发就不行,因为默认pattern1里面是没有QUERY_STRING的,
例如: http://abc.com/index.php?do=new
上面的 do=new 就是 QUERY_STIRNG,所以我们需要用到下面的方法。

RewriteEngine on
RewriteCond %{QUERY_STRING} ^.*new$
RewriteRule / http://target.com/ [L,P]

参考:
https://www.cnblogs.com/legend-song/p/5180929.html

花开堪折直须折,莫待无花空折枝

發表於 February 9, 2020   |   评论

《金缕衣》
作者:杜秋娘
劝君莫惜金缕衣,劝君惜取少年时。
花开堪折直须折,莫待无花空折枝。

升级 macOS Catalina 10.15 之后,好多APP提示"已损坏无法打开" 解决办法

發表於 October 18, 2019   |   评论

1571282766414937.jpeg

App 在 macOS Catalina下提示已损坏无法打开解决办法:

1、在系统的“安全与隐私”中允许“任何来源”,再打开终端。

2、输入以下命令;

sudo xattr -d com.apple.quarantine /Applications/xxxx.app

1571283074479461.jpeg

注意:/Applications/xxxx.app 换成你的App路径或在sudo xattr -d com.apple.quarantine 后将软件拖进去即可。

3、最后,重启App即可。

新版的小米路由APP-MIWIFI,太监了,无法远程下载怎么办?

發表於 September 21, 2019   |   评论

找了很久,终于找到一个解决办法,打下下面网址,粘贴您要下载的地址,点【下载到小米路由】,终于有可以用手机下下下了。
http://d.ibayapp.com

另:用testflight版可以找回这个功能

搞定盒子倍速播放全攻略(小米盒子、小米电视、天猫魔盒、 泰捷盒子、华为悦盒、移动魔百盒、华数、电信悦me盒子)

發表於 August 26, 2019   |   评论

吐槽

现在大部分的电视剧、甚至电影的剧情推进,节奏是越来越慢,硬要多拖好多集,各种回忆杀,慢动作,看多了心里着急同时感觉在浪费生命。现在大部分手机APP都已经支持倍速播放,让我们可以和时间做朋友。但是家里看肯定是在大屏电视看上爽。本人使用的就是小米盒子,奈何小米盒子的播放器一直不支持倍速播放,抱着长痛不如短痛的决心,不断搜索办法。

- 阅读剩余部分 -

Mac环境PHP strtoupper 中文乱码

發表於 June 12, 2019   |   评论

找到 php.ini

mbstring.internal_encoding = UTF-8 
mbstring.func_overload = 2

申请免费的SSL证书构建HTTPS站点并自动续订

發表於 May 28, 2019   |   1 条评论

为什么要SSL证书?

安全,普通的HTTP网站传输是明文传输的,内容很容易被窃取或者劫持。HTTPS使用SSL证书,传输加密,安全性更高。SSL证书通过在客户端浏览器和web浏览器之间建立一条SSL安全通道(Secure socket layer(SSL),对传送的数据进行加密和隐藏;确保数据在传送中不被改变,保证数据的完整性,现已成为该领域中全球化的标准。由于SSL技术已建立到所有主要的浏览器和WEB服务器程序中,因此,仅需安装服务器证书就可以激活该功能了,即通过它可以激活SSL协议,实现数据信息在客户端和服务器之间的加密传输,可以防止数据信息的泄露,保证了双方传递信息的安全性,而且用户可以通过服务器证书验证他所访问的网站是否是真实可靠。
同时谷歌、百度等巨头已经默认使用HTTPS安全链接。火狐、Chrome等浏览器也默认将非HTTPS链接显示为‘不安全’。

请输入图片描述

贵吗? 为什么使用letsencrypt.org ?

如果要启用HTTPS,我们就需要从证书授权机构(以下简称CA) 处获取一个证书,Let's Encrypt 就是一个 CA。我们可以从 Let's Encrypt 获得网站域名的免费的证书。这篇文章也主要讲的是通过 Let's Encrypt + Apache 来让网站升级到HTTPS。
https://letsencrypt.org/about/][2]
好处:

  • 支持子域名
  • 支持泛域名
  • 支持API
  • 免费

难点:

  • 申请下来的证书一般只有3个月有效期
  • 需要命令号知识




- 阅读剩余部分 -

Get your free SSL certification and extend it automatically

發表於 May 27, 2019   |   评论

Why SSL?

The primary reason why SSL is used is to keep sensitive information sent across the Internet encrypted so that only the intended recipient can access it. This is important because the information you send on the Internet is passed from computer to computer to get to the destination server. Any computer in between you and the server can see your credit card numbers, usernames and passwords, and other sensitive information if it is not encrypted with an SSL certificate. When an SSL certificate is used, the information becomes unreadable to everyone except for the server you are sending the information to. This protects it from hackers and identity thieves.

请输入图片描述

Why letsencrypt.org ?

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the Internet Security Research Group (ISRG).
https://letsencrypt.org/about/
Advantage:

  • Subdomain support
  • Wildcard support
  • API support
  • Free

Disadvantage:

  • Short period, 3 months mostly
  • Command line skill needed



- 阅读剩余部分 -

underconstruct.io a free and none-hosting solution for under construction page

發表於 May 27, 2019   |   评论

What's under construction page?

请输入图片描述

When we need the under construction page?

  • New domain, without certain context.
  • Web server update events
  • Just stop showing thing

A new fast way without hosting

An under construction page still need to be uploaded to any web hosting server. Sometimes you also need to install some packages, apache/ nginx etc.
Despite, we find out an new and fastest way to do that without any hosting server and command line. That's http://underconstruct.io

DNS for all

All you need to do is pointing your DNS to undercontruct.io
请输入图片描述

One more thing

It support theme configuration. Visit http://underconstruct.io for more.

Centos 6.x 上安装php 的 zbarcode 扩展

發表於 May 27, 2019   |   评论

环境

Centos 6.x
PHP 5.3.3

安装

1 安装ImageMagick依赖

yum install ImageMagick ImageMagick-devel

2 安装zbar拓展

wget -c http://jaist.dl.sourceforge.net/project/zbar/zbar/0.10/zbar-0.10.tar.bz2
tar jxvf zbar-0.10.tar.bz2
cd zbar-0.10
./configure --without-gtk --without-python --without-qt --prefix=/usr/local/zbar ##禁止gtk,python和qt的支持
make && make install

3 安装php-devel

yum install php-devel

4 安装php-zbarcode

git clone https://github.com/mkoppanen/php-zbarcode.git 
cd php-zbarcode
/usr/bin/phpize #自己phpize的位置
./configure --with-php-config=/usr/bin/php-config --with-zbarcode=/usr/local/zbar/
make && make install

5 添加extension=zbarcode.so 到php.ini中 然后重启apache

6 测试

    //新建一个图像对象  
    $image = new ZBarCodeImage("test.png");  

    // 创建一个二维码识别器  
    $scanner = new ZBarCodeScanner();  

    //识别图像  
    $barcode = $scanner->scan($image);  

    //循环输出二维码信息  
    if (!empty($barcode)) {  
        foreach ($barcode as $code) {  
            echo $code['type'];//图像的条码类型
            echo $code['data'];//条码的数据 
        }  
    }  

参考资料

  1. http://www.geekso.com/qrcode/
  2. http://www.xianyunyehe.cc/2017/03-29/php%E8%AF%86%E5%88%AB%E6%9D%A1%E7%A0%81.html
  1. 1
  2. 2
  3. 3
  4. 4
  5. ...
  6. 6
  7. 后一页 »

钜添

54 文章
2 分類
1 页面
GitHub 日记技术
php apache centos macos mysql https shadowsocks mac 微信 ups svn javascript outline accesskey Chrome Extension letsencrypt ssl free certification certbo wildcard renew cloudflare pgsql 归档 binlog isset array_key_exists redmine axure
© 2022 钜添   |   文章 RSS     |  登录
由 Typecho 强力驱动
主題 - NexT
Send message encrypted and private - Msg2
Build your Under Construction Page without hosting - UnderConstruct.IO