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
@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):
#
@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

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

```
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

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:

$grid_width:66px;
$grid_space: 16px;
.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12 {
display: inline;
float: left;
position: relative;
margin-left: $grid_space / 2;
margin-right: $grid_space / 2;
}
#!/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}'`
@stvnwrgs
stvnwrgs / Git Status Bash scripts
Last active December 28, 2015 23:29
Get Information for contributed users of a repo
/**
* Show inserts and delets by users in a repo
*
*
**/
perl -e 'foreach(`git shortlog -s -n`){'\
'($c,$a)=$_=~/^\s*(\d+)\s*(.+?)\s*$/;$p=$m=0;'\
'foreach(`git log --author="$a" --pretty=tformat: --numstat -C`)'\
'{($pp,$mm)=$_=~/^\s*(\d+)\s+(\d+)/;$p+=$pp;$m+=$mm;}'\