Skip to content

Instantly share code, notes, and snippets.

View cloverstd's full-sized avatar
🀄
Working for living

cloverstd cloverstd

🀄
Working for living
View GitHub Profile
@phlinhng
phlinhng / a-trojan-with-nginx-stream-module.md
Last active March 28, 2024 13:39
Trojan + NGINX 多網站共存

利用 NGINX 的 Stream 模塊 sni_preread 功能,可以做到讓 Trojan 和其他網站在同一台機器上共享 443 端口。

@justinmklam
justinmklam / backup-sd-card-to-file.md
Last active August 13, 2023 15:58
Backup SD card to file using dd

To find the partition, use the command:

$ df

The output will be something like below. In this case, the SD card is on /dev/mmcblk (ignore the two partitions).

Filesystem Size Used Avail Use% Mounted on
@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list

A primer on x86 assembly with GNU assembler

When it comes to assembly language, it isn't as hard as many people think. Fundamentally, you write short, human-readable commands for the processor to execute (your assembly code) and then use a tool (the actual assembler) to translate your code into machine-readable binary instructions. Unlike high-level languages, assembly language is very simple and doesn't have that many features. The difficulty is to deal with memory and build more complex flows (e.g. loops or I/O) from the simple primitives that the assembly language gives you.

Registers and instructions

CPUs usually have small, very fast storage available for the data that is used in its instructions. This kind of storage is much smaller but also much faster than the RAM and is called registers. An x86 processor has a bunch of them to store generic data, manage the stack, keep track of the current instruction and other administrative inform

@alswl
alswl / hosts
Last active November 12, 2023 11:17
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@YCF
YCF / sqlite2json.go
Created March 2, 2017 11:49
查询数据库输出为json的例子
package main
import (
"database/sql"
"encoding/json"
"fmt"
"net/http"
"strings"
"github.com/go-ini/ini"
@alq666
alq666 / haproxy-stats
Created May 24, 2016 14:10
HAProxy metrics
0. pxname [LFBS]: proxy name
1. svname [LFBS]: service name (FRONTEND for frontend, BACKEND for backend,
any name for server/listener)
2. qcur [..BS]: current queued requests. For the backend this reports the
number queued without a server assigned.
3. qmax [..BS]: max value of qcur
4. scur [LFBS]: current sessions
5. smax [LFBS]: max sessions
6. slim [LFBS]: configured session limit
7. stot [LFBS]: cumulative number of connections
@updateing
updateing / wltemp.c
Created April 25, 2016 12:09
Program for reading temperature of Broadcom wireless adapters.
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#define WLC_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
#define WLC_GET_VAR 262 /* get value of named variable */
@soffchen
soffchen / surge.conf
Last active March 4, 2024 05:23
surge.conf
[General]
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114
loglevel = notify
[Proxy]
BJ-All = custom
BJ-HK-Azure = custom
BJ-US-Azure = custom
@taichunmin
taichunmin / aliyun.sources.list
Created February 11, 2015 08:17
阿里雲 Ubuntu 14.04 的 apt-get 設定 sources.list
# deb http://mirrors.aliyun.com/ubuntu trusty main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty main restricted
# deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty-updates main restricted
# deb http://security.ubuntu.com/ubuntu trusty-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu trusty main restricted