Skip to content

Commit f7a7754

Browse files
committed
up
0 parents  commit f7a7754

File tree

153 files changed

+3759
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+3759
-0
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/go/ver.txt
2+
/go/update-bin.lock
3+
/git/ver.txt
4+
/git/update.lock
5+
/vim/ver.txt
6+
/vim/update.lock
7+
/nvim/ver.txt
8+
/nvim/release.json
9+
/watchman/ver.txt
10+
/watchman/update.lock
11+
/shadowsocks/ver.txt
12+
/shadowsocks/ver-obfs.txt
13+
/shadowsocks/update.lock
14+
/imagemagick/ver.txt
15+
/imagemagick/update.lock
16+
/nodejs/ver.txt
17+
/nodejs/update.lock
18+
/openssl/ver.txt
19+
/openssl/update.lock
20+
/gitflow/gitflow/
21+
22+
*.deb

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sudo: required
2+
language: c
3+
before_script:
4+
- sudo mkdir -p /www/src
5+
- sudo chown travis:travis /www/src
6+
7+
script:
8+
- ./run.sh
9+
10+
dist: trusty

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
zhengkai/build
2+
=======
3+
4+
系统软件版本跟不上,那就自己编译吧
5+
仅适用于 Ubuntu 16.04,不确定在 Debian 或低版本 Ubuntu 上有什么问题
6+
7+
需要确保 `/usr/local/src` 目录可写
8+
9+
取最新版源代码编译的软件
10+
-----------------------
11+
(依赖全部走系统自带的)
12+
13+
* `git`
14+
* `shadowsocks-libev`
15+
* `vim`
16+
* `watchman`
17+
18+
取最新版二进制包的软件
19+
----------------------
20+
21+
* `go`
22+
* `nodejs`
23+
24+
以上软件会记录已安装的版本,不会重复执行,可放入 crontab 每天跑
25+
安装目录 `--prefix=/usr/local`,请确保自己的 PATH 顺序,如果 which 没变可能需要 `hash -r`
26+
27+
其他
28+
----
29+
30+
* `mysql` 走系统自带的安装,安装时生成随机密码并写入 `~/.my.cnf`
31+
* `nginx` 取官方的 Ubuntu APT 源更新,以及额外的 SSL DH 强化
32+
* `php` 手动更新版本,全部 shared 编译,不要安装系统自带的 PHP,会冲突
33+
* `ssh` 安全检查,禁用 password
34+
* `vbox` 将某个 VirtualBox instance 作为服务随系统自动开关机
35+
* `rc-local` 高版本 Ubuntu 没有 rc.local 后的替代品

alacritty/run.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash -ex
2+
3+
VER="v0.5.0"
4+
5+
sudo apt-get install -y cargo cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3
6+
7+
cd /usr/local/src
8+
9+
if [ ! -d alacritty ]; then
10+
git clone https://github.com/alacritty/alacritty.git
11+
fi
12+
13+
cd alacritty
14+
15+
git clean -df
16+
git reset --hard
17+
git checkout master
18+
git pull --rebase
19+
git checkout "$VER"
20+
21+
cargo build --release
22+
23+
sudo cp target/release/alacritty /usr/local/bin/
24+
25+
sudo cp extra/completions/_alacritty /usr/share/zsh/vendor-completions/

azure/microsoft.asc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
Version: GnuPG v1.4.7 (GNU/Linux)
3+
4+
mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT
5+
LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV
6+
7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag
7+
OeizPXmRljMtUUttHQZnRhtlzkmwIrUivbfFPD+fEoHJ1+uIdfOzZX8/oKHKLe2j
8+
H632kvsNzJFlROVvGLYAk2WRcLu+RjjggixhwiB+Mu/A8Tf4V6b+YppS44q8EvVr
9+
M+QvY7LNSOffSO6Slsy9oisGTdfE39nC7pVRABEBAAG0N01pY3Jvc29mdCAoUmVs
10+
ZWFzZSBzaWduaW5nKSA8Z3Bnc2VjdXJpdHlAbWljcm9zb2Z0LmNvbT6JATUEEwEC
11+
AB8FAlYxWIwCGwMGCwkIBwMCBBUCCAMDFgIBAh4BAheAAAoJEOs+lK2+EinPGpsH
12+
/32vKy29Hg51H9dfFJMx0/a/F+5vKeCeVqimvyTM04C+XENNuSbYZ3eRPHGHFLqe
13+
MNGxsfb7C7ZxEeW7J/vSzRgHxm7ZvESisUYRFq2sgkJ+HFERNrqfci45bdhmrUsy
14+
7SWw9ybxdFOkuQoyKD3tBmiGfONQMlBaOMWdAsic965rvJsd5zYaZZFI1UwTkFXV
15+
KJt3bp3Ngn1vEYXwijGTa+FXz6GLHueJwF0I7ug34DgUkAFvAs8Hacr2DRYxL5RJ
16+
XdNgj4Jd2/g6T9InmWT0hASljur+dJnzNiNCkbn9KbX7J/qK1IbR8y560yRmFsU+
17+
NdCFTW7wY0Fb1fWJ+/KTsC4=
18+
=J6gs
19+
-----END PGP PUBLIC KEY BLOCK-----

