Skip to content

Instantly share code, notes, and snippets.

View ikuwow's full-sized avatar

Ikuo Degawa ikuwow

View GitHub Profile
@ikuwow
ikuwow / file0.txt
Created September 30, 2017 06:02
Macでディスクのパーティション形式をMBRからGPTに変える ref: http://qiita.com/ikuwow/items/4bc3923d8f7f8bfb2da2
$ diskutil eraseDisk JHFS+ SecretDisk GPT /dev/disk3
Started erase on disk3
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk3s2 as Mac OS Extended (Journaled) with name SecretDisk
Initialized /dev/rdisk3s2 as a 931 GB case-insensitive HFS Plus volume with a 81920k journal
Mounting disk
Finished erase on disk3
@ikuwow
ikuwow / file0.txt
Last active December 15, 2017 01:50
Minikubeを触ってみる、gcr.ioのプライベートレジストリからimageをpullしてみる ref: https://qiita.com/ikuwow/items/2c734a3fdb6c56322839
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
@ikuwow
ikuwow / file0.txt
Created April 23, 2017 06:12
YarnやWebpackでアセットがうまく管理されたWebページを作ってみる その1 ref: http://qiita.com/ikuwow/items/420aed9079604d8d6e90
$ yarn
yarn install v0.23.2
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Saved lockfile.
✨ Done in 0.44s.
@ikuwow
ikuwow / viewのクエリ
Last active January 22, 2017 15:42
CloudLoggingからBigQueryに流したログ(tsv in json)をみる ref: http://qiita.com/ikuwow/items/28369c4dc31a832a6ca1
-- use regacy sqlはoff
SELECT
REGEXP_EXTRACT(textPayload,r'^(?:[^\t]*\t){0}([^\t]*).*') AS field1,
REGEXP_EXTRACT(textPayload,r'^(?:[^\t]*\t){1}([^\t]*).*') AS field2,
REGEXP_EXTRACT(textPayload,r'^(?:[^\t]*\t){2}([^\t]*).*') AS field3,
...
FROM
`projectname.datasetname.somelogs_*`
;
# -*- coding: utf-8 -*-
import json, codecs, os
srcdir = 'perdate/'
destdir = 'perdate_tsv/'
if not os.path.exists(destdir):
os.mkdir(destdir)
@ikuwow
ikuwow / file0.txt
Created December 9, 2016 15:10
IBM Bluemix Container Serviceを少しだけ触ってみる(途中) ref: http://qiita.com/ikuwow/items/afdbf7994506dcd90857
502 Bad Gateway: Registered endpoint failed to handle the request.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@ikuwow
ikuwow / rm-old-timemachine-backup.sh
Created October 16, 2016 12:36
Remove Old Timemachine Backup Script
#!/bin/bash
cd /Volumes/Time\ Machine/Backups.backupdb/Ikuo’s\ Mac\ mini
BACKUPS=(\
2015-03-23-093603
2015-04-13-032009
2015-05-11-005904
2015-06-01-000440
2015-07-06-075631
#!/bin/bash
# Randomly choose pods, and kubectl exec
# usage ./kubeexec.sh hostname
pod_count=$(kubectl get pods -o name | wc -l)
pod_index=`echo "scale=0; $pod_count * $RANDOM / 32767 + 1" | bc`
pod=$(kubectl get pods -o name | awk "NR==$pod_index" | sed -e 's/pod\///g')
/usr/local/bin/kubectl exec $pod $@
@ikuwow
ikuwow / logtest-counter.yml
Created September 23, 2016 07:56
logtest-counter.yml
apiVersion: v1
kind: Pod
metadata:
name: counter-logger
spec:
containers:
- name: date-count
image: ubuntu:14.04
args: [bash, -c, 'for ((i = 0; ; i++)); do echo "$i: $(date)" >> /var/log/datelog.log; echo $RANDOM >> /var/log/randomlog.log; sleep 3; done']
volumeMounts: