Skip to content

Instantly share code, notes, and snippets.

@mid0111
mid0111 / connectAdbOverWifi.sh
Last active August 29, 2015 14:00
wi-fi経由でadb connect
# wi-fi経由でadb connect
CONNECTION_PORT="5555"
DEVICE_IP="192.168.0.2"
ANDROID_SDK_HOME="/usr/local/android-sdk-linux"
${ANDROID_SDK_HOME}/platform-tools/adb tcpip ${CONNECTION_PORT}
sleep 1
${ANDROID_SDK_HOME}/platform-tools/adb connect ${DEVICE_IP}
@mid0111
mid0111 / mountLocalDisk.md
Last active August 29, 2015 14:00
ローカルディレクトリをディスクイメージにしてマウントする

ローカルディレクトリをディスクイメージにしてマウントする

mount

IMAGE_PATH=/xxx/xxx/test.img
MOUNT_DIR_PATH=/yyy/yyy

# ディスクイメージ用の領域確保(ここでは10MB)
dd if=/dev/zero of=${IMAGE_PATH} bs=1M count=10
@mid0111
mid0111 / gcm_tips.md
Created April 22, 2014 12:38
GCM PUSH送信のメモ

GCM PUSH送信のメモ

メッセージ送信

 % curl https://android.googleapis.com/gcm/send -H "Content-Type: application/json" -H "Authorization:key=AIzaSyDWggtwcFnJ8Kxjob-4okYUCa85Z3DlzA0" -XPOST  -d '
 {
    "collapse_key":"test",
     "data":{"Text":"テストだよ"},
 "registration_ids":["aa", "bb"]
@mid0111
mid0111 / constructAndroidDev.md
Created April 19, 2014 06:53
Android + intellije 開発環境構築 on Linux Mint

Android + intellije 開発環境構築 on Linux Mint 16

32bit ライブラリのインストール

64bitマシンの場合のみ実施。 Linux Mint 16ではia32-libs packageが提供されていないので、1個ずつインストール。

% sudo apt-get install bluez-alsa:i386 gstreamer0.10-plugins-base:i386 gstreamer0.10-plugins-good:i386 gtk2-engines:i386 gtk2-engines-murrine:i386 gtk2-engines-oxygen:i386 gtk2-engines-pixbuf:i386 gvfs:i386 ibus-gtk:i386 libacl1:i386 libaio1:i386 libao4:i386 libasound2:i386 libasound2-plugins:i386 libasyncns0:i386 libattr1:i386 libaudio2:i386 libcanberra-gtk-module:i386 libcap2:i386 libcapi20-3:i386 libcups2:i386 libcupsimage2:i386 libcurl3:i386 libdbus-glib-1-2:i386 libesd0:i386 libfontconfig1:i386 libfreetype6:i386 libgail-common:i386 libgconf-2-4:i386 libgdbm3:i386 libgettextpo0:i386 libglapi-mesa:i386 libglu1-mesa:i386 libgphoto2-6:i386 libgphoto2-port10:i386 libgtk2.0-0:i386 libmpg123-0:i386 libncursesw5:i386 libnspr4:i386 libnss3:i386 libodbc1:i386 libopenal1:i386 libpulse-mainloop-glib0:i386 libpulsedsp:i386 libqt4-dbus:i386 libqt4-network:i386 libqt4
@mid0111
mid0111 / elasticsearch-river-twitter-sample.md
Created April 9, 2014 05:20
Sample elasticsearch-river-twitter.

twitter river作成

curl -XPUT localhost:9200/_river/twitter_river/_meta -d '
{
    "type" : "twitter",
    "twitter" : {
        "oauth" : {
            "consumer_key" : "aaa",

create snapshot directory

$ sudo mkdir -p /mnt/elasticsearch/data

regist repository

@mid0111
mid0111 / CustomList.java
Created April 8, 2014 11:59
Custom List class.
public class CustomList extends AbstractList<MyElement> {
private List<MyElement> list = null;
public CustomList() {
list = new ArrayList<MyElement>();
}
@Override
public MyElement get(int index) {
@mid0111
mid0111 / InstallJdk.md
Created April 2, 2014 12:52
java 8 install on linux mint
Downloads % tar xvfz jdk-8-linux-x64.tar.gz 
Downloads % sudo mkdir -p /opt/java
Downloads % sudo mv jdk1.8.0 /opt/java/
Downloads % sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.8.0/bin/java" 1
Downloads % sudo update-alternatives --set java /opt/java/jdk1.8.0/bin/java
update-alternatives: /usr/bin/java (java) を提供するために 手動モード で /opt/java/jdk1.8.0/bin/java を使います
Downloads % java -version
java version "1.8.0"
@mid0111
mid0111 / json2string.js
Created April 1, 2014 13:30
json string convert
var json = {
data: 'value'
};
JSON.stringify(json);