This file contains hidden or 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
| #!/usr/bin/python3 | |
| import os | |
| import time | |
| from threading import Thread | |
| import RPi.GPIO as GPIO | |
| import smbus | |
| rev = GPIO.RPI_REVISION |
This file contains hidden or 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
| use std::fs::{self, File}; | |
| use std::io::{self, stdout, BufWriter, ErrorKind, Write}; | |
| use std::path::PathBuf; | |
| use std::process::Command; | |
| use std::sync::mpsc; | |
| use std::thread; | |
| use std::time::Duration; | |
| use std::time::SystemTime; | |
| use chrono::{DateTime, Local, TimeZone, Utc}; |
This file contains hidden or 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
| import logging | |
| import tqdm | |
| class TqdmLoggingHandler(logging.Handler): | |
| # https://stackoverflow.com/questions/38543506/change-logging-print-function-to-tqdm-write-so-logging-doesnt-interfere-wit | |
| def __init__(self, level=logging.NOTSET): | |
| super().__init__(level) | |
| def emit(self, record): |
This file contains hidden or 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
| import contextlib | |
| import datetime | |
| import time | |
| import logging | |
| from logging.handlers import MemoryHandler | |
| import sys | |
| from typing import Any, Callable, Iterator, MutableMapping | |
| from tqdm import tqdm | |
| import toml |
This file contains hidden or 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
| import toml | |
| import logging | |
| # なんとなくloggingで出力する | |
| logging.basicConfig(level=logging.DEBUG, format="{message}", style="{") | |
| # 文字列としてパスを与えると読み込める | |
| # pathlib.Pathクラスでも可 | |
| params = toml.load("./parameter/nominal.toml") | |
| # dictクラスとしてロードされる |
This file contains hidden or 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
| // 既定値を上書きするには、このファイル内にキー バインドを挿入しますauto[] | |
| [ | |
| { | |
| "key": "ctrl+f9", | |
| "command": "python.execInTerminal", | |
| "when": "editorLangId == 'python'" | |
| }, | |
| { | |
| "key": "ctrl+;", | |
| "command": "workbench.action.terminal.focus", |
This file contains hidden or 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
| { | |
| "python.linting.pylintEnabled": false, | |
| "python.linting.flake8Enabled": true, | |
| "python.linting.lintOnSave": true, | |
| "python.linting.flake8Args": [ | |
| "--max-line-length", | |
| "88", | |
| "--ignore=E203,W503,W504" | |
| ], | |
| "python.formatting.provider": "black", |
This file contains hidden or 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
| from datetime import datetime, timezone | |
| import os | |
| from pathlib import Path | |
| import subprocess | |
| from urllib import request | |
| from zipfile import ZipFile | |
| from bs4 import BeautifulSoup | |
| import pytz |
This file contains hidden or 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/bash -eu | |
| OPENSSL_VER=1.1.0g | |
| mkdir openssl | |
| cd openssl | |
| wget https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz | |
| tar xf openssl-${OPENSSL_VER}.tar.gz | |
| cd openssl-${OPENSSL_VER} | |
| ./config zlib shared no-ssl3 |
This file contains hidden or 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
| mkdir ~/setup | |
| cd ~/setup | |
| wget https://raw.githubusercontent.com/estshorter/raspi-autosetup/master/setup.sh -O ./setup.sh | |
| chmod u+x ./setup.sh |