Monday, December 01, 2008

iptables command for port forwarding config in dd-wrt

i'v installed DD-WRT v24 SP1 in Linksys WRT350N, but the port forwarding from webpage doesn't work,so i had to login the console to set the rule:

Port Forwarding to a specific LAN IP


Port Forwarding can be accomplished from within the web interface here.
However, the very same thing can be done a bit differently (tested and
working), via command line. --u3gyxap: Example with port 443 and IP
192.168.1.2

iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 443 -j DNAT --to 192.168.1.2:443

iptables -I FORWARD -p tcp -d 192.168.1.2 --dport 443 -j ACCEPT

http://www.dd-wrt.com/wiki/index.php/Iptables

Monday, September 15, 2008

Multiple NICs for ur Windows

If your PC does not have multiple NICs, you can use MS Loopback
adapters. (If you do have multiple nics, this part is not necessary.)
  • Go to Start > Control Panel
  • Click ‘Add Hardware’
  • Click ‘Next’
  • Select ‘Yes, I already have a connection’
  • Select ‘Add a new hardware device’
  • Select ‘Install from a list’
  • Click ‘Network Adapters’
  • Select Microsoft Loopback
  • Click ‘Next’
  • Click ‘Next’
  • Click ‘Finish’
  • Double-Click ‘Network Connections’
  • Rename the loopback interface to something descriptive.
then run "ipconig /all" to check the new NIC's mac address

Ethernet adapter Local Connection 2:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Microsoft Loopback Adapter
        Physical Address. . . . . . . . . : 02-00-4C-4F-4F-50
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        Autoconfiguration IP Address. . . : 169.254.25.129
        Subnet Mask . . . . . . . . . . . : 255.255.0.0
        Default Gateway . . . . . . . . . :

Monday, August 25, 2008

SIP Express Router (SER) 安装备忘录三(原创)

数据库建好了,剩下的就是建立程序与数据库之间的联系了,同样的,还是通过编辑ser.cfg来实现,具体内容参考官方文档:
http://siprouter.teigre.com/doc/gettingstarted/ch07.html

#
# $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $
#
# simple quick-start config script
#

# ----------- global configuration parameters ------------------------

debug=3 # debug level (cmd line: -dddddddddd)
fork=no
log_stderror=yes # (cmd line: -E)

listen=10.74.121.71

check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
fifo_db_url="mysql://ser:heslo@localhost/ser"

# ------------------ module loading ----------------------------------

# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/mysql.so"

loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/uri_db.so"

# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

#modparam("usrloc", "db_mode", 0)

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)

# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
#modparam("auth_db", "password_column", "password")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
#modparam("rr", "enable_full_lr", 1)

modparam("auth_db|uri_db|usrloc", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("usrloc", "db_mode", 2)
modparam("rr", "enable_full_lr", 1)

# ------------------------- request routing logic -------------------

# main routing logic
route {

# -----------------------------------------------------------------
# Sanity Check Section
# -----------------------------------------------------------------
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483", "Too Many Hops");
break;
};

if (msg:len > max_len) {
sl_send_reply("513", "Message Overflow");
break;
};

# -----------------------------------------------------------------
# Record Route Section
# -----------------------------------------------------------------
if (method!="REGISTER") {
record_route();
};

# -----------------------------------------------------------------
# Loose Route Section
# -----------------------------------------------------------------
if (loose_route()) {
route(1);
break;
};

# -----------------------------------------------------------------
# Call Type Processing Section
# -----------------------------------------------------------------
if (uri!=myself) {
route(1);
break;
};

if (method=="ACK") {
route(1);
break;
} if (method=="INVITE") {
route(3);
break;
} else if (method=="REGISTER") {
route(2);
break;
};

lookup("aliases");
if (uri!=myself) {
route(1);
break;
};

if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};

route(1);
}

route[1] {

# -----------------------------------------------------------------
# Default Message Handler
# -----------------------------------------------------------------
if (!t_relay()) {
sl_reply_error();
};
}

route[2] {

# -----------------------------------------------------------------
# REGISTER Message Handler
# ----------------------------------------------------------------
sl_send_reply("100", "Trying");

if (!www_authorize("","subscriber")) {
www_challenge("","0");
break;
};

if (!check_to()) {
sl_send_reply("401", "Unauthorized");
break;
};

consume_credentials();

if (!save("location")) {
sl_reply_error();
};
}

