分类 工具 下的文章

由于项目需要,我们建立了某日本插画网站的全站作品和图片数据库。
利用php-phash为每张图片生成了唯一的标识码,通过计算汉明距离进行匹配。
那么有了这些数据之后,就应该开始搭建图片搜索引擎了。

数据量

  • 作品数:3700万左右
  • 空间:1.9TB
  • 数据库:MongoDB 4.0.3

前端

  • pixiv.FUN RiseFront - 可通过Redis缓存搜索结果,组织搜索队列
  • NGINX - 反向代理RiseFront

后端

  • Pifrise - 全称为pixiv.FUN Reverse Image Search Engine

    • 通过连接MongoDB初始化数据,以及作品信息
    • 接口为HTTP协议
    • 只支持全部搜索
    • Java
  • AoiHammer - 开源的汉明距离搜索引擎,通过本地文件初始化数据

    • 接口为TCP ANSI协议
    • 支持摘要搜索和全部搜索
    • C++

性能

  • Pifrise

    • i5-2300 3600w 900ms
    • E5645 x2 3650w 490ms
    • Mem: 6GB
  • AoiHammer

    • F i5-2300 3600w 100~200ms
    • S i5-2300 3600w 500ms
    • Mem: 8GB

iTXTech Rpf

是一个为 SimpleFramework 2.1swoole 4.2 设计的可扩展的反向代理框架

几行代码就能完成一个可用的反向代理

require_once "load_env.php";

use iTXTech\SimpleFramework\Console\Logger;
use iTXTech\Rpf\{Handler, Launcher};
use Swoole\Http\{Request, Response};
use Swoole\Coroutine\Http\Client;

Logger::info("Constructing");
$launcher = (new Launcher())
    ->listen("127.0.0.1", 80)
    ->handler(new class() extends Handler{
        public function ssl(bool $ssl){
            $this->ssl = true;
        }

        public function request(Request $request){
            Logger::info("Got request from " . $request->server["remote_addr"] . " to " .
                $request->header["host"] . $request->server["request_uri"]);
        }

        public function complete(Request $request, Response $response, string $body){
            Logger::info("Got response from " . $request->header["host"] . $request->server["request_uri"] .
                " len: " . strlen($body));
        }

        public function response(Request $request, Response $response, Client $client){
            $response->header["X-Powered-By"] = "iTXTech Rpf";
            $client->body .= "\n<!-- Powered by iTXTech Rpf --!>";
        }
    });

Loader::load($launcher);

开源协议

Copyright (C) 2018 iTX Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Introduction

Bypass TLS reset (based on Server Name Indication detection) of GFW on iOS.
Details for the GFW's new feature

RESEARCH ONLY PROJECT

Roadmap

  1. Find a web framework to implement a Reverse Proxy (Kitura or Perfect)
  2. Test on macOS first
  3. Integrate with OpenSSL for self-signed certificate
  4. Build an iOS app
  5. Use Network Extension to setup a VPNService in order to intercept packets with a TUNInterface
  6. Maybe NEKit will be used to modify packets for redirection

Notes

  1. This project will be my first Swift/Objective-C project.
  2. All these technologies has been tested on Android (Using Undertow or Nginx)
  3. Contributions are welcomed. See my GitHub homepage.

Records

SecureSNC

一键给什鸟科技的虚拟主机安装 Let's Encrypt 免费证书


最新版本

使用

usage: securesnc
 -a,--address <arg>   虚拟主机控制面板的地址
 -d,--domain <arg>    需要申请证书的域名
 -p,--pass <arg>      控制面板的密码
 -r,--root <arg>      虚拟主机的根目录,默认为 /wwwroot
 -s,--save            保存公钥和私钥
 -t,--test            启用测试模式,无签发数量限制,但是签发的是无效证书
 -u,--user <arg>      控制面板的用户名
 -y,--proxy <arg>     通过代理使用 ACME 协议,如:socks://127.0.0.1:1080
                      支持 socks v4/v5 和 http 协议的代理
$ ./securesnc -a 111.222.66.22 -d example.com -u admin -p 123456 -y socks://127.0.0.1:1080 -t -s
X:\SecureSNC>./securesnc -a 111.222.66.22 -d example.com -u admin -p 123456 -y socks://127.0.0.1:1080 -t -s

构建

$ mvn clean install
X:\SecureSNC>mvn clean install

许可证

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.