Useful commands

I use plenty of tools on a daily basic 🛠️. Some of them are used more often than others. I keep the most useful ones on that page to have easy access to them. They are in an alphabetical order.

Benchmarking in a loop (Ruby) 10 April 2020

loop { puts Benchmark.measure{ Rails.cache.data.keys('*') } }

Copy public SSH keys to clipboard 6 May 2020

pbcopy < ~/.ssh/id_rsa.pub

dmesg 27 March 2020

sudo dmesg diagnostic message, prints the message buffer of the kernel.

find 29 March 2020

find / -name "script.sh" to find a file or a directory.

Kubernetes: Display pod’s logs 5 May 2020

kubectl logs -n [NAMESPACE] [POD]

Kubernetes: Force recreate a pod 5 May 2020

kubectl get pod [POD] -n coral -o yaml | kubectl replace --force -f -

Kubernetes: Get deployments with current image version 5 May 2020

kubectl get deployments -n [NAMESPACE] -o wide

Kubernetes: List all pods in a namespace 5 May 2020

kubectl get pods -n [NAMESPACE]

Kubernetes: List pods from all namespaces 5 May 2020

kubectl get pods --all-namespaces

Pushing a tag to GitHub repo 10 April 2020

git tag -a v1.0.2 -m "Description"
git push origin v1.0.2

Removing AWS ElastiCache Redis instance 10 April 2020

aws elasticache delete-cache-cluster --cache-cluster-id [INSTANCE_NAME]

Setting GitHub token for Bundler (Ruby) 10 April 2020

export BUNDLE_GITHUB__COM=x-access-token:[TOKEN]