route[3] {
# -----------------------------------------------------------------
# INVITE Message Handler
# -----------------------------------------------------------------
if (!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
break;
} else if (!check_from()) {
sl_send_reply("403", "Use From=ID");
break;
};

consume_credentials();

lookup("aliases");
if (uri!=myself) {
route(1);
break;
};

if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};

route(1);
}

呵呵,是不是变化很大~,try it using different username and mismatch password, then you will got the 401 and 403 message

SIP Express Router (SER) 安装备忘录二(原创)

多数情况下,用户不会使用一个没有认证系统的服务器,所以引入Mysql数据库来做用户信息管理很必要,这也就是我们安装第二个包的目的,这个包包含了一个创建ser数据库的mysql脚本,调用即可:

root:~ # ser_mysql.sh
usage: ser_mysql.sh create
ser_mysql.sh drop (!!entirely deletes tables)
ser_mysql.sh reinit (!!entirely deletes and than re-creates tables
ser_mysql.sh backup (dumps current database to stdout)
ser_mysql.sh restore (restores tables from a file)
ser_mysql.sh copy (creates a new db from an existing one)
ser_mysql.sh reinstall (updates to a new SER database)

if you want to manipulate database as other MySql user than
root, want to change database name from default value "ser",
or want to use other values for users and password, edit the
"config vars" section of the command ser_mysql.sh

root:~ # ser_mysql.sh create
MySql password for root:cisco123
Domain (realm) for the default user 'admin' : admin

creating database ser ...

好啦,进去看看吧:

root:~ # mysql -u root -p
Enter password:cisco123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24 to server version: 5.0.26

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cyask |
| cyask0119 |
| mysql |
| ser |
| test |
| tmp |
| wikidb |
+--------------------+
8 rows in set (0.00 sec)

mysql> use ser;
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_ser |
+-----------------------+
| acc |
| active_sessions |
| admin_privileges |
| aliases |
| calls_forwarding |
| config |
| domain |
| event |
| grp |
| location |
| missed_calls |
| pending |
| phonebook |
| preferences_types |
| reserved |
| server_monitoring |
| server_monitoring_agg |
| silo |
| speed_dial |
| subscriber |
| trusted |
| uri |
| usr_preferences |
| version |
+-----------------------+
24 rows in set (0.00 sec)

再看看用户的列表:

mysql> select * from subscriber;
+----------------------------------+----------+--------+----------+------------+-----------+-------+----------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| phplib_id | username | domain | password | first_name | last_name | phone | email_address | datetime_created | datetime_modified | confirmation | flag | sendnotification | greeting | ha1 | ha1b | allow_find | timezone | rpid | domn | uuid |
+----------------------------------+----------+--------+----------+------------+-----------+-------+----------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| bfbd785b1447989599493a0c4ff0ed12 | admin | admin | heslo | Initial | Admin | 123 | root@localhost | 2002-09-04 19:37:45 | 0000-00-00 00:00:00 | 57DaSIPuCm52UNe54LF545750cfdL48OMZfroM53 | o | | | 381c06175d479f35e14ef1ab571006a9 | f11387e2a4644ebd23dcddc8296aff07 | 0 | NULL | NULL | NULL | NULL |
+----------------------------------+----------+--------+----------+------------+-----------+-------+----------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
1 row in set (0.00 sec)

呵呵,貌似只有一条吭,退出来再加俩用户:

root:~ #serctl add
eg: serctl add 1111 1111 1111@sipurash.com
domain unknown: use usernames with domain or set default domain in SIP_DOMAIN
报错!!!

这是个奇怪的BUG,解决办法是先设置好系统环境变量:
root:~ #export SIP_DOMAIN="sipurash.com"
root:~ #serctl add 1111 1111 1111@sipurash.com
Mysql password: heslo (记住喽,不是Mysql的root密码,是刚才数据库里看到的那个admin密码)
new user added
new user into uri table added

行了,再进Mysql里check一下,看是不是多出俩用户:

mysql> select * from subscriber;
+----------------------------------+----------+--------------+----------+------------+-----------+-------+-------------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| phplib_id | username | domain | password | first_name | last_name | phone | email_address | datetime_created | datetime_modified | confirmation | flag | sendnotification | greeting | ha1 | ha1b | allow_find | timezone | rpid | domn | uuid |
+----------------------------------+----------+--------------+----------+------------+-----------+-------+-------------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
| 69c0a7786ca204e08df9574aa9a08b65 | admin | sipurash.com | heslo | Initial | Admin | 123 | root@localhost | 2002-09-04 19:37:45 | 0000-00-00 00:00:00 | 57DaSIPuCm52UNe54LF545750cfdL48OMZfroM53 | o | | | a04b52602361fc804ab28d279c47425e | 7ffcf5a0fe10951340094c14b5b37ee1 | 0 | NULL | NULL | NULL | NULL |
| 56e0357f4a1dc787ff1ffe02c35ee230 | 1111 | sipurash.com | 1111 | | | | 1111@sipurash.com | 2007-04-10 14:45:22 | 0000-00-00 00:00:00 | | o | | | 56e0357f4a1dc787ff1ffe02c35ee230 | 8cf011a6d9251fcada7dae0bfb12ba12 | 0 | NULL | NULL | NULL | NULL |
| 93235e3655d178cff742f09e47079bbf | 2222 | sipurash.com | 2222 | | | | 2222@sipurash.com | 2007-04-10 14:45:40 | 0000-00-00 00:00:00 | | o | | | 93235e3655d178cff742f09e47079bbf | 798f1476edd5f5ab1243fc184396fb9a | 0 | NULL | NULL | NULL | NULL |
| edbde0b2da045fce98ee3cbde5fa488b | 3333 | sipurash.com | 3333 | | | | 3333@sipurash.com | 2007-07-13 10:31:05 | 0000-00-00 00:00:00 | | o | | | edbde0b2da045fce98ee3cbde5fa488b | 70072d6c05b1c6b973ae3fed36e66ae4 | 0 | NULL | NULL | NULL | NULL |
+----------------------------------+----------+--------------+----------+------------+-----------+-------+-------------------+---------------------+---------------------+------------------------------------------+------+------------------+----------+----------------------------------+----------------------------------+------------+----------+------+------+------+
4 rows in set (0.00 sec)

SIP Express Router (SER) 安装备忘录一(原创)

老早以前玩过的一个Sip Server,今天翻出来,备忘~
http://www.iptel.org/ser

安装平台是Opensuse10.2,所以呢,为了省事,有意找了rpm包来装:
ser-0.9.6-6.fc5.i386.rpm
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/ser
ser-mysql-0.9.6-6.fc5.i386.rpm
http://rpm.pbone.net/index.php3?stat=3&search=ser-mysql&srodzaj=3

root:~ #rpm -ivh ......

和大多数linux程序一样,配置都源于.cfg文件,所以装完了rpm包,就直接找ser.cfg,找不到的话就找程序根目录:

root:~ # locate ser.cfg
root:~ # whereis ser
ser: /usr/sbin/ser /etc/ser /usr/lib/ser /usr/share/man/man8/ser.8.gz

一看就知道应该在/etc/ser/下,简单编辑一下吧:

root:~ #vi /etc/ser/ser.cfg

#
# $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $
#
# simple quick-start config script
#

# ----------- global configuration parameters ------------------------

debug=3 # debug level (cmd line: -dddddddddd)
fork=no
log_stderror=yes # (cmd line: -E)

/* Uncomment these lines to enter debugging mode
fork=no
log_stderror=yes
*/

listen=10.74.121.71


check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
#port=5060
#children=4
fifo="/tmp/ser_fifo"

# ------------------ module loading ----------------------------------

# Uncomment this if you want to use SQL database
#loadmodule "/usr/lib/ser/modules/mysql.so"

loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/registrar.so"
loadmodule "/usr/lib/ser/modules/textops.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
#loadmodule "/usr/lib/ser/modules/auth.so"
#loadmodule "/usr/lib/ser/modules/auth_db.so"

# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

modparam("usrloc", "db_mode", 0)

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)

# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
#modparam("auth_db", "password_column", "password")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)


# ------------------------- request routing logic -------------------

# main routing logic

route{

# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
break;
};


# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER") record_route();

# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
break;
};

if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
break;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {

if (method=="REGISTER") {

# Uncomment this if you want to use digest authentication
# if (!www_authorize("iptel.org", "subscriber")) {
# www_challenge("iptel.org", "0");
# break;
# };

save("location");
break;
};

lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};

# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}

route[1]
{
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
}

几乎默认即可,主要是记住将 listen=x.x.x.x 打开

好了,程序可以跑起来了:

root:~ # ser -dddE
0(6820) read 3572621625 from /dev/urandom
0(6820) seeding PRNG with 497332213
0(6820) test random number 1132821449
Listening on
udp: 10.74.121.71 [10.74.121.71]:5060
tcp: 10.74.121.71 [10.74.121.71]:5060
Aliases:
tcp: pppoeserver:5060
tcp: pppoeserver.sipurash.com:5060
udp: pppoeserver:5060
udp: pppoeserver.sipurash.com:5060

WARNING: no fork mode
stateless - initializing
0(0) Maxfwd module- initializing
textops - initializing
0(0) INFO: udp_init: SO_RCVBUF is initially 109568
0(0) INFO: udp_init: SO_RCVBUF is finally 219136
2(0) INFO: fifo process starting: 6822
2(0) SER: open_uac_fifo: fifo server up at /tmp/ser_fifo...

找俩电话,注册上去打打看吧,没认证的,同时你可以用monitor来监控一下:

root:~ # serctl moni
[cycle #: 23; if constant make sure server lives and fifo is on]
Server: Sip EXpress router (0.9.6 (i386/linux))
Now: Mon Aug 25 21:34:07 2008
Up Since: Mon Aug 25 21:33:13 2008
Up time: 54 [sec]

Transaction Statistics
Current: 0 (0 waiting) Total: 0 (0 local)
Replied localy: 0
Completion status 6xx: 0, 5xx: 0, 4xx: 0, 3xx: 0,2xx: 0

Stateless Server Statistics
200: 2 202: 0 2xx: 0
300: 0 301: 0 302: 0 3xx: 0
400: 0 401: 0 403: 0 404: 0 407: 0 408: 0 483: 0 4xx: 0
500: 0 5xx: 0
6xx: 0
xxx: 0
failures: 0

UsrLoc Stats
Domain Registered Expired
'aliases' 0 0
'location' 2 0

Monday, June 25, 2007

IE?Firefox!



我是转贴的哈,知道原文的告诉我链接,负不起法律责任哈!!!

Tuesday, June 19, 2007

About AsteriskNow root login

http://forums.digium.com/viewtopic.php?t=12559

if you wanna login AsteriskNow system as root,pls sudo passwd root,change the default password,then login again,you can see detail message via that link.

Sunday, June 17, 2007

css_cheat_sheet

我是转贴的哈,知道原文的告诉我链接,负不起法律责任哈!!!

Wednesday, June 06, 2007

XDMCP Configuration in linux

http://wmltd.co.uk/index.php/products/nomachine_thin_client/setting_up_x



这篇文章里介绍了各个发行版的linux的XDMCP Configuration,在Suse底下的最简单,只要把防火墙打开就可以了,我用的是OpenSuse10.2,KDE,下面这个只是参考:



OpenSUSE 10.1


Assumptions: gdm is the display manager, as it is by default for OpenSUSE 10.x.


Firewall


Login as your normal user and  run Yast (Applications Menu ->
"System" -> "YaST"). You'll be prompted for your password. Go to the
Firewall configuration section ("Security and Users" -> "Firewall".
The firewall was running on my default install of OpenSUSE, so it's
necessary to allow access for xdmcp packets. In the left hand window,
click on "Allowed Services". In the right hand window, choose "Remote
Access to Display Manager" from the "Service to Allow" drop-down menu
and then press the "Add" button (This opens port 177/tcp+udp). You're
allowing access for the "External Zone" if it's a simple single network
interface PC. That is, you're allowing packets into your computer from
the outside LAN/world. Now press "Next" then "Accept". The firewall is
now configured.


Display Manager


There are two files which need to be edited for a default install of
OpenSUSE. The first can be edited in YaST - go to "System" ->
"/etc/sysconfig Editor". You'll get a window with a tree of all the
settings on the left. Choose "Desktop" -> "Display Manager" then
highlight the DISPLAYMANAGER_REMOTE_ACCESS setting. In the right window
you can now set this to "yes" and press the "Finish" button.

Now you
need to close YaST and open a terminal window, and type "su" to become
the root user. edit /etc/opt/gnome/gdm/gdm.conf (I used nano to edit
the file) and scroll down to about line 229 and set Enable=true within
the [xdmcp] section of the file.

Now you need to re-start xdm to
make the changes stick. Logout, then either reboot, or: Press
Ctrl-Alt-F1 to get a text terminal. Login as the root user, then type:


/etc/init.d/xdm restart


The display manager will re-start and you can now point your WML
Linux Thin Client at your OpenSUSE server and get a login window. Note
that if you want the remote login window to look the same as the local
login window, then go back to /etc/opt/gnome/gdm/gdm.conf and look for
the relevant setting to change.







Powered by ScribeFire.

Monday, June 04, 2007

uninstall ubuntu

http://www.users.bigpond.net.au/hermanzone/p18.htm

这个网站告诉了你至少6种方法删除linux————当你得PC是windows&linux双系统的情况下.
我喜欢最后一种:Mbrfix.exe

http://www.sysint.no/en/Download.aspx

这是个windows工具,你可以轻松的修复你的MBR。

MbrFix.exe

MbrFix.exe is a useful tool for professionals or serious
hobbyists, it has been updated to work for Vista as well. It can do a
whole list of other neat operations as well.

1) Download a small utility called MbrFix.exe here, http://www.sysint.no/en/Download.aspx
Read all about MbrFix.exe here, http://www.sysint.no/nedlasting/mbrfix.htm

2) Paste the file to the root of drive C:

If you don't know what I mean by 'the root of drive C, just open in 'My
Computer, Click on Local Disk (C:), open it, and paste MbrFix.exe.there.

3) Click 'Start'->;'Run', type CMD (for a Command Prompt).

The command prompt will at first be something like,

(Where 'Herman' is my username for Windows, yours will probably be something different).

Change it to just a C: prompt by typing: cd \ , then press 'Enter'.

After that you should just have a plain C:\>

Type this command after the C:\>: MbrFix /drive 0 fixmbr /yes
for example,

Nothing much will appear to happen, your monitor may blink slightly,
that's all. You will see the plain C:\> again. Type 'exit'.

4) That's it! Reboot to see if it worked.

Wednesday, May 30, 2007

A trial Sip proxy server can run in different OS

http://www.brekeke.com/



Pls see that link,you can download a windows version installed in your laptop for 60 days trial.It's user-friendly and you can manage it through webserver(based on java,tomcat).





Powered by ScribeFire.

Sunday, May 27, 2007

Firefox something

You know firefox is my favourite open-source web browser and there are lots of add-ons drive me crazy,but which is the best valuebal,pls see these articles come from Computerworld.com:

20 must-have Firefox extensions

Top 10 Firefox extensions to avoid

and

15 Coolest Firefox Tricks Ever

come from lifehack.org

Thursday, May 24, 2007

PPPoE client configure for IP phone----Writen by welv

当Server配置成功后,剩下的工作就是配置client了,么什么复杂,就是路由!
Client拨进去以后,得到的默认网关是PPPoE-Server的地址,所以如果你的一些上层服务的Server与pppoe-server不在同一个网段里,就很麻烦了。

举个例子:

Sip-phone--------- >PPPoE-Server sip-server
10.74.52.51 10.74.52.50 10.74.51.200

此时电话是以10.74.52.50为默认网关的,而10.74.52.50又不具备转发能力,故电话注册不上

解决方案:
为PPPoE-Server加装网卡,一块连51网段,另一块连52网段,然后做路由,就变成这个样子


Sip-phone<------------------->PPPoE-Server<--------------------------->Sip-server
10.74.52.51 10.74.52.50 10.74.51.250 10.74.51.200

然后使能两块网卡的IP转发能力,此时的路由表是这样的:

Destination Gateway Genmask Flags Metric Ref Use Iface
10.74.52.0 10.74.52.1 255.255.255.192 UG 0 0 0 eth0
10.74.51.0 10.74.51.1 255.255.255.0 UG 0 0 0 eth2
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo

现在,电话发往Sip-server的包目的地址可达了,但是Sip-server却不知道回去的地址,你必须给它也加一条到目的地址10.74.52.50的路由,下一跳指向10.74.51.250:

route add -host 10.74.52.50 gw 10.74.51.250

然后路由表变成这样:

Destination Gateway Genmask Flags Metric Ref Use Iface
10.74.52.51 10.74.51.250 255.255.255.255 UGH 0 0 0 eth0
10.74.51.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 10.74.51.1 0.0.0.0 UG 0 0 0 eth0

得,成了!!!

Monday, May 21, 2007

pppoe-server in linux install&configure----writen by welv

