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
#!/usr/bin/env bash | |
curl -o- -L https://gist.githubusercontent.com/hangox/1b7c6b1e675cba36e654e5d9f546085d/raw/4e416c709187f914a919e6f6a9ba22fcd611cf74/enable-bbr.sh | bash | |
sudo apt-get remove docker docker-engine docker.io containerd runc | |
sudo apt-get update -y | |
sudo apt-get install -y\ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ |
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
#!/usr/bin/env bash | |
sudo apt-get remove docker docker-engine docker.io containerd runc | |
sudo apt-get update -y | |
sudo apt-get install -y\ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common |
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 | |
ANDROID_HOME=$1 | |
check_android_home() { | |
if [ "$#" -lt 1 ]; then | |
if [ -z "${ANDROID_HOME}" ]; then | |
echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter" | |
exit 1 | |
else | |
ANDROID_HOME="${ANDROID_HOME}" |
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
#!/usr/bin/env bash | |
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf | |
sysctl -p | |
sysctl net.ipv4.tcp_available_congestion_control | |
sysctl net.ipv4.tcp_congestion_control | |
lsmod | grep bbr |
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
#!/usr/bin/env bash | |
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org | |
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm | |
yum --enablerepo=elrepo-kernel install kernel-ml -y | |
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \' | |
grub2-set-default 0 # default 0 表示第一个内核设置为默认运行, 选择最新内核就对了 | |
reboot |
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
#!/usr/bin/env bash | |
# 移除老旧docker | |
sudo yum remove docker \ | |
docker-common \ | |
docker-selinux \ | |
docker-engine | |
sudo yum install -y yum-utils \ |
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
简单的用法就是 | |
git archive --format zip --output /path/to/file.zip master # 将 master 以zip格式打包到指定文件 | |
还有个更简单的 | |
git archive v0.1 | gzip > site.tgz | |
git archive master > /home/hainuo/fds.zip |
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
apply plugin: 'com.bmuschko.nexus' | |
//buidscript 中添加 classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' | |
//version = '1.1' | |
//group = 'com.hangox' | |
//ext{ | |
// libName = 'RulerView' | |
// libDescripton = '刻度尺' | |
//} | |
modifyPom { |
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
View statusBar = getWindow().getDecorView().findViewById(android.R.id | |
.statusBarBackground); | |
statusBar.setBackgroundResource(android.R.color.transparent); |
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
public static int dpToPx(Context context,float dpValue) { | |
final float scale =context.getResources().getDisplayMetrics().density; | |
return (int) (dpValue * scale + 0.5f); | |
} |
NewerOlder