Skip to content

Instantly share code, notes, and snippets.

Ando takuya-andou

Block or report user

Report or block takuya-andou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@takuya-andou
takuya-andou / job.yaml
Created Oct 29, 2019
GKEでの並列ジョブ
View job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: job-wq
spec:
# 並列実行数
parallelism: 3650
template:
metadata:
name: job-wq
@takuya-andou
takuya-andou / pvc.yaml
Created Oct 29, 2019
永続ボリューム
View pvc.yaml
# 参考:https://tkzo.jp/blog/use-persistent-volumes-in-gke/
# volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
# 任意のPV名を設定します
name: persistvol
spec:
capacity:
# 作成したボリュームの容量と合わせます
@takuya-andou
takuya-andou / create_cluster.sh
Created Oct 29, 2019
GKEのクラスターを作成するスクリプト
View create_cluster.sh
# キューを扱うNodeのためのNodePool
gcloud container clusters create autoscaled-cluster \
--num-nodes 2 \
--machine-type=n1-standard-1 \
--zone us-west1-a --disk-size=10\
# キューを処理するためのNodePool。preemptibleにしている。
gcloud container node-pools create preemptible-pool96 \
--cluster autoscaled-cluster --preemptible --num-nodes 0 \
--enable-autoscaling --min-nodes 0 --max-nodes 960 \
@takuya-andou
takuya-andou / add_queue.sh
Created Oct 29, 2019
日付の文字列をキューに入れていくだけのスクリプト
View add_queue.sh
#!/bin/sh
#
# YYYY-MM-DD
#
STARTDATE=20100101
ENDDATE=20191005
CURRENTDATE=$STARTDATE
@takuya-andou
takuya-andou / ConvertToQR.py
Created Aug 28, 2017
リスト内のURLを一気にQR化するためのスクリプト
View ConvertToQR.py
# -*- coding: utf-8 -*-
import sys
import qrcode
# QRコードを作る場合
URLarray = ['http://google.com','http://yahoo.co.jp']
for i, URL in enumerate(URLarray):
img = qrcode.make(URL) # ''内の文字をQRコードに変換
img.save('qr_img' + str(i) + '.png') # QRコードに名前をつけて保存
@takuya-andou
takuya-andou / GoogleShortener.py
Created Aug 28, 2017
リスト内のURLを一気に短縮化するためのスクリプト
View GoogleShortener.py
# coding:utf-8
import sys
import re
from urllib2 import urlopen as U, Request as R
from json import loads as J
API_KEY = "ここはGoogleのAPIを取得して使う"
API = "https://www.googleapis.com/urlshortener/v1/url?key=" + API_KEY
View piano.js
const DashButton = require('dash-button');
const {exec} = require('child_process');
const do1 = new DashButton("xx:xx:xx:xx:xx:xx"); //じゃがりこ
const re = new DashButton("xx:xx:xx:xx:xx:xx"); //パンテーン
const mi = new DashButton("xx:xx:xx:xx:xx:xx"); //ヘルシア
const fa = new DashButton("xx:xx:xx:xx:xx:xx"); //カロリーメイト
const so = new DashButton("xx:xx:xx:xx:xx:xx"); //エヴィアン
const ra = new DashButton("xx:xx:xx:xx:xx:xx"); //アマゾンベーシック
const si = new DashButton("xx:xx:xx:xx:xx:xx"); //シーブリーズ
@takuya-andou
takuya-andou / byebyeSteve.py
Created Dec 13, 2016
Amazon Dash Button launches Steve
View byebyeSteve.py
# coding: utf-8
from scapy.all import *
from picraft import World, Vector, Block
world = World("MineCraftServer IP")
def arp_display(pkt):
if pkt[ARP].op == 1:
if pkt[ARP].hwsrc == 'Your AmazonDashButton's Mac Address':
world.player.pos = Vector(0, 300, 0)
@takuya-andou
takuya-andou / LineBotBeaconAPI.php
Created Oct 6, 2016
LineビーコンとLineMessagingAPIによる勤怠管理
View LineBotBeaconAPI.php
<?php
$json_string = file_get_contents('php://input');
$json_object = json_decode($json_string);
$AndoUserID = '<<LineUserID>>';
error_log("callback start.");
foreach ($json_object->events as $event) {
if('message' == $event->type){
if ($event->source->userId == $AndoUserID) {
if ($event->message->text =='おは'){
View classifier_from_little_data_script_3.py
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
You can’t perform that action at this time.