Shell 判断系统类型

case “$OSTYPE” in
linux*)
echo “Set Envs for linux”
;;
darwin*)
echo “Set Envs for Mac”
;;
*)
echo “Unsupported OS, Exit”
exit 100
;;
esac

Android Gradle SDK License Agreements

* What went wrong:
A problem occurred configuring project ':mi'.
> Failed to notify project evaluation listener.
   > You have not accepted the license agreements of the following SDK components:
     [Android SDK Build-Tools 25].
     Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
     Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
   > You have not accepted the license agreements of the following SDK components:
     [Android SDK Build-Tools 25].
     Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
     Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

解决方案: android update sdk -u在过程中选择同意[y]

Docker 常用命令

列出所有镜像


docker images
docker images --format "{{.ID}}: {{.Repository}}"
docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"

删除 Dangling 镜像

docker rmi $(docker images -q -f dangling=true)

进入容器

docker exec -it name bash

Docker Commit

docker commit \--author "name" \--message "message" \webserver \nginx:v2sha256:000000000.....

以root用户进入Container

docker exec -u root -it [container_id] bash

挂载卷

docker run -d -v hostdata:/containerdata xxxx

端口映射

docker run -p [host port]:[container port] xxx

更新Docker存储大小

此方法会清除所有现有镜像,需要做好镜像备份

qemu-img create -f qcow2 ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 100G

以TAR包方式导入导出镜像

docker save -o ~/image_save.tar image
docker load -i ~/image_save.tar

上传到Docker Store

docker logindocker tag [image id] username/imagename:versiondocker push username/imagename

非root用户使用Docker

sudo usermod -aG docker $USER

查询Android设备硬解码能力

/system/etc/media_codecs.xml
/system/etc/media_profiles.xml

CSS Box Model

Alt css box model