Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Masanori Ohgita mugifly

View GitHub Profile
@mugifly
mugifly / esp-1wire-temp-sensor-with-hassio.ino
Last active Mar 17, 2019
ESP8266 + DS18B20 One-Wire Temperature Sensor (Works with Hass.io)
View esp-1wire-temp-sensor-with-hassio.ino
// ESP8266 + DS18B20 One-Wire Temperature Sensor (Works with Hass.io)
// https://gist.github.com/mugifly/8e5a0aa81ca4a2485b2c2b46e0968fc6
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <timer.h>
@mugifly
mugifly / ghome-notifier-server.js
Last active Aug 19, 2018
Simplest API Server for Google Home Notifier
View ghome-notifier-server.js
/**
* Simplest API Server for Google Home Notifier
* https://gist.github.com/mugifly/22af0d55ccf4099becd44165f6500196/
* Thanks for https://github.com/noelportugal/google-home-notifier
**/
'use strict';
// Language to speak
@mugifly
mugifly / mag.md
Last active Mar 17, 2019
A simplest and unofficial client command for leafee mag (door sensor)
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
@mugifly
mugifly / switchbot-cmd.md
Last active Jan 31, 2018
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 / start-netconsole-capture.sh
Created Dec 18, 2016
Netconsole capturing script
View start-netconsole-capture.sh
#!/bin/bash
ip=` ip --oneline --family inet address show dev wlp8s0 | cut -d' ' -f7 | cut -d '/' -f1`
echo "-- Watching on ${ip}:6666 --"
nc -u -l -p 6666
@mugifly
mugifly / img-conv-for-slack-emoji
Last active May 9, 2018
Image Converter for Slack Emoji (128px) - Required: ImageMagick.
View img-conv-for-slack-emoji
#!/bin/bash
set -e
echo -e "Image Converter for Slack Emoji\nNOTICE: The image will be overwritten."
if [ $# -lt 1 ]; then
echo "USAGE:"
echo -e " ${0} IMG_FILE [IMG_FILE...]\n"
echo "IMG_FILE:"
@mugifly
mugifly / looxu-b50n-tips-for-arch-linux.md
Last active Mar 21, 2018
Tips for Arch Linux on LOOX U/B50N
View looxu-b50n-tips-for-arch-linux.md

Tips for Arch Linux on LOOX U/B50N

I using the LOOX U with using Arch Linux + LXDE. It's fairly comfortable.

Change the keymap

$ sudo localectl set-x11-keymap jp pc106
$ logout

Calibrate the touchscreen

@mugifly
mugifly / Dockerfile
Created Aug 18, 2016
Dockerfile for Build and CI of Android Projects - Included: fb-adb command, disabling system animation
View Dockerfile
FROM java:8
MAINTAINER Masanori Ohgita
# NOTE: This Dockerfile was forked from following projects.
# https://github.com/denlabo/dockerfile-android-project - Modified by Ohgita on denLabo LLC
# https://github.com/gfx/docker-android-project - Authored by FUJI Goro (MIT License)
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
@mugifly
mugifly / adb-android-disable-animation.sh
Last active May 22, 2018
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 / 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")
You can’t perform that action at this time.