Category: Uncategorized

  • Composer with Bitbucket Private Repository

    Create a Composer project and push it to your repo: Create Bitbucket OAuth Consumer here. This command will generate ./auth.json file. Use –global flag to generate ~/.composer/auth.json file. Add the private repository to ./composer.json. Use –global flag to generate ~/.composer/config.json file. Install the package from the private repository. We use dev-* prefix to checkout a…

  • Docker: ENTRYPOINT vs. CMD

    ENTRYPOINT is the process run when the container starts (PID 1). CMD is the argument for the entrypoint. When you run the container without arguments, this will execute ENTRYPOINT + CMD: When you run the container with arguments, this will execute ENTRYPOINT + arguments: When you want to override the entrypoint use the –entrypoint flag:

  • MySQL: Permissions

    Grant all: Grant all to a database starts with “test_”: From MySQL website: The _ and % wildcards are permitted when specifying database names in GRANT statements that grant privileges at the database level (GRANT … ON db_name.*). This means, for example, that to use a _ character as part of a database name, specify it using the \ escape character as \_ in the GRANT statement, to prevent the…

  • Kubernetes: Pulling Image From Private Registry

    Create the Secret for you docker registry: To double check: Create a test pod: For pod, setting the imagePullSecrets only available using the –overrides flag when you create the pod. After the pod is created, you cannot edit the imagePullSecrets using kubectl edit or patch. DEPLOYMENT You can edit the deployment manifest and add the…

  • Git: References

    Git references located in .git/refs folder .git/refs/heads is the position of commit based on branch (HEAD) in the local repository .git/refs/remotes/<remote-name> is the position of commit based on branch (HEAD) in the remote repository .git/refs/tags is the position of commit based on tag in the local repository Push commit to new remote branch Since this…

  • Linux: Find and Delete files

    Find the files you want to delete: References:

  • PHP: Include vs. Require

    Both are used to include external file to the script. Include When the file we are trying to include does not exist or the permission is incorrect, this will give you a warning and continue the script. Require When the file we are trying to include does not exist or the permission is incorrect, this…

  • Tmux: Session, Window, Pane

    Session Start a session CTRL-b + d – Detach from current session List sessions CTRL-b + s – Show sessions from inside the session Attach to a session Rename a “nameless” session to something meaningful CTRL-b + $ – Rename current session from inside the session Window CTRL-b + c – Create a new window…

  • Kubernetes: GatewayAPI Nginx

    Install Kubernetes GatewayAPI Install Nginx CRD Install Nginx Create NodePort Service Create Gateway resource References:

  • Kubernetes: GatewayAPI URLRewrite Filter

    In this example, request to /echo or /echo/ (because of the type: PathPrefix) will be rewritten as / and becomes the request of “web” Service. In this example, request only to /echo (because of the type: Exact) will be rewritten as / and becomes the request of “web” Service.