azure/run.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# https://docs.microsoft.com/zh-cn/cli/azure/install-azure-cli-apt?view=azure-cli-latest
4+
5+
cd $(dirname `readlink -f $0`)
6+
7+
sudo apt-key add microsoft.asc
8+
9+
LIST_FILE='/etc/apt/sources.list.d/azure.list'
10+
if [ ! -e "$LIST_FILE" ]; then
11+
sudo cp source.list "$LIST_FILE"
12+
fi
13+
sudo apt update
14+
15+
sudo apt-get install -y azure-cli

azure/source.list

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ bionic main

bazel/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu
2+
3+
https://stackoverflow.com/questions/25923939/how-do-i-download-binary-files-of-a-github-release

bbr/20-bbr.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
net.ipv4.tcp_congestion_control = bbr

bbr/run.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
cd $(dirname `readlink -f $0`)
4+
5+
echo kernel: `sudo uname -r`
6+
7+
ERR=`sudo modprobe tcp_bbr 2>&1`
8+
if [ -n "$ERR" ]; then
9+
>&2 echo 'no tcp_bbr'
10+
exit 1
11+
fi
12+
13+
MOD_CONF='/etc/modules-load.d/modules.conf'
14+
GREP=`grep 'tcp_bbr' "$MOD_CONF"`
15+
if [ "$GREP" != 'tcp_bbr' ]; then
16+
echo 'tcp_bbr' | sudo tee -a "$MOD_CONF"
17+
echo add tcp_bbr to "$MOD_CONF"
18+
fi
19+
20+
SYS_CONF='/etc/sysctl.d/20-bbr.conf'
21+
if [ ! -f "$SYS_CONF" ]; then
22+
sudo cp 20-bbr.conf "$SYS_CONF"
23+
echo add 20-bbr.conf to "$SYS_CONF"
24+
fi
25+
26+
sudo sysctl net.ipv4.tcp_available_congestion_control
27+
sudo sysctl -p "$SYS_CONF"
28+
29+
CHECK=`sudo sysctl net.ipv4.tcp_congestion_control | grep 'control = bbr'`
30+
if [ -z "$CHECK" ]; then
31+
>&2 echo 'FAIL'
32+
exit 1
33+
fi
34+
35+
echo OK, done

cert/install.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
cd "$(dirname "$(readlink -f "$0")")" || exit 1
4+
5+
MC="/usr/share/ca-certificates/mozilla/ISRG_Root_X2.crt"
6+
7+
set -x
8+
9+
sudo cp ./isrg-root-x2.pem "$MC"
10+
sudo chown root:root "$MC"
11+
sudo chmod 755 "$MC"
12+
13+
sudo ln -sf "$MC" /etc/ssl/certs/ISRG_Root_X2.pem
14+
15+
sudo update-ca-certificates
16+
17+
# curl 是读这个文件而不是扫目录
18+
ROOT_BUNDLE='/etc/ssl/certs/ca-certificates.crt'
19+
if ! grep -q 'EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW' "$ROOT_BUNDLE"; then
20+
(sudo tee -a "$ROOT_BUNDLE") < ./isrg-root-x2.pem
21+
fi

cert/isrg-root-x2.pem

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw
3+
CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg
4+
R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00
5+
MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT
6+
ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw
7+
EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW
8+
+1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9
9+
ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T
10+
AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI
11+
zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW
12+
tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1
13+
/q4AaOeMSQ+2b1tbFfLn
14+
-----END CERTIFICATE-----

conda/run.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
mkdir -p /usr/local/src/conda
4+
5+
cd /usr/local/src/conda || exit
6+
7+
FILE="Miniconda3-py310_23.3.1-0-Linux-x86_64.sh"
8+
if [ ! -e "$FILE" ]; then
9+
wget "https://repo.anaconda.com/miniconda/$FILE"
10+
fi
11+
12+
if [ ! -e ~/.condarc ]; then
13+
echo "changeps1: False" > ~/.condarc
14+
fi
15+
16+
bash "$FILE"

cuda/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb*.deb

cuda/anaconda-install.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
conda install pillow
4+
conda install cudnn
5+
6+
conda install tensorflow=1.15
7+
conda install tensorflow-gpu=1.15

cuda/anaconda.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
4+
5+
FILE="/usr/local/src/anaconda3.sh"
6+
if [ ! -f "$FILE" ]; then
7+
wget 'https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh' -O "$FILE"
8+
fi
9+
10+
chmod +x "$FILE"
11+
"$FILE"

cuda/lib.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
apt install libffi-dev

cuda/nvidia-cuda-11.7-ubuntu-22.04.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
PIN="/etc/apt/preferences.d/cuda-repository-pin-600"
4+
if [ ! -e "$PIN" ]; then
5+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
6+
sudo mv cuda-ubuntu2204.pin "$PIN"
7+
fi
8+
9+
DEB="cuda-repo-ubuntu2204-11-7-local_11.7.1-515.65.01-1_amd64.deb"
10+
if [ ! -e "$DEB" ]; then
11+
wget "https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/${DEB}"
12+
sudo dpkg -i "$DEB"
13+
sudo cp /var/cuda-repo-ubuntu2204-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
14+
fi
15+
16+
sudo apt-get update
17+
sudo apt-get -y install cuda

cuda/run.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/bash
2+
3+
REP_FILE="/etc/apt/preferences.d/cuda-repository-pin-600"
4+
if [ ! -f "$REP_FILE" ]; then
5+
TMP_FILE="/tmp/cuda-ubuntu1804.pin"
6+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin -O "$TMP_FILE"
7+
sudo cp "$TMP_FILE" "$REP_FILE"
8+
fi
9+
10+
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
11+
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
12+
sudo apt-get update
13+
sudo apt-get -y install cuda

curl/msh3.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
cd /usr/local/src || exit 1
4+
5+
if [ ! -d msh3 ]; then
6+
git clone --depth 1 --recursive https://github.com/nibanks/msh3
7+
fi
8+
mkdir -p msh3/build
9+
cd msh3/build || exit 1
10+
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
11+
cmake --build .
12+
sudo cmake --install .
13+
14+
cd /usr/local/src || exit 1
15+
if [ ! -d curl ]; then
16+
git clone https://github.com/curl/curl
17+
fi
18+
cd curl || exit 1
19+
20+
git pull --rebase
21+
22+
sudo apt install libtool libssl-dev
23+
24+
autoreconf -fi
25+
./configure \
26+
LDFLAGS="-Wl,-rpath,/usr/local/lib" \
27+
--enable-versioned-symbols \
28+
--with-msh3=/usr/local \
29+
--with-openssl
30+
make -j"$(nproc)"
31+
sudo make install

curl/quiche.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash -ex
2+
3+
SRC="/usr/local/src"
4+
cd "$SRC" || exit 1
5+
6+
QUCIHE="${SRC}/quiche"
7+
8+
if [ ! -d quiche ]; then
9+
git clone https://github.com/cloudflare/quiche
10+
fi
11+
cd "$QUCIHE" || exit 1
12+
git pull
13+
git submodule update --init --recursive
14+
cargo build --package quiche --release --features ffi,pkg-config-meta,qlog
15+
QUCIHE_LIB="${QUCIHE}/quiche/deps/boringssl/src/lib"
16+
mkdir -p "${QUCIHE_LIB}"
17+
ln -vnf "${QUCIHE}/$(find target/release -name libcrypto.a)" "$QUCIHE_LIB"
18+
ln -vnf "${QUCIHE}/$(find target/release -name libssl.a)" "$QUCIHE_LIB"
19+
20+
cd "$SRC" || exit 1
21+
if [ ! -d curl ]; then
22+
git clone https://github.com/curl/curl
23+
fi
24+
cd curl
25+
git pull
26+
autoreconf -fi
27+
./configure \
28+
LDFLAGS="-Wl,-rpath,${QUCIHE}/target/release" \
29+
--with-openssl="${QUCIHE}/quiche/deps/boringssl/src" \
30+
--with-quiche="${QUCIHE}/target/release"
31+
make -j"$(nproc)"
32+
sudo make install

daily.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
cd $(dirname `readlink -f $0`)
4+
5+
./git/run.sh
6+
./go/update_bin.sh
7+
./nodejs/stable.sh
8+
./nodejs/npm.sh
9+
./shadowsocks/run.sh
10+
./vim/run.sh
11+
./watchman/run.sh

dict/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/wudao-dict
2+
/dict-bin

dict/run.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
DIR=`readlink -f "$0"` && DIR=`dirname "$DIR"` && cd "$DIR" || exit 1
4+
5+
if [ ! -e 'wudao-dict' ]; then
6+
git clone https://github.com/chestnutheng/wudao-dict
7+
fi
8+
9+
sudo -H pip3 install bs4
10+
sudo -H pip3 install lxml
11+
12+
mkdir -p wudao-dict/wudao-dict/usr
13+
14+
echo '#! /bin/bash'> ./dict-bin
15+
echo "cd '${DIR}/wudao-dict/wudao-dict'" >> ./dict-bin
16+
echo './wdd $*' >> ./dict-bin
17+
18+
sudo cp ./dict-bin /usr/local/bin/dict
19+
sudo chmod +x /usr/local/bin/dict
20+
sudo cp ./wudao-dict/wudao-dict/wd_com /etc/bash_completion.d/wd
21+
. /etc/bash_completion.d/wd

disable-network-manager/dns.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
sudo systemctl disable systemd-resolved
4+
sudo systemctl stop systemd-resolved

0 commit comments

Comments
 (0)