2010年12月29日星期三
2010年12月27日星期一
MadWifi: linux driver for wireless ethernet card
http://madwifi-project.org/wiki/UserDocs/FirstTimeHowTo
How to build the ad-hoc network:
https://help.ubuntu.com/community/WifiDocs/Adhoc
https://help.ubuntu.com/community/WifiDocs/Driver/Madwifi
Specifically, for Atheros card, the restricted Madwifi driver supports adhoc mode through the creation of a new VAP.
1. remove the ath_pci module with modprobe
$ sudo modprobe -r ath_pci
2. Now re-insert the module with the option of creating it in ad-hoc mode:
$ sudo modprobe ath_pci autocreate=adhoc
3. then, build a ad-hoc network by assigning the different IP addresses for different host computer:
$ sudo iwconfig eth0 essid 'NAMEofAdhoc'
for example, for the first computer,
$ sudo ifconfig eth0 169.254.114.102 netmask 255.255.0.0
for the second computer,
$ sudo ifconfig eth0 169.254.114.103 netmask 255.255.0.0
Using the following command to change the frequency:
$ sudo iwconfig eth0 freq 2.462G
Iperf: a tool to measure the bandwidth and the quality of a network
http://openmaniak.com/iperf.php
The source code is available at:
http://sourceforge.net/projects/iperf/
iperf(1)
NAME
iperf
- Modified version of a tool for measuring maximum TCP and UDP bandwidth in the sense that also a bandwidth for TCP may be specified
DESCRIPTION
This program iperf
is the modified version of the original iperf
program. This version allows that also a bandwidth for TCP may be specified. This can be done with the option -a
which was not available in the original version.
USAGE
Usage: iperf [-s|-c host] [-p port] [-t secs] [-w bytes] ...
iperf [-h|--help] [-v|--version]
Client/Server:
-f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-l, --len #[KM] length of buffer to read or write (default 8 KB)
-m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)
-p, --port # server port to listen on/connect to
-u, --udp use UDP rather than TCP
-w, --window #[KM] TCP window size (socket buffer size)
-B, --bind bind to , an interface or multicast address
-M, --mss # set TCP maximum segment size (MTU - 40 bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-V, --IPv6Version Set the domain to IPv6
Server specific:
-s, --server run in server mode
-D, --daemon run the server as a daemon
Client specific:
-a, --tcp_bandwidth \ for TCP, bandwidth to send at in bits/sec
#[KM] (default no bandwidth limit used)
-b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec
(default 1 Mbit/sec, implies -u)
-c, --client run in client mode, connecting to
-n, --num #[KM] number of bytes to transmit (instead of -t)
-t, --time # time in seconds to transmit for (default 10 secs)
-F, --fileinput input the data to be transmitted from a file
-I, --stdin input the data to be transmitted from stdin
-P, --parallel # number of parallel client threads to run
-S, --tos # set type-of-service for outgoing packets
-T, --ttl # time-to-live, for multicast (default 1)
-W, --windowSizeSuggest Run the client so as to suggest a suitable window size (default off)
Miscellaneous:
-h, --help print this message and quit
-v, --version print version information and quit
[KM] Indicates options that support a K or M suffix for kilo- or mega-
The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_, such as IPERF_BANDWIDTH.
Report bugs to
ORIGINAL IPERF DOCUMENTATION
- http://dast.nlanr.net/Projects/Iperf/
- The documentation.
- http://dast.nlanr.net/Projects/Iperf/iperfdocs_1.6.html
- The Iperf V. 1.6 User Docs.
SEE ALSO
jperf(1)
http://staff.science.uva.nl/~jblom/gigaport/tools/man/iperf.html
2010年12月25日星期六
Install Debian Linux in Gateway laptop zz
2010年12月23日星期四
More about adding a user in linux
useradd -m -s /bin/bash userName
passwd userName
cd /home
ls -l
mkdir scheiber
chmod 0700 scheiber
chown -R scheiber:scheiber scheiber
To check the permission:
http://www.howtogeek.com/howto/ubuntu/add-a-user-on-ubuntu-server/
python tutorial
http://bytes.com/topic/python/
2010年12月22日星期三
2010年12月21日星期二
Set Failed on device wlan
According to wireshark wiki, the following command is used in linux:
sudo iwconfig wlan1 mode monitor
But I kept receive the error message "set Failed on device wlan1".
Finally, I found that I need turn the device off first by
sudo ifconfig wlan1 down
sudo iwconfig wlan1 mode monitor
sudo ifconfig wlan1 up.
Then it rocks as you want now :)
2010年12月19日星期日
HowTo:Checkout SVN in Windows ZZ
http://vegastrike.sourceforge.net/wiki/HowTo:Checkout_SVN#Tortoise_SVN
2010年12月10日星期五
mbr被破坏无法进入ubuntu 9.10 ZZ
sudo fdisk -l查看磁盘信息。 找到 / ,/boot的对应分区。
我这里是/dev/sda11 在/ , /dev/sda3在/boot.
接着我们来挂载:
sudo mount /dev/sda11 /mnt
sudo mount /dev/sda3 /mnt/boot (如果没有对/boot单独分区的话请别打这条了)
sudo grub-install --root-directory=/mnt /dev/sda
最后重启进入ubuntu打开终端输入 update-grub2
2010年12月9日星期四
Configuring Ubuntu Linux Remote Access using SSH ZZ
http://principialabs.com/beginning-ssh-on-ubuntu/
bbn code
http://www.mail-archive.com/discuss-gnuradio@gnu.org/msg15066.html
http://1010.co.uk/org/notes.html
http://old.nabble.com/BBN%27s-802.11b-code-td18136664.html
The quick solution is: change io_signature (1,2,...) --> in_signature(1,1,...)
and recompile. :)
-----------------------------------------
Install BBN code for USRP2 @ Ubuntu 9.04 + XCVR2450
svn co https://www.cgran.org/cgran/projects/bbn_80211/branches/usrp2_version bbn_80211
cd bbn_80211/
./bootstrap && ./configure && make
sudo make install
If there are errors when doing "make" on bbn, like:
bbn_tap.cc:: ‘printf’ was not declared in this scope
bbn_tap.cc: ‘fprintf’ was not declared in this scope
....
It is probably the problem of GCC version.
The solution is to add the following declaration on top of each cc files.
#include
#include
#include
Install gnuradio 3.2.2 in Ubuntu 10.04
2010年12月8日星期三
Dell E6410 install Ubuntu 10.04
http://www.downloadatoz.com/driver/articles/fix-dell-latitude-e6410-black-screen-during-ubuntu-10-04-installation.html
2010年12月6日星期一
Export figure to pdf in Matlab ZZ
http://jinghaoxu.blogspot.com/2007/04/export-figure-to-pdf-in-matlab.html
The good thing is, Matlab can export figure to pdf format. Unfortunately, when saving a figure to a pdf file in Matlab, you'll find the figure doesn't fit the layout very well, i.e. there is a large margin from the figure to the page boundary. Those margins will be inserted into the LaTex output when you include these pdf figures.
A solution is:
1) After you plot the figure in Matlab, go to 'File->Export Setup', input the size of the output you want, e.g. Width: 6 inches, Height: 5 inches. Then click 'Apply to Figure' button.
2) Don't close the 'Export Setup' window. Go to 'File->Print Preview->Paper', input the same size in the Width and Height options.
3) Don't close the 'Print Preview' window. Go back to the 'Export Setup' window, and click 'Export', then select pdf format and save it.
4) Check the output pdf file, you'll see it is perfect.
latex 单行或多行公式的排版ZZ
from : http://www.boyeut.com/2007/05/equation.html
1.自动编号的单行公式环境是
\begin{equation}
…
\end{equation}
不参与自动编号的单行公式环境:
\[
…
\]
人工编号的单行公式可以使用Tex原有的行间公式标记
$$公式 \eqno 编号 $$ 将编号放在右边
$$公式 \leqno 编号 $$ 将编号放在左边
引用时候可以直接用$编号$即可。
例如,$$a^2+b^2=c^2 \eqno (**)$$
由公式($**$)即可得到结论。
一般情况下,行间公式 $$…$$也可以用\[…\]表示
但对于这种人工编号的公式,不能用\[..\]代替$$…$$.
2.单个公式很长,需要换行,但仅允许生成一个编号时,可以用split命令
\begin{equation}
\begin{split}
a &= b \\
c &= d
\end{split}
\end{equation}
注意:每行只允许出现一个“&”,使用split命令后,编号上下居中显示。
3.多行公式:
\begin{eqnarray}
左 & 中 & 右\\
左 & 中 & 右\\
…
\end{eqnarray}
该环境对多行公式每行都加自动编号,如果相对某行不加编号,可在换行之前添加命令\nonumber
如果要改变公式的自动编号,可以重设计数器初始值:
\setcounter{equation}{数}
下一个编号自动加1。
4.方程组的排版:
多个公式,每个公式自动编号。
1) gather环境
是下面align环境的一种特殊情形。
\begin{gather}
a &= b \\
c &= d \\
…
\end{gather}
>>1.如果其中某几行使用同一个编号,则需要内嵌一个split环境。
>>2.命令\notag可使当前行不编号。
2) align环境
可使几组公式并排在一起,即在同一行显示多个公式,方法是跟以前一样,使用”&”对齐。
可替代gather环境。
3) 以上几种方程组环境,无论每个公式多小,都会占满一行。使用相应的\gathered,\aligned环境,则只占据公式的实际宽度,整体作为一个特大的符号与其他符号一同处理。
这个结构还可以添加位置参数,以决定与其他符号的竖直对齐方式(b,t)。而且这种环境不再具有自动编号功能。
例如:
\begin{equation}
\left.
\begin{aligned}[b]
a &= b+c \\
d &= b+c
\end{aligned}
\right\}
\Longrightarrow
\qquad a=d
\end{equation}
这里更正参考文献中P149页的一个小错误。就是\right}应该改为\right\}.
【参考文献】
1.陈志杰等,LATEX入门与提高(第二版),高等教育出版社,2006.5