Skip to content

Instantly share code, notes, and snippets.

@kwoktung
kwoktung / ss.md
Created May 6, 2023 02:51 — forked from HJianBo/ss.md
Shadowsocks original protocol

The shadowsocks protocol is very similar to SOCKS5 but encrypted and simpler.

Below is the structure of a shadowsocks request (sent from client-side), which is identical for both TCP and UDP connections before encrypted (or after decrypted).

+--------------+---------------------+------------------+----------+
| Address Type | Destination Address | Destination Port |   Data   |
+--------------+---------------------+------------------+----------+
|      1       |       Variable      |         2        | Variable |
+--------------+---------------------+------------------+----------+
@kwoktung
kwoktung / main.go
Last active December 5, 2019 06:20 — forked from 2minchul/main.go
Cancellation for http request using NewRequestWithContext in Golang
package main
import (
"context"
"fmt"
"net/http"
"time"
)
func main() {
@kwoktung
kwoktung / install-redis.md
Last active November 28, 2019 14:57 — forked from hackedunit/install-redis.md
Install and configure Redis on Ubuntu 16.04 with systemd
  1. Install pre-requisities

sudo apt-get install build-essential tcl

  1. Install Redis
cd /tmp
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
@kwoktung
kwoktung / readme.md
Created August 16, 2018 16:22 — forked from irazasyed/readme.md
CSS: Retina Display Media Query

Retina Display Media Query Example:

===

CSS Code for Normal and Retina:

#logo{
    background-image: url(logo.png);
    background-size: 185px 75px;
 background-repeat: no-repeat;