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-clean.sh
Created August 18, 2016 07:17
Cleanup Script for Docker Images and Containers
#!/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 / adb-android-disable-animation.sh
Last active December 8, 2022 22:40
Disable the animation of Android Virtual Device using adb command
# 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 / Dockerfile
Created August 18, 2016 16:27
Dockerfile for Build and CI of Android Projects - Included: fb-adb command, disabling system animation
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 / looxu-b50n-tips-for-arch-linux.md
Last active March 21, 2018 17:53
Tips for Arch Linux on LOOX U/B50N

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 / img-conv-for-slack-emoji
Last active July 26, 2022 18:45
Image Converter for Slack Emoji (128px) - Required: ImageMagick.
#!/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 / start-netconsole-capture.sh
Created December 18, 2016 16:45
Netconsole capturing script
#!/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 / switchbot-cmd.md
Last active February 10, 2022 23:58
Simplest Switchbot Command

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 / 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 / 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>