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 \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"github.com/greymd/ojichat/generator" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
- GCP のすべてのリソースは プロジェクト の下に作成される
- プロジェクトごとに請求や IAM の管理が可能
- 本番やステージングといった複数環境のリソースを分離するためにもプロジェクトで分けよう
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function intersect(rect1, rect2) { | |
return ((rect2.bottom - rect1.top) * (rect2.top - rect1.bottom) < 0) && | |
((rect2.right - rect1.left) * (rect2.left - rect1.right) < 0); | |
} |
NewerOlder