Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Deyong Zhu M2shad0w

View GitHub Profile
View git 设置和取消代理
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@M2shad0w
M2shad0w / go-get-ip-from-request
Created Jun 11, 2018 — forked from johnsonz/go-get-ip-from-request
go从Request获取IP地址
View go-get-ip-from-request
func GetIPFromRequest(r *http.Request) string {
ip, _, err := net.SplitHostPort(r.RemoteAddr)
if err != nil {
glog.Errorf("userip: %q is not IP:port", r.RemoteAddr)
return ""
}
userIP := net.ParseIP(ip)
if userIP == nil {
glog.Errorf("userip: %q is not IP:port", r.RemoteAddr)
return ""
@M2shad0w
M2shad0w / wget-gdrive.sh
Created May 3, 2018 — forked from lvzongting/wget-gdrive.sh
download google drive file only with wget 仅通过wget 在bash命令行下载谷歌网盘(狗哥网盘)上的文件
View wget-gdrive.sh
#reference https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal
#get cookie and code
wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/Code: \1\n/p'
#download the file
wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=CODE_FROM_ABOVE&id=FILEID'
@M2shad0w
M2shad0w / 文件服务.md
Created Apr 10, 2018
NGINX 文件服务设置
View 文件服务.md
autoindex on;# 显示目录
autoindex_exact_size on;# 显示文件大小
autoindex_localtime on;# 显示文件时间
@M2shad0w
M2shad0w / gist:b307dc28afd4b3ecc1e520ed74cd2c13
Created Feb 11, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:b307dc28afd4b3ecc1e520ed74cd2c13

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@M2shad0w
M2shad0w / tornado-nginx-example.conf
Created Aug 23, 2017 — forked from didip/tornado-nginx-example.conf
Nginx config example for Tornado
View tornado-nginx-example.conf
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
@M2shad0w
M2shad0w / go-get-progress.md
Created Jul 28, 2017 — forked from Jimmy-Xu/go-get-progress.md
go get支持显示进度条
View go-get-progress.md

修改 $GOROOT/src/cmd/go/vcs.go,作如下修改

// vcsGit describes how to use Git.
var vcsGit = &vcsCmd{
        name: "Git",
        cmd:  "git",

        createCmd:   []string{"clone --progress {repo} {dir}", "--git-dir={dir}/.git submodule update --init --recursive"},
        downloadCmd: []string{"pull --ff-only", "submodule update --init --recursive"},
@M2shad0w
M2shad0w / image_trans.py
Last active Jul 28, 2017
image_trans 图像去黑色背景
View image_trans.py
# -*- coding: utf-8 -*-
# !/usr/bin/env python
import sys
from PIL import Image, ImageDraw
file_name = sys.argv[1]
def binarizing(img,threshold): # input: gray image
pixdata = img.load()
View sh shad0w.sh
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS, Debian, Ubuntu #
# Description: One click Install Shadowsocks-go server #
# Author: Teddysun <i@teddysun.com> #
# Thanks: @cyfdecyf <https://twitter.com/cyfdecyf> #
# Intro: https://teddysun.com/392.html #
#==================================================================
You can’t perform that action at this time.