Skip to content

Instantly share code, notes, and snippets.

@libChan
libChan / wsl_clash_proxy.sh
Last active October 17, 2025 07:19
WSL2使用clash for windows代理
# WSL通过Win访问网络,所以WSL的网关指向的是Windows,DNS服务器指向的也是Windows,设置WSL的proxy为win的代理ip+端口即可
# WSL中的DNS server在/etc/resolv.conf中查看,该文件是由/etc/wsl.conf自动生成的。
# 如果关闭了wsl.conf中自动生成resolve.conf并自行修改了resolve.conf,DNS nameserver并不是本机win ip
# 需要开启wsl.conf的自动生成,再运行以下命令
# https://zhuanlan.zhihu.com/p/153124468
# 添加到环境变量设置中,例如~/.zshrc
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
export https_proxy="http://${hostip}:7890"
export http_proxy="http://${hostip}:7890"
@tcya
tcya / index.html
Last active February 4, 2025 09:59
海德沙龙刷机包
<!DOCTYPE html>
<html>
<head>
<title>海德沙龙刷机包</title>
<style>
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 3px;
}
@owent
owent / test_backtrace.cpp
Last active March 25, 2025 12:16
test_backtrace
/**
* traceback for cpp
*
* Created on: 2018-01-27
* Author: owent
*
* Released under the MIT license
*
* @note Required flag -rdynamic or addr2line to get the function name when using gcc/clang in unix like system
* @note Using addr2line -Cfpe <exe_path> [func_addr...] for more detail when using gcc/clang
@thelinked
thelinked / LockingQueue.hpp
Last active May 28, 2025 11:22
C++11 blocking queue using the standard library.
#pragma once
#include <queue>
#include <mutex>
#include <condition_variable>
template<typename T>
class LockingQueue
{
public:
void push(T const& _data)
@fmela
fmela / stacktrace.cxx
Last active August 21, 2025 21:24
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright