View job.yaml
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: job-wq | |
spec: | |
# 並列実行数 | |
parallelism: 3650 | |
template: | |
metadata: | |
name: job-wq |
View pvc.yaml
# 参考:https://tkzo.jp/blog/use-persistent-volumes-in-gke/ | |
# volume.yaml | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
# 任意のPV名を設定します | |
name: persistvol | |
spec: | |
capacity: | |
# 作成したボリュームの容量と合わせます |
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 \ |
View add_queue.sh
#!/bin/sh | |
# | |
# YYYY-MM-DD | |
# | |
STARTDATE=20100101 | |
ENDDATE=20191005 | |
CURRENTDATE=$STARTDATE |
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コードに名前をつけて保存 |
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"); //シーブリーズ |
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) |
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/ |
NewerOlder