NTFS for Mac® OS X 6.5

终于可以不用忍受ntfs-3g那蜗牛速度了,特别是写入速度!
相比6.0版,没有了打开大文件错误和特定情况下的传输速度问题。
http://www.paragon-software.com/home/ntfs-mac/download.html

Preference pane is added;
Preference pane allows enabling/disabling POSIX permissions on an NTFS volume;
Preference pane allows turning off/on Paragon NTFS for Linux driver;
Preference pane allows disabling/enabling NTFS file/folder compression;
Preferences pane allows disabling/enabling Last Access Time attribute update;
Improved performance;
Improved driver stability.

用Mplayer播放高清电影(蓝光原盘)

前提还是你的cpu必须强劲,默认情况下mplayer是单线程的,所以显得力不从心,如果你的cpu是双核或支持超线程,那么试试加上一下参数:
[code]
-lavdopts threads=8
[/code]
或者,来自这里:http://ubuntuforums.org/showthread.php?t=629701
[code]
-vfm ffmpeg -lavdopts lowres=2:fast:skiploopfilter=all:threads=8
[/code]
———
蓝光原盘抓出来的文件一般以 .ts 结尾 h264 标准
——- update ——
mac下,mplayer的性能明显差很多,经过大量测试,发现问题主要在音频驱动上,我的配置:
[code]
−vf scale=-2 -lavdopts lowres=1,1400:fast:skiploopfilter=all:threads=8 -ao openal -vo macosx
[/code]
播放《汽车总动员》时勉强不卡!或许因为ntfs-3g的性能不佳吧,另外lowres这个配置未生效。
−vf scale=-2 可以修正字幕被拉扁的问题(视频质量未见异常)。

新装 Leopard 安装开发环境全记录

前期工作

安装光盘里的 Xcode,或者下载 iPhone SDK,2.1G,包括了最新的 Xcode 和 iPhone SDK。

安装好后会有 apache-2.2.6 / php-5.2.5 / ruby-1.8.6 / rails-1.2.6 / python-2.5.1 / java-1.5.0_13 / sqlite-3.4.0 …… gcc 会有2个版本:4.0.14.2.1,默认 /usr/bin/gcc 软连到 gcc-4.0,我们先让默认的 gcc 改用 4.2(2007年1月就 release 了,Changelog
[code]
cd /usr/bin
sudo unlink gcc
sudo ln -s gcc-4.2 gcc
[/code]

设置全局编译参数,编辑 /etc/profile,加上下面的全局变量,保存后重启终端
[code]
export MACOSX_DEPLOYMENT_TARGET=10.5
export ARCHFLAGS=’-arch x86_64′
export CFLAGS=’-arch x86_64 -O3 -pipe’
export CXXFLAGS=$CFLAGS
export LDFLAGS=’-arch x86_64 -bind_at_load’
[/code]

如果需要编译兼容 i386、ppc、ppc64 版本的(编译出来的文件会增大不少),只要加上相应的 -arch 即可
[code]
export CFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -O3 -pipe”
export CXXFLAGS=$CFLAGS
export LDFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load”
[/code]

如果需要编译针对 CPU 优化的,Apple 全系列已经升级到 Intel Core Duo,所以可以加上以下参数
[code]
CHOST=”x86_64-pc-linux-gnu”
CFLAGS=”-march=nocona -O2 -pipe”
CXXFLAGS=”${CFLAGS}”
[/code]
-O 使用 O3,其他详见 http://www.gentoo-wiki.com/Safe_Cflags

因此我自己编译的最终参数是
[code]
export MACOSX_DEPLOYMENT_TARGET=10.5
export ARCHFLAGS=’-arch x86_64′
export CFLAGS=’-arch x86_64 -march=nocona -pipe -O3 -pipe’
export CXXFLAGS=$CFLAGS
export LDFLAGS=’-arch x86_64 -bind_at_load’
[/code]

Java

虽然 Apple 总算在 2008年2月 放出了 JDK6 Preview,但是问题还是非常多。我们还是用 BSD 的一个移植版本 Soylatte,直接下载 64-bit JDK for Mac OS X 10.5: soylatte16-amd64-1.0.2.tar.bz2 (Username: ‘jrl’,Password: ‘I am a Licensee in good standing’)
解压后放到 /usr/local/soylatte16-amd64,软连 /usr/local/java 到这个目录:
[code]
cd /usr/local; sudo ln -s soylatte16-amd64 java
cd /System/Library/Frameworks/JavaVM.framework/Versions/; sudo mkdir soylatte16-amd64
cd soylatte16-amd64; sudo ln -s /usr/local/java Home; sudo ln -s ./Home/bin ./Commands
cd ../A; sudo mv Commands Commands.bak; sudo ln -s ../CurrentJDK/Commands ./
cd ..; sudo unlink CurrentJDK; sudo ln -s soylatte16-amd64 CurrentJDK
java -version
[/code]
显示如下,Java 就算搞定了
[code]
java version “1.6.0_03-p3”
Java(TM) SE Runtime Environment (build 1.6.0_03-p3-landonf_03_feb_2008_01_32-b00)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-p3-landonf_03_feb_2008_01_32-b00, mixed mode)
[/code]

