Skip to content

Instantly share code, notes, and snippets.

View rsevilla87's full-sized avatar
💩

Raúl Sevilla rsevilla87

💩
View GitHub Profile
@rsevilla87
rsevilla87 / ca.md
Created June 13, 2018 07:11 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@rsevilla87
rsevilla87 / gist:232058ac11c46d7004e6a0cc36b67e39
Last active August 29, 2019 09:34
Number of running pods per node in a kubernetes cluster
kubectl get pods -o go-template --template='{{range .items}}{{if eq .status.phase "Running"}}{{.spec.nodeName}}{{"\n"}}{{end}}{{end}}' --all-namespaces | awk '{nodes[$1]++ }END{ for (n in nodes) print n": "nodes[n]}'
List failed pods and show their reserved IP address:
kubectl get pod --all-namespaces -o template --template='{{ range .items }} {{ if eq .status.phase "Failed" }}{{"\n" }}{{ .metadata.name }}{{": "}}{{ .status.phase }}{{" "}}{{ .status.podIP}}{{ end }}{{ end }}'
@rsevilla87
rsevilla87 / agrimotor.sh
Created August 29, 2017 15:09
Periodic agrimotor
nohup bash -c 'while [ 0 ]; do sleep 3 ; for i in /dev/pts/*; do echo -e '\e[33m\U1F69C\e[0m' >${i}; done 2>/dev/null ; done' &
@rsevilla87
rsevilla87 / config.rake
Created April 27, 2017 22:15
ManageIQ config rake tasks
namespace :config do
role_list = ["automate", "database_owner", "ems_metrics_coordinator", "ems_metrics_collector", "ems_metrics_processor", "database_operations", "event", "git_owner", "notifier", "ems_inventory", "ems_operations", "rhn_mirror", "reporting", "scheduler", "smartproxy", "smartstate", "user_interface", "web_services", "websocket"]
desc "Usage information regarding available tasks"
task :usage do
puts "The following configuration tasks are available, arguments between [] are optional:"
puts " List all roles available - Usage: rake config:list_roles"
puts " List appliance active roles - Usage: rake config:list_active_roles [APPLIANCE_ID=appliance_id]"
puts " Set appliance roles - Usage: rake config:set_roles SERVER_ROLES='[\"roles\", \"json\", \"array\"]' [APPLIANCE_ID=appliance_id]"