2009-07-24

FreeBSD遠端Console設定UTF-8環境

http://toolbox.orzcorp.com/?p=8

proftpd big5

PS:如果要讓proftpd不使用unicode,可把unix系統設為big5後才編譯,也記得在configure時不要加--enable-nls
修改/etc/sysconfig/i18n
將LANG="zh_TW.UTF-8"
改成LANG="zh_TW.BIG5"再重開機
編譯完就可以改回來了 XD
PS:改成BIG5以後,能夠不再改就不要改,因為,有遇過客戶端軟體造成的怪異問題
這個對於只會用IE開FTP的人有用.(說穿了,就是全部統一使用非Unicode,就算你用Smartftp或是FileZilla來連也一樣,雖然FileZilla會嘗試用UTF8處理...)
或者是
在proftpd.conf裡設定UseUTF8 off
新版的proftpd.conf(1.3.2rc1)是設UseEncoding off 或 UseEncoding cp950 cp950
(在1.3.2正式版上未測試)

ftp utf-8 big5

xp的下的檔案總管不支援ftp utf-8的檔案名,只能用big 5
所以pureftpd.conf必須要配合調整一下。
compile --with-rfc2640

FileSystemCharset big5
ClientCharset big5

vista底下的ftp就support utf8 filename

pureftpd anonymous delete resume rename file

os:freebsd 6.1

使用pure-ftpd想要開啟anonymous delete resume rename file
必須在configure前就要 setenv

setenv CPPFLAGS "-DANON_CAN_DELETE -DANON_CAN_RENAME"
cd /usr/ports/ftp/pure-ftpd
make install clean
就可以了

setenv CFLAGS not work。



Hi again.

What follows is something extremely confidential, private, undocumented
and top secret. But as you subscribed to the shiny pureftpd-users
mailing-list, you need to know. Maybe this is dangerous. Maybe if
someone knows that you've read this, special agents will murder you.
So you're free to delete this message without any further reading now.

Still here? Are you sure?

Well...

Ok.

Apart from ./configure and run-time options, there are some
undocumented switches in Pure-FTPd. They are undocumented because they
were only designed for testing/debugging, or because they are uncommon
needs.

But if you are strong, you can play with these undocumented switches.

To enable them, you have to recompile pure-ftpd with something like
that :

env CFLAGS="$CFLAGS -DSTRICT_REST -DLOG_ANON_EMAIL" ./configure
make install-strip

Add as many -D as you want here.

Here's a list of these top secret features :

* ALWAYS_RESOLVE_IDS :
Always try to get full user names, even once chrooted. If you define
this, you can put a fake etc/passwd file (or similar, like pwd.db) in
a chrooted environment to get user names.

* ANON_CAN_CHANGE_PERMS :
Allow anonymous users to chmod files.

* ANON_CAN_DELETE :
Allow anonymous users to delete files.

* ANON_CAN_RENAME :
Allow anonymous users to rename files.

* ANON_CAN_RESUME :
Allow anonymous users to resume uploads.

* AUTORENAME_REVERSE_ORDER :
When autorename is enabled, put the unique id at the beginning of
file names, not at the end. Useful if you want to keep extensions.

* DEFAULT_TO_BINARY_TYPE :
Default to binary transfers even if 'bin' ('TYPE I') hasn't been
issued by the client.

* DISABLE_MKD_RMD :
People can't create/delete directories any more.

* DO_AUTHD_TIMEOUT :
Send an ALRM signal to an authentication module after 60 seconds.

* FANCY_LS_DIRECTORY_HEADERS :
Display 'ls' with multiple directories with lovely headers. This is how
the good old first releases of pure-ftpd were displaying things.
Unfortunately, it breaks parsing with some clients (like ncftp with a
recursive get) . But I really feel nostalgic when I see these headers
again.

* LOG_ANON_EMAIL :
Log what anonymous users have entered in the 'password' field.
Except for SPAM, I don't see any reason why people would enable this.
So no, no, no, don't ask, it won't become a standard feature.

* NON_BLOCKING_DATA_SOCKET :
Create transfers socket with O_NONBLOCK.

* RFC_CONFORMANT_LINES :
Assumes that all clients will end their command lines with \r\n as
expected. Unfortunately, in the real life, this is not always the case.

* RFC_CONFORMANT_PARSER :
Allows control characters and other horrible stuff in commands and
file names.

* SAVE_DESCRIPTORS :
Save file descriptors by closing/reopening the log after/before
every logged message. Slow, painful, and not chroot-friendly.

* SKIP_COMMAND_TRAILING_SPACES :
Trim spaces after commands, so that 'STOR xyz' is the same as 'STOR
xyz' . For brain damaged clients.

* SNPRINTF_IS_NOT_BUGGY :
Asserts that your snprintf() function works the ISO C99 way. Never
enable this on binary packages.

* STRICT_REST :
Disallow REST commands in ASCII mode (or at least : reply with an
error code) .

* WITHOUT_PAM_SESSION :
Do PAM authentication, but don't open PAM sessions.


Have fun...

_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Pureftpd-users mailing list
Pureftpd-users@lists.sourceforge.net
https://lists.sourceforge.net/lists.../pureftpd-users

2009-07-16

ffdshow thumbnails rundll32 crash

