Skip to content

Instantly share code, notes, and snippets.

View xigang's full-sized avatar
🎾
/*happy coding*/

Xigang Wang xigang

🎾
/*happy coding*/
View GitHub Profile
@xigang
xigang / bytes_split.go
Created July 4, 2020 08:12 — forked from xlab/bytes_split.go
Golang split byte slice in chunks sized by limit
func split(buf []byte, lim int) [][]byte {
var chunk []byte
chunks := make([][]byte, 0, len(buf)/lim+1)
for len(buf) >= lim {
chunk, buf = buf[:lim], buf[lim:]
chunks = append(chunks, chunk)
}
if len(buf) > 0 {
chunks = append(chunks, buf[:len(buf)])
}
@xigang
xigang / gist:b0291256946355238a41b5994e80103d
Created June 23, 2020 08:55
Sublime Text 3 license key 2020 Updated and working perfectly
Thanks GUys use this oone
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
@xigang
xigang / LICENCE SUBLIME TEXT
Created May 4, 2020 03:02 — forked from guruskid/LICENCE SUBLIME TEXT
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@xigang
xigang / inventory_replcacer.go
Created April 5, 2017 09:29 — forked from reiki4040/inventory_replcacer.go
replace inventory file block for tool.
package main
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"strings"
)
@xigang
xigang / client.go
Created December 5, 2016 13:58 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@xigang
xigang / golang-tls.md
Created December 5, 2016 13:53 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@xigang
xigang / git-key.md
Created August 23, 2016 09:45 — forked from yisibl/git-key.md
如何创建 Git 公钥

如何创建公钥

  1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

  2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!