Skip to content

Instantly share code, notes, and snippets.

View mugifly's full-sized avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
@mugifly
mugifly / docker-container-ip.sh
Last active October 5, 2020 10:26
Simple inspector for Docker container IP address (shell script)
#!/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 / PKGBUILD
Created October 9, 2015 09:02
PKGBUILD file for odenwlan-node (It also an example of PKGBUILD file for Electron based app.)
# 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')
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 / japan-prefectures-roman-hepburn.csv
Last active October 16, 2019 02:54
日本の都道府県名のヘボン式ローマ字リスト (CSV) / The list of Roman alphabet (Hepburn system) of the prefectures in Japan
北海道 ほっかいどう hokkaido
青森県 あおもり aomori
岩手県 いわて iwate
宮城県 みやぎ miyagi
秋田県 あきた akita
山形県 やまがた yamagata
福島県 ふくしま fukushima
茨城県 いばらき ibaraki
栃木県 とちぎ tochigi
群馬県 ぐんま gumma
@mugifly
mugifly / mag.md
Last active June 3, 2019 14:56
A simplest and unofficial client command for leafee mag (IoT sensor for doors and windows)

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 / esp-signal-lights.ino
Created April 26, 2019 02:22
ESP8266 + Triple Signal Lights
// ESP8266 + 積層信号灯 (3色)
// https://gist.github.com/mugifly/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <timer.h>
// 設定 - Wi-Fi
#define WLAN_SSID "XXXXXX"
@mugifly
mugifly / ghome-notifier-server.js
Last active March 27, 2019 10:07
Simplest API Server for Google Home Notifier
/**
* 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 / esp-1wire-temp-sensor-with-hassio.ino
Last active March 17, 2019 14:34
ESP8266 + DS18B20 One-Wire Temperature Sensor (Works with Hass.io)
// 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 / detect-animated-gif.pl
Created August 9, 2015 17:34
Detector for animated GIF image (perl5)
#!/usr/bin/env perl
# Detector for animated GIF image (perl5)
# Based on http://d.hatena.ne.jp/namanamanamana/20090415/1239729068 Thanks.
use strict;
use warnings;
use LWP::UserAgent;
# Fetch a GIF image
my $ua = LWP::UserAgent->new();
my $res = $ua->get('http://example.com/foo-animation.gif');
@mugifly
mugifly / angular-filters.js
Last active September 5, 2018 17:55
Angular JS little filters.
'use strict';
angular.module('foo', [])
.filter('substring', function() {
return function(str, start, end) {
return str.substring(start, end);
};
})