Tuesday, May 13, 2008

黑暗的灵魂 签名档

一个人有著邪恶冷酷的心,却又能真正地爱著某些事物,是有可能的,而且这才叫黑暗
的灵魂,那种只会作恶的,不过是蒙昧的灵魂;那些不敢承认的,只叫做怯懦的灵魂;
真正散发著黑暗的甜美芳香的灵魂,是深深知道何谓善,何谓恶,而后坚定不悔地选择
恶的那些人,他们知道自己在做什么,对前途有著坚定的决心。

Tuesday, April 22, 2008

freebsd 多路由 教育网电信 双线接入

通过使用ipfw的lookup table实现对教育网和电信的路由自动选择。

#此前在首页部分显示#

On Tue, Aug 24, 2004 at 10:55:13PM +0200, Simon L. Nielsen wrote:
> On 2004.08.24 11:17:39 -0500, Chris wrote:
> > I'm working with a friend of mine w/ipfw. Below are IP's that are trying
> > to hack in via ssh. I suggested to use something in the form of:
> >
> > # Allow in SFTP, SSH, and SCP from public Internet
> > ${fwcmd} add 090 pass log tcp from xxx.xxx.xxx.xxx/29 to ${ip} 22 setup
> > limit src-addr 4
> >
> > But he mentions that he needs access to his box from potential client
> > sites where the IP is unknown.
> >
> > There has to be a better way to block the below - suggestions?
>
> If you use FreeBSD -CURRENT or -STABLE (newer than 4.10 and 5.2) you
> could use the new table feature. Otherwise if you use ipfw2 you could
> use "or-blocks" e.g.
>
> ipfw deny ip from { 1.2.4.5 or 1.2.4.7 or 1.2.5.7 } to any

Good call, but unfortunately, this is not very good in performance either..

If you use latest kernel, your ipfw2 should have the lookup tables patch which
uses radix lookup. { blah or bleh or x or y or z } list is a linear lookup,
causing the system to lookup twice in linear fassion to come to a match. It is
not exactly any better in terms of performance efficiency than adding hundreds
of straight ipfw rules each with a ip address specification.

Try this if you have tables feature:

ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32
ipfw table 1 add x.x.x.x/32

ipfw add 300 deny ip from table(1) to any

No matter how many elements you got in table 1, due to radix/patricia trie
lookup as with kernel routing table, the time spent in looking thru firewall
elements is O(32) constant.

To demonstrate the efficiency:

Test #1: Start with 1 ipfw rule (the last rule 65535 being allow all) that
denies one ip address on the DUT. Flood the remote tester device that is not
denied by the ipfw rule. Start the test, and increment the ipfw rules from 1
to 10. Result:

1 rule: 140kpps
2 rule: 140kpps
3 rule: 138kpps
4 rule: 137kpps
5 rule: 135kpps
6 rule: 135kpps
7 rule: 132kpps
8 rule: 133kpps
9 rule: 131kpps
10 rule: 129kpps

Test #2: Perform the exact same test above, however use a lookup table to store
the elements from 1 to 10:

1 element in table: 140kpps
2 element in table: 140kpps
3 element in table: 140kpps
4 element in table: 141kpps
5 element in table: 140kpps
6 element in table: 139kpps
7 element in table: 140kpps
8 element in table: 142kpps
9 element in table: 140kpps
10 element in table: 140kpps




Monday, April 21, 2008

D-link 友讯网络 BAS 认证校园网客户端 for linux

aecium
Amtium eFlow Client for GNU/Linux.

http://gitorious.org/projects/aecium

感谢wkz0712的工作,广大的linux校园网用户可以不用摆脱虚拟机直接连入校园网了!
bkuyang验证有效,可以在河南大学的校园网使用。

Amtium eFlow Client for GNU/Linux




这是一个根据(貌似)官方版本(网上有)反汇编后,重写的版本。欢迎使用。使用:
$12net -h
如有错误请回帖指明。
你可以将程序改名,首次使用参数要输全

$sudo cp 12net /usr/bin/program_name
$program_name -h 210.45.193.3 -u username -p password -d eth0 -f

或者在$HOME/.program_name里写:
host=210.45.193.3
server=int
interface=eth0

离开:
$program_name -l

下载链接: aecium.zip

