This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function set_proxy() { | |
# 自动获取宿主 Windows 的 IP 地址 | |
proxy_server=`cat /etc/resolv.conf|grep nameserver|awk '{print $2}'` | |
# 改成你的 http_proxy(局域网)端口号 | |
proxy_port=10809 | |
export http_proxy=http://$proxy_server:$proxy_port | |
export HTTP_PROXY=$http_proxy | |
export https_proxy=$http_proxy | |
export HTTPS_PROXY=$http_proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ "${1}" == "" ]; then | |
echo "************************************************************************" | |
echo "Error: This script needs a parameter: version" | |
echo " 3.29.2 .etc" | |
echo "************************************************************************" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
给定一个有序列表l,用最快的方法找出数x在其中的位置 | |
""" | |
l = [1, 3, 4, 12, 34, 62, 77, 79, 88, 90, 99] | |
x = 77 | |
""" | |
思路,先找出数组l的中间值,和x比较大小,若比x大,则x在l的前半部分, | |
再在l的前半部分的列表ll中,按以上方法判断x的位置 | |
""" |