Skip to content

Instantly share code, notes, and snippets.

View dixyes's full-sized avatar
🧧
<-- this is a 红包

Yun Dou dixyes

🧧
<-- this is a 红包
View GitHub Profile
@dixyes
dixyes / covert.py
Created September 10, 2016 01:54
a dplayer json - bilibili xml converter
#!/bin/env python
#bili xml <==> Dplayer json converter
import sys,json
# struct and vars
xmlhead0="<i><chatserver>"
xmlhead1="</chatserver><chatid>"
xmlhead2="</chatid><mission>0</mission><maxlimit>"
xmlhead3="</maxlimit><source></source><ds></ds><de></de><max_count>"
@dixyes
dixyes / README.md
Last active July 3, 2017 12:48
msgsvc

msgsvc

this is a very simple messge service with static file written in py

非常简单的基于静态文件的使用py写的消息服务

usage / 用法

const var / 常量

@dixyes
dixyes / index.js
Created August 18, 2017 16:53
hexo-tag-dplayer
/**
* hexo-tag-dplayer
* Syntax:
* {% dplayer key=value ... %}
*/
'use strict';
const fs = require('hexo-fs'),
util = require('hexo-util'),
urlFn = require('url'),
path = require('path'),
@dixyes
dixyes / unzip.py
Last active October 9, 2017 13:41
i dont know what this is
#!/usr/bin/env python
# WTFPL
import base64 as b64
import sys,zipfile,os.path
from Crypto.Cipher import AES
if __name__ == "__main__":
basename = os.path.basename(sys.argv[1])
@dixyes
dixyes / ext.py
Created April 17, 2018 07:21
badapple! bootloader
import cv2
vc = cv2.VideoCapture('ba.mp4')
c=1
fs = 1
count = 0
fuckl = lambda x : b"#" if x > 20 else b" "
@dixyes
dixyes / README.md
Last active October 13, 2018 14:03
截图抽奖

截图抽奖

使用了opencv的python接口

注意使用了非自由的sift/surf(需要编译nonfree的opencv-contrib-python库) 效果

基本思路

  • 准备:
@dixyes
dixyes / hls.html
Created June 6, 2017 11:51
Live Danmaku using Dplayer mqttjs mosca msgpack-lite
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>HLS Player</title>
<link href="/css/DPlayer.min.css" rel="stylesheet">
</head>
<body>
<div id="player1" class="dplayer"></div>
<script src="/js/DPlayer.min.js"></script><!-- Dplayer 2.0, using master branch -->

使用类似

void replaceOnReceive(int (*cb) (/*arguments of php_swoole_OnReceive...*/)){
    void * pSwooleG = dlsym(/*arguments to get SwooleG...*/);
    void * pServ = pSwooleG+OFFSET_SERV;
    void * pOnReceive2Replace = (*pServ)+OFFSET_ONRECV;
    assert(*pOnReceive2Replace == php_swoole_OnReceive);
    *pOnReceive2Replace = cb;
}
@dixyes
dixyes / sms4.patch
Created January 9, 2020 10:34
SMS4 in mbedtls
diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h
index 96efd937f..bd0027b7e 100644
--- a/include/mbedtls/cipher.h
+++ b/include/mbedtls/cipher.h
@@ -92,6 +92,7 @@ typedef enum {
MBEDTLS_CIPHER_ID_ARC4, /**< The RC4 cipher. */
MBEDTLS_CIPHER_ID_ARIA, /**< The Aria cipher. */
MBEDTLS_CIPHER_ID_CHACHA20, /**< The ChaCha20 cipher. */
+ MBEDTLS_CIPHER_ID_SMS4,
} mbedtls_cipher_id_t;
@dixyes
dixyes / config.list.example
Last active September 5, 2020 14:21
my mc mod updater
AbyssalCraft-1.12.2-1.10.2.jar:AbyssalCraft*
astralsorcery-1.12.2-1.10.26.jar:astralsorcery*
BuildingGadgets-2.8.4.jar:BuildingGadgets*
gregtech-1.12.2-1.10.0.546.jar:gregtech*
industrialcraft-2-2.8.220-ex112.jar:industrialcraft*
Jade-0.1.0.jar:Jade*
jei_1.12.2-4.16.1.301.jar:jei_1.12.2*
just-enough-harvestcraft-1.12.2-1.7.2.jar:just-enough-harvestcraft-*
levelup2-1.5.6.jar:levelup2*
LittleMaidAppendPack-1.0.3.jar:LittleMaidAppendPack*