Skip to content

Instantly share code, notes, and snippets.

@ihipop
ihipop / main.go
Created Feb 25, 2021
Fake Telnet Server
View main.go
package main
import (
"fmt"
"github.com/reiver/go-oi"
"github.com/reiver/go-telnet"
)
func main() {
@ihipop
ihipop / M3C API.md
Created Feb 24, 2021
M3C 机顶盒API
View M3C API.md

基本格式说明

成功响应

<LIST>
	<result r="0">Success</result>
</LIST>

失败响应

@ihipop
ihipop / aha.html
Created Jan 30, 2020 — forked from zhanglianxin/aha.html
TPLINK_Auth_Key_计算器
View aha.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TPLINK_Auth_Key_计算器 作者:青岛小哥 email:qdpp007@outlook.com</title>
<script type="text/javascript">
function $(id)
{
return document.getElementById(id);
}
@ihipop
ihipop / swoole-process-socket-with-Coroutine.php
Created Apr 23, 2019
协程安全的进程通讯 With Swoole
View swoole-process-socket-with-Coroutine.php
<?php
Swoole\Runtime::enableCoroutine();
$processContainer = [];
for ($i = 0; $i < 2; $i++) {
$process = new \Swoole\Process(function (\Swoole\Process $workerProcess) {
\Swoole\Coroutine::create(function () use ($workerProcess) {
while (true) {
$socket = $workerProcess->exportSocket();
$pid = posix_getpid();
echo 'Idle:' . $pid . PHP_EOL;
@ihipop
ihipop / youzan-express.json
Last active Nov 28, 2018
有赞快递.json
View youzan-express.json
{
"response": {
"allExpress": [
{
"display": 1,
"name": "申通快递",
"id": 1
},
{
"display": 1,
@ihipop
ihipop / test-hash-map.php
Last active Aug 29, 2018
测试 php 的 hash_map / 纯数组 查找元素速度和资源占用情况
View test-hash-map.php
<?php
function create_uuid()
{
$str = md5(uniqid(mt_rand(), true));
$uuid = substr($str, 0, 8) . '-';
$uuid .= substr($str, 8, 4) . '-';
$uuid .= substr($str, 12, 4) . '-';
$uuid .= substr($str, 16, 4) . '-';
$uuid .= substr($str, 20, 12);
@ihipop
ihipop / psysh.md
Last active Aug 25, 2018
psysh配置
View psysh.md

~/.config/psysh/config.php

<?php
return call_user_func(function () {
    $defaultIncludes    = [];
    $composerAutoload   = [];
    $composerAutoload[] = (getenv("COMPOSER_HOME") ?: getenv("HOME") . '/.composer/') . '/vendor/autoload.php';
    $composerAutoload[] = getcwd() . DIRECTORY_SEPARATOR . '/vendor/autoload.php';
    foreach ($composerAutoload as $autoloader) {
@ihipop
ihipop / frp systemd.md
Last active Mar 19, 2021
FRP systemd 启动脚本 FRP systemd init config
View frp systemd.md
@ihipop
ihipop / firefox.desktop
Last active May 18, 2018
firefox.desktop file
View firefox.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Firefox
Name[bg]=Firefox
Name[ca]=Firefox
Name[cs]=Firefox
Name[el]=Firefox
Name[es]=Firefox
Name[fa]=Firefox
Name[fi]=Firefox