OpenNMS Architecture Introduction (Discovery & Monitor)

O.S. : Ubuntu12.04 LTS OpenNMS Version : 1.10.7 OpenNMS base on TMN & FCAPS network management models. OpenNMS Block Diagram Discovery & Monitor daemons Eventd Event handling daemon Configuration files: eventconf.xml -> Defines the UEI (Universal Event Identifiers). eventd-configuration.xml -> Defines operating parameters for eventd such as timeouts, listener threads and listener port. events-archiver-configuation.xml -> Configuration for event archive daemon. events.archiver.properties -> Fine tune events archive subsystem. etc/events/*.xml -> Vendor UEI define files. Listening “eventsConfigChange” event. ...

February 3, 2013 · 2 min · oopsmonk

Baking 2012

結束上份工作後, 不想閒著, 也就開始找新"玩具", 做麵包好像滿有趣的, 又不用出門可以在家陪小朋友,於是爬了2~3天的文章,了解需要的東西. Google什麼是yeast(Active dry, Instant dry, Fresh)? 什麼是麵粉(高筋, 中筋, 低筋, 法國粉)? 什麼是麵糰(擴展, 完成)? 什麼是揉麵? 天真的以為"吐司"很簡單,麵糰整好丟進烤模..done. 結果烤到第五條吐司, 才__接近滿模__. 失敗品之一: 接著白吐司太無聊了, 所以做了其它嚐試 全麥鮪魚麵包 高粉 270g 全麥粉 30g Instant dry 3/4t 奶油 20g 塩 1/2t 糖 20g 水 185g 整形參考: 蒔蘿鮪魚麵包 海蒂的白麵包 配方跟做法參考 【肉桂打噴嚏】海蒂的白麵包 全麥豆漿枸杞葡萄乾 高粉 270g 全麥粉 30g Instant dry 3/4t 奶油 20g 塩 1/2t 糖 20g 豆漿 185g 枸杞 + 葡萄乾 適量. No-Knead Bread 做了這些後, 深深感到… 萬能的雙手真的累人又吵, 尤其吐司要揉到完成階段. 再上鄰居來關切說: “你家是不是最近在釘東西?”…XD 於是開始Google解決辦法.. 沒想到真的有人研發出No-Knead Bread…OMG ...

November 30, 2012 · 1 min · oopsmonk

How to split boot.img and get kernel config

boot_cm9.img file from mk802_legacy-compatibility_v1.zip Device: Rikomagic MK802 Script files : Split_bootimg.pl , extract-ikconfig ( in {kernel_source}/script ) Split boot.img Copy boot_cm9.img, Split_bootimg.pl, extract-ikconfig into ‘split_boot’ $ mkdir split_boot $ cd split_boot $ ./split_bootimg.pl boot_cm9.img Page size: 2048 (0x00000800) Kernel size: 8094708 (0x007b83f4) Ramdisk size: 178940 (0x0002bafc) Second size: 0 (0x00000000) Board name: Command line: console=ttyS0,115200 rw init=/init loglevel=8 Writing boot_cm9.img-kernel ... complete. Writing boot_cm9.img-ramdisk.gz ... complete. Get kernel image (boot_cm9.img-kernel) and ramdisk (boot_cm9.img-ramdisk.gz) Extract kernel config $ dd if=boot_cm9.img-kernel of=dd_uImage bs=1024 skip=1 7903+1 records in 7903+1 records out 8093684 bytes (8.1 MB) copied, 0.0178518 s, 453 MB/s $./extract-ikconfig dd_uImage > kernel_config Extract ramdisk $ mkdir ramdisk $ cd ramdisk $ gzip -dc ../boot_cm9.img-ramdisk.gz | cpio -i 6677 blocks $ tree . . ├── data ├── default.prop ├── dev ├── init ├── init.goldfish.rc ├── initlogo.rle ├── init.rc ├── init.sun4i.rc ├── init.sun4i.usb.rc ├── proc ├── sbin │ ├── adbd │ └── ueventd -> ../init ├── sys ├── system ├── ueventd.goldfish.rc ├── ueventd.rc └── ueventd.sun4i.rc Reference: HOWTO: Unpack, Edit, and Re-Pack Boot Images ...

September 12, 2012 · 1 min · oopsmonk

How to extract kernel config from uImage

Get extract-ikconfig in kernel-source/scripts/ $mkdir extreact-uImage $cd extreact-uImage $cp {kernel-source}/scripts/extract-ikconfig . Dump uImage skip 1024 bytes $cp {uImage/what/you/want} uImage $dd if=uImage of=dd_uImage bs=1024 skip=1 $./extract-ikconfig dd_uImage > config

August 21, 2012 · 1 min · oopsmonk

XBMC for Android on MK802

XBMC announced XBMC for Android. 不過並不打算放上Google Play, 需要自行compile及打包, 方法可參考: Build XBMC for Android on lubuntu 12.04 在此記錄一下目前在MK802跑起來的情況. MK802介紹可參考: Android 4.0 mini PC 最小的主機MK802 CPU : Allwinner A10 - ARM Cortex A8 SoC GPU : ARM Mali 400 RAM : 1GB 以公定價$79USD及讓人跌破眼鏡的入手價, 拿來玩真是夠本了. 這次是要用Android 手機來控制 XBMC, 因為MK802沒有IR只能用滑鼠操作上有些不便. Google Play上有Official XBMC Remote可直接下載來用. 中文設定: 切換到Appearance -> Setting -> International -> Language 為了能透過HTTP連到MK802的XBMC, 需要將"網站伺服"的功能打開, 設定port number 接著查看IP, 設定手機上的XBMC Remote如下: 連線成功就會出現控制選項 用手機上"Remote Control" Navigation, 測試播放USB裡的影片 影片開播後選手機上的"Now Playing", 可以做seek, FF/FB功能, 音量控制是使用手機上的音量鍵. (當初還因為無法控制音量煩腦, 沒想到直接用就可以…冏) ...

July 29, 2012 · 1 min · oopsmonk

Build XBMC for Android on lubuntu 12.04

Install required packages # sudo apt-get install build-essential default-jdk git curl autoconf \ unzip zip zlib1g-dev gawk gperf Getting the Android SDK and NDK http://developer.android.com/sdk/index.html SDK : android-sdk_r20.0.1-linux.tgz crystax-5 NDK with enabled support of C++ exceptions, RTTI and Standard C++ Library http://www.crystax.net/en/android/ndk/7#download NDK : android-ndk-r7-crystax-5.beta2-linux-x86.tar.bz2 Installing Android SDK packages <android-sdk> : $HOME/XBMC_Project/android-sdk-linux # cd <android-sdk>/tools # ./android update sdk -u -t platform,platform-tool Setup the Android toolchain <android-ndk> : $HOME/XBMC_Project/android-ndk-r8b <android-toolchain> : $HOME/XBMC_Project/android_toolchain/android-9 # cd <android-ndk> # ls platforms # cd build/tools # ./make-standalone-toolchain.sh --ndk-dir=../../ \ --install-dir=<android-toolchain>/android-9 --platform=android-9 Create a (new) debug key to sign debug APKs All packages must be signed. The following command will generate a self-signed debug key. If the result is a cryptic error, it probably just means a debug key already existed, no cause for alarm. ...

July 28, 2012 · 2 min · oopsmonk

Android Threads, Handlers and AsyncTask

先看過Processes and Threads會有比較清楚的概念, 當Adnroid Application 啟動後, 系統會建一個主要的thread 稱 “main thread” or “UI thread”, 所有的components 皆跑在這個UI thread, system calls 也是透過UI thread dispatched給各個component, ex: onKeyDown, touch event. UI thread 如因大量運算或等待而blocked, 預設超過5秒ANR(Application Not Responding)就會發生. 且Android UI components 並非thread-safe, 使用上要特別小心. 所以: long time computation使用另外的thread, 不要寫在 UI Thread. 不要在UI thread 之外使用UI component method. 透過Thread, Handler and AsyncTask perform asynchronous processing, 避免UI thread block. Threads Android 提供以下的method, 可在其它的thread 下調用 UI thread. Activity.runOnUiThread(Runnable) View.post(Runnable) <-- used in example code. View.postDelayed(Runnable, long) 或是使用Handler or AsyncTasks class 達到同樣的效果. ...

June 14, 2012 · 1 min · oopsmonk