This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkg install -y cmake make clang libpcap-dev git | |
git clone https://github.com/spacemeowx2/switch-lan-play.git | |
mkdir switch-lan-play/build | |
pushd switch-lan-play/build | |
cmake .. | |
make | |
popd | |
cp ./switch-lan-play/build/src/lan-play . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from idaapi import * | |
from idc import * | |
from idautils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"update_time": 153916320, | |
"list": [{ | |
"name": "服务器1", | |
"address": "0.0.0.0:1234", | |
"description": "服务器描述, 比如服务器官网之类的" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dgram = require('dgram') | |
const crypto = require('crypto') | |
function udpPing (server, port = 11451, timeout = 1000) { | |
return new Promise((resolve, reject) => { | |
const socket = dgram.createSocket('udp4') | |
const myReject = (err) => { | |
socket.close() | |
reject(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const groupCount = 5 | |
function sim() { | |
let score = {} | |
for (let i = 0; i < groupCount; i++) { | |
score[i] = 0 | |
} | |
for (let i = 0; i < groupCount - 1; i++) { | |
for (let j = i + 1; j < groupCount; j++) { | |
const win1 = Math.random() < 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 显示B站弹幕发送时间 | |
// @namespace http://imspace.cn/ | |
// @version 0.1 | |
// @description 显示B站弹幕发送时间 | |
// @author Space | |
// @match https://live.bilibili.com/* | |
// @match http://live.bilibili.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import shbus.realtime | |
line = '733路' | |
direction = True | |
stop = 0 | |
client = shbus.realtime.client() | |
response = client.getRealtimeBus(line, stop, direction=direction) | |
print(response.info.routes[0 if direction else 1].names[stop]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gqlPing(server, delay = 0) { | |
return new Promise((res, rej) => { | |
const ws = new WebSocket(`ws://${server}`, 'graphql-ws') | |
let timeoutId = undefined | |
let lastTime = undefined; | |
const doPing = () => { | |
ws.send(`{"id":"1","type":"start","payload":{"variables":{},"extensions":{},"operationName":null,"query":"subscription{serverInfo{online}}"}}`) | |
lastTime = Date.now() | |
} | |
ws.onmessage = (e) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |