2008年9月27日

Get stored Wireless Key from Computer

WirelessKeyView 挖出電腦裡的WiFi無線網路登入密碼!(中文版)  【重灌狂人】

當我們要重灌電腦前,或者需要另外取用無線網路登入密碼時,如果你已經忘記原本的無線網路密碼是多少,可以試試看透過WirelessKeyView這軟體來挖出原本儲存在電腦中的無線網路登入密碼。

WirelessKeyView可以還原WEP與WPA所使用的KEY,如果你常用的KEY很多的話,還可以把抓出來的KEY另外儲存成TXT文字檔或HTML網頁,方便我們重灌完電腦之後馬上使用這些KEY來登入無線網路。

Convert bin to iso under Linux

bin2iso-0.4.c

ref: Leonetix Home: CD Image Conversion

2008年9月23日

Firefox hacks

In Depth: 8 hacks to make Firefox ridiculously fast | PCAnswers
Firefox has been outperforming IE in every department for years, and version 3 is speedier than ever.

But tweak the right settings and you could make it faster still, more than doubling your speed in some situations, all for about five minutes work and for the cost of precisely nothing at all. Here's what you need to do.

1. Enable pipelining

Browsers are normally very polite, sending a request to a server then waiting for a response before continuing. Pipelining is a more aggressive technique that lets them send multiple requests before any responses are received, often reducing page download times. To enable it, type about:config in the address bar, double-click network.http.pipelining and network.http.proxy.pipelining so their values are set to true, then double-click network.http.pipelining.maxrequests and set this to 8.

Keep in mind that some servers don't support pipelining, though, and if you regularly visit a lot of these then the tweak can actually reduce performance. Set network.http.pipelining and network.http.proxy.pipelining to false again if you have any problems.

2. Render quickly

Large, complex web pages can take a while to download. Firefox doesn't want to keep you waiting, so by default will display what it's received so far every 0.12 seconds (the "content notify interval"). While this helps the browser feel snappy, frequent redraws increase the total page load time, so a longer content notify interval will improve performance.

Type about:config and press [Enter], then right-click (Apple users ctrl-click) somewhere in the window and select New > Integer. Type content.notify.interval as your preference name, click OK, enter 500000 (that's five hundred thousand, not fifty thousand) and click OK again.

Right-click again in the window and select New > Boolean. This time create a value called content.notify.ontimer and set it to True to finish the job.

3. Faster loading

If you haven't moved your mouse or touched the keyboard for 0.75 seconds (the content switch threshold) then Firefox enters a low frequency interrupt mode, which means its interface becomes less responsive but your page loads more quickly. Reducing the content switch threshold can improve performance, then, and it only takes a moment.

Type about:config and press [Enter], right-click in the window and select New > Integer. Type content.switch.threshold, click OK, enter 250000 (a quarter of a second) and click OK to finish.

4. No interruptions

You can take the last step even further by telling Firefox to ignore user interface events altogether until the current page has been downloaded. This is a little drastic as Firefox could remain unresponsive for quite some time, but try this and see how it works for you.

Type about:config, press [Enter], right-click in the window and select New > Boolean. Type content.interrupt.parsing, click OK, set the value to False and click OK.

5. Block Flash

Intrusive Flash animations are everywhere, popping up over the content you actually want to read and slowing down your browsing. Fortunately there's a very easy solution. Install the Flashblock extension (flashblock.mozdev.org) and it'll block all Flash applets from loading, so web pages will display much more quickly. And if you discover some Flash content that isn't entirely useless, just click its placeholder to download and view the applet as normal.

6. Increase the cache size

As you browse the web so Firefox stores site images and scripts in a local memory cache, where they can be speedily retrieved if you revisit the same page. If you have plenty of RAM (2 GB of more), leave Firefox running all the time and regularly return to pages then you can improve performance by increasing this cache size. Type about:config and press [Enter], then right-click anywhere in the window and select New > Integer. Type browser.cache.memory.capacity, click OK, enter 65536 and click OK, then restart your browser to get the new, larger cache.

7. Enable TraceMonkey

TraceMonkey is a new Firefox feature that converts slow Javascript into super-speedy x86 code, and so lets it run some functions anything up to 20 times faster than the current version. It's still buggy so isn't available in the regular Firefox download yet, but if you're willing to risk the odd crash or two then there's an easy way to try it out.

Install the latest nightly build (ftp://ftp.mozilla.org/pub/firefox/nightly/latest-trunk/), launch it, type about:config in the address bar and press Enter. Type JIT in the filter box, then double-click javascript.options.jit.chrome and javascript.options.jit.content to change their values to true, and that's it - you're running the fastest Firefox Javascript engine ever.

8. Compress data

If you've a slow internet connection then it may feel like you'll never get Firefox to perform properly, but that's not necessarily true. Install toonel.net (toonel.net) and this clever Java applet will re-route your web traffic through its own server, compressing it at the same time, so there's much less to download. And it can even compress JPEGs by allowing you to reduce their quality. This all helps to cut your data transfer, useful if you're on a limited 1 GB-per-month account, and can at best double your browsing performance.

Enable vim syntax highlighting

Using vim color schemes with Putty - Vim Tips Wiki - a Wikia wiki
I am using PuTTY in Windows to access a Unix box, and the Terminal-type string in PuTTY is set to xterm. I wanted to use Vim's color schemes. I tried many different things with no decent result until I found the following code in Vim's help. After inserting the following lines in my vimrc, I was able to use all the color schemes defined by Vim.

For a 16-color display:

if has("terminfo")
let &t_Co=16
let &t_AB="\[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm"
let &t_AF="\[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm"
else
let &t_Co=16
let &t_Sf="\[3%dm"
let &t_Sb="\[4%dm"
endif

:help xfree-xterm

For an 8-color display:

if &term =~ "xterm"
if has("terminfo")
let &t_Co=8
let &t_Sf="\[3%p1%dm"
let &t_Sb="\[4%p1%dm"
else
let &t_Co=8
let &t_Sf="\[3%dm"
let &t_Sb="\[4%dm"
endif
endif

ps. the vimrc are /etc/vimrc and ~/.vimrc

2008年9月13日

Connecting to CUHK Resnet VPN under Ubuntu 8.04 LTS

As PPTP service suspended since 1 Sept, the guide given in ITSC website doesn't not work now. Here are the steps for L2TP VPN connection.

1. Download the ipsec-tools, racoon and xl2tpd
(or sudo apt-get install ipsec-tools racoon xl2tpd)

2. Install the packages

3. Add the content between the lines to /etc/racoon/racoon.conf
------- File Begin, don't copy this line -----------
path pre_shared_key "/etc/racoon/psk.txt";
padding {
maximum_length 20;
randomize off;
strict_check off;
exclusive_tail off;
}
remote anonymous {
exchange_mode main;
doi ipsec_doi;
situation identity_only;
generate_policy on;
proposal_check obey;
proposal {
encryption_algorithm des;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 1;
}
}
sainfo anonymous {
lifetime time 28800 sec;
encryption_algorithm 3des;
authentication_algorithm hmac_md5;
compression_algorithm deflate;
}
------- File End, don't copy this line -----------

4. Add the content between the lines to /etc/racoon/psk.txt
------- File Begin, don't copy this line -----------
10.0.255.248 ipsec-vpn
10.0.255.249 ipsec-vpn
10.0.255.250 ipsec-vpn
10.0.255.251 ipsec-vpn
10.0.255.252 ipsec-vpn
10.0.255.253 ipsec-vpn
10.0.255.254 ipsec-vpn
------- File End, don't copy this line -----------

5. Save the content between the lines to /etc/ipsec.conf
------- File Begin, don't copy this line -----------
#!/usr/sbin/setkey -f
flush;
spdflush;
spdadd 10.0.219.121/18[1701] 0.0.0.0/0[0] any
-P out ipsec esp/transport//require;
------- File End, don't copy this line -----------

6. Add the content between the lines to at /etc/xl2tpd/xl2tpd.conf
------- File Begin, don't copy this line -----------
[global]
port = 1701
auth file = /etc/xl2tpd/l2tp-secrets

[lac connect]
lns = ipsec-vpn.resnet.cuhk.edu.hk
redial = yes
require pap = yes
ppp debug = no
pppoptfile = /etc/ppp/options.l2tp
------- File End, don't copy this line -----------

6. Save the content between the lines to at /etc/ppp/options.l2tp
------- File Begin, don't copy this line -----------
lock
debug
mtu 1000
nobsdcomp
nodeflate
noaccomp
nopcomp
novj
defaultroute
replacedefaultroute
name YOUR_COMPUTING_ID
------- File End, don't copy this line -----------

7. Add the content between the lines to both /etc/xl2tpd/l2tp-secrets and /etc/ppp/pap-secrets
------- File Begin, don't copy this line -----------
YOUR_COMPUTING_ID ipsec-vpn.resnet.cuhk.edu.hk YOUR_CWEM_PASSWORD
------- File End, don't copy this line -----------

8. Run
sudo mkdir /var/run/xl2tpd
sudo /etc/init.d/racoon start
sudo /etc/init.d/xl2tpd start
echo "c connect" | sudo tee /var/run/xl2tpd/l2tp-control

9. You should get your Resnet connection now

Ref:
How to L2TP/IPsec @ CUHK
iveney的共享空间: l2tp over ipsec in Linux @ CUHK
Using Linux as an L2TP/IPsec VPN client
codeserv.us » Blog Archive » Ubuntu IPSEC/L2TP VPN Client

reserved system UIDs

Username UID GID Home Shell
root00/root/bin/bash
bin11/sbin/sbin/nologin
daemon22/sbin/sbin/nologin
sys
3

adm34/var/adm/sbin/nologin
lp47/var/spool/lpd/sbin/nologin
tty
5

sync50/sbin/bin/sync
disk
6

shutdown60/sbin/bin/shutdown
halt70/sbin/bin/halt
mem
8

mail812/var/spool/mail/sbin/nologin
kmem
9

news913/etc/news/sbin/nologin
wheel
10

uucp1014/var/spool/uucp/sbin/nologin
operator110/root/sbin/nologin
games1220/usr/games/sbin/nologin
gopher1330/var/gopher/sbin/nologin
ftp1450/srv/ftp/sbin/nologin
man
15

floppy
19

slocate
21

utmp
22

squid2323/var/spool/squid/sbin/nologin
pvm
24

named2525/var/named/sbin/nologin
postgres2626/srv/pgsql/bin/bash
mysql2727/var/lib/mysql/bin/bash
nscd2828//sbin/nologin
rpcuser2929/var/lib/nfs/sbin/nologin
rpc3232//sbin/nologin
amanda336/var/lib/amanda/bin/bash
netdump3434/var/crash/bin/bash
ntp3838/etc/ntp/sbin/nologin
canna3939/var/lib/canna/sbin/nologin
dip
40

mailman4141/var/mailman/sbin/nologin
gdm4242/var/gdm/sbin/nologin
xfs4343/etc/X11/xfs/sbin/nologin
avahi4444//sbin/nologin
avahi-autoipd4545//sbin/nologin
netdev
46//sbin/nologin
mailnull4747/var/spool/mailqueue/sbin/nologin
apache4848/var/www/sbin/nologin
wnn4949/home/wnn/sbin/nologin
smmsp5151/var/spool/mqueue/sbin/nologin
tomcat5353/var/lib/tomcat/sbin/nologin
lock
54

ldap5555/var/lib/ldap/sbin/nologin
nut5757/var/lib/ups/sbin/nologin
webalizer6767/var/www/usage/sbin/nologin
haldaemon6868//sbin/nologin
vcsa6969/dev/sbin/nologin
emerge7070/var/conary/emerge/sbin/nologin
privoxy7373/etc/privoxy/sbin/nologin
sshd7474/var/empty/sshd/sbin/nologin
radvd7575//sbin/nologin
cyrus7612/var/lib/imap/bin/bash
pcap7777/var/arpwatch/sbin/nologin
fax7878/var/spool/fax/sbin/nologin
dbus8181//sbin/nologin
ingres8282/srv/ingres/bin/bash
beagleindex8888//sbin/nologin
postfix8989/var/spool/postfix/sbin/nologin
postdrop
90

tomcat9191/usr/share/tomcat/bin/sh
quagga9292/var/run/quagga/sbin/nologin
exim9393/var/spool/exim/sbin/nologin
radiusd9595//sbin/nologin
dovecot9797/usr/libexec/dovecot/sbin/nologin
ident9898//sbin/nologin
nobody9999//sbin/nologin
users
100

htt100101/usr/lib/im/sbin/nologin
quaggavt
102

fcron103103//sbin/nologin
isogen104104/srv/mint/images/sbin/nologin
ircd105105//sbin/nologin
zope182182/var/opt/zope/bin/bash
rmake201201/srv/rmake/sbin/nologin
rmake-chroot202202//sbin/nologin
nfsnobody6553465534/var/lib/nfs/sbin/nologin

WiFi Channel Map

Enable port 587 in Postfix

Racker Hacker » Enable submission port 587 in Postfix
Enable submission port 587 in Postfix

Enabling submission port support for Postfix is really easy. To have postfix listen on both 25 and 587, be sure that the line starting with submission is uncommented in /etc/postfix/master.cf:

smtp inet n - n - - smtpd
submission inet n - n - - smtpd