Skip to content

Instantly share code, notes, and snippets.

@lexrus
lexrus / ss_startup.sh
Last active November 13, 2023 13:41
ss_startup.sh
#!/bin/sh
#
# This startup script initializes a Shadowsocks server in Debian 11.
# It's compatible with DigitalOcean, Linode and Vultr.
#
# Author: @lexrus https://github.com/lexrus
#
# Get $100 free credit for VPS with my referral links:
# DigitalOcean: https://m.do.co/c/3eb5cf371fc9
# Linode: https://www.linode.com/lp/refer/?r=9f144941e797d495a10c2841c3137ce1acde5f15
@abn
abn / nm-create-resolved-custom-port-dns-dispatcher.sh
Last active May 14, 2024 12:56
NetworkManager Dispatcher: Configure systemd-resolved DNS server with custom port on connection up event
# NetworkManager connection config does not like custom ports for DNS servers
# we work around this by using a dispatcher to configure this on up events
# change these to your desired configs
CONNECTION_ID=wg0
DNS_TARGET=10.10.0.1:5300
DNS_SEARCH_DOMAIN=~testing
cat > /etc/NetworkManager/dispatcher.d/99-${CONNECTION_ID}.sh <<EOF
#!/usr/bin/env bash
@koush
koush / .bash_profile
Last active February 23, 2022 23:54
Put this in your .bash_profile(s) to open VS Code on your local machine while SSH'd into a remote machine.
# this needs to be on the *remote* machine.
if [ ! -z "$SSH_CLIENT" ]
then
function code() {
local ssh_client_host=$(echo $SSH_CLIENT | cut -d ' ' -f1)
if [ -z "$1" ]
then
local argpath="."
@chenhengqi
chenhengqi / kprobe-event-trace.md
Last active June 30, 2024 23:27
Kprobe-based Event Tracing

Scripts

$ echo global > /sys/kernel/debug/tracing/trace_clock
$ echo 'p:kprobes/tcp_reset tcp_reset port=+12(%di):u16 dst=+0(%di):u32 state=+18(%di):u8' >> /sys/kernel/debug/tracing/kprobe_events
$ echo 1 > /sys/kernel/debug/tracing/events/kprobes/tcp_reset/enable
$ echo 'p:kprobes/tcp_retransmit tcp_retransmit_skb port=+12(%di):u16 dst=+0(%di):u32 state=+18(%di):u8' >> /sys/kernel/debug/tracing/kprobe_events
$ echo 1 > /sys/kernel/debug/tracing/events/kprobes/tcp_retransmit/enable
@muff-in
muff-in / resources.md
Last active May 14, 2025 15:29
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@adwait1-g
adwait1-g / running_the_kernel.md
Last active December 10, 2024 12:35
This gist tells you how to build the kernel and run it on qemu. This is also a way to get started with kernel's internals.

1. Downloading and building the Linux kernel

  1. Clone the github repository onto your local machine.
$ git clone https://github.com/torvalds/linux.git
$ cd linux
  1. Configure the build
@davidwu111
davidwu111 / docker_openwrt_config.md
Last active March 7, 2025 07:21
Clash Docker & Openwrt 配置与踩坑记录

Clash Docker & Openwrt 配置与踩坑记录


使用Openwrt作为主路由,另一台Ubuntu 18.04主机上使用Docker运行Clash来作为网关进行转发,以达到按规则智能翻墙的目的。也是很多人提到的“旁路由”方法。

注:Openwrt可以直接编译OpenClash,我这次只是纯粹为了折腾而折腾。


@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active May 12, 2025 10:36
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@riverscn
riverscn / 北京联通IPTV内网组播.m3u
Created August 4, 2019 15:55
北京联通IPTV内网组播地址节目表(239.2.1.1网段)
#EXTM3U name="北京联通IPTV(RTP)”
#EXTINF:-1,CCTV-1高清(1)
rtp://239.2.1.129:8000
#EXTINF:-1,CCTV-2高清(2)
rtp://239.2.1.60:8084
#EXTINF:-1,CCTV-4高清(4)
rtp://239.2.1.105:8092
#EXTINF:-1,CCTV-7高清(7)
rtp://239.2.1.61:8104
#EXTINF:-1,CCTV-9高清(9)
@maboloshi
maboloshi / README.MD
Last active May 14, 2024 08:41
[小米9 刷入欧洲版MIUI for macOS]

小米9 刷欧洲版 MIUI 固件及适当的本土化修复

本教程不保证它的权威性和正确性,也不对任何实践中的错误、数据丢失等问题负责!
本教程平台为 macOS, 其他系统请酌情参考

更新说明

@ 2020/8/29

  1. 添加"介绍"
  2. 更新 TWRP 信息