Skip to content

Instantly share code, notes, and snippets.

View enginespot's full-sized avatar
🏠
Working from home

Hongde Liu enginespot

🏠
Working from home
View GitHub Profile
@enginespot
enginespot / Git: Empty branch.md
Created June 30, 2021 04:09 — forked from blattmann/Git: Empty branch.md
Git: Create empty branch

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.

@enginespot
enginespot / carray2slice.go
Created June 25, 2021 09:14 — forked from nasitra/carray2slice.go
Convert 'C' array to golang slice
func carray2slice(array *C.int, len int) []C.int {
var list []C.int
sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&list)))
sliceHeader.Cap = len
sliceHeader.Len = len
sliceHeader.Data = uintptr(unsafe.Pointer(array))
return list
}
@enginespot
enginespot / lxcli_proxy.sh
Created September 4, 2017 10:53 — forked from valorad/lxcli_proxy.sh
linux command line tools use proxy
enable_proxy() {
export http_proxy="127.0.0.1:1080"
export https_proxy="127.0.0.1:1080"
}
disable_proxy() {
unset http_proxy
unset https_proxy
}
@enginespot
enginespot / gdb debug
Created April 1, 2017 09:05
gdb debug
https://blog.codeship.com/using-gdb-debugger-with-go/
@enginespot
enginespot / git-key.md
Created April 1, 2017 04:10 — forked from yisibl/git-key.md
如何创建 Git 公钥

如何创建公钥

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

  2. 执行:

    cd ~/.ssh

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

@enginespot
enginespot / one step.md
Last active November 21, 2016 12:55
one step

docker run -d -p 1984:1984 oddrationale/docker-shadowsocks -s 0.0.0.0 -p 1984 -k $SSPASSWORD -m aes-256-cfb

@enginespot
enginespot / HttpHelloWorldServerHandler.java
Last active August 15, 2016 11:41
http can only accept limit connection at the same time
/*
* Copyright 2013 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@enginespot
enginespot / dev.conf
Created January 8, 2016 11:06 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@enginespot
enginespot / IntelliJ_IDEA__Perf_Tuning.txt
Created November 2, 2015 13:02 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1