Saturday, April 19, 2008

This one is from Drivel.
Just don't know why cant they make the Desktop Client WSWG.

Are you using CERNET?
Yes
No

Why do you choose it?
I like it because ...
I have no other choice!



Friday, April 18, 2008

Desktop posting client test

Testing post from BloGTK!
Mesh
Enjoying my happy on with CERNET~

Will all these things work perfect?
Testing post from BloGTK!

Mesh

Enjoying my happy on with CERNET~

Saturday, October 6, 2007

run netbeans directly from a jar

To launch NetBeans from a jar is useful when you want to do something different, or, if you hate the native launcher and want to make Java a really cross platform one. Hansmuller has wrote a blog about Using Java Web Start to Launch NetBeans. I tried it but failed to locate the NetBeans homedir, and there seems to be no source attached. So I googled for a while and find this page suggesting how NetBeans start itself. But the most useful information comes from the following article, which is conspicuously, from Sun's site.

Generic Launcher

The $nbplatform cluster is guaranteed to contain $nbplatform/lib/nbexec executable that is supposed to be used by final products. Example:

The NetBeans IDE product should provide its own executable /usr/bin/netbeans which will locate the $nbplatform/lib/nbexec (currently implemented here for unix and here for windows) executable, read their own configuration files, find out locations of additional clusters and pass --clusters /pathto/nb4.0:/pathto/ide4:/pathto/enterprise7 and --userdir $HOME/.myproductuserdir to it.

The Native Product should have its own launcher called netbeans-native and read its own settings, specify its own user directory and list of clusters (probably --clusters /pathto/ide6:/pathto/web9 as the Native product is extension of the base NetBeans IDE without the enterprise part) and pass that information to the generic $nbplatform/lib/nbexec.

Configuring the Launcher

The behaviour of nbexec launcher can be influenced by special arguments and environment variables:
  • --clusters - specifies the paths to clusters that shall be placed on the execution stack (config, modules, configurations, etc.). Individual elements are separated using java.io.File.pathSeparator so for example on Windows it is ; and on Unix :

  • --branding - gives the name of branding that shall be used

  • regular parameters - these are end user oriented parameters printed when invoked with --help option:
    Usage: bin/../platform4/lib/nbexec {options} arguments

    General options:
    --help show this help
    --jdkhome path to Java(TM) 2 SDK, Standard Edition
    -J pass to JVM

    --cp:p prepend to classpath
    --cp:a append to classpath

    Core options:
    --laf use given LookAndFeel class instead of the default
    --fontsize set the base font size of the user interface, in points
    --locale use specified locale
    --userdir use specified directory to store user settings


Now we are assured that NetBeans can and is in deed launched from a jar(or a cluster of jars ^_^), and the .exe thing is just a configuration reader. Look into the nbexec file, and you will finally get the command like this:
java -Djdk.home=/usr/lib/jvm/java-6-sun -classpath $nbhome/platform6/lib/boot.jar:$nbhome/platform6/lib/org-openide-modules.jar:$nbhome/platform6/lib/org-openide-util.jar:$nbhome/platform6/lib/locale/boot_ja.jar:$nbhome/platform6/lib/locale/boot_pt_BR.jar:$nbhome/platform6/lib/locale/boot_zh_CN.jar:$nbhome/platform6/lib/locale/org-openide-modules_ja.jar:$nbhome/platform6/lib/locale/org-openide-modules_pt_BR.jar:$nbhome/platform6/lib/locale/org-openide-modules_zh_CN.jar:$nbhome/platform6/lib/locale/org-openide-util_ja.jar:$nbhome/platform6/lib/locale/org-openide-util_pt_BR.jar:$nbhome/platform6/lib/locale/org-openide-util_zh_CN.jar:$nbhome/platform6/lib/locale/swing-l10n_pt_BR.jar:/usr/lib/jvm/java-6-sun/lib/dt.jar:/usr/lib/jvm/java-6-sun/lib/tools.jar -Dnetbeans.dirs=$nbhome/nb5.5:$nbhome/ide7:$nbhome/enterprise3/ -Dnetbeans.home=$nbhome/platform6 org.netbeans.Main --userdir /home/yang/.netbeans/
BTW, NetBeans can be shared between linux and M$win.