Skip to content

Instantly share code, notes, and snippets.

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

alexniver

🏠
Working from home
View GitHub Profile
@alexniver
alexniver / golang, ubuntu go get in china.md
Last active April 26, 2023 11:15
ubuntu下, 使用shadowsock和Privoxy帮助你在命令行中, 无障碍进行go get

#前言 由于大家都懂的, 国内使用go get的时候, 经常会各种失败, 如果有vpn的话, 打开vpn, 问题就解决了, 但vpn其实挺不灵活的.

相对来说shadowsock则灵活得多.

#解决方案 shadowsock + Privoxy

思路就是, 使用shadowsock建立一个本地sock5代理, 但因为go get 需要http代理, 所以需要使用privoxy把sock5代理转为http代理.

@alexniver
alexniver / git connect.md
Last active December 21, 2022 07:34
git 科学上网

install connect

yay -S connect

vi ~/.ssh/config

Host github.com
 User git
@alexniver
alexniver / rust connect.md
Created November 12, 2022 06:49
rust cargo 科学上网
~/.cargo/config
[http]
proxy = "socks5h://127.0.0.1:7891"
[https]
proxy = "socks5h://127.0.0.1:7891"
package main

import (
	"crypto/md5"
	//"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
@alexniver
alexniver / sum.go
Last active June 14, 2019 15:20
calculate sum use all cpu core
package main
import (
"fmt"
"runtime"
)
func Sum(start, end int) chan int {
c := make(chan int)
s := 0
  1. 首先根据官方文档安装spf13.vim
  2. 执行下面的语句
echo "let g:spf13_bundle_groups=['general', 'youcompleteme', 'programming', 'go', 'javascript', 'html', 'misc', 'writing' ]" >> ~/.vimrc.before.local 
vim +BundleInstall! +qall
  1. 将下面的配置加入到 .vimrc.local
" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
@alexniver
alexniver / .md
Created February 13, 2019 18:12
spf13-vim + vim-go
  1. Install spf13-vim
sh <(curl https://j.mp/spf13-vim3 -L)
  1. Install Go bundle
echo "let g:spf13_bundle_groups=['general', 'neocomplete', 'programming', 'ruby', 'python', 'go', 'javascript', 'html', 'misc', 'writing' ]" >> ~/.vimrc.before.local 
@alexniver
alexniver / go交叉编译ubuntu to windows.md
Created January 20, 2019 11:26
如何在ubuntu上编译出windows的可执行文件
sudo apt-get install mingw-w64
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build main.go
@alexniver
alexniver / vimrc for windows
Last active December 27, 2018 06:20
windows下使用的vim简易配置
" General {{{
set nocompatible
set nobackup
set noswapfile
set history=1024
set autochdir
set whichwrap=b,s,<,>,[,]
set nobomb
set backspace=indent,eol,start whichwrap+=<,>,[,]
" Vim 的默认寄存器和系统剪贴板共享