Skip to content

Instantly share code, notes, and snippets.

View kenichimiki's full-sized avatar

MIKI-IE kenichimiki

View GitHub Profile
@kenichimiki
kenichimiki / Build_OpenCV_with_cuDNN_for_Jetson_Nano
Created May 30, 2020 20:50
Build OpenCV with NVIDIA CuDNN on Nvidia Jetson Nano
#!/usr/bin/env bash
# 2020 miki-ie.com
set -e
# change default constants here:
readonly PREFIX=/usr/local # install prefix, (can be ~/.local for a user install)
readonly DEFAULT_VERSION=4.3.0 # controls the default version (gets reset by the first argument)
readonly CPUS=$(nproc) # controls the number of jobs
@kenichimiki
kenichimiki / Build_OpenCV.sh
Last active June 11, 2020 04:06
Build OpenCV with NVIDIA CuDNN on Nvidia Jetson Nano
#!/usr/bin/env bash
# 2020 miki-ie.com
set -e
# change default constants here:
readonly PREFIX=/usr/local # install prefix, (can be ~/.local for a user install)
readonly DEFAULT_VERSION=4.3.0 # controls the default version (gets reset by the first argument)
readonly CPUS=$(nproc) # controls the number of jobs
@kenichimiki
kenichimiki / PredictJanken.ipynb
Created April 7, 2020 06:53
めざましじゃんけん 時系列予測 サンプルスクリプト
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kenichimiki
kenichimiki / Sample_Using_jankenApi.php
Created September 20, 2019 07:48
Sample of how to call the Mezamashi Park jankenApi from PHP script.
function updatePredict($date, $times, $predict,$api_key){
$post_data = [
"mod" => "updatePredict",
"date" => $date,
"times" => $times,
"predict" => $predict
];
//curl実行
$curl = curl_init("https://janken.miki-ie.com/jankenApi.php");
@kenichimiki
kenichimiki / Sample_Using_jankenApi.py
Created September 20, 2019 07:48
Sample of how to call the Mezamashi Park jankenApi from Python3 script.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib.request
import json
url = 'https://janken.miki-ie.com/jankenApi.php'
headers = {
'Authorization': 'Bearer @@API_KEY@@',
@kenichimiki
kenichimiki / Python-Darknet-DNN-Sample.py
Created September 8, 2019 11:47
Implement to Python for Darknet/YOLO model using DNN module. Sample code
#!/usr/bin/env python
# coding: utf-8
target_model = "yolov3-tiny-janken_final.weights"
target_config = "yolov3-tiny-janken.cfg"
import cv2 as cv
import numpy as np
MODEL = "./janken_cfg/" + target_model
@kenichimiki
kenichimiki / control-regza-tv.py
Created August 24, 2019 02:07
Control Toshiba Regza TV via python using web I/F
import requests
from requests.auth import HTTPDigestAuth
TV_IP = "xxx.xxx.xxx.xxx"
TV_USER = "user"
TV_PASS = "pass"
TV_VOLUME_DOWN = "40BF1E"
TV_BOTTON_8 = "40BF08"
def execjanken(key):
@kenichimiki
kenichimiki / home-api-tweet-janken-result.php
Created August 9, 2019 03:15
Post new tweet using TwitterOAuth
<?php
require "twitteroauth/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
define("TARGET_TWEET",0);
##TARGET_TWEET 0 is newest record
$host_name = '127.0.0.1:3307';
$user_name = '@DB_User@';
$password = '@DB_Pass@';
$database_name ='@DB_Name@';
$table_name = '@DB_Table@';
@kenichimiki
kenichimiki / sendgrid-api.php
Created July 27, 2019 00:18
PHP script for Inbound Email Parse Webhook of SendGrid
<?php
/*************************************************************************
* sendgrid-api (MAIN)
* Home Tools for private. Using IFTTT and Google Home etc
*
* PHP 5 or later
*
* @category Home IoT
* @author Miki
* @url https://www.miki-ie.com/
import urllib.request
#params for IFTTT
ifttt_api_key = '/with/key/@アクセスキー@'
url_base = 'https://maker.ifttt.com/trigger/'
#EVENT name for IFTTT
ifttt_event = 'test'
url = url_base + ifttt_event + ifttt_api_key
params = {'value1': 123,'value2': 123,'value3': 123,}