Skip to content

Instantly share code, notes, and snippets.

View sohgoh's full-sized avatar

Satoshi Ohgoh sohgoh

  • NTT Resonant Technology Inc.
View GitHub Profile
@sohgoh
sohgoh / make.sh
Last active June 29, 2017 05:43
Build script for libimobiledevice
#!/bin/bash
# Run in libimobiledevice root directory
export install_dir="/directory-as-you-like"
export openssl_dir="/usr/local/Cellar/openssl/1.0.2k"
export pkg_config_macro="/usr/local/share/aclocal/pkg.m4"
export libzip_CFLAGS="-I${install_dir}/lib/libzip/include -I${install_dir}/include"
export libzip_LIBS="-L${install_dir}/lib -lzip -lz"
export libxml2_CFLAGS="-I${install_dir}/include/libxml2"
@sohgoh
sohgoh / mackerel-plugin-usbrh-status.rb
Created May 21, 2017 13:08
USB-RHで温度・湿度・不快指数をmackerelに投げるプラグイン
if ENV['MACKEREL_AGENT_PLUGIN_META'] == '1'
require 'json'
meta = {
:graphs => {
'super.usbrh.status' => {
:label => 'USB-RH Status',
:unit => 'integer',
:metrics => [
{
@sohgoh
sohgoh / idevicescreenshot2png.sh
Created July 13, 2016 07:35
idevicescreenshot2png
#!/bin/bash
mvTiffImageFiles () {
mkdir -p tiff
TIFF_FILE_COUNT=`find . -name \*.tiff -d 1 -print | wc -l`
if [ ${TIFF_FILE_COUNT} -gt 0 ]; then
mv ./*.tiff ./tiff/
fi
}
@sohgoh
sohgoh / forwarding-example.md
Last active December 22, 2015 06:59 — forked from f1sherman/forwarding-example.md
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/myname:

// 以前は port {80 8080} -> 127.0.0.1 port 8080 みたいな書き方が出来たけどEl Capitanから無視される?ようなので注意
rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
@sohgoh
sohgoh / dropStashes.sh
Last active August 29, 2015 14:24
git stash dropをまとめて実行するスクリプト
#!/bin/sh
# git stash dropを一気に実行するシェルスクリプト
# 直近の10stash($min)分まで一気にdropします
# 事前にcurrent環境変数には対象リポジトリのディレクトリパスを指定しておく
pushd $current
tmp=`git stash list | wc -l`
max=`expr $tmp - 1`