Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
@mugifly
mugifly / PKGBUILD
Created Oct 9, 2015
PKGBUILD file for odenwlan-node (It also an example of PKGBUILD file for Electron based app.)
View PKGBUILD
# Maintainer: Masanori Ohgita <mp_aur[at]ohgita[dot]info>
pkgname=odenwlan-node
pkgver=1.3.0
pkgrel=1
pkgdesc="An automatic login tool for Wi-Fi of OECU"
url="https://github.com/odentools/odenwlan-node/"
arch=('i686' 'x86_64')
license=('MIT')
depends=('nodejs>=4.1.1' 'npm>=3.3.4')
makedepens=('git')
@mugifly
mugifly / image-predict-on-tfjs-node.js
Last active May 29, 2020
Image Prediction on tfjs-node (with model made by Teachable Machine Image)
View image-predict-on-tfjs-node.js
const tf = require('@tensorflow/tfjs-node');
const Jimp = require('jimp');
// Directory path for model files (model.json, metadata.json, weights.bin)
// NOTE: It can be obtained from [Export Model] -> [Tensorflow.js] -> [Download my model]
// on https://teachablemachine.withgoogle.com/train/image
const MODEL_DIR_PATH = `${__dirname}`;
// Path for image file to predict class
const IMAGE_FILE_PATH = `${__dirname}/example.jpg`;
@mugifly
mugifly / switchbot-cmd.md
Last active Apr 17, 2020
Simplest Switchbot Command
View switchbot-cmd.md

switchbot-cmd.py

Simplest Switchbot Command

Installation

It tested on Raspberry Pi Zero W with Raspbian Stretch.

$ sudo apt-get install python-pip libglib2.0-dev bluez-tools
$ sudo pip install bluepy
@mugifly
mugifly / morninp.md
Last active Apr 4, 2020
Unofficial CLI command for mornin'+ (mornin' plus) smart curtain.
View morninp.md

morninp.py

Unofficial CLI command for mornin'+ (mornin' plus) smart curtain.

Requirements: Python 3, bluepy 3.2+, pycryptodome 3.6+


View imas-cinderella-girls.csv
airi-totoki 十時愛梨 passion
akane-hino 日野茜 passion
aki-yamato 大和亜季 cool
anasutashia アナスタシア cool
anzu-futaba 双葉杏 cute
arisu-tachibana 橘ありす cool
asuka-ninomiya 二宮飛鳥 cool
ayame-hamaguchi 浜口あやめ passion
chie-sasaki 佐々木千枝 cool
chieri-ogata 緒方智絵里 cute
@mugifly
mugifly / adb-android-disable-animation.sh
Last active Oct 30, 2019
Disable the animation of Android Virtual Device using adb command
View adb-android-disable-animation.sh
# For Android JellyBean and newer device
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="window_animation_scale"'
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="transition_animation_scale"'
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="animator_duration_scale"'
# For Android ICS and older device
adb shell "echo \"update system set value=0.0 where name='window_animation_scale';\" | sqlite3 /data/data/com.android.providers.settings/databases/settings.db"
adb shell "echo \"update system set value=0.0 where name='transition_animation_scale';\" | sqlite3 /data/data/com.android.providers.settings/databases/settings.db"
@mugifly
mugifly / japan-prefectures-roman-hepburn.csv
Last active Oct 16, 2019
日本の都道府県名のヘボン式ローマ字リスト (CSV) / The list of Roman alphabet (Hepburn system) of the prefectures in Japan
View japan-prefectures-roman-hepburn.csv
北海道 ほっかいどう hokkaido
青森県 あおもり aomori
岩手県 いわて iwate
宮城県 みやぎ miyagi
秋田県 あきた akita
山形県 やまがた yamagata
福島県 ふくしま fukushima
茨城県 いばらき ibaraki
栃木県 とちぎ tochigi
群馬県 ぐんま gumma
@mugifly
mugifly / docker-clean.sh
Created Aug 18, 2016
Cleanup Script for Docker Images and Containers
View docker-clean.sh
#!/bin/sh
echo -e "-- Removing exited containers --\n"
docker ps --all --quiet --filter="status=exited" | xargs --no-run-if-empty docker rm --volumes
echo -e "\n\n-- Removing untagged images --\n"
docker rmi --force $(docker images | awk '/^<none>/ { print $3 }')
echo -e "\n\n-- Removing volume directories --\n"
docker volume rm $(docker volume ls --quiet --filter="dangling=true")
@mugifly
mugifly / docker-container-ip.sh
Last active Aug 6, 2019
Simple inspector for Docker container IP address (shell script)
View docker-container-ip.sh
#!/bin/bash
# Simple inspector for Docker container IP address
# https://gist.github.com/mugifly/3bb1c54b48764340eda8
print_help () {
echo -e "USAGE: docker-container-ip.sh KEYWORD\n"
echo "KEYWORD: A keyword string for target container."
echo " e.g. dokku.mysql.foobar"
echo -e "\n[Example usecases]"
echo " Connect to MySQL database in container:"
@mugifly
mugifly / mag.md
Last active Jun 3, 2019
A simplest and unofficial client command for leafee mag (IoT sensor for doors and windows)
View mag.md

mag.py

A simplest and unofficial client command for leafee mag

Installation

It tested on Raspberry Pi Zero W with Raspbian Stretch.

$ sudo apt-get install python-pip libglib2.0-dev bluez-tools
$ sudo pip install bluepy
You can’t perform that action at this time.