Skip to content

Instantly share code, notes, and snippets.

@dodocat
dodocat / create-docker-tls.sh
Last active December 26, 2017 07:05 — forked from Stono/create-docker-tls.sh
Creating and setting up Docker for TLS
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#
@dodocat
dodocat / gist:c125c13ef60fd43ac592155842ca6d21
Created November 21, 2017 01:16
docker in docker gitlab
docker start image daemon
https://stackoverflow.com/questions/24706708/how-to-start-docker-container-as-server

get project list from a repo

repo forall -c 'echo $REPO_PATH:$REPO_PROJECT > path_list.txt'

filter non-exist path

 cat path.txt | while read p; do a=`echo $p | cut -d ':' -f1`; b=`echo $p | cut -d ':' -f2`; if [ -d $a ]; then echo $a:$b; fi; done;

说明

Google I/O 2016 上发布了 ConstraintLayout, 简直是要变革 Android 写界面方式. 于是第二天我立即找到相关文档尝试, 这是官方提供的 Codelab 项目. 手把手教你探索 ConstraintLayout.

本文涉及到一些词汇对照表:

Constraint 约束
Constraint Handle 约束手柄

Gradle 的全局配置 Global Gradle Configration

gradle 的一些构建参数需要配置在用户全局配置中:

  • 不应提交到源码的私有信息
  • 全局通用配置
  • 持续集成配置

Gradle 的配置结构是这样的: User -> project -> module. User 级的 Gradle 配置位于 ~/.gradle/gradle.properties. 全局配置都在这个文件.

解决一个重复 class 导致的 dex 错误

Develop AOSP Module efficiently 高效开发 AOSP 模块

mmm frameworks/packages/SystemUI/  # 编译指定模块
adb sync system # 把编译出的结果同步到设备中
adb shell stop # 重新启动应用
adb shell start
find . -type f -name '*java' -exec enca -L zh_CN -x UTF-8 {} \;
pushd $OUT
arch=$(date +y+m+d)
mkdir -p ../$arch
cp -uvL * ../$arch
tar zcvf ../$arch.tar.gz ../$arch/*
popd
@dodocat
dodocat / dos2unix.sh
Created April 19, 2016 09:20
Convert dos \n\r to unix \n
#!/bin/bash
showUsage()
{
echo "Usage: dos2unixdir [destdir]"
exit 0
}
dir=$PWD
if [ $# -gt 1 ]
then