Done for fish
Get latest created pod in namespace
kubectl -n $NAMESPACE logs (kubectl -n $NAMESPACE get pods --sort-by=.metadata.creationTimestamp -o jsonpath="{.items[-1:].metadata.name}")
| ``` | |
| level=debug ts=2020-03-20T08:42:41.652898089Z caller=mock.go:159 msg=Get key=collectors/ring modify_index=2 value="\"7\\xd8\\n5\\n\\x14logging-store-loki-0\\x12\\x1d\\n\\x13192.168.23\"" | |
| level=debug ts=2020-03-20T08:42:41.65371781Z caller=mock.go:86 msg=CAS key=collectors/ring modify_index=2 value="\"\\xad\\x1e\\xf0<\\n3\\n\\x14logging-store-loki-0\\x12\\x1b\\n\\x13192.168.\"" | |
| level=debug ts=2020-03-20T08:42:41.653765369Z caller=mock.go:159 msg=Get key=collectors/ring modify_index=3 value="\"\\xad\\x1e\\xf0<\\n3\\n\\x14logging-store-loki-0\\x12\\x1b\\n\\x13192.168.\"" | |
| level=debug ts=2020-03-20T08:42:41.653919855Z caller=mock.go:113 msg=Get key=collectors/ring wait_index=3 | |
| level=debug ts=2020-03-20T08:42:46.652925235Z caller=mock.go:113 msg=Get key=collectors/ring wait_index=0 | |
| level=debug ts=2020-03-20T08:42:46.652971628Z caller=mock.go:159 msg=Get key=collectors/ring modify_index=3 value="\"\\xad\\x1e\\xf0<\\n3\\n\\x14logging-store-loki-0\\x12\\x1b\\n\\x13192.168.\"" | |
| level=debug ts=2020-03-20T08:42:46.65 |
| #! /bin/bash | |
| #################### Usage | |
| # | |
| # 1. Register an account on https://www.pushbullet.com/ | |
| # 2. Add devices | |
| # 3. Create an access token https://www.pushbullet.com/#settings/account | |
| # 4. save it to your bash profile $PUSHBULLET_API_TOKEN | |
| # 5. Re-source, Execute the following (you can remove jq): | |
| # |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| wget -N -P /tmp http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz | |
| gunzip -k /tmp/GeoLite2-City.mmdb.gz | |
| mv /tmp/GeoLite2-City.mmdb /varGeoLite2-City.mmdb |
| # instance group instances | |
| gcloud compute instance-groups managed list-instances playground-etcd-group-manager --zone europe-west1-d --format json |jq .[].instance |rev |cut -d/ -f1 | rev | tr -d '"' |
| #Output# | |
| ## Ignore command fails ## | |
| `|| true` | |
| # String Manipulation # | |
| ## Get value seperated by tab/space ## | |
| `| awk '{print $2}'` |
| asd |
| step1: res=$(curl -w "\n" 'https://discovery.etcd.io/new?size=3') => set var res = discovery url | |
| step2: sed -i'' -e "s,discovery: \".*,discovery: \"$res\",g" coreos/etcd.yml; => replace | |
| step3: rm coreos/etcd.yml-e; => remove to stupid backup file | |
| res=$(curl -w "\n" 'https://discovery.etcd.io/new?size=3');sed -i'' -e "s,discovery: \".*,discovery: \"$res\",g" coreos/etcd.yml;rm coreos/etcd.yml-e; |