Coding Spirit

一位程序员,比较帅的那种

AWS IoT allow user to use x.509 certificate to get services authentication(like KVS) via AWS IoT core. To verify if policies are correctly attached, we can use curl to check if temporary token can be granted or not:

1
curl -H "x-amzn-iot-thingname:my_thing_name" --cert certificate.pem --key private.pem.key  https://xxxxxxxxxxxxxx.credentials.iot.us-east-1.amazonaws.com/role-aliases/my_thing_role_aliases/credentials --cacert cacert.pem

If set runs-on as ubuntu-latest, user can use Github CLI tool gh to set secret in actions:

1
2
3
4
5
6
7
- name: Set ECR credentials
id: set-ecr-credentials
run: |
gh auth login --with-token <<< ${{ secrets.PA_TOKEN }}
gh secret set ECR_REGISTRY --body ${{ steps.login-ecr.outputs.registry }} --repo ${{ github.repository }}
gh secret set ECR_USERNAME --body ${{ steps.login-ecr.outputs.username }} --repo ${{ github.repository }}
gh secret set ECR_PASSWORD --body ${{ steps.login-ecr.outputs.password }} --repo ${{ github.repository }}

Using following command to delete all workflow runs on GitHub actions of a specific branch:

1
user=GH_USERNAME repo=REPO_NAME; gh api repos/$user/$repo/actions/runs \--paginate -q '.workflow_runs[] | select(.head_branch == "master") | "\(.id)"' | \xargs -n1 -I % gh api repos/$user/$repo/actions/runs/% -X DELETE

Replace GH_USERNAME and REPO_NAME with your parameters.

You need to install GitHub CLI tool gh first.

1
raspivid -o - -t 0 | cvlc -v stream:///dev/stdin --sout '#rtp{sdp=rtsp://:5554/}' :demux=h264
0%