Skip to content

Instantly share code, notes, and snippets.

View stvnwrgs's full-sized avatar
🪁
Building something new

Steven Wirges stvnwrgs

🪁
Building something new
View GitHub Profile
```
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

Done for fish

General

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}")

Network problems

@stvnwrgs
stvnwrgs / pushb
Last active June 2, 2022 13:57
A small script to send push notifications to your phone when a job is done
#! /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):
#

Keybase proof

I hereby claim:

  • I am stvnwrgs on github.
  • I am stvnwrgs (https://keybase.io/stvnwrgs) on keybase.
  • I have a public key ASBpkVSgIb7JxuRBrnHdOjeRo3eMFf7-D9EslsWp2G9TxAo

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
@stvnwrgs
stvnwrgs / README.md
Last active October 6, 2020 10:28
A little script that automatically resizes a gce disk and the partition on the disk.

Google Cloud Bash Scripts

This little script is used to resize and repartition disks in GKE.

Requirements

  • gcloud

Disk Resizer

Usage

# 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}'`
@stvnwrgs
stvnwrgs / asd
Created November 16, 2015 19:51
asd
asd
@stvnwrgs
stvnwrgs / gist:cf346143cf57ee76cb27
Created October 12, 2015 15:42
Bash one-liner for generating a etcd2 discovery token and replace it in a yml file
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;