基本库和命令

libtool
[code]
curl http://ftp.gnu.org/gnu/libtool/libtool-1.5.26.tar.gz > libtool-1.5.26.tar.gz
tar xzf libtool-1.5.26.tar.gz
cd libtool-1.5.26
./configure
make
sudo make install
[/code]

zlib
[code]
curl http://www.zlib.net/zlib-1.2.3.tar.gz > zlib-1.2.3.tar.gz
tar xzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
sudo make install
[/code]

openssl/libssl
[code]
curl http://www.openssl.org/source/openssl-0.9.8g.tar.gz > openssl-0.9.8g.tar.gz
tar xzf openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config –prefix=/usr/local –openssldir=/openssl threads zlib-dynamic
vi Makefile
# OPTIONS 里去掉 no-sse2 来开启 CPU 的 SSE2 指令集支持
# CFLAG 里 -arch i386 改为 -arch x86_64
# SHARED_LDFLAGS 同上
make
sudo make install
cd /usr/local/bin
sudo ln -s ../openssl/bin/* ./
[/code]

wget
[code]
curl http://ftp.gnu.org/gnu/wget/wget-1.11.tar.bz2 > wget-1.11.tar.bz2
tar xjf wget-1.11.tar.bz2
cd wget-1.11.tar.bz2
./configure –with-libssl-prefix=/usr/local/openssl
make
sudo make install
[/code]

libpng
[code]
wget http://downloads.sourceforge.net/libpng/lpng1225.tar.bz2 -O libpng-1.2.25.tar.bz2
tar xjf libpng-1.2.25.tar.bz2
cd libpng-1.2.25
./configure
make
sudo make install
[/code]

libjpeg
[code]
wget http://freshmeat.net/redir/libjpeg/5665/url_tgz/jpegsrc.v6b.tar.gz
tar xzf jpegsrc.v6b.tar.gz
cd jpeg-6b
cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .
./configure –enable-shared –enable-static
make
sudo mkdir -p /usr/local/man/man1
sudo make install -lib
[/code]

freetype
[code]
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz
tar xzf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure
make
sudo make install
[/code]

fontconfig
[code]
wget http://fontconfig.org/release/fontconfig-2.5.91.tar.gz
tar xzf fontconfig-2.5.91.tar.gz
cd fontconfig-2.5.91
./configure –prefix=/usr/local –with-zlib –with-jpeg –with-png –with-freetype –disable-dependency-tracking
make
sudo make install
[/code]

gd2
[code]
wget http://www.libgd.org/releases/gd-2.0.35.tar.bz2
tar xjf gd-2.0.35.tar.bz2
cd gd-2.0.35
./configure –with-fontconfig=/usr/local/bin –disable-dependency-tracking
make
sudo make install
[/code]

ImageMagick
[code]
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.9-7.tar.bz2
tar xjf ImageMagick-6.3.9-7.tar.bz2
cd ImageMagick-6.3.9
./configure –with-fontconfig
make
sudo make install
[/code]

mysql
[code]
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51a.tar.gz/from/http://mirror.services.wisc.edu/mysql/
tar xzf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure –with-mysql-user=mysql –with-mysql-group=mysql –with-innodb –with-archive-storage-engine –with-ndbcluster –with-zlib-dir=/usr/local –with-pthread –with-extra-charsets=utf8 –disable-dependency-tracking
make
sudo make install
[/code]

neon
[code]
wget http://www.webdav.org/neon/neon-0.25.5.tar.gz
tar xzf neon-0.25.5.tar.gz
cd neon-0.25.5
./configure –with-ssl=openssl
make
sudo make install
[/code]

Berkeley DB
[code]
# 为了让 subversion-1.4.6 使用,只能用 db-4.4 版本的
wget http://download.oracle.com/berkeley-db/db-4.4.20.tar.gz
tar xzf db-4.4.20.tar.gz
cd db-4.4.20/build_unix
make
sudo make install
cd /usr/local/; sudo ln -s BerkeleyDB.4.4 bdb
[/code]

subversion
[code]
wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.8.tar.bz2
tar xjf httpd-2.2.8.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.bz2
tar xjf subversion-1.4.6.tar.bz2
cd subversion-1.4.6
cp -r ../httpd-2.2.8/srclib/apr* ./
./configure –with-apxs=/usr/sbin/apxs –with-berkeley-db=/usr/local/bdb –with-ssl
make
sudo make install
[/code]

libevent
[code]
wget http://www.monkey.org/~provos/libevent-1.4.2-rc.tar.gz
tar xzf libevent-1.4.2-rc.tar.gz
cd libevent-1.4.2-rc
./configure
make
sudo make install
[/code]

memcached
[code]
wget http://www.danga.com/memcached/dist/memcached-1.2.5.tar.gz
tar xzf memcached-1.2.5.tar.gz
cd memcached-1.2.5
./configure
make
sudo make install
[/code]

pcre
[code]
wget http://nchc.dl.sourceforge.net/sourceforge/pcre/pcre-7.6.tar.bz2
tar xjf pcre-7.6.tar.bz2
cd pcre-7.6
./configure –enable-utf8
make
sudo make install
[/code]

pkg-config
[code]
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
tar xzf pkg-config-0.23.tar.gz
cd pkg-config-0.23
make
sudo make install
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
[/code]

libxml2
[code]
wget ftp://xmlsoft.org/libxml2/libxml2-2.6.31.tar.gz
tar xzf libxml2-2.6.31.tar.gz
cd libxml2-2.6.31
[/code]

lighttpd
[code]
wget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.bz2
tar xjf lighttpd-1.4.19.tar.bz2
cd lighttpd-1.4.19
./configure –with-openssl –with-zlib –without-bzip2 –with-pcre –with-gdbm –with-memcache –with-ldap
make
sudo make install
[/code]

好像大功告成了,还缺啥嘛?

iphone 1.1.3/1.1.4 完美破解指南

首先用itunes将iphone升级至1.1.3/1.1.4
然后运行ziphone激活,破解,解锁……
安装openssh
root登陆,密码:alpine
安全起见 #chmod -x /usr/bin/passwd
这里生成密码,salt为/s,用它替换root密码(/etc/master.passwd)
然后移动 /Application /Library 到第二分区

Leopard 编译 universal php5

因为自带的php没有gd所以要重编
因为服务器用的是x86_64 httpd+php5所以要编 x86_64
因为自带的httpd+php是 universal ,所以要这样做
自带的httpd很好,所以不搞它了
参考:
ppc就不要了

export MACOSX_DEPLOYMENT_TARGET=10.5
export ARCHFLAGS=’-arch i386 -arch x86_64′
export CFLAGS=’-arch i386 -arch x86_64 -O3 -pipe’
export CXXFLAGS=’-arch i386 -arch x86_64 -O3 -pipe’
export LDFLAGS=’-arch i386 -arch x86_64 -bind_at_load’

make时候可能出现这样的提示:

gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

在 configure 的时候加上 –disable-dependency-tracking

‘./configure’ \
‘–prefix=/usr’ \
‘–with-config-file-path=/private/etc’ \
‘–sysconfdir=/private/etc’ \
‘–with-apxs2=/usr/sbin/apxs’ \
‘–with-iconv=/usr/local’ \
‘–with-mhash=/usr/local’ \
‘–with-gettext=/usr/local’ \
‘–with-mysql=/usr/local’ \
‘–with-mysqli=/usr/local/bin/mysql_config’ \
‘–with-pdo-mysql=/usr/local’ \
‘–with-openssl=/usr’ \
‘–with-zlib=/usr’ \
‘–with-curl=/usr’ \
‘–with-gd’ \
‘–with-png-dir=/usr/X11’ \
‘–with-jpeg-dir=/usr/local’ \
‘–with-freetype-dir=/usr/X11’ \
‘–with-xpm-dir=/usr/X11’ \
‘–enable-gd-native-ttf’ \
‘–enable-mbstring’ \
‘–enable-sockets’ \

已有的库就不重装了,只需自己安装 gawk, libiconv, mhash, gettext, mysql, jpeg
需要特别注意:系统自带的liviconv有问题,需要自己编一份到/usr/local(小心不要覆盖以前的,否则可能连sh都不能执行了),php在configure时就算指定了 –with-iconv=/usr/local 它还是首先找到 /usr/include/iconv.h ,而且 –help 里只提到 –with-iconv-dir=,应该使用 –with-iconv=
解决方法:

sh#mv /usr/include/iconv.h /usr/include/iconv.h.bak