Skip to content

Instantly share code, notes, and snippets.

View akiraak's full-sized avatar

Akira Kozakai akiraak

View GitHub Profile
@akiraak
akiraak / main.tf
Created December 29, 2021 20:49
Terraform で AWS の普通のインフラ構築
variable "main" {
default = {
"aws_account_ids" = ["XXXXXXXXXX"]
"app_name" = "XXXX"
"region" = "ap-northeast-1"
"az_1" = "ap-northeast-1a"
"az_2" = "ap-northeast-1c"
"acm_certificate_arn" = "arn:aws:acm:ap-northeast-1:XXXXXXXXX:certificate/XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
"app_public_key_path" = "XXXX.pub"
"management_public_key_path" = "XXXX.pub"
AWSTemplateFormatVersion: "2010-09-09"
Description: Network resource template part1
Resources:
# VPCの設定
sbcntrVpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
@akiraak
akiraak / coffee.ino
Created November 20, 2021 17:54
コーヒー豆焙煎機のESP32コード
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <WiFi.h>
#include "Ambient.h"
#include "max6675.h"
#define SECOND (1000)
#define MINUTE (SECOND * 60)
#define HOUR (MINUTE * 60)
#define DAY (HOUR * 24)
@akiraak
akiraak / camera.desktop
Last active July 13, 2018 00:23
ラズパイでコンデジを作る ref: https://qiita.com/akiraak/items/59cde5b162b36fe360ce
[Desktop Entry]
Type=Application
Name=windowpy
Exec=/usr/bin/python2.7 /home/pi/projects/camera/camera.py
Terminal=false
import Tkinter as tk
import RPi.GPIO as GPIO
from datetime import datetime
import picamera
import os.path
import time
camera = picamera.PiCamera()
camera.resolution = (2592, 1944)
@akiraak
akiraak / DP201header.gcode
Created May 29, 2018 21:22
If you want to use Simplify3d for Sindoh DP201 3D Printer, put this code into header of gcode file.
;3DWOX Desktop Version : 1.2.689
;[Cartridge_Number] : <0>
;-----------------------------------------
;Layer_Height(mm) : 0.200000
;Wall_Thickness(mm) : 0.800000
;Enable_Retraction(0=Off,1=On) : 1
;Bottom/Top_Thickness(mm) : 0.800000
@akiraak
akiraak / thread.py
Last active October 1, 2017 23:39
Pythonでシンプルにステッド処理
import os
import concurrent.futures as confu
def target_func(x):
return x + 1
def main():
count = 10
@akiraak
akiraak / base.html
Created June 18, 2017 03:40
Echoでtemplateを使う
{{define "base"}}
<html lang="en">
<head>
<title>{{template "title" .}}</title>
</head>
<body>
{{template "body" .}}
</body>
</html>
{{end}}
type PageItem struct {
Page int
Str string
}
type Page struct {
Items []PageItem
MaxPage int
}
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"io/ioutil"
"strconv"
"strings"
"time"
)