- Generate TLS certificates for
localhost:
pip install trustme-cli
trustme-cli- Run
wrkon each endpoint, eg:
| // Base64 encode | |
| val text = "This is plaintext." | |
| val bytesEncoded = java.util.Base64.getEncoder.encode(text.getBytes()) | |
| // Base64 decode | |
| val textDecoded = new String(java.util.Base64.getDecoder.decode(bytesEncoded)) | |
| println(textDecoded) |
| from starlette.applications import Starlette | |
| from starlette.routing import Route | |
| from starlette.responses import PlainTextResponse | |
| import httpx | |
| import aiohttp | |
| HOST, PORT = "localhost", 8000 | |
| URL = f"http://{HOST}:{PORT}/" |
localhost:pip install trustme-cli
trustme-cliwrk on each endpoint, eg:| 1 hostname elliot-01 | |
| 2 echo elliot-01 > /etc/hostname | |
| 3 bash | |
| 4 vim /etc/modules-load.d/k8s.conf | |
| 5 curl -fsSL https://get.docker.com | bash | |
| 6 docker version | |
| 7 docker ps | |
| 8 apt-get update && apt-get install -y apt-transport-https | |
| 9 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
| 10 echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list |
| oc project kubernauts | |
| podname=$(oc get pods | grep postgres-$(oc get dc postgres -o jsonpath='{.status.latestVersion}') | grep -v deploy | grep Running | awk '{print $1}') | |
| oc rsh -c postgres $podname | |
| OR | |
| oc get pods | grep postgres | |
| oc exec -it postgres-pod-name bash | |
| oc project kubernauts | |
| podname=$(oc get pods | grep postgres-$(oc get dc postgres -o jsonpath='{.status.latestVersion}') | grep -v deploy | grep Running | awk '{print $1}') | |
| oc rsh -c postgres $podname | |
| OR | |
| oc get pods | grep postgres | |
| oc exec -it postgres-pod-name bash | |
| #!/bin/bash | |
| ################ | |
| # Uncomment if you want the script to always use the scripts | |
| # directory as the folder to look through | |
| #REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| REPOSITORIES=`pwd` | |
| IFS=$'\n' |
| # https://pypi.python.org/pypi/kafka-python | |
| from kafka import TopicPartition | |
| from kafka import KafkaConsumer | |
| topic_name = 'test-01' | |
| group_id = 'test-consumer-01' | |
| KAFKA_BROKER_LIST="10.2.65.197:9092,10.2.67.55:9092,10.2.91.23:9092" | |
| # option 1 |
| #!/bin/bash | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |
Disable:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Enable:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist