Skip to content

Instantly share code, notes, and snippets.

View spacemeowx2's full-sized avatar

imspace spacemeowx2

  • 05:26 (UTC +08:00)
View GitHub Profile
import requests
import time
from hashlib import md5
def demo(roomId):
tt = int(time.time())
signContent = 'lapi/live/thirdPart/getPlay/%d?aid=pcclient&rate=0&time=%d9TUk5fjjUjg9qIMH3sdnh' % (roomId, tt)
sign = md5(signContent).hexdigest()
url = 'http://coapi.douyucdn.cn/lapi/live/thirdPart/getPlay/%d?rate=0' % roomId
package
{
import flash.display.MovieClip;
import TryCatchTest.MyError
import TryCatchTest.MyError2
import flash.system.ApplicationDomain
import flash.system.SecurityDomain
import flash.system.LoaderContext
import flash.net.URLRequest
import flash.display.Loader;
// ==UserScript==
// @name Stream Test
// @namespace http://imspace.cn/gms
// @match *://*/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
function getBodyChecker () {
let c = 0;
let ret = function (buffer) {
@spacemeowx2
spacemeowx2 / getAll.js
Last active March 15, 2020 09:11
抽奖微博爬虫
const DELAY_TIME = 1000
async function getRepost(page) {
let res = await fetch(`https://m.weibo.cn/api/statuses/repostTimeline?id=4211254174873514&page=${page}`)
let obj = await res.json()
if (obj.ok !== 1) {
return false
}
return obj.data.data
}
async function getComment(page) {
@spacemeowx2
spacemeowx2 / USB HID Report Descriptor.txt
Created March 24, 2018 17:42
Switch Pro HID Report Descriptor
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x15, 0x00, // Logical Minimum (0)
0x09, 0x04, // Usage (Joystick)
0xA1, 0x01, // Collection (Application)
0x85, 0x30, // Report ID (48)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x0A, // Usage Maximum (0x0A)
0x15, 0x00, // Logical Minimum (0)
@spacemeowx2
spacemeowx2 / p.bin.note
Last active May 28, 2018 12:02
simple vm @ RCTF 2018
15 00 01 00 00 // X = 0x100
LABEL:
0E // X++
12 // A = [X]
0B // putchar(A)
0C 00 01 00 00 // loop
15 10 01 00 00
0E // X++
@spacemeowx2
spacemeowx2 / downloader.js
Last active August 16, 2018 10:29
Downloader for one game
const axios = require('axios').default
const http = require('http')
const https = require('https')
const path = require('path')
const fs = require('fs')
const Transform = require('stream').Transform
const promisePipe = require('promisepipe')
const mkdirp = require('mkdirp')
const SpaceProgress = require('./space-progress')
const spaceProgress = new SpaceProgress(process.stderr)
@spacemeowx2
spacemeowx2 / brcmfmac43340-sdio.txt
Last active March 1, 2021 11:57
/lib/firmware/brcm/brcmfmac43340-sdio.txt
# /lib/firmware/brcm/brcmfmac43340-sdio.txt works on my CHUWI Hibox
# previous version 5G does not work
manfid=0x2d0
prodid=0x0653
vendid=0x14e4
devid=0x4386
boardtype=0x0653
boardrev=0x1203
boardnum=22
macaddr=02:0A:F7:2A:3B:4C
((async () => {
const sleep = ms => new Promise(r => setTimeout(r, ms))
class IdleUnload {
/**
* @param obj Unloadable 对象
* @param idleTime 超时时间 单位为秒
*/
constructor(obj, idleTime) {
this.obj = obj;
this.loaded = false;
@spacemeowx2
spacemeowx2 / my_alias.bat
Last active August 22, 2018 16:36
my_alias.sh
alias mcpeserver=docker run -p 19132:19132/udp -d mcpeserver
alias project=cd /d D:\project\
alias run-daemon=docker run -p 127.0.0.1:5666:5666 -p 6881:6881 -p 6882:6882/udp -v E:\downloads:/downloads -d space-daemon
set TERM=xterm-256color