Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
͜͡w͜͜͡͡o͜͜͡͡w͜͜͡͡,͜͜͡͡ ͜͜͡͡G͜͜͡͡i͜͜͡͡t͜͜͡͡H͜͜͡͡u͜͜͡͡b͜͡!

CUI Hao cuihaoleo

:octocat:
͜͡w͜͜͡͡o͜͜͡͡w͜͜͡͡,͜͜͡͡ ͜͜͡͡G͜͜͡͡i͜͜͡͡t͜͜͡͡H͜͜͡͡u͜͜͡͡b͜͡!
View GitHub Profile
@cuihaoleo
cuihaoleo / depgraph.gml
Created Apr 25, 2021
PoliCheck GraphMatcher bug reproduce
View depgraph.gml
graph [
directed 1
node [
id 0
label "(3, collect, <AnnotationType.COLLECT_VERB: 3>)"
tag "<AnnotationType.COLLECT_VERB: 3>"
lemma "'store,collect'"
lemmaList "'store'"
lemmaList "'collect'"
dep "'conj'"
View ConnectBssid.cpp
#pragma comment(lib, "Wlanapi.lib")
#include <iostream>
#include <string>
#include <chrono>
#include <thread>
#include <regex>
#include <vector>
#include <utility>
#include <codecvt>
@cuihaoleo
cuihaoleo / cdm-fio.py
Created Jun 8, 2020
Something like CrystalDiskMark
View cdm-fio.py
#!/usr/bin/env python3
import json
import subprocess
import tempfile
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--loops", type=int, default=5,
help="Number of runs for each test.")
@cuihaoleo
cuihaoleo / chito.py
Created Feb 23, 2019
Export is-programmer.com data to JSON
View chito.py
#!/usr/bin/env python3
import os
import datetime
import logging
import psycopg2
from requestsutils import RequestsBase
from htmlutils import parse_document_from_requests
View smart_pxe.yaml
define:
- MIRRORS_HOST: mirrors.ustc.edu.cn
- PXE_HOST: pxe.ustc.edu.cn
- TFTP_EXPORT: /srv/tftp/data
- HTTP_EXPORT: /srv/http/data
- DOWNLOAD_POOL: download/
menu:
- name: Arch Linux
menu:
- name: Arch Linux (${version})
View cgroup.conf
CgroupAutomount=no
CgroupMountpoint=/sys/fs/cgroup
ConstrainCores=yes
ConstrainDevices=yes
ConstrainRAMSpace=no
ConstrainSwapSpace=yes
AllowedSwapSpace=20
TaskAffinity=no
View test14.txt
execve("/home/cuihao/temp/a.out", ["/home/cuihao/temp/a.out"], [/* 18 vars */]) = 0
brk(NULL) = 0x7fffc7a79000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2bd2fc0000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=52542, ...}) = 0
mmap(NULL, 52542, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f2bd2fb3000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
View strace.txt
execve("/usr/bin/git", ["git", "config", "test.test", "test"], [/* 18 vars */]) = 0
brk(NULL) = 0x7fffb909c000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5e08070000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=52542, ...}) = 0
mmap(NULL, 52542, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5e08063000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
View update-he-ddns.sh
#!/bin/bash
DOMAIN=$1
KEY=$2
IPV4=$(ip route get 1 | grep -Po '(?<=src )[^ ]+')
IPV6=$(ip route get 2001:: | grep -Po '(?<=src )[^ ]+')
if [[ -n $IPv4 ]]; then
echo "Update IPv4: $IPV4"
View keybase.md

Keybase proof

I hereby claim:

  • I am cuihaoleo on github.
  • I am cuihao (https://keybase.io/cuihao) on keybase.
  • I have a public key whose fingerprint is AA0C BF38 59E5 80B9 7D9F 0463 8FDE 3D8F C99F 40AE

To claim this, I am signing this object: