2012年6月28日 星期四

[Linux] Minimal syslog file

# fix logs into memory instead of /var/log/messages. and the log size is 512 KB
syslogd -C 512
# to read the logs
logread

2012年6月26日 星期二

[3G] 3G profile

3G profiles

2012年6月23日 星期六

[iOS] Link new xib to File's Owner

The correct answer was given by user763308:
To link a .xib to a class under Xcode4:
  1. Open your .xib.
  2. In placeholder: select File's Owner.
  3. In the third thumbnail:"Identity Inspector" of the right panel, edit the "Custom Class" field and enter the name of your class.
I also then had to:
  1. Click the root view under Objects.
  2. Click the last tab: "Show Connections".
  3. Drag "New referencing outlet" to "File's Owner" and select "view".

2012年6月18日 星期一

[iOS] Hide Status Bar


[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
or
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];

plist:
UIStatusBarHidden, value boolean

[iOS] Change APP name

TARGETS -> UnoOnline -> Build Settings -> Product Name -> UNO Online

2012年6月7日 星期四

[Technology] 3G-4G 理論速度


Downstream Upstream
3G WCDMA 384kbps 384kbps 中華電信, 台灣大, 遠傳, 威寶
CDMA2000 3.1Mbps 1.8Mbps 亞太
3.5G HSDPA 14.4Mbps 384kbps
3.75G HSUPA 14.4Mbps 5.76Mbps
---- HSPA+ 21.6Mbps 5.76Mbps
3.9G HSDPA+ 42Mbps 5.76Mbps 威寶
4G LTE 326.4Mbps 86.4Mbps

2012年6月6日 星期三

[TOOL] CVS add directories recursively


First, add all the directories, but not any named "CVS":
find . -type d \! -name CVS -exec cvs add '{}' \;
Then add all the files, excluding anything in a CVS directory:
find . \( -type d -name CVS -prune \) -o \( -type f -exec cvs add '{}' \; \)
find . -type f -print0| xargs -0 cvs add
Reference

2012年6月5日 星期二

[Linux] DNS Relay

1. Download BIND
http://www.bind9.net/download

2. Cross compile ./configure --host=mips --disable-static --prefix=$(TOOLCHAIN) --includedir=$(INC_GPL_HEADER_PATH) --libdir=$(INC_GPL_LIB_PATH) --with-openssl=no --with-pkcs11=no --with-gssapi=no --with-randomdev=no --without-iconv --without-libiconv --without-docbook-xsl --with-libxml2=no --with-purify=no --with-docbook-xsl=no --with-libiconv=no --with-iconv=no --with-idnlib=no --with-atf=no --with-dlopen=no --with-dlz-mysql=no --with-dlz-postgres=no --with-dlz-bdb=no --with-dlz-filesystem=no --with-dlz-ldap=no --with-dlz-odbc=no --with-dlz-stub=no --disable-developer --disable-devpoll --disable-epoll --disable-largefile --disable-backtrace --disable-isc-spnego --disable-chroot
3. to fix gen issue (bind-tools-BJA-gen-HOSTCC.diff) : modify configure
if test "$cross_compiling" = "yes"; then
        if test -z "$BUILD_CC"; then
               as_fn_error $? "BUILD_CC not set" "$LINENO" 5
        fi
        BUILD_CFLAGS="$BUILD_CFLAGS"
        BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
        BUILD_LDFLAGS="$BUILD_LDFLAGS"
        BUILD_LIBS="$BUILD_LIBS"
else

to

if test "$cross_compiling" = "yes"; then
        #if test -z "$BUILD_CC"; then
        #       as_fn_error $? "BUILD_CC not set" "$LINENO" 5
        #fi
        BUILD_CC="$CC"
        BUILD_CFLAGS="$BUILD_CFLAGS"
        BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
        BUILD_LDFLAGS="$BUILD_LDFLAGS"
        BUILD_LIBS="$BUILD_LIBS"
else

4. to fix epoll issue (or compile it with "--disable-epoll" in step 2.)
bind-tools-BJA-epoll-AC_TRY_RUN-cross.diff

5. /var/named.conf
#Disable query logging
logging {
        category default { null; };
        category lame-servers { null; };
        category edns-disabled { null; };
}

options {
        directory "/var/named";
        version "not currently available";
        listen-on { 192.168.0.1; };
        avoid-v4-udp-ports { range 1 32767; };
        avoid-v6-udp-ports { range 1 32767; };
        forwarders { 168.95.1.1;168.95.192.1; };
        forward only;
        max-ncache-ttl 3;
        allow-transfer { none; };
        allow-update-forwarding { none; };
        allow-notify { none; };
};

6. run named
mkdir /var/named
named -c /var/named.conf -d 10 -p 53

7. messages and logs
/var/log/messages  (if syslogd exists.)
/var/log/named.run

References:
DNS BIND - Operations Statements
DNS HOWTO
bind - DNS 設定
example 1
example 2