December 30, 2003

bootsplash 筆記

/etc/rc.d/init.d/functions
initsplash()
. /etc/bootsplash/themes/$theme/config/bootsplash-`fbresolution`.cfg

開機畫面是放在 silentjpeg=

ref. bootsplash
http://pank.org/blog/archives/000035.html

Posted by pank at 10:05 PM | Comments (0)

FreeBSD netstart

/etc/netstart 啟動網路相關設定及服務

Posted by pank at 11:04 AM | Comments (0)

December 23, 2003

gallery 調成 4x3

修改 album.dat
"rows";s:1:"3";s:4:"cols";s:1:"4"
修改其中的 "3" "4"

Posted by pank at 09:09 AM | Comments (0)

December 19, 2003

hotkey 設定 in inittab

ex.

kb::kbrequest:/sbin/shutdown -h now
in /etc/inittab, and

control alt keycode 79 = KeyboardSignal
control alt keycode 107 = KeyboardSignal

in their keymap. Now Ctrl-Alt-End will do a system shutdown

Posted by pank at 04:22 PM | Comments (0)

Magic SysRq key (linux 魔術鍵)

Kernel hacking -> Magic SysRq key

press Alt+PrintScreen+?

/usr/src/linux/Documentation/sysrq.txt

enable
echo 0 > /proc/sys/kernel/sysrq

disable
echo 1 > /proc/sys/kernel/sysrq

* What are the 'command' keys?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'r' - Turns off keyboard raw mode and sets it to XLATE.

'k' - Secure Access Key (SAK) Kills all programs on the current virtual
console. NOTE: See important comments below in SAK section.

'b' - Will immediately reboot the system without syncing or unmounting
your disks.

'o' - Will shut your system off (if configured and supported).

's' - Will attempt to sync all mounted filesystems.

'u' - Will attempt to remount all mounted filesystems read-only.

'p' - Will dump the current registers and flags to your console.

't' - Will dump a list of current tasks and their information to your
console.

'm' - Will dump current memory info to your console.

'0'-'9' - Sets the console log level, controlling which kernel messages
will be printed to your console. ('0', for example would make
it so that only emergency messages like PANICs or OOPSes would
make it to your console.)

'e' - Send a SIGTERM to all processes, except for init.

'i' - Send a SIGKILL to all processes, except for init.

'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system
will be non-functional after this.)

'h' - Will display help ( actually any other key than those listed
above will display help. but 'h' is easy to remember :-)

Posted by pank at 03:37 PM | Comments (0)

修改 X keyboard mapping

ex.
xmodmap -e "keycode 22 = 5 percent"

Posted by pank at 02:13 PM | Comments (0)

console 遇亂碼還原方法

當 console 變成一些如下面這樣的亂碼時

⎼⎺⎺├@├␊␌⎺␋▒ ␍┌

解決方法
# cat
ctrl-o
ctrl-d
ctrl-c

或是 setterm -reset

Posted by pank at 11:33 AM | Comments (0)

December 15, 2003

linux date set format

date 122012301999.20 #將系統時間設為1999年12月20日12時30分20秒

Posted by pank at 11:58 AM | Comments (0)

December 11, 2003

NOKIA 手機看韌體版本

*#0000#

Posted by pank at 09:01 PM | Comments (0)

找出比某檔舊的檔案並刪除

#!/bin/sh
if [ -z $1 ] ; then
echo "Usage: `echo $0` {file}"
else
if [ -f $1 ] ; then
find *tgz \! -newer $1 -exec rm {} \;
else
echo File does not exist.
fi
fi

Posted by pank at 09:34 AM | Comments (0)

December 09, 2003

netsh set IP

http://support.microsoft.com/default.aspx?scid=%2Fdirectory%2Fworldwide%2Fzh-tw%2Ffaq%2F6420.asp

DHCP
 
netsh interface ip set address "區域連線" dhcp
netsh interface ip set dns "區域連線" dhcp
netsh interface ip set Wins "區域連線" dhcp
 
Static IP
 
netsh interface ip set address "區域連線" static 10.0.0.9 255.0.0.0 10.0.0.1 1
netsh interface ip set dns "區域連線" static 10.0.0.9
netsh interface ip set Wins "區域連線" static 10.0.0.9

sample:

[C:\]type dhcp.bat
netsh interface ip set address "區域連線" dhcp
netsh interface ip set dns "區域連線" dhcp
netsh interface ip set wins "區域連線" dhcp

[C:\]type static.bat
netsh interface ip set address "區域連線" static 192.168.0.9 255.255.255.0 192.168.0.2 1
netsh interface ip set dns "區域連線" static 192.168.0.2

Posted by pank at 09:08 AM | Comments (1)

December 08, 2003

udhcpc

http://routerlinux.com/docs/manual/man8/udhcpc.8.html

default lease time: 10days

Posted by pank at 04:00 PM | Comments (0)

javascript location

For self:
location.href="whateva.htm";

For blank:
window.open="whateva.htm";

For parent:
parent.location.href="whateva.htm";

For top:
top.location.href="whateve.htm";

For SomeFrame:
parent.SomeFrame.location.href="whateva.htm";

Meta refresh can't target a frame

Problem: A meta refresh tag can't target a frame other than the current.

Workaround: Use a JavaScript timed location change.

Code Example: We have a frame named right. The delay is 3 seconds.


setTimeout("top.right.location = 'p.html'", 3000);


Note: Remember that top is a reserved word. So use names like upper and lower instead of top and bottom.

Posted by pank at 02:58 PM | Comments (0)

C/P 值

Capability/Price

Posted by pank at 09:15 AM | Comments (0)

December 06, 2003

procmail 達成 bcc

作者: pank (7/7的情人) 看板: BSD
標題: Re: 請問Procmail 可以設定所有信件自動備份一份給?…
時間: Sat Dec 6 15:56:06 2003

※ 引述《TerryLiaw.bbs@Terry.dragon2.net (早睡早起)》之銘言:
: ※ 引述《pank.bbs@77bbs.com (7/7的情人)》之銘言:
: > ※ 引述《"Lotus" , 看板: BSD》之銘言:
: > : 請教前輩 Procmail 可不可以設定為不管哪個USER收到信件 都直接會備份一份到
某個USER
: > : 請前輩提示 謝謝...
: > 設定 always_bcc 參數
: postfix 才有 always_bcc 可以用吧 ? :p

sorry, 把 procmail 看成 postfix :p

若是用 sendmail 搭配 procmail 備分到某信箱, 可以用

:0c
! user@elsewhere

這只能使用外部信箱, 不能使用本機帳號, 否則會有 loop 的情況發生

要備分到本機帳號, 需加一段 header 作 check, 以避免信件 loop

:0c
* ! ^X-Loop: check
| formail -A "X-Loop: check" | sendmail user

當信件第一次進到 procmail 的 rule, 沒有 "^X-Loop: check" 的話,
會上加去然後寄給 user, 第二次進到 procmail 的信(給 user 的),
由於有 "^X-Loop: check", 就不會再加 "X-Loop: check" 並寄給 user.

Posted by pank at 04:35 PM | Comments (0)

December 03, 2003

Tweak UI

http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp

Taskbar and Start menu
Grouping 選第三個 Group any application with at least n windows
n 若設大一點, 相當於取消 Grouping 功能

Posted by pank at 06:35 PM | Comments (0)

好用的手機資料管理軟體

http://www.oxygensoftware.com/download/
http://www.opm-2.com/download/OPM2.zip
可以把手機所有資訊包含通訊錄, 行事曆, 圖檔, 音樂 匯出匯入

Posted by pank at 10:55 AM | Comments (0)

系統工具

http://www.sysinternals.com

Posted by pank at 09:24 AM | Comments (0)

December 02, 2003

batch file magic (website)

http://www.robvanderwoude.com/

Posted by pank at 09:41 AM | Comments (0)