Curl with credentials

Curl with basic authentication user curl --user USER:PASSWORD https://raw.githubusercontent.com/cplee/github-actions-demo/refs/heads/master/package.json Curl with basic authentication as Header Encode your credentials in base64 first then pass it to your curl command: # Encode your credentials $ echo 'USER:PASSWORD' | base64 VVNFUjpQQVNTV09SRAo= # Pass it to your curl command $ curl -H "authorization: Basic VVNFUjpQQVNTV09SRAo=" https://raw.githubusercontent.com/cplee/github-actions-demo/refs/heads/master/package.json # Note that you can also decode your base64 encoded credentials this way ```$ echo -n VVNFUjpQQVNTV09SRAo= | base64 -d USER:PASSWORD You can also pass the command directly in your curl command: ...

April 17, 2025 · 2 min

Docker Compose Tips

Useful commands List deployed docker compose project docker compose ls Cleanup containers and volumes docker compose down -v Copy from one volume to another cp -rp /var/lib/docker/volumes/ftith_opensearch-data1/_data/ /var/lib/docker/volumes/opensearch_opensearch-data1/ YAML anchor and aliases Simple x-common_env: &common_env env_file: - db.env services: db: <<: *common_env image: postgres:16.3 frontend: <<: *common_env image: nginx:1.27.0-bookworm Common anchors with multiple docker compose files Due to this bug: https://github.com/docker/compose/issues/5621, you’ll need a workaround to fix this issue. Given those 2 files: db.yml ...

December 20, 2023 · 1 min