Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / _memo.md
Created Apr 21, 2022
Example of calling Cloud Monitoring API
View _memo.md

Prerequisite

  • python3
  • curl
  • gcloud

Usage

echo  | bash cloud-monitoring-api-list-time-series.sh   
@tkuchiki
tkuchiki / _usage.md
Created Apr 21, 2022
Drop Spanner tables
View _usage.md
$ bash drop-spanner-tables.sh <your project> <your spanner instance> <your spanner database>
View __usage.md

Prerequiresite

  • macOS: brew install coreutils
  • Linux: GNU date

Usage

# timelist.txt
3/16 17:26 ~ 17:29 JST
View delete-spanner-databases.sh
#!/bin/bash
project="${1}"
instance="${2}"
billing_project="${3}"
_gcloud() {
if [ "${billing_project}" != "" ]; then
gcloud --project ${project} --billing-project ${billing_project} "${@}"
fi
View calc-elapsed-times.rb
#!/usr/bin/env ruby
require 'time'
require 'optparse'
in_delim = "\t"
out_delim = "\t"
f = nil
opt = OptionParser.new
@tkuchiki
tkuchiki / install_mysql8_ubuntu.sh
Created Aug 29, 2020
Install mysql 8.0 on ubuntu 18.04
View install_mysql8_ubuntu.sh
#!/bin/bash
apt-get update
apt-get install -y debconf libaio1 apparmor-profiles lsb-release gnupg
DEB="/tmp/mysql.deb"
ROOT_PASSWORD=""
MYSQL_USER="testuser"
MYSQL_PASSWORD="testpass"
@tkuchiki
tkuchiki / memo.md
Created Jul 17, 2019
Show HTTP status code constants for Go(net/http)
View memo.md
$ go doc -all net/http | awk '$1 ~ /Status/ && $2 == "=" {print}' | awk '{print $3, $1}'
100 StatusContinue
101 StatusSwitchingProtocols
102 StatusProcessing
200 StatusOK
201 StatusCreated
202 StatusAccepted
203 StatusNonAuthoritativeInfo
204 StatusNoContent
@tkuchiki
tkuchiki / _memo.md
Last active Aug 11, 2020
Recursive PURGE from BASE URL for Fastly
View _memo.md

Requirements

  • wget
  • curl

Usage

$ bash fastly-recursive-purge.sh https://example.com
@tkuchiki
tkuchiki / doc.md
Last active May 6, 2019
V8 plot-timer-events.patch
View doc.md
View gist:19bc02b050052e2fdffbb31c1b10ff95
## Prerequire
- https://brew.sh/
- Jave 8 >=
- `brew tap homebrew/cask-versions`
- `brew cask install java11`
- minio
- `brew install minio/stable/minio`
- `sudo mkdir /data/minio ; sudo chown tkuchiki /data/minio`
- `minio server /opt/minio`