Skip to content

Instantly share code, notes, and snippets.

1. Configure redsocks

/etc/redsocks.conf

base {
        log_debug = off;
        log_info = on;
        log = "syslog:local7";
        daemon = on;
        redirector = iptables;
}
@rrottmann
rrottmann / dist-upgrade-buster-to-bookworm.sh
Last active October 9, 2025 12:27
Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/bullseye-security bullseye-security/updates main
deb-src http://security.debian.org/bullseye-security bullseye-security/updates main
@exuan
exuan / jrttjsb.js
Last active August 11, 2022 06:43
jrttjsb
/*
今日头条极速版
IOS/安卓: 今日头条极速版
邀请码: 1431235326
老用户每天几毛,新用户可能收益高点
普通版定时: 1-59/15 6-23 * * *
激进版定时: 1-59/5 * * * *
多用户跑的时间会久一点,自己看着改定时吧
自定义UA:捉包拿到自己的UA,填到变量jrttjsbUA里,不填默认用安卓UA
自定义每次运行阅读文章的数量:填到变量jrttjsbReadNum,不填默认10篇
@ninlith
ninlith / build.txt
Last active February 12, 2025 04:55
Hybrid UEFI/BIOS multiboot USB drive
# Hybrid UEFI/BIOS multiboot USB drive
# Install required packages
sudo apt install gdisk grub2-common grub-efi-amd64-bin grub-pc-bin qemu-system
# Create an empty disk image
target_size=3.6G # $(lsblk -b --output SIZE -n -d /dev/sdX) for drive size
qemu-img create -f raw boottitikku.img "$target_size"
# Create a GUID Partition Table (GPT)
@FreddieOliveira
FreddieOliveira / docker.md
Last active October 21, 2025 14:00
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@kikyous
kikyous / clash-config
Last active March 31, 2025 07:26
clash-config
port: 7890
# Port of SOCKS5 proxy server on the local end
socks-port: 7891
# Transparent proxy server port for Linux and macOS (Redirect TCP and TProxy UDP)
# redir-port: 7892
# Transparent proxy server port for Linux (TProxy TCP and TProxy UDP)
# tproxy-port: 7893
@stephenbradshaw
stephenbradshaw / python3_https_server.py
Created November 5, 2020 01:26
Python 3 Simple HTTPS server
#!/usr/bin/env python3
# python3 update of https://gist.github.com/dergachev/7028596
# Create a basic certificate using openssl:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# Or to set CN, SAN and/or create a cert signed by your own root CA: https://thegreycorner.com/pentesting_stuff/writeups/selfsignedcert.html
import http.server
import ssl
httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler)
@joedborg
joedborg / launch_vm.sh
Last active May 14, 2025 13:29
LXD Ubuntu VM launch and disk resize
#!/bin/env bash
set -e
readonly VM="banana"
readonly CPU="8"
readonly MEM="8GB"
readonly DSK="120GB"
lxc init images:ubuntu/focal ${VM} -p default -p vm --vm
@un-def
un-def / luaversion.lua
Last active July 21, 2025 07:36
A simple function to detect Lua version
local luaversion = function()
if ({false, [1] = true})[1] then -- luacheck: ignore 314
return 'LuaJIT'
elseif 1 / 0 == 1 / '-0' then
return 0 + '0' .. '' == '0' and 'Lua 5.4' or 'Lua 5.3'
end
local f = function() return function() end end
return f() == f() and 'Lua 5.2' or 'Lua 5.1'
end
@dbkinghorn
dbkinghorn / netplan2NM.sh
Created June 23, 2020 17:07
Change Ubuntu 20.04 server netplan to use NetworkManager instead of networkd
#!/usr/bin/env bash
# netplan2NM.sh
# Ubuntu server 20.04 Change from netplan to NetworkManager for all interfaces
echo 'Changing netplan to NetowrkManager on all interfaces'
# backup existing yaml file
cd /etc/netplan
cp 01-netcfg.yaml 01-netcfg.yaml.BAK