Skip to content

Instantly share code, notes, and snippets.

blueprint_name: hpc-slurm
vars:
project_id: ## Set GCP Project ID Here ##
deployment_name: hpc-slurm
region: asia-northeast1
zone: asia-northeast1-b
deployment_groups:
- group: primary
blueprint_name: gpus
vars:
project_id: ## Set Google Cloud project ID Here ##
deployment_name: ## Set a deployment name Here ##
region: asia-northeast1
zone: asia-northeast1-a
gpu_zones: [asia-northeast1-a, asia-northeast1-c]
@pottava
pottava / crc-on-google-cloud.md
Last active July 3, 2024 19:33
CodeReady Containers (crc)

Setup a CRC instance on Google Cloud

1. Create a VM

vm_name=
gcloud compute instances create \
    "${vm_name}" --zone asia-northeast1-c \
    --image-project=ubuntu-os-cloud --image-family=ubuntu-2004-lts \
    --machine-type "n1-custom-14-36864" --boot-disk-size 300G --boot-disk-type pd-standard \
@pottava
pottava / main.go
Created March 14, 2021 07:09
ojichat の API 化
package main
import (
"fmt"
"log"
"net/http"
"os"
"github.com/greymd/ojichat/generator"
)
sudo apt-get update
sudo apt-get -y upgrade
cat /etc/debian_version
sudo reboot
sudo rpi-update
sudo raspi-config
raspistill -o image.jpg
rsync -av -e ssh --progress --partial --append [email protected]:/home/pi/image.jpg .
@pottava
pottava / prep-container-engine-for-prod.md
Last active August 26, 2020 09:37
本番環境のための GKE 構築 Tips

プロジェクト・ネットワーク・クラスタの構成

プロジェクト

  • GCP のすべてのリソースは プロジェクト の下に作成される
  • プロジェクトごとに請求や IAM の管理が可能
  • 本番やステージングといった複数環境のリソースを分離するためにもプロジェクトで分けよう
@pottava
pottava / localstack-sample.md
Last active October 29, 2018 11:22
AWS CLI with Atlassian/LocalStack

1. Create a docker-compose.yml

version: '2.1'

services:

  localstack:
    image: atlassianlabs/localstack:0.5.0
    ports:
@pottava
pottava / docker-swarm-on-aws.sh
Last active April 17, 2017 20:18
Docker Swarm on AWS Multiple AZ
#!/bin/sh
# Create consul container
export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY
export AWS_DEFAULT_REGION=ap-northeast-1
export AWS_ZONE=a
export AWS_SUBNET_ID
export AWS_INSTANCE_TYPE=c4.large
@pottava
pottava / src.js
Created November 12, 2012 06:09
サーバアクセスなしにローカルファイルを背景画像に適用するjs
// change BgImage by the input file's attribute without any server access.
document.querySelector('input[type="file"]').addEventListener('change', function (e) {
var reader = new FileReader();
reader.onload = function(e) {
$('#backgroundId').css({backgroundImage:'url("'+e.target.result+'")'});
};
reader.readAsDataURL(e.target.files[0]);
}, false);
@pottava
pottava / gist:3791759
Created September 27, 2012 02:05
交差判定js
function intersect(rect1, rect2) {
return ((rect2.bottom - rect1.top) * (rect2.top - rect1.bottom) < 0) &&
((rect2.right - rect1.left) * (rect2.left - rect1.right) < 0);
}