Skip to content

Instantly share code, notes, and snippets.

@qnnnnez
qnnnnez / flash-openstick-boot-img.sh
Last active November 16, 2023 06:13
Flash boot partition directly on your OpenStick device. (Tested on UZ801V3)
#!/bin/bash
set -e
set -x
if [ $# -eq 0 ]; then
echo "Usage: $0 kernel-version"
echo "kernel-version is the suffix of vmlinuz and initrd.img in /boot"
exit 1
fi
@qnnnnez
qnnnnez / qsort.jq
Last active September 22, 2023 09:35
quicksort implementation in jq
def partition($p):
{
"less": (. | map(select(. < $p))),
"equal": (. | map(select(. == $p))),
"greater": (. | map(select(. > $p)))
};
def qsort:
(
if (. | length | . <= 1) then . else
@qnnnnez
qnnnnez / shrinkme.io-bypass.js
Created August 13, 2023 07:05
shrinkme.io bypass
// ==UserScript==
// @name shrinkme.io bypass
// @namespace qnnnnez@live.com
// @version 0.1
// @description skip waitting for shrinkme.io links
// @author qnnnnez
// @match https://shrinkme.io/st*
// @grant none
// ==/UserScript==
@qnnnnez
qnnnnez / hk.py
Created March 22, 2023 03:15
深圳出入境预约查询
locations = ['440305000000', '440305000001']
start_date = '2023-03-03'
query_days = 7
url = "https://msjw.ga.sz.gov.cn/crj/crjmsjw/wsyydata/getScheduleData"
import requests
import os
import time
def detect_charset(encoded_text, default=None):
"""
探测编码格式,只支持 gbk 或 utf-8
:param default: 默认编码
:param encoded_text: 待探测的二进制数据
:return:
"""
# Python2 中,str 是字节串,unicode 才是字符串
if not isinstance(encoded_text, str):
from ctypes import *
import os
from enum import IntFlag
import errno
libc = cdll.LoadLibrary('libc.so.6')
class CloneFlag(IntFlag):
VM = 0x00000100 #/* set if VM shared between processes */
FS = 0x00000200 #/* set if fs info shared between processes */
flowscript = '''
查询结果 = 录取信息库.单条查询({
“姓名” : 姓名输入框.内容,
“准考证号” : 准考证输入框.内容,
“身份证号” : 身份证输入框.内容,
});
如果(查询结果){
结果页.姓名文本.内容 = 查询结果.分数;
结果页.高考分数文本.内容 = 查询结果.分数;
结果页.录取结果文本.内容 = 查询结果.录取状态;
@qnnnnez
qnnnnez / issue.sh
Created February 24, 2019 12:01
nginx configuration for tls-alpn-01
# using https://github.com/Neilpang/acme.sh
acme.sh --issue -d your.domain.1 --alpn --tlsport 30443
@qnnnnez
qnnnnez / Makefile
Created January 8, 2019 13:33
compile and run .COM executable in dosbox
AS := as
LD := ld
DOSBOX := dosbox
%.o: %.S
$(AS) --32 -o $@ $<
output.com: hello.o
$(LD) -T dos.ld -o $@ $<
@qnnnnez
qnnnnez / cqooc.py
Last active November 26, 2019 09:16
cqooc.com Quick Learner
# config
username = '' # your username used to login
user_id = int() # should be a integer
courseId = ''
cookie_xsid = '' # find it in your browser after logging in
finish_time = '' # e.g. 20181222
parentId = ''