[Work Notes] msgpack-idl How-To

msgpack-idl How-To Step 1: Get the msgpack-idl $ git clone git://github.com/msgpack/msgpack-idl.git Step 2: Install the required Ruby tool $ sudo apt-get install ruby1.9.1 Step 3: Go to msgpack-idl folder $ sudo gem install msgpack-idl $ sudo msgpack-idl --install java Step 4: Create a sample file sample with the following content: message Node { 1: string address 2: map<string,string> properties 3: optional string? description } message StorageNode < Node { 4: long capacity 5: optional int weight = 1 } Step 5: Generate Java code with the following commands: ...

February 4, 2013 · 1 min · 143 words · ChenFu Kuo

[工作點滴] message pack rpc install on openwrt

Message pack with RPC extension required 3 packages. msgpack msgpack-rpc mpio The msgpack and mpio are required by msgpack-rpc. The following are openwrt makefiles that I use to build the packages. msgpack library include $(TOPDIR)/rules.mk PKG_NAME:=msgpack PKG_VERSION:=0.5.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://msgpack.org/releases/cpp/ PKG_MD5SUM:=705106a9378c792fe22d285dba5c142c PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk define Package/msgpack SECTION:=libs CATEGORY:=Libraries TITLE:=Message Pack library URL:=http://msgpack.org endef define Package/msgpack/description MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON but it’s faster and smaller. endef ...

February 4, 2013 · 2 min · 257 words · ChenFu Kuo

[Work Notes] Git Clone Error: "Problem with the SSL CA cert (path? access rights?)"

Our company’s git server does not support SSL verify but does support username/password authentication. Git enables SSL verification by default when accessing HTTPS URLs. You may encounter the following error: error: Problem with the SSL CA cert (path? access rights?) while accessing https://tw.ubnt.com/git/example.git/info/refs fatal: HTTP request failed To fix this, disable SSL verification globally: git config --global http.sslVerify false Then clone again: $ git clone https://tw.ubnt.com/git/example.git Cloning into 'test'... Username for 'https://tw.ubnt.com': name Password for 'https://[email protected]': password remote: Counting objects: 1054, done. remote: Compressing objects: 100% (674/674), done. remote: Total 1054 (delta 390), reused 747 (delta 290) Receiving objects: 100% (1054/1054), 14.45 MiB | 377 KiB/s, done. Resolving deltas: 100% (390/390), done. Done!

January 31, 2013 · 1 min · 113 words · ChenFu Kuo

[Work Notes] Protocol Buffer and Message Pack — Initial Study

When I had an engineering discussion with an overseas engineer, I found that he uses a third-party library called MessagePack for binary serialization in internet applications. More detailed information about MessagePack is here: http://msgpack.org/ I’m not sure yet what the full differences are between these two libraries, and I couldn’t find a detailed comparison online. So I’ll spend some time studying both.

January 31, 2013 · 1 min · 62 words · ChenFu Kuo

[工作點滴] protocol buffer message

The statusapi.pb-c.h and statusapi.pb-c.c are generated. Only header file is printing here for further explaination. statusap.pb-c.h /* Generated by the protocol buffer compiler. DO NOT EDIT! */ #ifndef PROTOBUF_C_statusapi_2eproto__INCLUDED #define PROTOBUF_C_statusapi_2eproto__INCLUDED #include <google/protobuf-c/protobuf-c.h> PROTOBUF_C_BEGIN_DECLS typedef struct _Statusapi__StatusRequestType Statusapi__StatusRequestType; typedef struct _Statusapi__StatusResponseType Statusapi__StatusResponseType; typedef struct _Statusapi__StatusParams Statusapi__StatusParams; /* — enums — */ /* — messages — */ struct _Statusapi__StatusRequestType { ProtobufCMessage base; }; #define STATUSAPI__STATUS_REQUEST_TYPE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&statusapi__status_request_type__descriptor) \ } struct _Statusapi__StatusResponseType { ProtobufCMessage base; }; #define STATUSAPI__STATUS_RESPONSE_TYPE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&statusapi__status_response_type__descriptor) \ } ...

January 31, 2013 · 4 min · 779 words · ChenFu Kuo

[Work Notes] Protocol Buffer Examples

There is protobuf and protobuf-c website: http://code.google.com/p/protobuf/ http://code.google.com/p/protobuf-c/ We are implementing remote control from back-end applications using protobuf-c. The protobuf-c has extensions from Google’s protobuf for RPC functionality. The first experiment is using the message directly by packing messages into shared memory between the server and the client. Both sides can get the message without issues. Our target is to use the RPC approach that protobuf-c provides. First, we create a .proto file — here’s an example statusapi.proto: ...

January 30, 2013 · 2 min · 285 words · ChenFu Kuo

[Work Notes] Heading Toward Ten Years

While organizing earlier blog posts from 2008, I notice how immature I was back then — but looking at the transitions and broader experiences since, it seems I’ve grown, even if just a little. In January 2011, just before hitting my seventh year, I made a major decision: to leave a very familiar work environment. In some ways, it meant stepping out of my comfort zone — essentially resetting myself. What guided the decision was an unexpected opportunity to work at a multinational foreign company. That opportunity matched a few things I’d been thinking about: ...

January 29, 2013 · 3 min · 546 words · ChenFu Kuo

[Miscellaneous] Great BBQ in Neihu

In Neihu, there’s a great BBQ spot on the road in front of the main gate of Lishan Junior High School, near Gang-Qian Road. It’s called Chuan Men Zi BBQ (串門子燒烤) — pretty solid! There’s a bookstore next door. Hours are 17:00 to 24:00. You can call ahead to order and then pick up — it’s takeout only, not the kind of place you sit down with friends for a long chat. ...

July 4, 2008 · 1 min · 115 words · ChenFu Kuo

[Work Notes] ncftp-3.2.1 Cross-Compiling

ncftp is an FTP client. One of our projects needed FTP functionality, so I cross-compiled it for an ARM target. Build Steps Step 1: Generate the Makefile. If you need curses support, add the relevant library — but for our project it’s not needed: ./configure --disable-ccdv --without-curses --without-ncurse Step 2: Edit the Makefile — update CC and STRIP as follows: CROSS_COMPILE=arm-unknown-linux-gnu- CC=${CROSS_COMPILE}gcc STRIP=${CROSS_COMPILE}strip Step 3: Make it! make

March 3, 2008 · 1 min · 68 words · ChenFu Kuo

[Personal Reflections] A Married Man

In two more weeks, I’ll be getting married — the title says it all. “A married man” is simply the counterpart of “a married woman”! Marriage marks the beginning of a new chapter in life. Someone will be by my side, supporting me through everything. There will surely be much to learn and grow through — I hope I can do it well. 😄 Thank you to my other half for more than three years of companionship. I look forward to your continued guidance in the days ahead.

December 23, 2007 · 1 min · 88 words · ChenFu Kuo