我的RS3么搞定,所以移到OpenSUSE上来搞。

网上有现成的rpm包,找来装上就成,不会有什么麻烦,装完后:

linux:~ # rpm -qa | grep ppp
ppp-2.4.4-24
rp-pppoe-3.8-5
smpppd-1.59-38
linux:~ #

然后就是配置了,主要是在/etc/ppp/目录下,
首先是认证方式:pppoe-server-options文件里,pap or chap,pap不好用,只能用chap;
其次是在相应的文件里指定用户名和密码,比如chap-secrets:

# client          server        secret         IP addresses
"21026A"           *           "cisco1"        10.74.52.51
"21026AA"         *           "cisco12"      10.74.52.52
"21026AAA"       *           "cisco123"    10.74.52.53

再后来就么什么了,启动程序吧:

linux:/etc/ppp # pppoe-server --help
pppoe-server: invalid option -- -
Usage: pppoe-server [options]
Options:
-I if_name -- Specify interface (default eth0.)
-T timeout -- Specify inactivity timeout in seconds.
-C name -- Set access concentrator name.
-m MSS -- Clamp incoming and outgoing MSS options.
-L ip -- Set local IP address.
-l -- Increment local IP address for each session.
-R ip -- Set start address of remote IP pool.
-S name -- Advertise specified service-name.
-O fname -- Use PPPD options from specified file
(default /etc/ppp/pppoe-server-options).
-p fname -- Optain IP address pool from specified file.
-N num -- Allow 'num' concurrent sessions.
-o offset -- Assign session numbers starting at offset+1.
-f disc:sess -- Set Ethernet frame types (hex).
-s -- Use synchronous PPP mode.
-u -- Pass 'unit' option to pppd.
-r -- Randomize session numbers.
-d -- Debug session creation.
-P -- Check pool file for correctness and exit.
-h -- Print usage information.

PPPoE-Server Version 3.8, Copyright (C) 2001-2006 Roaring Penguin
Software Inc.
PPPoE-Server comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under the terms of the GNU General Public License, version 2
or (at your option) any later version.
http://www.roaringpenguin.com
linux:/etc/ppp #

 

晕了吧,简单点的:
linux:/etc/ppp #pppoe-server -I eth0 -S sipurash -L 10.74.52.50 -R 10.74.52.51 -N 3

明白了吧,easy哈?

Friday, May 18, 2007

值得推荐的Firefox插件----Mouse Gestures

http://optimoz.mozdev.org/gestures/index.html

这是个好东西,鼠标在页面上划来划去,就可以控制浏览器前进、后退等等动作。

赞!!!

Tools for windows access linux volumes

http://www.fs-driver.org/index.html

“ It provides Windows NT4.0/2000/XP/2003 with full access to Linux Ext2 volumes (read access and write access)। This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer.

The "Ext2 Installable File System for Windows" software is freeware.”

----copy from the website

Monday, May 14, 2007

Realplayer不能运行的原因

下面这个链接解释了为什么装完Realplayer不能用的原因--竟然是与输入法冲突

https://help.ubuntu.com/community/RealplayerInstallationMethods?action=show&redirect=RealPlayerInstallationMethods#head-952f28daf565230d2827780b6cf3f7d31e116299

"RealPlayer and SCIM

RealPlayer might not start if using SCIM as the default input method. When trying to launch from the terminal one gets the error message

Segmentation fault (core dumped)

This issue can be resolved by setting the environment variable GTK_IM_MODULE to the value xim (instead of scim).

export GTK_IM_MODULE=xim

After typing this in a terminal, RealPlayer can be started from this terminal. In order to make this setting the default, one can for example write a small shell script which first sets the above environment variable and then launches the RealPlayer."----copy from that website

Friday, May 11, 2007

Debian etch installation from windows guide----Writen by welv

From http://goodbye-microsoft.com/ website,you can download a debian.exe file,run it from your windows platform,it will instruct you install a debian system step by step.

Of course,you need keep internet connection.

When you finished base system installation,you will confused why it can't enter a Xwindows system,don't worry,just following http://www.debsir.org 's documents do:

1.apt-get install xorg

2.apt-get install kde-core

3.apt-get install kde-i18n-zhcn(chinese support)

4.apt-get install kmix(for audio)

5.apt-get install gtk2-engines-clearlooks gtk-qt-engine(some themes)

6.apt-get install kdm(login manager)

