Skip to content

Instantly share code, notes, and snippets.

View Miura55's full-sized avatar
🎯
Focusing

Koki Miura Miura55

🎯
Focusing
View GitHub Profile
@Miura55
Miura55 / reTurminalを使った自室のモニタリングサイネージ.md
Created March 30, 2022 17:51
reTurminalを使った自室のモニタリングサイネージの作り方をまとめたドキュメント

reTurminalを使った自室のモニタリングサイネージ

使うもの

  • Grove SGP30(CO2ノードの近似値を取得するため)
  • Grove Temperature&Humidity Sensor(温度・湿度の取得)
  • reTurminal
  • Grove Base HAT for Raspberry Pi

配線

温湿度センサーはGrove Base HAT上のPWMポートに接続する。

@Miura55
Miura55 / install_ros_melodic_raspi.sh
Last active March 17, 2022 07:51
Install ROS melodic for Raspberry Pi
#!/bin/bash
# Install ROS melodic on Raspberry Pi OS Buster
# Ref: http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Melodic%20on%20the%20Raspberry%20Pi
echo "Start Install"
# Setup ROS Repositories to source list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
@Miura55
Miura55 / rotate_display
Created January 3, 2022 12:25
Rotate display script for Ubuntu tablet
#!/bin/bash
rotation=$(xrandr -q --verbose|grep DSI-1|egrep -o "(normal|left)"|head -1)
if [ "$rotation" = "normal" ];then
xrandr --output DSI-1 --rotate left
else
xrandr --output DSI-1 --rotate normal
fi
@Miura55
Miura55 / lambda_function.py
Last active December 5, 2021 04:00
LINE botでAWS IoT Coreを使いデバイスにメッセージを送信するLINE bot
import os
import json
import boto3
import urllib3
http = urllib3.PoolManager()
class LineBotApi(object):
def __init__(self, access_token):
self.access_token = access_token
@Miura55
Miura55 / call_environ.py
Last active October 2, 2021 08:37
2021-10-02 REV UP LIVE CODING SHOW
#! /usr/bin/env python3
import seeed_dht
import requests
from datetime import datetime
ACCESS_TOKEN = 'YOUR_TOKEN'
def call_api(message):
header = {'Authorization': 'Bearer {}'.format(ACCESS_TOKEN)}
payload = {'message':message}
#!/bin/bash
# Install ros kinetic on raspian buster
# Ref: http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20the%20Raspberry%20Pi
# Setup ROS Repositories
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
@Miura55
Miura55 / sample.csv
Created February 16, 2020 08:44
csv_sample
name age
Taro 24
Ken 21
Ichiro 32
電気をつけて LEDをつける
LEDをつけて LEDをつける
スイッチを入れて LEDをつける
スイッチを消して LEDを消す
LEDを消して LEDを消す
電気を消して LEDを消す
#
#
# main() will be run when you invoke this action
#
# @param Cloud Functions actions accept a single parameter, which must be a JSON object.
#
# @return The output of this action, which must be a JSON object.
#
#
import sys