Skip to content

Instantly share code, notes, and snippets.

@ivanape
ivanape / minikube-litmus-chaos.sh
Last active October 29, 2021 13:58
Create a minikube cluster with Litmus Chaos 2.0
#Create minikuke cluster
minikube start --cpus 6 --memory 8g --container-runtime cri-o --driver virtualbox --kubernetes-version 1.19.0
#Create litmus namespace
minikube kubectl create ns litmus
#Deploy litmus
minikube kubectl -- apply -f https://litmuschaos.github.io/litmus/2.2.0/litmus-2.2.0.yaml
#Get litmus portal URL
# remove all containers
docker rm -vf $(docker ps -a -q)
# remove all images
docker rmi -f $(docker images -a -q)
# system prune
docker system prune
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@ivanape
ivanape / postgres_queries_and_commands.sql
Created July 13, 2017 09:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'