Skip to content

Instantly share code, notes, and snippets.

View tstromberg's full-sized avatar
🚀
Making Chainguard awesome.

Thomas Strömberg tstromberg

🚀
Making Chainguard awesome.
View GitHub Profile
@tstromberg
tstromberg / pull_qardio_csv.sh
Created September 7, 2016 23:40
Export Qardio heartbeat measurements from an Android phone to a local CSV file.
#!/bin/bash
#
# Export Qardio heartbeat measurements to a local CSV file.
set -eux -o pipefail
adb shell "echo cp /data/data/com.getqardio.android/databases/qardio.db /mnt/sdcard/ \| su"
adb shell "echo chmod 777 /mnt/sdcard/qardio.db \| su"
adb pull /mnt/sdcard/qardio.db
echo -e '.mode csv\nSELECT * FROM measurements;' \
| sqlite3 qardio.db | tee qardio.csv
@tstromberg
tstromberg / git-hacks.sh
Created August 21, 2018 05:32
git hacks subtree
git remote add common git@github.com:tstromberg/git-experiments.git
git checkout common/master
git subtree split -P hacks/verify-go-lint -b split-verify-go-lint-branch
@tstromberg
tstromberg / meh.sh
Created September 17, 2018 04:41
theflybook / sly park availability
# 1055 is "Tent Only"
% curl 'https://go.theflybook.com/vx/entities/find' -H 'Origin: https://go.theflybook.com' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11021.13.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.16 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://go.theflybook.com/Book/356/6f3cf449-4837-48f3-a553-fc57985a8eba/0' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'X-FB-API-KEY: de2ab706-c36f-4381-82be-2a45c621366b' -H 'Sec-Metadata: destination="", site=same-origin' --data-binary '{"categoryId":1055}' --compressed > /tmp/sites
% egrep -o 'entityId": (.*),' /tmp/sites | cut -d" " -f2 | cut -d, -f1 | xargs > /tmp/sitenums
% for i in $(cat /tmp/sitenums); do echo $i; curl -s "https://go.theflybook.com/vx/lodging/$i/AvailabilityDatesOnly" -H 'Origin: https://go.theflybook.com' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-
#!/bin/sh
# This script executes the Kubernetes conformance tests in accordance with:
# https://github.com/cncf/k8s-conformance/blob/master/instructions.md
#
# Usage:
# conformance_tests.sh <path to minikube> <flags>
#
# Example:
# conformance_tests.sh ./out/minikube --vm-driver=hyperkit
set -ex -o pipefail
#!/bin/sh
# This script executes the Kubernetes conformance tests in accordance with:
# https://github.com/cncf/k8s-conformance/blob/master/instructions.md
#
# Usage:
# conformance_tests.sh <path to minikube> <flags>
#
# Example:
# conformance_tests.sh ./out/minikube --vm-driver=hyperkit
set -ex -o pipefail
% ./out/minikube start --alsologtostderr [+0007] tstromberg@:~/src/minikube
I0407 08:50:04.096199 61908 notify.go:125] Checking for updates...
I0407 08:50:04.443902 61908 start.go:262] hostinfo: {"hostname":"tstromberg-macbookpro.roam.corp.google.com","uptime":516377,"bootTime":1585758227,"procs":533,"os":"darwin","platform":"darwin","platformFamily":"","platformVersion":"10.15.4","kernelVersion":"19.4.0","virtualizationSystem":"","virtualizationRole":"","hostid":"ab0aa7ee-3d03-3c21-91ad-5719d79d7af6"}
W0407 08:50:04.444367 61908 start.go:270] gopshost.Virtualization returned error: not implemented yet
😄 minikube v1.9.2 on Darwin 10.15.4
I0407 08:50:04.465639 61908 driver.go:245] Setting default libvirt URI to qemu:///system
I0407 08:50:04.465715 61908 global.go:100] Querying for installed drivers using PATH=
## Fake hyperkit
```
% cat /tmp/hyperkit
#!/bin/sh
echo "hyperkit: v0.20190802-4-g97f091"
```
## Set PATH
2020-04-08T15:35:11.1051573Z ##[section]Starting: Request a runner to run this job
2020-04-08T15:35:11.4252647Z Requesting a hosted runner in current repository's account/organization with labels: 'ubuntu-18.04', require runner match: True
2020-04-08T15:35:11.5245861Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2020-04-08T15:35:11.5599694Z ##[section]Finishing: Request a runner to run this job
2020-04-08T15:35:17.5479494Z Current runner version: '2.168.0'
2020-04-08T15:35:17.5499496Z ##[group]Operating System
2020-04-08T15:35:17.5500014Z Ubuntu
2020-04-08T15:35:17.5500124Z 18.04.4
2020-04-08T15:35:17.5500265Z LTS
2020-04-08T15:35:17.5500406Z ##[endgroup]
#!/bin/sh
version="v1.11.0"
old="/tmp/minikube-${version}"
curl -L -C - -o "${old}" https://storage.googleapis.com/minikube/releases/${version}/minikube-darwin-amd64
chmod 755 "${old}"
git fetch
git pull
make
*** LOOP 23 of 50: v1.11.0 to HEAD, logging to /var/folders/n1/qxvd9kc11w15mc4qv6g43x80000kt3/T/tmp.lchLxlhY
*** start flags: -p stresscd597 --base-image gcr.io/k8s-minikube/kic:ubuntu-upgrade --driver=docker --delete-on-failure
Upgrade v1.11.0 to HEAD hot test: loop 23
I0724 03:09:33.214125 70622 start.go:98] hostinfo: {"hostname":"tstromberg-macbookpro.roam.corp.google.com","uptime":235076,"bootTime":1595350297,"procs":488,"os":"darwin","platform":"darwin","platformFamily":"","platformVersion":"10.15.5","kernelVersion":"19.5.0","virtualizationSystem":"","virtualizationRole":"","hostid":"54f1a78d-6f41-32bd-bfed-4381f9f6e2ef"}
W0724 03:09:33.214257 70622 start.go:106] gopshost.Virtualization returned error: not implemented yet
I0724 03:09:33.234536 70622 driver.go:253] Setting default libvirt URI to qemu:///system
I0724 03:09:33.291763 70622 docker.go:95] docker version: linux-19.03.8