Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| #!/usr/bin/env bash | |
| set -m # enable job control | |
| ## run with "-d" command line switch to debug each step, script will wait for keypress to go on | |
| ## integrated mods by KingdonB in his fork: https://gist.github.com/kingdonb/dec74f3b74ffbb83b54d53d5c033e508 | |
| ## added proper coredns patching via "coredns-custom" configmap | |
| ## added automatic /etc/hosts file modification if needed, sudo password will be asked in case | |
| ## added (commented out) lines to add Flux extra controllers to the setup | |
| ## deployed podinfo as in Flux Get Started guide |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| annotations: | |
| deployment.kubernetes.io/revision: "8" | |
| creationTimestamp: "2020-11-02T14:42:53Z" | |
| generation: 8 | |
| labels: | |
| app.kubernetes.io/instance: flux | |
| app.kubernetes.io/version: latest |
| { | |
| "check": { | |
| "id": "check-disk", | |
| "name": "check-disk", | |
| "script": "/usr/lib/nagios/plugins/check_disk -w 30% -c 5%", | |
| "interval": "1m" | |
| } | |
| } |
| #!/bin/bash | |
| sudo /sbin/route add -net x.x.x.0/24 xxx.xxx.xxx.xxx | |
| # Save this file somewhere and make it executable (chmod a+x <file>) | |
| # Then run 'sudo defaults write com.apple.loginwindow LoginHook /Path/To/Your/Script' |
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
The new Docker daemon uses port: 2376 with TLS enable by default. Sometimes I want to play with curl
on the old plain http port 2375. The trick is: use socat in a container to proxy the unix socket
to a real port.
docker run -d \
--volume /var/run/docker.sock:/var/run/docker.sock \
--name docker-http \
deb socat -d -d TCP-L:2375,fork UNIX:/var/run/docker.sock
| #!/bin/bash | |
| # Author: Erik Kristensen | |
| # Email: [email protected] | |
| # License: MIT | |
| # Nagios Usage: check_nrpe!check_docker_container!_container_id_ | |
| # Usage: ./check_docker_container.sh _container_id_ | |
| # | |
| # Depending on your docker configuration, root might be required. If your nrpe user has rights | |
| # to talk to the docker daemon, then root is not required. This is why root privileges are not |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| namespace Bleroy.Helpers { | |
| public static class NotNull { | |
| public static TProp Get<TSource, TProp>(this TSource source, Expression<Func<TSource, TProp>> property) where TSource : class { | |
| if (source == null) return default(TProp); | |
| var current = property.Body; |