Skip to content

Instantly share code, notes, and snippets.

Working for living

cloverstd cloverstd

Working for living
View GitHub Profile
bmatcuk /
Created May 30, 2019
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 / hosts
Last active Nov 25, 2020
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
View hosts
YCF / sqlite2json.go
Created Mar 2, 2017
View sqlite2json.go
package main
import (
View haproxy-stats
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 / wltemp.c
Created Apr 25, 2016
Program for reading temperature of Broadcom wireless adapters.
View wltemp.c
#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 */
View surge.conf
skip-proxy =,,,,, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun =,,
# dns-server =,,
loglevel = notify
BJ-All = custom
BJ-HK-Azure = custom
BJ-US-Azure = custom
taichunmin / aliyun.sources.list
Created Feb 11, 2015
阿里雲 Ubuntu 14.04 的 apt-get 設定 sources.list
View aliyun.sources.list
# deb trusty main restricted
# deb trusty main restricted
# deb trusty-updates main restricted
# deb trusty-updates main restricted
# deb trusty-security main restricted
# See for how to upgrade to
# newer versions of the distribution.
deb trusty main restricted
bdarnell /
Created Jan 11, 2015
Demo of streaming requests with Tornado
"""Demo of streaming requests with Tornado.
This script features a client using AsyncHTTPClient's body_producer
feature to slowly produce a large request body, and two server
handlers to receive this body (one is a proxy that forwards to the
other, also using body_producer).
It also demonstrates flow control: if --client_delay is smaller than
--server_delay, the client will eventually be suspended to allow the
server to catch up. You can see this in the logs, as the "client
Globegitter /
Last active Sep 28, 2020
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src trusty nginx" | sudo tee -a /etc/apt/sources.list
You can’t perform that action at this time.