Skip to content

Instantly share code, notes, and snippets.

Avatar
📟

Junxiao Shi yoursunny

📟
View GitHub Profile
View .gitignore
*.mmdb
*.ndjson
.vscode
__pycache__
@yoursunny
yoursunny / .gitignore
Last active Sep 10, 2021
"freewifi" via ESP8266 Captive Portal https://yoursunny.com/t/2017/freewifi/
View .gitignore
/.vscode
/data
View open.c
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/stat.h>
#include <unistd.h>
View Dockerfile
FROM golang:1.16 AS build
WORKDIR /app
COPY . .
RUN env CGO_ENABLED=0 go build -o summer-host-storage main.go
FROM scratch
COPY --from=build /app/summer-host-storage /summer-host-storage
ENTRYPOINT ["/summer-host-storage"]
CMD ["-listen=:8000"]
View .gitignore
*.mmdb
*.ndjson
.vscode
__pycache__
View .gitignore
*.mmdb
*.ndjson
.vscode
__pycache__
@yoursunny
yoursunny / ca-profile.data.base64
Last active May 1, 2022
yoursunny.com NDNts-CA profile
View ca-profile.data.base64
Bv0DMwdECANuZG4IA2VkdQgFd3VzdGwIBkBHVUVTVAgSa3RtNjQwQGhpb3dhaHQuY29tCAJDQQgE
SU5GTzYIAAABgIHWScYyAQAUCxkEADbugBoDMgEAFf0CQIEvBy0IA25kbggDZWR1CAV3dXN0bAgG
QEdVRVNUCBJrdG02NDBAaGlvd2FodC5jb22DAIsEACeNAIn9AgMG/QH/B0oIA25kbggDZWR1CAV3
dXN0bAgGQEdVRVNUCBJrdG02NDBAaGlvd2FodC5jb20IA0tFWTgIAAXd+x6/sBAIAk5BNggAAAGA
gdWcsBQJGAECGQQANu6AFVswWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARQc+F6YsCUULNoDxpp
CsOl2LXk2kWytEv02aE7ir2iY+DV6qcSkGeLtyqPg6QEpzoba5BCN7Coygd543QZ6MKRFv0A/RsB
AxwiByAIA25kbggDZWR1CAV3dXN0bAgDS0VZCAjfmPdLPcidyP0A/Sb9AP4PMjAyMjA0MzBUMjI1
NTAx/QD/DzIwMjMwNTAxVDIyNTUwMf0BAqj9AgAP/QIBB2Fkdmlzb3L9AgIA/QIAH/0CAQVlbWFp
bP0CAhJrdG02NDBAaGlvd2FodC5jb239AgAQ/QIBCGZ1bGxuYW1l/QICAP0CAA39AgEFZ3JvdXD9
AgIA/QIAD/0CAQdob21ldXJs/QICAP0CADb9AgEMb3JnYW5pemF0aW9u/QICIldhc2hpbmd0b24g
View time_tlv.py
b = 0
m_bits = 5
m_max = (1<<m_bits)
for i in range(0,256):
e = i >> m_bits
m = i & ((1<<m_bits) - 1)
if e == 0:
x = (0 + m / m_max) * pow(2, 1 + b)
@yoursunny
yoursunny / index.d.ts
Created Jun 5, 2020
@types/root__asn1
View index.d.ts
// Type definitions for @root/asn1 1.0
// Project: https://git.coolaj86.com/coolaj86/asn1.js
// Definitions by: Junxiao Shi <https://github.com/yoursunny>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.7
export {};
interface Element<V extends string|Uint8Array> {
type: number;