vista 底下,使用k-lite codepack 5.0
不知道為什麼看某個錄製的mpq時,一直會有rundll32 dep crash的問題...
原來是因為檔案總管自動建立thumbnails的問題。

設定了資料夾的檢視方式,使用「 Always show icons, never thumbnails 」就正常了。
不過缺點是jpg檔,也不會有thumbnails,要用預覽,或是用xnview等軟體。

或是也可以用另一種方法,讓某些副檔名的檔案不要產生thumbnails。

You can disable auto creation of thumbnails in Windows Explorer for videos files pr extention.
Just delete the following registry key:

HKEY_CLASSES_ROOT\[Extention]\ShellEx\ BB2E617C-0920-11d1-9A0B-00C04FC2D6C1

Replace [Extention] with the extention of your choice like:

.avi
.vob
.mpg
.mov
.vmw

If you at one point want it back again, just create the key again and reboot. And Vista will again happily suck all the power out of your computer, when opening a folder with lots of video files...

2009-07-08

尋找哪個cvsup server連線最快

cd /usr/ports/sysutils/fastest_cvsup

#make install clean #安裝
#rehash

#fastest_cvsup -c tw #會幫你找出前三名

-1st: cvsup?.tw.freebsd.org
-2nd: cvsup?.tw.freebsd.org
-3rd: cvsup?.tw.freebsd.org

2009-07-07

FreeBSD 7.2 ipnat ipfilter

新的版本,基本上都不需要再重編kernel,為了一點效能,而整個重編kernel也很麻煩,而且現在cpu都太快了。

rc.conf:
ppp_enable="YES"
ppp_mode="ddial"
ppp_profile="pppoe"

ipfilter_enable="YES"
ipnat_enable="YES"
ipmon_enable="NO"
ipmon_flags="-Ds"

/etc/ipf.rules

ipnat.rules
map tun0 192.168.2.0/24 -> 0/32 proxy port ftp ftp/tcp
map tun0 192.168.2.0/24 -> 0/32 portmap tcp/udp auto
map tun0 192.168.2.0/24 -> 0/32

2009-07-02

FreeBSD 7.2+Apache22+PHP+mysql51

1. Fresh Install a FreeBSD 7.2-RELEASE
install from ftp6.tw.freebsd.org

2. portsnap fetch extract

3. mysql51-server (for a long time)
mkdir /usr/local/mysql
chown /usr/local/mysql user:mysql pw:mysql
用ln -s 於/var/db/mysql建link至/usr/local/mysql(可省略)
make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_general_ci BUILD_OPTIMIZED=yes BUILD_STATIC=yes install clean

cp /usr/local/share/mysql/my-huge.cnf /var/db/mysql/my.cnf
ee my.cnf
[mysqld]
skip-name-resolve



4. install apache22 (for a long time with perl)
make config
BerkleyDB(subversion) mod_proxy all

/etc/newsyslog.conf
#newsyslog
/var/log/httpd-access.log 644 3 1 @T00 Z
/var/log/httpd-error.log 644 3 1 @T00 Z /var/run/httpd.pid


modify apache22.conf
#kenny
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


5. install php5

6. install pure-ftpd

7. http://blog.cheyingwu.tw/index.php/2007/05/04/freebsd-utf8-env/
FreeBSD UTF-8 環境

FreeBSD 5.x 以上,就已經支援 i18n,之前因為 ftp 日文檔名的問題,所以全面 utf-8 記錄一下整個過程

改 csh 的登入設定

#~/.cshrc setenv LC_ALL zh_TW.UTF-8


安裝 convmv 轉 big5 中文檔名

cd /usr/ports/converters/convmv make install clean;rehash

使用法

convmv -f big5 -t utf-8 -r --notest [檔名 or 目錄名]

檔案內容編碼用 iconv 轉

iconv -f big5 -t utf-8 檔名 > 檔名

重編 pure-ftpd 支援 RFC 2640,在 Makefile 裡面加上

--with-rfc2640

編完後編輯 pure-ftpd.conf

FileSystemCharset utf-8 ClientCharset big5

這樣一來就完成 FreeBSD UTF-8 化

延伸閱讀

兔耳八克斯 » FreeBSD遠端Console設定UTF-8環境
MC104 :: 觀看文章 - [推薦] 轉換目錄/檔名編碼的 perl 程式

8. install phpmyadmin (安裝很多雜七雜八的port,也是很久)
mysqladmin -u root password xxxxxx(更改root password)
modify httpd.conf
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

Options none
AllowOverride Limit

Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.1.x(自己的網段)

http://x.x.x.x/phpmyadmin/setup

9.cd /usr/ports/devel/ruby-gems
# make install clean
remember to install ruby-iconv
不然rails會出現undefined method `camelize' for "app":String
cd /usr/ports/converters/ruby-iconv

2023 灌籃高手 SLAM Dunk

 2023 哩哩摳摳 昨天是難得的颱風假。 去看了二輪的灌籃高手。 電影院一堆的小朋友阿。 以下有小暴雷。 雖然我不算是非常的迷灌籃高手,但是還是很喜歡這部作品。 井上老師的畫風我也非常喜歡。 整部片是以良田的角度來看的。 以前我並不是很熟習良田這個角色,但是看到良田能重新站起來...