Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / _memo.md
Created April 21, 2022 13:56
Example of calling Cloud Monitoring API

Prerequisite

  • python3
  • curl
  • gcloud

Usage

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

Prerequiresite

  • macOS: brew install coreutils
  • Linux: GNU date

Usage

# timelist.txt
3/16 17:26 ~ 17:29 JST
#!/bin/bash
project="${1}"
instance="${2}"
billing_project="${3}"
_gcloud() {
if [ "${billing_project}" != "" ]; then
gcloud --project ${project} --billing-project ${billing_project} "${@}"
fi
#!/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 August 29, 2020 12:40
Install mysql 8.0 on ubuntu 18.04
#!/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 July 17, 2019 02:31
Show HTTP status code constants for Go(net/http)
$ 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 August 11, 2020 15:28
Recursive PURGE from BASE URL for Fastly

Requirements

  • wget
  • curl

Usage

$ bash fastly-recursive-purge.sh https://example.com
@tkuchiki
tkuchiki / doc.md
Last active May 6, 2019 03:24
V8 plot-timer-events.patch
@tkuchiki
tkuchiki / gist:19bc02b050052e2fdffbb31c1b10ff95
Created April 29, 2019 10:22
[WIP] Halyard install on macos
## 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`