Posts

Showing posts from 2023

Colima - Drop In replacement for Docker Desktop for Mac and Linux

Colima ( Co ntainer on Li nux Ma chines) is an open source alternative and drop in replacement for Docker Desktop on Mac and Linux. https://github.com/abiosoft/colima It is simple to setup and run containers without the need for sudo or root access. Images can be pulled form both Docker hub ( https://hub.docker.com ) or Amazon's public registry ( https://gallery.ecr.aws ) Amazon's registry is more permissive or friendly with pull rates for both clients and non-clients of AWS. This article show the setup and basics of running containers on mac. Installation command for Linux can vary based on the distribution type, hence please refer to official documentation for up-to-date steps at  https://github.com/abiosoft/colima/blob/main/docs/INSTALL.md Installation on mac: brew install docker  brew install docker-buildx brew install docker-compose brew install jq brew install colima Setup docker compose as docker plugin mkdir -p $HOME/.docker/cli-plugins ln -sfn $(which docker-compose) ...

git submodules

 git submodules allows to link one or more related git projects, which allows to build and execute commands in the dependent projects in a seamless way both on development machines and CI servers. This post explains about some basic commands required with git repositories containing git submodules. Add a new submodule: git submodule add <git_repo_url> <submodule_path> git add . git commit -m "Added Submodule" git push Remove an existing submodule: git submodule deinit <submodule_path> git rm <submodule_path> rm -rf .git/modules/<submodule_path> git add . git commit -m "Removed Submodule" git push Pull changes to submodules in already cloned repository: git pull --recurse-submodules git submodule update --init --recursive Pull changes to submodules in parallel: The -j parameters specifies the maximum number of parallel jobs to pull the submodules. In the below example -j8 means, up to 8 submodules will be pulled in parallel. The will spe...

Install Docker Engine and Compose on Linux machines (for developers)

Install docker: Know the linux architecture type using uname -m mkdir -p $HOME/tools/docker_engine Download latest static binary from https://download.docker.com/linux/static/stable/ to $HOME/tools/docker_engine sudo groupadd docker sudo gpasswd -a ${USER} docker newgrp docker find $HOME/tools/docker_engine -type f -name docker-*.tar.gz | xargs -I {} mv {} $HOME/tools/docker_engine/docker-engine.tar.gz tar -xvzf $HOME/tools/docker_engine/docker-engine.tar.gz -C $HOME/tools/docker_engine chmod a+rwx -R $HOME/tools/docker_engine/* ls -1 $HOME/tools/docker_engine/docker | xargs -I{} sudo ln -sfn $HOME/tools/docker_engine/docker/{} /usr/bin/{} Start docker service manually in the foreground sudo dockerd press Ctrl+C to stop/kill the docker engine Start docker service manually in the background sudo su nohup dockerd > /dev/null 2>&1 & exit Kill the docker service running in the background sudo ps -Aef | grep dockerd | grep -v grep | tr -s ' ' | cut -d' ' -f2 |...

Kibana KQL cheat sheet

Search logs containing the exact text message: "my search term" Search logs containing the wildcard text message: *search* Search logs with and, or, not ((message: "text 1" OR "text 2") AND (message: *text3*) AND NOT (message: "text 4")) Search logs where message field exists message: * Search logs where message field not exists NOT message: * Search logs by level: (level: "INFO" OR level: "WARN" OR level: "ERROR" OR level: "DEBUG" OR level: "TRACE") Search logs by kubernetes pod name: kubernetes.pod.name: example-service-name-* Search logs by kubernetes container name: kubernetes.container.name: "example-container-name" Common fields: @timestamp message level kubernetes.pod.name kubernetes.container.name