Skip to content

Instantly share code, notes, and snippets.

@smiley-yoyo
smiley-yoyo / delete-from-v2-docker-registry.md
Created September 3, 2025 03:46 — forked from jaytaylor/delete-from-v2-docker-registry.md
One liner for deleting images from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
    curl -sSL -I \
        -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
@smiley-yoyo
smiley-yoyo / get-argocd-default-password.md
Created July 24, 2025 02:51 — forked from iambryancs/get-argocd-default-password.md
Get ArgoCD default admin password

Get ArgoCD default admin password

To get ArgoCD default admin password after installation, run:

kubectl -n argocd get secret argocd-initial-admin-secret \
          -o jsonpath="{.data.password}" | base64 -d; echo

The default admin user is admin.

@smiley-yoyo
smiley-yoyo / join_test.go
Created December 20, 2024 07:25 — forked from dtjm/join_test.go
Benchmarking various ways of concatenating strings in Go
package join
import (
"fmt"
"strings"
"testing"
)
var (
testData = []string{"a", "b", "c", "d", "e"}
@smiley-yoyo
smiley-yoyo / safe_time_rotating_file_handler.py
Last active June 17, 2024 11:32 — forked from SerhoLiu/safe_rotating_file_handler.py
python multiprocessing safe time rotating file handler
import logging
import os
import sys
import time
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler
from NamedAtomicLock import NamedAtomicLock
class MultiProcessLock(NamedAtomicLock):
@smiley-yoyo
smiley-yoyo / generics_aware_goimports.sh
Created April 8, 2024 02:13
How to build generics-aware goimports as of 2021/12/07
# In this script I'll use gotip, but there might be other ways
go install golang.org/dl/gotip@latest
# golang/go HEAD will be built
gotip download
# make sure gotip is available
gotip version
git clone https://github.com/golang/tools

Update 28 July 2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Update 23 May 2020: This guide is ALREADY OUTDATED and might no longer work with new versions of Ubuntu and VirtualBox. Please consider switching to the updated guide instead. I will no longer respond to the replies to this gist. Thank you.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

@smiley-yoyo
smiley-yoyo / enum.go
Last active February 16, 2022 09:12 — forked from lummie/enum.go
Golang Enum pattern that can be serialized to json
package enum_example
import (
"bytes"
"encoding/json"
)
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred
type TaskState int
@smiley-yoyo
smiley-yoyo / PYTHON_DEFAULT.md
Created March 22, 2021 06:54 — forked from patrickmmartin/PYTHON_DEFAULT.md
update-alternatives for python3 on Ubuntu

Ubuntu 16 default python is almost python 3

Loads of solutions exist, but for changing the system default, alias is not the way to go.

$ update-alternatives --list python update-alternatives: error: no alternatives for python

TCP + TLS + Web

背景

  • 目前 Vmess + WebSocket + TLS (以下简称 wss)方式,因其特征如同 HTTPS 流量,可以隐藏 V2Ray 路径,主动侦测会得到正常 HTTP 网站响应,具有良好的伪装能力,目前被广泛用于反审查。

  • 但是如此强大的伪装能力,需要付出严重的性能代价:TLS 1.3 握手需要消耗 1-rtt,WS 握手也需要消耗 1-rtt,增大了握手延迟。V2Ray 增加了 mux 以减少握手的发生,然而实际使用中 mux 体验并不好,很多用户选择关闭。

  • 最近兴起了一个新的反审查工具——Trojan,这个工具将一个类似 Socks 的协议直接通过 TLS 传输,并将认证失败的流量交由 Web 服务器处理。降低 WS 延迟的同时,提供与 wss 方式一样的伪装能力。但是该工具较为年轻,没有路由功能,各平台图形化客户端也不完善。