Skip to content

Instantly share code, notes, and snippets.

@Zayrick
Zayrick / docker-registry-proxy-worker.js
Last active February 25, 2025 00:52
基于 Cloudflare Workers 的 Docker Registry 代理脚本,支持自动补全 library 命名空间,动态使用访问域名作为代理地址,并优化了认证处理和请求转发逻辑。适用于国内访问 Docker Hub 镜像时遇到的拉取问题。
/**
* Docker Registry 代理 Worker
*
* 功能说明:
* 1. 根路径请求重定向到 Docker 官网
* 2. 针对 /v2/ 请求返回带有 WWW-Authenticate 挑战的响应,
* 引导 Docker 客户端获取认证 Token。
* 3. 针对 /auth/token 请求,从 Docker 授权服务获取认证 Token。
* 4. 对于其他请求(如拉取镜像配置或镜像数据),转发到上游 Docker Registry,
* 并在必要时对请求路径进行调整(例如缺失默认命名空间时自动补全 "library")。
@ZenithalHourlyRate
ZenithalHourlyRate / GUD.md
Last active April 14, 2025 21:08
Use old phone as a second display: USB GUD with postmarketOS

Demo

Xiaomi Redmi 2 with resolution 1280x720 (GUD RGB565 with compression)

9.mp4
10.mp4

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 12, 2025 01:53
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@aiguofer
aiguofer / encrypeted_cert_session.py
Created February 13, 2017 15:14
Creating a Python requests session using a passphrase protected Client side Cert
import ssl
from requests.adapters import HTTPAdapter
CFG_FILE = '<path_to_cfg>'
secure_hosts = [
'https://<host>'
]
class SSLAdapter(HTTPAdapter):
def __init__(self, certfile, keyfile, password=None, *args, **kwargs):
@tzmartin
tzmartin / embedded-file-viewer.md
Last active April 16, 2025 14:36
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@icetan
icetan / gen-rsa-pubkey.sh
Created October 27, 2015 01:38
Create a public RSA key from modulus and exponent on the command line
#!/bin/bash
set -e
b2hex() { echo -n $1|base64 --decode | xxd -p -u | tr -d \\n; }
modulus=$(b2hex u2/nlDLMbqLY+XBnWlqHv74a/wvmPoefKv+5NkTU0sbQAEMN7Gar9Hgp50uMUQhiOhwO6L4hezrY021etPyh2Q==)
exponent=$(b2hex AQAB)
asn1conf=$(echo -e "asn1=SEQUENCE:pubkeyinfo\n[pubkeyinfo]\nalgorithm=SEQUENCE:rsa_alg\npubkey=BITWRAP,SEQUENCE:rsapubkey\n[rsa_alg]\nalgorithm=OID:rsaEncryption\nparameter=NULL\n[rsapubkey]\nn=INTEGER:0x$modulus\ne=INTEGER:0x$exponent" | openssl asn1parse -genconf /dev/stdin -noout -out /dev/stdout | base64)
@soarez
soarez / ca.md
Last active April 24, 2025 12:51
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.