2010年8月24日 星期二

免螢幕 免鍵盤 免網路線? 一條電線設定好Mac Mini Server

如果你的無線網路環境是沒有密碼的話,也許可以免網路線。

不過反正我有網路線。

環境
分享器一台,或是可以配發dhcp的東西,用macbook的網路分享也可以。
另外一台mac系統,安裝server admin tools用。(server光碟第二片)
網路線一條,接上去。


  1. 打開mini server

  2. 去分享器的地方看,目前的dhcp client,看一下mini server盒子上面的ethernet mac address,找到對應的ip是192.168.200.142

    • Voila_Capture54-2010-08-24-23-00.png



  3. 安裝server admin tools,打開server assistant。

    • Voila_Capture60-2010-08-24-23-00.png



  4. 加入一台新的server,密碼,盒子上面的serial前八位數字。

  5. 連線成功,開始之後的設定。

    • Voila_Capture61-2010-08-24-23-00.png

2010年7月25日 星期日

nfsd privileged port

http://mars.netanya.ac.il/~unesco/cdrom/LDP/NFS/HTML_FORMAT/NFS-HOWTO-6.html

Another important thing is to ensure that nfsd checks that all it's requests comes from a privileged port. If it accepts requests from any old port on the client a user with no special privileges can run a program that's is easy to obtain over the Internet. It talks nfs protocol and will claim that the user is anyone the user wants to be. Spooky. The Linux nfsd does this check by default, on other OSes you have to enable this check yourself. This should be described in the nfsd man page for the OS.

Another thing. Never export a file system to 'localhost' or 127.0.0.1. Trust me.

新版的說
http://nfs.sourceforge.net/nfs-howto/ar01s06.html
The TCP ports 1-1024 are reserved for root's use (and therefore sometimes referred to as "secure ports") A non-root user cannot bind these ports. Adding the secure option to an /etc/exports means that it will only listed to requests coming from ports 1-1024 on the client, so that a malicious non-root user on the client cannot come along and open up a spoofed NFS dialogue on a non-reserved port. This option is set by default.

舊的版本說,只要相信從1024以下來的client,而且不要給localhost連線。這有點道理,如果相信從localhost來的1024以上的連線,可能是假造的。
但是應該只要做其中一項就好了吧,外部的連線不管是不是1024以下的都有可能會是假的。

不知道為什麼linux的實作還是這樣。

在mac上面mount_nfs要加上
-o resvport
Use a reserved socket port number. This is useful for mounting
servers that require clients to use a reserved port number on the
mistaken belief that this makes NFS more secure
. (For the rare
case where the client has a trusted root account but untrustwor-
thy users and the network cables are in secure areas this does
help, but for normal desktop clients this does not apply.)

意思就是說這樣根本沒什麼用就對了。

如果沒有加這個的話,會出現 /Volumes/nfs: Permission Denied

或是在nfs server /etc/exports 加上 insecure

2010年7月19日 星期一

AAC+/eAAC/AAC plus/Enhanced AAC

Shared library libaacplus
http://tipok.org.ua/node/17

with patch for ffmpeg, need to download source code from 3GPP.


3GPP Reference encoder
Floating Point: http://www.3gpp.org/ftp/Specs/html-info/26410.htm
Fixed Point: http://www.3gpp.org/ftp/Specs/html-info/26411.htm



aacplusenc
http://teknoraver.net/software/mp4tools/#download
Also with binary for Win/Linux/Mac platform.


NeroAAC
http://www.audiocoding.com/nero_aacenc.html
No source code


DarkGiank's enhAacPlusEnc
http://dgaapenc.berlios.de/en/#ins




To support 80kbps encoding, edit sbr_main.c

{ 64000, 80001, 24000, 2, 12, 9, 3, 0, -3, SBR_SWITCH_LRC, 2 }, /* nominal: 80 kbit/s 48khz*/
{ 64000, 80001, 22050, 2, 12, 9, 3, 0, -3, SBR_SWITCH_LRC, 2 }, /* nominal: 80 kbit/s 44.1khz*/


不知道為什麼不要乾脆都用AAC+ 80kbps來存音樂就好。thepiratebay上面有人分享48kbps的AAC+音樂, 可是種子太少沒有下載來聽。iTunes也支援最高到80kbps。

