source: http://www.longine.co.cc/frame.php?frameon=yes&referer=http%3A//www.longine.co.cc/viewthread.php%3Ftid%3D103
1)在Windows下有好用的ConvertZ
2)在Linux下只要一個指令就解決...
語法如下:
piconv -f gbk -t utf8 < file_gbk.sgf > file_utf8.sgf
複製代碼
就能將 gbk 編碼轉為 utf8 ,要轉成繁體,就改成 big5
如果有大量的文件要轉換,需要寫個小程式才能解決...
3)linux另外有一種叫做convmv的批次轉碼工具,
安裝:
sudo apt-get install convmv
(或者make,make install)
或到 http://j3e.de/linux/convmv/ 下載
用法:
convmv --help #先看說明
convmv --list #列出所有可用編碼
convmv -f big5-eten -t utf8 -r /Path/To/Your/Files #從 big5 檔名轉碼成 utf8,僅顯示測試結果,尚未實際轉換喔。
convmv -f big5-eten -t utf8 -r --notest /Path/To/Your/Files #加上 --notest 參數,正式進行檔名轉碼。
#常用在從 windows 搬到 linux UTF-8 環境結果產生亂碼的檔名。
Wednesday, May 25, 2011
Wednesday, February 16, 2011
Build squeeze base system image for easy debian on N900
Reference:
http://www.debian.org/releases/stable/i386/apds03.html.en
http://talk.maemo.org/showpost.php?p=419501&postcount=28
N900:~$ apt-get install dmsetup
N900:~$ debian
EasyDebian:~$ mkdir /mnt/debinst
EasyDebian:~$ dd if=/dev/zero of=/home/user/MyDocs/squeeze.img.ext2 count=4194304
EasyDebian:~$ mke2fs -L Squeeze /home/user/MyDocs/squeeze.img.ext2
EasyDebian:~$ apt-get update
EasyDebian:~$ apt-get install debootstrap
EasyDebian:~$ mount -t ext2 /home/user/MyDocs/squeeze.img.ext2 /mnt/debinst -o loop,noatime,nobh,nodiratime 2>&1
EasyDebian:~$ /usr/sbin/debootstrap --arch armel squeeze /mnt/debinst http://ftp.jp.debian.org/debian
EasyDebian:~$ mount -o bind /dev /mnt/debinst/dev
EasyDebian:~$ mount -t devpts none /mnt/debinst/dev/pts
EasyDebian:~$ mount -o bind /tmp /mnt/debinst/tmp
EasyDebian:~$ mount -o bind /var/tmp /mnt/debinst/var/tmp
EasyDebian:~$ mount -o bind /dev/shm /mnt/debinst/dev/shm
EasyDebian:~$ LANG=C chroot /mnt/debinst /bin/bash
Squeeze:~$ mount -t proc proc /proc
Squeeze:~$ rm /bin/sh
Squeeze:~$ ln -s /bin/bash /bin/sh
Squeeze:~$ dpkg-reconfigure tzdata
> Asis -> Hong Kong
Squeeze:~$ aptitude update
Squeeze:~$ aptitude install locales
Squeeze:~$ dpkg-reconfigure locales
> en_GB*
> en_HK*
> en_US*
#Squeeze:~$ aptitude install console-data
#Squeeze:~$ dpkg-reconfigure console-data
Squeeze:~$ useradd -m user
Squeeze:~$ mkdir /home/user/MyDocs
#Squeeze:~$ mkdir /var/run/dbus
#Squeeze:~$ mkdir /var/lib/dbus
#Squeeze:~$ mkdir /var/run/pulse
Squeeze:~$ vi /var/run/onfirstchroot-ext.rc
> #Fix the /etc/mtab file
> #CHROOT=`pwd | awk -F'/var' '{ print $1 }'`
> echo Updating the /etc/mtab file...
> CHROOT2=`echo $CHROOT | awk -F'/' '{ print $2 }'`
> cat /etc/mtab | grep $CHROOT2 | sed "s/$CHROOT2\///" | sed "s/$CHROOT2//" | grep bind -v > $CHROOT/etc/mtab
Squeeze:~$ chmod 744 /var/run/onfirstchroot-ext.rc
Squeeze:~$ umount /proc
Squeeze:~$ exit
EasyDebian:~$ umount /mnt/debinst/dev/shm
EasyDebian:~$ umount /mnt/debinst/var/tmp
EasyDebian:~$ umount /mnt/debinst/tmp
EasyDebian:~$ umount /mnt/debinst/dev/pts
EasyDebian:~$ umount /mnt/debinst/dev
EasyDebian:~$ umount /mnt/debinst
EasyDebian:~$ exit
N900:~$ closechroot
N900:~$ mv /home/user/MyDocs/debian-m5-v3d.img.ext2 /home/user/MyDocs/Lenny.img.ext2
N900:~$ mv /home/user/MyDocs/squeeze.img.ext2 /home/user/MyDocs/debian-m5-v3d.img.ext2
N900:~$ debian
Squeeze:~$ tasksel install standard
Squeeze:~$ aptitude clean
http://www.debian.org/releases/stable/i386/apds03.html.en
http://talk.maemo.org/showpost.php?p=419501&postcount=28
N900:~$ apt-get install dmsetup
N900:~$ debian
EasyDebian:~$ mkdir /mnt/debinst
EasyDebian:~$ dd if=/dev/zero of=/home/user/MyDocs/squeeze.img.ext2 count=4194304
EasyDebian:~$ mke2fs -L Squeeze /home/user/MyDocs/squeeze.img.ext2
EasyDebian:~$ apt-get update
EasyDebian:~$ apt-get install debootstrap
EasyDebian:~$ mount -t ext2 /home/user/MyDocs/squeeze.img.ext2 /mnt/debinst -o loop,noatime,nobh,nodiratime 2>&1
EasyDebian:~$ /usr/sbin/debootstrap --arch armel squeeze /mnt/debinst http://ftp.jp.debian.org/debian
EasyDebian:~$ mount -o bind /dev /mnt/debinst/dev
EasyDebian:~$ mount -t devpts none /mnt/debinst/dev/pts
EasyDebian:~$ mount -o bind /tmp /mnt/debinst/tmp
EasyDebian:~$ mount -o bind /var/tmp /mnt/debinst/var/tmp
EasyDebian:~$ mount -o bind /dev/shm /mnt/debinst/dev/shm
EasyDebian:~$ LANG=C chroot /mnt/debinst /bin/bash
Squeeze:~$ mount -t proc proc /proc
Squeeze:~$ rm /bin/sh
Squeeze:~$ ln -s /bin/bash /bin/sh
Squeeze:~$ dpkg-reconfigure tzdata
> Asis -> Hong Kong
Squeeze:~$ aptitude update
Squeeze:~$ aptitude install locales
Squeeze:~$ dpkg-reconfigure locales
> en_GB*
> en_HK*
> en_US*
#Squeeze:~$ aptitude install console-data
#Squeeze:~$ dpkg-reconfigure console-data
Squeeze:~$ useradd -m user
Squeeze:~$ mkdir /home/user/MyDocs
#Squeeze:~$ mkdir /var/run/dbus
#Squeeze:~$ mkdir /var/lib/dbus
#Squeeze:~$ mkdir /var/run/pulse
Squeeze:~$ vi /var/run/onfirstchroot-ext.rc
> #Fix the /etc/mtab file
> #CHROOT=`pwd | awk -F'/var' '{ print $1 }'`
> echo Updating the /etc/mtab file...
> CHROOT2=`echo $CHROOT | awk -F'/' '{ print $2 }'`
> cat /etc/mtab | grep $CHROOT2 | sed "s/$CHROOT2\///" | sed "s/$CHROOT2//" | grep bind -v > $CHROOT/etc/mtab
Squeeze:~$ chmod 744 /var/run/onfirstchroot-ext.rc
Squeeze:~$ umount /proc
Squeeze:~$ exit
EasyDebian:~$ umount /mnt/debinst/dev/shm
EasyDebian:~$ umount /mnt/debinst/var/tmp
EasyDebian:~$ umount /mnt/debinst/tmp
EasyDebian:~$ umount /mnt/debinst/dev/pts
EasyDebian:~$ umount /mnt/debinst/dev
EasyDebian:~$ umount /mnt/debinst
EasyDebian:~$ exit
N900:~$ closechroot
N900:~$ mv /home/user/MyDocs/debian-m5-v3d.img.ext2 /home/user/MyDocs/Lenny.img.ext2
N900:~$ mv /home/user/MyDocs/squeeze.img.ext2 /home/user/MyDocs/debian-m5-v3d.img.ext2
N900:~$ debian
Squeeze:~$ tasksel install standard
Squeeze:~$ aptitude clean
Monday, November 8, 2010
Disable WIFI on startup
vi /etc/event.d/wlancond
remove "start on started hildon-desktop"
vi /etc/event.replace.d/wlancond
remove "start on started hildon-desktop"
vi /etc/modprobe.d/blacklist
blacklist wl12xx
remove "start on started hildon-desktop"
vi /etc/event.replace.d/wlancond
remove "start on started hildon-desktop"
vi /etc/modprobe.d/blacklist
blacklist wl12xx
Friday, May 28, 2010
Google latitude on N900
Open http://www.google.com/maps/m?view=data&mode=latitude&source=mog on N900
http://talk.maemo.org/showthread.php?p=417739#post417739
http://talk.maemo.org/showthread.php?p=417739#post417739
Wednesday, May 26, 2010
Remove N900 unused application
1. Amazon Installer
apt-get --purge --auto-remove remove amazon-installer
2. AP News Installer
apt-get --purge --auto-remove remove ap-installer
3. Document To Go Installer
apt-get --purge --auto-remove remove dtg-installer
4. Foreca Installer
apt-get --purge --auto-remove remove foreca-installer
5. tutorial-home-applet
apt-get --purge --auto-remove remove tutorial-home-applet osso-tutorial*
rm -rf /usr/share/tutorial-applet
6. PDF reader
apt-get --purge --auto-remove remove osso-pdf-viewer*
7. RSS
apt-get --purge --auto-remove remove osso-rss-feed-reader*
8. Blocks
apt-get --purge --auto-remove remove maemoblocks
9. Chess
apt-get --purge --auto-remove remove gnuchess osso-graphics-game-chess osso-sounds-game-chess
10. Mahjong
apt-get --purge --auto-remove remove osso-mahjong osso-graphics-game-mahjong osso-sounds-game-mahjong
11. Marbles
apt-get --purge --auto-remove remove osso-lmarbles osso-graphics-game-lmarbles
12. games
apt-get --purge --auto-remove remove osso-games* hildon-games-wrapper0
13. Backup
apt-get --purge --auto-remove remove osso-backup*
14. User Guide
rm /usr/share/applications/hildon/user-guide.desktop
15. OVI Promotion Widget
apt-get --purge --auto-remove remove ovi-promotion-widget
**mp-fremantle-generic-pr**
apt-get --purge --auto-remove remove amazon-installer
2. AP News Installer
apt-get --purge --auto-remove remove ap-installer
3. Document To Go Installer
apt-get --purge --auto-remove remove dtg-installer
4. Foreca Installer
apt-get --purge --auto-remove remove foreca-installer
5. tutorial-home-applet
apt-get --purge --auto-remove remove tutorial-home-applet osso-tutorial*
rm -rf /usr/share/tutorial-applet
6. PDF reader
apt-get --purge --auto-remove remove osso-pdf-viewer*
7. RSS
apt-get --purge --auto-remove remove osso-rss-feed-reader*
8. Blocks
apt-get --purge --auto-remove remove maemoblocks
9. Chess
apt-get --purge --auto-remove remove gnuchess osso-graphics-game-chess osso-sounds-game-chess
10. Mahjong
apt-get --purge --auto-remove remove osso-mahjong osso-graphics-game-mahjong osso-sounds-game-mahjong
11. Marbles
apt-get --purge --auto-remove remove osso-lmarbles osso-graphics-game-lmarbles
12. games
apt-get --purge --auto-remove remove osso-games* hildon-games-wrapper0
13. Backup
apt-get --purge --auto-remove remove osso-backup*
14. User Guide
rm /usr/share/applications/hildon/user-guide.desktop
15. OVI Promotion Widget
apt-get --purge --auto-remove remove ovi-promotion-widget
**mp-fremantle-generic-pr**
N900 Modification
Add "~", "|", ">" to X Terminal
1. root
2. gconftool-2 -s /apps/osso/xterm/key_labels -t list --list-type=string "[Tab,Esc,Up,Dn,~,|,>]"
3. gconftool-2 -s /apps/osso/xterm/keys -t list --list-type=string "[Tab,Escape,Page_Up,Page_Down,asciitilde,bar,greater]"
Power Button - Single click to lock
1. root
2. vi /etc/mce/mce.ini
3. PowerKeyShortAction=menu to PowerKeyShortAction=tklock
4. PowerKeyLongAction=poweroff to PowerKeyLongAction=menu
Power Button - Add menu item
1. root
2. vi /etc/systemui/systemui.xml
3. remove <!--
4. remove -->
Enable SmartReflex of OMAP 3
1. vi /etc/pmconfig
2. sr_vdd1_autocomp 0 to sr_vdd1_autocomp 1
3. sr_vdd2_autocomp 0 to sr_vdd2_autocomp 1
Enable SS Code dialing
1. vi /home/user/.osso/call-ui.ini
[supplementary]
ssc=1
[launcher_in]
duration=700
sequenced=1
depth=-300
[launcher_launch]
duration=300
delay=400
duration_out=300
depth=-2
1. root
2. gconftool-2 -s /apps/osso/xterm/key_labels -t list --list-type=string "[Tab,Esc,Up,Dn,~,|,>]"
3. gconftool-2 -s /apps/osso/xterm/keys -t list --list-type=string "[Tab,Escape,Page_Up,Page_Down,asciitilde,bar,greater]"
Power Button - Single click to lock
1. root
2. vi /etc/mce/mce.ini
3. PowerKeyShortAction=menu to PowerKeyShortAction=tklock
4. PowerKeyLongAction=poweroff to PowerKeyLongAction=menu
Power Button - Add menu item
1. root
2. vi /etc/systemui/systemui.xml
3. remove <!--
4. remove -->
Enable SmartReflex of OMAP 3
1. vi /etc/pmconfig
2. sr_vdd1_autocomp 0 to sr_vdd1_autocomp 1
3. sr_vdd2_autocomp 0 to sr_vdd2_autocomp 1
Enable SS Code dialing
1. vi /home/user/.osso/call-ui.ini
[supplementary]
ssc=1
2. chown user /home/user/.osso/call-ui.ini
3. chgrp users /home/user/.osso/call-ui.ini
Disabling Auto Updates Check
1. gconftool -s -t int /apps/hildon/update-notifier/check_interval 44640
(<=2147483647)
( vi /var/lib/gconf/apps/hildon/update-notifier/%gconf.xml )
Menu Transitions
1. vi /usr/share/hildon-desktop/transitions ini
duration=700
sequenced=1
depth=-300
[launcher_launch]
duration=300
delay=400
duration_out=300
depth=-2
Tuesday, May 25, 2010
wifi-switcher
wifi.sh
#!/bin/sh
#
# Wifi switcher for N900 Copyright (C) 2010 by Tito Ragusa
#
# Wifi switicher is a tool to tenable/disable wifi on the Nokia N900
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Please read the COPYING and README file!!!
#
# Report bugs to
#
print_msg()
{
run-standalone.sh dbus-send --print-reply \
--type=method_call --dest=org.freedesktop.Notifications \
/org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog \
string:"$1" uint32:0 string:'$2'
}
if_failed_print_and_die()
{
if [ $? -ne "0" ] ; then
print_msg "CANNOT $action WLAN: $step FAILED" "KO"
exit 1
fi
}
out=`ifconfig wlan0`
if [ $? -eq "0" ] ; then
# wlan is up, if running disconnect, then remove module
action="DISABLE"
if [ `echo "$out" | grep -c RUNNING` -gt "0" ] ; then
run-standalone.sh dbus-send --system \
--dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
fi
# needed to reset ip-monitoring widgets
ifconfig wlan0 0.0.0.0
# down the interface to run hooks in /etc/network/if-*down.d, ignore error
# downing wmaster0 seems to better reset the hardware when it is stuck
# in some undefined state
#ifconfig wmaster0 down
# down the interface to run hooks in /etc/network/if-*down.d, ignore error
ifconfig wlan0 down
# remove the module
step="RMMOD"
rmmod wl12xx
if_failed_print_and_die
# no need to stop wlancond here as it would be respawned by upstart
print_msg "WLAN DISABLED" "OK"
exit 2
else
# wlan is not configured, reload modules
action="ENABLE"
step="MODPROBE"
modprobe wl12xx
if_failed_print_and_die
# Calibrate: do not remove this is needed even if 'start wlancond'
# triggers one more calibration later
step="CALIBRATION"
wl1251-cal
if_failed_print_and_die
# Restart wlancond properly
stop wlancond
start wlancond
# Up the interface, to run hooks in /etc/network/if*/
step="'IFCONFIG WLAN0 UP'"
ifconfig wlan0 up
if_failed_print_and_die
run-standalone.sh dbus-send --print-reply --system \
--dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false
exit 0
fi
#!/bin/sh
#
# Wifi switcher for N900 Copyright (C) 2010 by Tito Ragusa
#
# Wifi switicher is a tool to tenable/disable wifi on the Nokia N900
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Please read the COPYING and README file!!!
#
# Report bugs to
#
print_msg()
{
run-standalone.sh dbus-send --print-reply \
--type=method_call --dest=org.freedesktop.Notifications \
/org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog \
string:"$1" uint32:0 string:'$2'
}
if_failed_print_and_die()
{
if [ $? -ne "0" ] ; then
print_msg "CANNOT $action WLAN: $step FAILED" "KO"
exit 1
fi
}
out=`ifconfig wlan0`
if [ $? -eq "0" ] ; then
# wlan is up, if running disconnect, then remove module
action="DISABLE"
if [ `echo "$out" | grep -c RUNNING` -gt "0" ] ; then
run-standalone.sh dbus-send --system \
--dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
fi
# needed to reset ip-monitoring widgets
ifconfig wlan0 0.0.0.0
# down the interface to run hooks in /etc/network/if-*down.d, ignore error
# downing wmaster0 seems to better reset the hardware when it is stuck
# in some undefined state
#ifconfig wmaster0 down
# down the interface to run hooks in /etc/network/if-*down.d, ignore error
ifconfig wlan0 down
# remove the module
step="RMMOD"
rmmod wl12xx
if_failed_print_and_die
# no need to stop wlancond here as it would be respawned by upstart
print_msg "WLAN DISABLED" "OK"
exit 2
else
# wlan is not configured, reload modules
action="ENABLE"
step="MODPROBE"
modprobe wl12xx
if_failed_print_and_die
# Calibrate: do not remove this is needed even if 'start wlancond'
# triggers one more calibration later
step="CALIBRATION"
wl1251-cal
if_failed_print_and_die
# Restart wlancond properly
stop wlancond
start wlancond
# Up the interface, to run hooks in /etc/network/if*/
step="'IFCONFIG WLAN0 UP'"
ifconfig wlan0 up
if_failed_print_and_die
run-standalone.sh dbus-send --print-reply --system \
--dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false
exit 0
fi
Subscribe to:
Comments (Atom)