Blog

  • git 一个commit 有多个 tag

    一个 commit 不小心打了多个 tag

    输出最新的 tag

    LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
    

    根据最新的 commit 显示多个 tag

    git show-ref --tags | grep $(git rev-parse v0.2.0)
    a359509551c1a85cdfbf7675d3f7f36a8577ee38 refs/tags/v0.2.0
    a359509551c1a85cdfbf7675d3f7f36a8577ee38 refs/tags/v0.3.0
    
  • 技术简历要点

    描述 prior success, STAR 法则:

    situation
    task
    action
    result

  • mac 查看端口占用

    docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:8080: bind: address already in use.
    ERRO[0000] error waiting for container: context canceled
    
    lsof -n -i4TCP:8080 | grep LISTEN
    
    main    30863 jpuyy   14u  IPv6 0xe7a300fd0dafc76f      0t0  TCP *:http-alt (LISTEN)
    
    jpuyy       30863   0.0  0.0  5014020  10856 s010  S+    3:22PM   0:00.29 /var/folders/d7/s1_bmdw95gg8grv857tkvqmw0000gp/T/go-build454434651/b001/exe/main all
    
    
  • kubernetes kafka-client

    镜像使用 https://hub.docker.com/r/confluentinc/cp-kafka/

    kubectl apply -f kafka-client.yaml

    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: kafka-client
      namespace: app
    spec:
      selector:
        matchLabels:
          app: kafka-client
      template:
        metadata:
          labels:
            app: kafka-client
        spec:
          containers:
            - name: kafka-client
              image: confluentinc/cp-kafka
              imagePullPolicy: IfNotPresent
              command: ["sleep"]
              args: ["infinity"]
    

    长时间跑在 front 或者使用

            command:
              - sh
              - -c
              - "exec tail -f /dev/null"
    
  • badblocks check disk

    家里的 linux 用了好长时间了,运行一下

    badblocks -v /dev/sda1 > /tmp/sda1-badsectors.txt
    Checking blocks 0 to 3907016703
    Checking for bad blocks (read-only test):