ご家庭で常時動いているサーバーの情報をどのように通知していますか? メールや専用のミドルウエアを利用して通知している方も多いかと思いますが、
今回はPushbulletの紹介と併せて、
Pushbulletとは?
Pushbulletはサイトの説明にあるように、

対象となるデバイスは、
Pushbulletで共有できるデータは以下になります。
- テキスト
- リンク
- 画像
(25MBまで)
注意として、
Pushbulletの導入
Androidへのインストール
まずスマートフォンにPushbulletを導入してみましょう。ここではAndroidへのインストールを例としますが、
- Google PlayのPushbulletページから
[インストール] を選択し、 導入したいAndroidデバイスにインストールします。 - インストールされたPushbulletを起動し、
GoogleアカウントもしくはFacebookアカウントでログインします [1]。 - 通知設定でPushbulletを有効にします
[2]。
これでスマートフォン側の設定は終了です。注意事項として、

ブラウザへの導入
ブラウザ側の導入も簡単です。ここではChromiumを例としますが、
- ChromeウェブストアのPushbulletのページで
[Chromeに追加] をクリックしてインストールします。 - Chromeのポップアップで
“クリックしてサインイン” と出ますので、 クリックしGoogleアカウントもしくはFacebookアカウントでログインします。
使い方
共有したいテキストやサイトなどがある場合、

ブラウザから共有する場合は、

Ubuntu DesktopでのPushbullet環境
PushbulletはUbuntu Desktop向けに単独で動作するアプリケーションとして
以下のコマンドでpushbullet-indicatorとNautilusの拡張であるnautilus-pushbulletパッケージをインストールします。
$ sudo add-apt-repository ppa:atareao/atareao $ sudo apt-get update $ sudo apt-get install pushbullet-indicator nautilus-pushbullet
インストールが完了したら一度ログアウトしてセッションを再起動します。再度ログインすると通知エリアにPushbulletのアイコンが表示されます。pushbullet-indicatorの利用方法は通知エリアにあるPushbulletアイコンをクリックして

また、
![図6 Nautilusからファイルを共有する([Send to ...]を選択) 図6 Nautilusからファイルを共有する([Send to ...]を選択)](/assets/images/admin/serial/01/ubuntu-recipe/0377/thumb/TH800_006.jpg)

CUI環境からPushbulletを利用する
Ubuntu ServerなどのCUI環境向けにはPushbulletから提供される公式なアプリケーションはありません。しかし、
PushbulletはJSONを利用したHTTPを利用して端末間の通知を実現しています。それでは、
$ sudo apt-get install curl $ curl --header 'Authorization: Bearer YOURTOKENKEY' -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "タイトル", "body": "本文"}'
実行すると、
このような形でCUI環境でもPushbulletを利用して通知ができますが、
$ sudo apt-get install git $ cd $ git clone https://github.com/Red5d/pushbullet-bash.git
pushbullet-bashを導入した後、
$ echo "PB_API_KEY=YOURTOKENKEY" > ~/.config/pushbullet
これでpushbullet-bashが利用できるようになりましたので、
$ ~/pushbullet-bash/pushbullet push all note "タイトル" "本文"
curlで行った時と同じように通知が行われましたが、pushbullet <action> <device> <type> <data>
の形式で、
$ ~/pushbullet-bash/pushbullet list Available devices: ------------------ Chrome Firefox LGE Nexus 5 Sony SO-02G Ubuntu all Contacts: ------------------
より詳しく知りたい場合はpushbullet --help
で確認すると良いでしょう。
筆者の環境では、
#/bin/sh df -h |grep data |awk '{print $6" "$4" "$5}' | xargs -0 /home/youraccount/pushbullet-bash/pushbullet push "Sony SO-02G" note "Disk info" >/dev/null 2>&1
上記の処理がcronによって実行されると、

このような感じで、