Fix the continues auto-disconnect wireless issue on Ubuntu

The wireless card in my laptop is RTL8191SEvB. In Linux (no matter I use is Gentoo or Ubuntu), the default kernel module is r8192se_pci. The detail can be retrieved by:

1
2
3
4
5
6
$ lspci -v
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8191SEvB Wireless LAN Controller (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. Device e020
.....
Kernel driver in use: rtl819xSE
Kernel modules: r8192se_pci

Although it works but I also encounter a problem that the network connection will disconnect automatic and continuously. To overcome this issue, from the reference: Can’t get Realtek RTL8191SEvB wireless adapter to work, the solution is easy. What we should do is adding a parameter while probing module. The command is:

1
2
$ sudo rmmod r8192se_pci
$ sudo modprobe r8192se_pci hwwep=0

And we can set up as a global module option in system, that is:

1
$ sudo echo "options r8192se_pci hwwep=0" > /etc/modprobe.d/r8192se_pci.conf

And the options will be added while module start-up.
Note: This solution is in test by myself.

Delimiter issue in bash for loop with cat command

If we had a list file which listing like:

aa
bb
cc dd

which we write a bash script and want to print out each line with cat command. The script listing as:

1
2
3
4
5
6
#!/bin/bash

for line in `cat list_file`
do
    echo $line
done

But the result is:

aa
bb
cc
dd

This issue is due to the Internal Field Separator (IFS) in bash is default defined as <space><tab><newline>. So the solution is simple. Just add the following command in bash script (line 2 of the above example) to overwrite it.

1
IFS=$'\n'

And the output result is correctly.