Skip to content

Instantly share code, notes, and snippets.

View harrifeng's full-sized avatar

Harri Feng harrifeng

View GitHub Profile
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
docker images | grep 5000 | awk '{print $1 ":"0.1}' | xargs docker rmi
tcpdump -c 100000 -s 0 -i eth0 port 5000 -A | tee -a http.log
vim /etc/sysconfig/network-scripts/ifcfg-eno*
HWADDR=00:0C:29:8D:24:73
TYPE=Ethernet
BOOTPROTO=static #启用静态IP地址
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
使用git push提交时,每次都要输入密码,次数多了,感觉挺麻烦. 如果git以ssh协议通讯,免密码可以用ssh公钥设置免登录。如果git时以https方式访问呢,该怎么办?下面方式可以解决这个问题.
* 新建文件并保存密码
touch ~/.git-credentials
vim ~/.git-credentials
添加内容
https://{username}:{passwd}@github.com
CR, LF, CR/LF区别与关系
前言
在文本处理中,CR(Carriage Return),LF(Line Feed),CR/LF是不同操作系统上使用的换行符,具体如下:
Dos和Windows采用回车+换行CR/LF表示下一行
而UNIX/Linux采用换行符LF表示下一行
苹果机(MAC OS系统)则采用回车符CR表示下一行
区别
@harrifeng
harrifeng / second.txt
Created September 25, 2017 08:45
Chinese seconds vs English name
纳秒
纳秒,符号ns(英语:nanosecond ).
1纳秒等于十亿分之一秒(10-9秒)
1 纳秒 = 1000皮秒
1,000 纳秒 = 1微秒
1,000,000 纳秒 = 1毫秒
1,000,000,000 纳秒 = 1秒
微秒
微秒,符号μs(英语:microsecond ).
docker stop `docker ps -a -q`
docker system prune --force
o0oYRYMSRFPjQVTVY1ZizsSutCovIkfwq1YzNxz5
a = [1, 2, 3, 4]
b = [2, 3, 2, 5]
print(a, b)
#########################################
# key is a function that uses one paras #
#########################################
print(sorted([a, b], key=lambda x: x[2]))
def mycmp(x, y):