Tuesday, December 30, 2008


This NAS comes with Linux OS and BT download / iTunes / UPnP DLNA AV Server and can be modified using the Dlink - DNS323 funplug packages

Objective of modding
(a) Add ssh server
(b) Add lighttpd (port 80), php & mysql
(c) change the web admin http page to port 81


(1) Upgrade NAS firmware 1.1.2

(2) Setup the BT Downloader and FTP / Samba server via the web admin of the NAS

(3) Use telnet to gain access
telnet 1192
ID: root
PASSWORD: password

(4) install funplug

cd /DataFolder
mkdir ffp
cd ffp
wget http://www.inreto.de/dns323/fun-plug/0.5/fun_plug.tgz
tar zxvf funplug.tgz
ln -sf /DataFolder/ffp /
export PATH=/ffp/bin:/ffp/sbin/:$PATH

(5) download funplug packages

cd /DataFolder/ffp
rsync -av inreto.de::dns323/fun-plug/0.5/packages .

(6) start ssh server

chmod 111 /ffp/var/lib/sshd
sh /ffp/start/sshd.sh start

(7) Install lighttpd, php and mysql

cd /DataFolder/ffp
mkdir -p packages
funpkg -i mysql-5.1.28-rc-1.tgz
funpkg -i php-5.2.6-mysql51-1.tgz
chmod u+x /ffp/start/mysqld.sh
/ffp/start/mysqld.sh restart
/ffp/bin/mysqladmin -u root password 'new-password'
ln -s /ffp/var/mysql.sock /tmp/mysql.sock
cp /DataFolder/ffp/etc/examples/lighttpd.conf-with-php /DataFolder/ffp/etc/lighttpd.conf
cp /DataFolder/ffp/etc/examples/my.cnf /DataFolder/ffp/etc/my.cnf
vi /DataFolder/ffp/etc/lighttpd.conf
mkdir -p /DataFolder/ffp/etc/www/logs
mkdir -p /DataFolder/www/tmp
echo '<?php phpinfo(); ?>' > /DataFolder/www/index.php

when editing lighttpd.conf change these

server.document-root = "/DataFolder/www/"
server.upload-dirs = ( "/DataFolder/www/tmp" )
server.errorlog = "/DataFolder/ffp/etc/www/logs/error.log"
accesslog.filename = "/DataFolder/ffp/etc/www/logs/access.log"
server.port = 80

(8) Modify btdog (so that the modding will be effective even after NAS reboot)

mv /DataFolder/.bittorrent/bin/btdog /DataFolder/.bittorrent/bin/btdog_bak
vi /etc/protocols

and add this line to /etc/profile

export PATH=/ffp/bin:/ffp/sbin/:$PATH

cp /etc/profile /DataFolder/.bittorrent/bin/profile.bak
vi /DataFolder/.bittorrent/bin/btdog

the content of btdog is

btdog: Select all

#ledset 4=USB1 6=USB2 7=Power 17=HDD1 18=HDD2, 0=on 1=off
#/bin/ledset 4 1
#/bin/ledset 6 1
#/bin/ledset 7 1
#/bin/ledset 17 1
#/bin/ledset 18 1
ln -s /DataFolder/ffp/ /ffp
export PATH=/ffp/bin:/ffp/sbin/:/usr/bin:/bin:/usr/sbin:/sbin
killall webs nashttpd
cp /DataFolder/.bittorrent/bin/profile.bak /etc/profile
/DataFolder/ffp/sbin/lighttpd -f /DataFolder/ffp/etc/lighttpd.conf&
chmod 600 /DataFolder/ffp/etc/ssh/ssh_host_rsa_key /DataFolder/ffp/etc/ssh/ssh_host_dsa_key /DataFolder/ffp/etc/ssh/ssh_host_key
chmod 600 -R /DataFolder/ffp/var/lib/sshd
chmod 111 /DataFolder/ffp/var/lib/sshd
sh /DataFolder/ffp/start/sshd.sh start
cp /DataFolder/ffp/etc/my.cnf /etc/my.cnf
chmod 0644 /etc/my.cnf
chmod +x /DataFolder/ffp/start/mysqld.sh
sh /DataFolder/ffp/start/mysqld.sh start&
ln -sf /DataFolder/ffp/var/mysql.sock /tmp/mysql.sock
/DataFolder/.bittorrent/bin/btdog_bak /DataFolder/.bittorrent/bin/bt -daemon-loop --default-settings-file /DataFolder/.bittorrent/bin/btsettings.txt

change btdog to be executable

chmod +x /DataFolder/.bittorrent/bin/btdog

(9) reboot NAS and test lighttpd, php, mysql, ssh and other servers

and enjoy installing some more packages from fun-plug see here

Saturday, December 27, 2008

How-to compile and install wget binary in Mac OS X

mkdir -p wget; cd wget
curl -O http://ftp.gnu.org/pub/gnu/wget/wget-latest.tar.gz
tar -zxvf wget-latest.tar.gz
cd *
sudo cp -p src/wget /usr/bin/

Tuesday, December 23, 2008

MSI Wind Notebook Install Mac OS X 10.5.4/5

Here is the guide

You need these

for display driver

for wifi

for creating Lepoard install partition in harddisk


Headphone jack switch

Front Row update 2.1.2 (so that Front Row can see your iTunes Library if you have upgraded to iTunes 8)

Results for Mac OS X 10.5.4/5 Installation
WinXP / Mac OS X dual boot : OK
Ethernet : OK
Wifi : OK
Speaker : OK
GMA950 Graphics 1024 x 600 : OK
USB Hard Disk : OK
USB HSDPA modem : OK
Bluetooth : OK
Quick Time Player : OK
iPhone SDK Development : OK
WebCam, Photo Booth : OK
Headphone Jack Output : with switch.sh script (see above)

Sound Line Input / mic : failed
Trackpad Scrolling : not working (but you can press the upper / lower right corner of the track pad to slowly scroll)

If you need to upgrade Safari to 3.2.1, you need to first upgrade Mac OS X to 10.5.5 and then update Security Update 2008-007 Client (Leopard)

To upgrade 10.5.5, you can download this update from Apple

After update to 10.5.5, you just need to reinstall the GMA950 driver and everything works except mic / line input

Then download the Security Update 2008-007 here http://www.apple.com/downloads/macosx/apple/security_updates/securityupdate2008007clientleopard.html

Then in the Software Update, you can have the option to upgrade Safari to 3.2.1

This is how to disable the Realtek utility in startup

sudo mv WiUtilityCardbusPCIStartUp ~/

And also remove it in System Settings -> Accounts -> Login Items

Thursday, December 4, 2008

Create US iTunes Account without credit card

(1) Open iTunes and change iTunes store to United States.

(2) Goto App Store of US and Click to buy a free app

(3) Choose to create a new account and enter email address and password and other questions. Choose none for payment method to create a new iTunes Account. Enter a valid US address (find it in Google), you need valid and matching city (e.g. Piscataway), state(e.g. NJ) and zipcode (e.g. 08854) and telephone number (3 digits for area code and 7 digits for telephone number) e.g. (852)9123456.
If you want to find a valid address in US, you can also make use of Google Map in iPhone. For example, first search a city say San Franciso, then search Starbucks.

(4) If you want to add Store credit to your iTunes Account to buy paid app,
buy US iTunes gift certificate from ebay (search here) or from your friend in US (tell him to email you the Activation Code and the Card Serial Number)