另外, Ogg Vorbis @48kbps 聽起來其實也不錯。

2010年7月17日 星期六

新酷音測試




/* 
 * File:   main.cpp
 * Author: adolf
 *
 * Created on 2010年7月17日, 上午 1:11
 */

#include <stdlib.h>

#include <stdio.h>
#include <chewing/chewing.h>
#include <chewing/global.h>
#include <chewing/chewingio.h>
#include <string.h>

using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {

    if (0 != chewing_Init("/Users/adolf/chewing/0.3.2/share/chewing/", ".")) {
        fprintf(stderr, "chewing_Init failed\n");

        exit(-1);
    }
    ChewingConfigData config;

    ChewingContext * ctx = chewing_new();

    chewing_set_maxChiSymbolLen(ctx, 16);
    chewing_set_candPerPage(ctx,10);

    char * str0 = "w96j0 eji6 g wu3 au4z/ ";
    //char * str = "1";
    for (int i = 0; i < strlen(str0); i++) {

        //printf("%d\n",i);
        chewing_handle_Default(ctx, str0[i]);
        chewing_cand_Enumerate(ctx);

        if (chewing_cand_TotalChoice(ctx) >0) {
            while (chewing_cand_hasNext(ctx)) {

                char* str = chewing_cand_String(ctx);
                if (str) {

                    //converted_string = utf8_mbstowcs( str );
                    printf("candidates %s\n", str);
                    chewing_free(str);
                }
            }
        } else {

            if (chewing_buffer_Check(ctx)) {
                char * str = chewing_buffer_String(ctx);

                if (str) {
                    printf("buffer %s\n", str);
                    chewing_free(str);
                }
            }
        }

        if (chewing_commit_Check(ctx)) {
            char* str = chewing_commit_String(ctx);

            if (str) {
                printf("%s\n", str);
                chewing_free(str);
            }
        }
    }

    chewing_handle_Left(ctx);
    chewing_handle_Left(ctx);
    /*
    chewing_handle_Down(ctx);
    chewing_handle_Down(ctx);
    chewing_handle_Enter(ctx);*/
    chewing_handle_Default(ctx,'v');

    chewing_handle_Default(ctx,'u');
    chewing_handle_Default(ctx,'l');
    chewing_handle_Default(ctx,'3');

    if (chewing_buffer_Check(ctx)) {
                char * str = chewing_buffer_String(ctx);

                if (str) {
                    printf("buffer %s\n", str);
                    chewing_free(str);
                }
            }

    return 0;
}

2010年7月8日 星期四

android超級好用注音輸入法 1.0.2

1.0.3 新增功能說明

輸入'中'的時候,會出現

文,文系,了,共,區,午,原,古,和,國....樞神經,正大學,正機場,氣不足,泰賓館...

很多以中開頭的詞彙。

要一直翻到最後一頁的話乾脆就自己打完了。

這時候只要打注音ㄍ,就會出現中之後注音開頭ㄍ的詞彙前三個,例如 共,古,廣

如果打ㄍㄨㄛ... 就會出現 國人,國城,國菜...

不用打聲調, 打ㄍㄨㄛㄖㄣ,就會變成國人了。同理,打ㄊㄞㄅ一,就會出現泰賓館。

不喜歡的請到開發者網頁下載舊版1.0.2

不喜歡1.0.3的選詞功能的請下載這個。

另外

會在背景時候清理資料庫(vacuum), 最多一天一次。

某些rom會擋掉廣告,這些不能切換成中文鍵盤。

2010年6月24日 星期四

android超級好用注音輸入法

只是名字而已...。

Based on

http://code.google.com/p/android-traditional-chinese-ime/

使用gcin的注音字碼,詞典庫。

現在開始30天之後失效。

PastedGraphic-2010-06-24-03-19.jpg

台鐵的挖土機繼續挖鐵軌ing...。

一個平交道挖了半年還挖不完。

2010年5月30日 星期日

Motorola Droid 輸入法

Motorola輸入法比較麻煩, 他有檢查裝置, 也有多個螢幕解析度的設定。

所以, 就算跳過了檢查機制, 也可能因為螢幕解析度不符合, 而載入錯的(480x320)螢幕設定, 弄出一個超小鍵盤。或是手寫輸入法, 根本找不到正確的設定而掛掉...。

DisplayMetrics