---
# System prepended metadata

title: 其他指令
tags: [筆記, 公司]

---

# 其他指令
## 憑證
### 製作 pfx 檔案
```bash=
openssl pkcs12 -export -out www.twlab.net.pfx -inkey my.key -in my.crt -certfile sign.crt
```
## 探針
### 插入探針指令
```bash=
java -javaagent:/ArmsAgent/arms-bootstrap-1.7.0-SNAPSHOT.jar -Darms.licenseKey=guxvxe3gog@bc5cd30d7a09568 -Darms.appName=$arms_appname -cp $CLASSPATH -Xms6144m -Xmx6144m com.digiwin.gateway.DWApiGatewayApplication
```
### Docker 探針啟動指令
```bash=
#JAVA_HOME=/opt/jdk1.8
#export JAVA_HOME

WORKDIR=/DWApiGateway/WEB-INF
export WORKDIR

CLASSPATH=.:$WORKDIR:$WORKDIR/lib/*:$WORKDIR/classes/*:$WORKDIR/properties
export CLASSPATH

cd $WORKDIR/classes

if test -z "$arms_appname";
then
        java -cp $CLASSPATH -Xms@jvm.xms@ -Xmx@jvm.xmx@ com.digiwin.gateway.DWApiGatewayApplication
else
        java -javaagent:/ArmsAgent/arms-bootstrap-1.7.0-SNAPSHOT.jar -Darms.licenseKey=guxvxe3gog@bc5cd30d7a09568 -Darms.appName=$arms_appname -cp $CLASSPATH -Xms@jvm.xms@ -Xmx@jvm.xmx@ com.digiwin.gateway.DWApiGatewayApplication
fi
```

### Kubernetes 探針植入指令
```yaml=
apiVersion: extensions/v1beta1
kind: Deployment
metadata: {name: dop-test-dwapigateway, namespace: dop}
spec:
  replicas: 1
  template:
    spec:
      containers:
      - image: digiwincloudacr.azurecr.io/dop/dopbackend-2.0.0.14:1.1.1.1004.10001
        name: dop-test-dwapigateway
        env:
        ...（省略）
        - {name: arms_appname, value: DOP-TEST} // 探針名稱
        ...（省略）
        ports:
        - {containerPort: 32622}
        volumeMounts:
        - {mountPath: /DWApiGateway/WEB-INF/classes/log, name: dwlogs}
        - {mountPath: /ArmsAgent, name: arms} //探針位置
        - {mountPath: /etc/localtime, name: host-time}
      volumes:
      - name: dwlogs
        nfs: {server: 10.0.0.159, path: /data/digiwincloudlog/dop}
      - name: arms
        nfs: {server: 10.0.0.159, path: /data/ArmsAgent}
      - name: host-time
        hostPath: {path: /etc/localtime}
      nodeSelector: {area: dop}
    metadata:
      labels: {run: dop-test-dwapigateway}
  strategy:
    type: RollingUpdate
    rollingUpdate: {maxSurge: 100%, maxUnavailable: 0%}
  minReadySeconds: 180
```
## 檔案位置
### Windows Hosts
```bash
C:\Windows\System32\drivers\etc\
```

## Harbor API
### 取得 repositories 的 id
- https://registry.digiwincloud.com.cn/api/projects?name=oee
### 取得
- https://registry.digiwincloud.com.cn/api/repositories?project_id=41
- https://registry.digiwincloud.com.cn/api/repositories/oee/oeefrontend/tags

###### tags: `公司` `筆記`