Then reboot,you can enter

Thursday, May 10, 2007

Debian和Ubuntu的故事:在冲突中共存

人们常常认为一个开源软件工程的优点之一就是不会彻底的消失的。一旦某个人开放了代码,其他人就可以获得和利用它。但是一个以存在的项目为基础的项目往往与其原始项目产生矛盾。而且随着项目名声扩大,冲突也越来越多,例如Debian和Ubuntu。

  Debian项目始与1993年。它有它自己的方针和政策来指导一套高质量的版本的发行。因为所有的开发者都是自愿人员,所以Debian没有固定的 发行时间表。有数个其他发行版是以Debian为基础开发的,但它们都显得默默无闻——除了Ubuntu。这个始于2004年的项目现在毫无疑问的成为在初学者和中等水平用户中最流行的版本。

  与Debian不同,Ubuntu开发人员的工作被支付以报酬。他们中的一些人是以前Debian的开发人员;也有一些人同时服务于两个项目。 Ubuntu项目的发起人是Mark Shuttleworth,一位前Debian开发人员。他创立Thawte公司提供数字认证和网络安全服务。1999年他把公司卖给了Verisign 而成亿万富翁。

  Ubuntu在Debian开发版基础上开发。它的优势之一是其全职的研发人员,这可以使Ubuntu可以许诺以六个月的周期发布新版本。 Shuttleworth已经公开表示虽然Ubuntu是免费的,但其创立的Canonical公司将会以成本价格提供技术服务支持。相反,Debian的发布时间表的观念是什么时候准备好,什么时候发布。其在2005年中代号Sarge的最新版的发布是在前一个版本发布的三年半以后。

  Debian的决策过程是所有开发者共同参与的,采取自愿原则。而在Ubuntu,一旦决策出现僵局,Shuttleworth就成为最后的决策者。而Debian的邮件列表上常常会爆发激烈的辩论——这些问题往往是无关紧要。而且这种辩论会持续很长时间。

  最近两个项目的不同之处由于Mark Garrett离开Debian项目而成为公众焦点。Garrett做了四年的开发工作,是去年离开项目领导人之一。(澳大利亚的Anthony Towns被选为新的领导人。)Garrett发布了一份辞职声明。在声明中,他非常赞赏Ubuntu的严格的组织结构。用他的话说:“有一个具有独裁的的领导权和话语权的人对很多事情都会有很大帮助。”

  (Garrett这段话实际上讽刺地表达了一个开源程序员对更多的属于“大教堂”开发模式中的特征的认同。“大教堂”这个词由开源领袖 Erics.Raymond用来概括私有软件的开发模式而得名。他用他称为“集市”模式来与之对比。后一种模式最好的例子就是Linux核心的开发。)

  此后Debian和Ubuntu之间的摩擦越来越大。关注到这一变化的Debian项目创始人Ian Murdock号召让Debian与Ubuntu有一个规律的发布周期。同时他希望所有的数量在不断增加的Debian派生版本能够具有共同的核心部分。

  最近,一些Debian的开发者开始认为Ubuntu贡献出来的远远小与它拿走的。于是在今年的在墨西哥举行的Debian年度会议上,一些愤怒的人衬衫上写着“F--- Ubuntu”。长期从事Debian开发工作的Martin Krafft在会议后在博客发表一个长长的贴子概括了Debian社区所共同感受到的不满。另一名开发者Joey Hess也公开对Ubuntu正在把Debian变成一个“组件超级市场”而感到忧虑。

  Hess详细的说道:“我致力于Debian的主要目的就是进我所能使Debian成最好的发行版。我并不介意其他人使用我的工作成果,特别是这种使 用能够获得更多的开源成果。但是很长时间才让我明白最重要的并不是为Debian增加某个软件包,而是找到一种新的方法整合我们的软件。”

  他接着说道:“...,向Debian贡献独立补丁完全不能使Debian共享Ubuntu的组件。这使得Debian浪费大量的时间来做一个追赶的角色,而不是解决怎样在不同的软件包种选择一套合适的软件来组和在一起从而得到完整的全面的提

  怎样解决分歧还有待于进一步观察。但是对于致力于任何一个阵营的人都希望能找到一种适当的方法来促进两个项目的共同进步。

  注:作者是一位有着六年历史的Debian用户。

我是转贴的哈,知道原文的告诉我链接,负不起法律责任哈!!!