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
| #define F_CPU 8000000UL // 内蔵クロック8MHz | |
| #include <avr/io.h> | |
| #include <util/delay.h> | |
| // 設定 | |
| #define FREQ_HZ 60 // 周波数60Hz | |
| #define CYCLE_US (1000000UL / ((FREQ_HZ -10) * 2)) // 周期のマイクロ秒。10Hz高く出るので引く | |
| #define HALF_PERIOD_US (CYCLE_US / 2) // 半周期のマイクロ秒 | |
| #define DEADTIME_US 20 // デッドタイム20us | |
| #define MAX_ON_TIME_US (HALF_PERIOD_US - DEADTIME_US) // 最大ON時間(半周期からデッドタイムを引いた値) |
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
| # Mysqlコンテナを起動 | |
| services: | |
| mysql: | |
| image: mysql:8 | |
| container_name: mysql_container | |
| environment: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: test | |
| ports: | |
| - "3306:3306" |
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
| AT90S2313ビルド方法 | |
| ## -Wall : 詳細な警告を全て表示するようにする | |
| ## -Os : バイナリサイズが小さくなるよう最適化をする | |
| ## -mmcu=<Name> : プログラムを動かすマイコンを指定 | |
| # ビルド | |
| avr-gcc -Os -Wall -mmcu=at90s2313 main.c -o test.elf | |
| # elfからhexファイル作成 | |
| avr-objcopy -I elf32-avr -O ihex test.elf test.hex | |
| # メモリ使用量を調べる |
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
| #include <xc.h> | |
| // 構成ビット設定 | |
| #pragma config FOSC = INTOSCIO // 内部クロック使用、RA6, RA7はI/Oとして使用可能 | |
| #pragma config WDTE = OFF // ウォッチドッグタイマー無効 | |
| #pragma config PWRTE = ON // パワーオンタイマー無効 | |
| #pragma config MCLRE = OFF // MCLRピン無効 | |
| #pragma config BOREN = OFF // 電源電圧低下検出無効 | |
| #pragma config LVP = OFF // 低電圧プログラミング無効 | |
| #pragma config CP = OFF // コード保護無効 |
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
| # RTX1200 Rev.10.01.65 (Tue Oct 13 12:23:48 2015) | |
| # Memory 128Mbytes, 3LAN, 1BRI | |
| # main: RTX1200 ver=b0 serial=XXXXXXXX MAC-Address=XX:XX:XX:XX:XX:XX MAC-Address=XX:XX:XX:XX:XX:XX MAC-Address=XX:XX:XX:XX:XX:XX | |
| # Reporting Date: Aug 7 17:18:23 2016 | |
| # セキュリティクラス 3(シリアルからのみログイン許可) | |
| # Telnet SSHコマンド使用不可 | |
| security class 3 on off off | |
| # タイムゾーンはJST |
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 cf from 'cloudfront'; | |
| const kvsId = '<CloudFrontKeyValueStoreのID>'; | |
| // This fails if the key value store is not associated with the function | |
| const kvsHandle = cf.kvs(kvsId); | |
| // async functionになるので注意! | |
| async function handler(event) { | |
| // CloudFrontから渡ってくるヘッダからホスト名取得 |
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 zabbix/zabbix-web-apache-pgsql:ubuntu-latest | |
| USER root | |
| RUN apt-get clean && apt-get update && \ | |
| apt-get -y install fonts-ipafont && \ | |
| rm -f /etc/alternatives/zabbix-frontend-font && \ | |
| rm -f /usr/share/zabbix/assets/fonts/DejaVuSans.ttf && \ | |
| update-alternatives --install /usr/share/zabbix/assets/fonts/DejaVuSans.ttf zabbix-frontend-font /usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf 50 && \ | |
| update-alternatives --set zabbix-frontend-font /usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf && \ | |
| chown -R www-data:www-data /usr/share/zabbix/assets/ && \ | |
| chmod -R 744 /usr/share/zabbix/assets && \ |
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 | |
| # | |
| # Cronで動かすときはPATHを設定すること。 | |
| # 例:)PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
| get_contenner_service_name(){ | |
| echo $1 | cut -d"_" -f2- | rev | cut -c 3- | rev | |
| } | |
| mysql_contenner_backup(){ | |
| target_contenner=$1 |
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
| # -*- coding: utf-8 -*- | |
| # | |
| # S3+CloudFrontでCache Distributionパターンを構築するスクリプトです。 | |
| # 要 AWS SDK for Ruby V2 | |
| require 'aws-sdk-core' | |
| require 'yaml' | |
| require 'pp' | |
| config = YAML.load(File.read("config.yml")) |
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 strict'; | |
| const { Mutex } = require( 'await-semaphore' ); | |
| /** | |
| * スリープ | |
| */ | |
| const _sleep = ( waitSec ) => { | |
| return new Promise( function ( resolve ) { | |
| setTimeout( function () { resolve(); }, waitSec ); | |
| } ); |
NewerOlder