Skip to content

Instantly share code, notes, and snippets.

@namp10010
namp10010 / curl_statuscode.sh
Created September 7, 2022 22:53
curl check status code
#!/bin/bash
curl -X GET -s -o /dev/null -w '%{http_code}' http://localhost:8080/healthz` -eq 200 || exit 1
@namp10010
namp10010 / docker_healthcheck.sh
Created September 20, 2022 06:46
check docker compose healthcheck status and output
#!/bin/bash
# checking docker healthcheck status and output
docker inspect --format "{{json .State.Health }}" your_container_name
@namp10010
namp10010 / global-gitignore.md
Created September 29, 2022 05:36 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@namp10010
namp10010 / postgres.yaml
Created November 13, 2023 23:05
postgres docker-compose with init scripts and health check.
postgres_db:
image: postgres
deploy:
resources:
limits:
memory: 125M
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
healthcheck:
@namp10010
namp10010 / go_cmd_globbing.md
Created November 28, 2023 20:20
go cmd matching globbing pattern
@namp10010
namp10010 / rdb_design.md
Created November 28, 2023 21:12
relational database design resources