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 / 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 -->
@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 / zimifi.py
Last active September 11, 2020 14:46
zimifi router SMS receive / send
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# test python file for zmifi MF855
# using default password zimifi
# WTFPL
import re, hashlib, random, json, datetime
import requests
from collections import defaultdict
@dixyes
dixyes / README.md
Last active October 13, 2018 14:03
截图抽奖

截图抽奖

使用了opencv的python接口

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

基本思路

  • 准备:

使用类似

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 / extinst.lua
Last active June 27, 2022 19:29
use luajit, ncurses(w) to create a command line ui
#!/home/dixyes/awsl/pl/luajit
--[[
gist: https://gist.github.com/dixyes/cd945d8a195889de32cb524254d90d33
First to say : ffi niubi!
This file is ncursesw command line ui written in lua, using luajit and some C things.
Note: pits here:
1. variables created by ffi.new("sometype") may be gced at anytime (maybe use ffi.typeof() to create type can resolve this.);
workaround: use ffi.C.malloc instead
2. struct index may be not reliable: for example a structure struct sStruct{u32 lFirst; u64 llSecond;}; when use instSStruct[0].llSecond, it will use area from llSecond's half to out of bound 4 bytes as llSecond.