Skip to content

Instantly share code, notes, and snippets.

View bzd111's full-sized avatar
💭
more input and more output

bzd111 bzd111

💭
more input and more output
View GitHub Profile
@bzd111
bzd111 / gbrowse
Last active April 26, 2023 09:26
open git repo url in command line
function gbrowse(){
remote="origin"
if [ ! -z "$1" ];then
remote=$1
fi
origin="git config --get remote.$remote.url"
url=`eval $origin`
if [[ $url == git* ]]; then
url=$(sed 's/:/\//g' <<< "$url")
@bzd111
bzd111 / remove_file.py
Created July 25, 2022 13:12
python remove file use pathlib
from pathlib import Path
for i in Path('.').glob('*.mp4'):
print(i)
i.unlink()
for i in Path('.').glob('*.m4a'):
print(i)
i.unlink()
for i in Path('.').glob('*.pdf'):
print(i)
i.unlink()
@bzd111
bzd111 / auth.py
Last active July 22, 2022 02:34
python3 http.server with authentication
import http.server
import cgi
import base64
import json
import os
from urllib.parse import urlparse, parse_qs
class CustomServerHandler(http.server.SimpleHTTPRequestHandler):
def do_HEAD(self):
if sys.version_info[0] >= 3:
import configparser
else:
from backports import configparser
@bzd111
bzd111 / git_toturial
Created March 3, 2017 03:18 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@bzd111
bzd111 / git_toturial
Created March 3, 2017 03:18 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库