Monday, June 16, 2008

How to enable wireless under Fedora 8

Using Linux system, although you are not a computer developer, you always need DIY to make your operating system more personalized and more comfortable. However, without internet DIY is not so easy. Where there is a problem, there is a solution, and internet makes it shared .
For the goodness of internet, I need wireless connection.
The problem is wireless may not be enable automatically by NetworkManager under Fedora 8. Depending on which wireless chip card you are using, you need to install wireless driver.
Firstly, get information of your wireless card.
-------------------------------------------------------------------
command line$ lspci | grep Wireless
02:00.0 Network controller: Atheros Communications, Inc. AR5418 802.11a/b/g/n Wireless PCI Express Adapter (rev 01)
-------------------------------------------------------------------
my macbook uses Atheros AR5418 .
Madwifi is a good choice for Atheros chip, but AR5418 in Atheros AR5008 family is not supported in the currently official released version. However, the one built from the trunk works for AR5418.
Here is an article interpreting step by step instructions: "How to checkout and install madwifi experimental driver for AR5008". It works for me!

Todo: how to connected to a selected encrypted Access point ?

Setting static IP on Fedora 8 (zz)

Posted on by matt_cempreng

Setting IP is very important due to able to work in the networking area, such as: file sharing, file printing, remote login, remote administration (or hacking?), etc.

Setting IP in LINUX environment either permanent or temporary is simple. It can be done by few ways, usually by editing directly to the config-file, by using the cmd-tool, or by using the graphical (GUI) tool. Just remember that all changes of the configuration needs root privilege.

Editing the Configuration File

There are files related to the networking system especially related to the IP address of the own host or other hosts. The configuration can be changed by editing the file (that needs root privilege), and then restarting the network service.

1. Editing the file: /etc/sysconfig/network-scripts/ifcfg-eth0

The file: /etc/sysconfig/network-scripts/ifcfg-eth0 contains the information about the configuration of ethernet card (NIC). If the file doesn’t exist, don’t worry because you still can write a new file with the text editor. Just make sure the format is correct. The ‘#’ character will be intepreted as a comment.

The name of the first netwok card is eth0, the second one is eth1, the third eth2, eth3, ….. and so on.

This is the example output of editing the file using ‘nano’ text editor.

ifcfg-eth0

I’ll describe it if you can’t see the picture correctly. Once again, the ‘#’ in the file character will be interpreted as comment, so I’ll use this advantage to explain the file as comments without damaging the config-file itself. Or, if you want just simply copy this text and use it directly after you paste it and save to the /etc/sysconfig/network-scripts/ifcfg-eth0 file to your machine.

Don’t forget to do the administration of the system, you must login as root.


[login@domain path]#nano /etc/sysconfig/network-scripts/ifcfg-eth0

# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
DEVICE=eth0
BOOTPROTO=static
# Refer to basic IP assignment rules
IPADDR=192.168.254.4
NETMASK=255.255.255.0
NETWORK=192.168.254.0
BROADCAST=192.168.254.255
GATEWAY=192.168.254.254
# I really don't enven think about changing this line
# I changed this once and everything messed up
HWADDR=00:17:31:65:98:3B
# Your DNS name
DNS1=202.134.0.155
DNS2=202.134.2.5
# This will bring ethernet card up every booting
ONBOOT=yes
# My NIC type on PCI slot
TYPE=Ethernet

[login@domain path]#_

2. Editing the file: /etc/resolv.conf

The file /etc/resolv.conf contains the information about DNS. This is the resolver’s configuration file. The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information. Refer to ‘man resolv.conf‘.


[login@domain path]#cat /etc/resolv.conf
search MyDomainName
nameserver 202.134.0.155
nameserver 202.134.2.5
[login@domain path]#_

3. Editing the file: /etc/sysconfig/network

The file /etc/sysconfig/network contains information about gateway, hostname and network connection. This is the example of the file in my Linux Box.


[login@domain path]#cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=cempreng.net
[login@domain path]#_

The line: NETWORKING=yes tells wether the computer will connect to the network. If you wish not to join your machine to the network just make change to NETWORKING=no.

The line: HOSTNAME=cempreng.net will gives you the host name of your machine. We can easily make change of our host name by editing this line. Alternatively we can use the command hostname to set the system’s host name. More information refer to ‘man hostname‘.

NOTE:
Don’t forget to restart the network service after the configuration changed. On Fedora system just simply by typing command like this:

[login@domain path]#service network restart
or
[login@domain path]#/etc/rc.d/init.d/network restart

Using Command Line Tool

1. Command Line: ifconfig

Command : ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. If no arguments are given, it displays the status of currently active interfaces. Refer to ‘man ifconfig‘.

Format:

ifconfig [interface]
ifconfig interface [aftype] options | address

ifconfig

This is an example from my machine:


[login@domain path]#ifconfig

eth0 Link encap:Ethernet HWaddr 00:17:31:65:98:3B
inet addr:192.168.254.4 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::217:31ff:fe65:983b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:186357 errors:0 dropped:0 overruns:0 frame:0
TX packets:127850 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:213616062 (203.7 MiB) TX bytes:14120057 (13.4 MiB)
Interrupt:17 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7787 errors:0 dropped:0 overruns:0 frame:0
TX packets:7787 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2576283 (2.4 MiB) TX bytes:2576283 (2.4 MiB)

[login@domain path]#

As we can see the eth0 is the name of the first ethernet card (NIC). I only have one ethernet card so the name will be eth0, assigned as the first (and the only) one. And so is the lo, it is the loopback connection, usually 127.0.0.1.

A loopback is a communications channel with only one endpoint. Any message transmitted through such a channel is immediately received by the same channel.
From:
http://en.wikipedia.org/wiki/Loopback

To change IP address as desired just follow the syntax of ifconfig. This is an example changing IP address to 192.168.254.3 (C-Class). By default the netmask will be automatically given.


[login@domain path]#ifconfig eth0 inet address 192.168.254.3

2. Command Line: ip

Actually I never use this command line, and I don’t want to write about this one to decrease the risk soo…. please learn it by yourself and please tell me after you mastering this command line.

Using GUI Tool

Alternatively, we can change IP address from GUI tool placed in:
System -> Administration -> Network
or using command
system-config-network by typing on console terminal (such as xterm, gnome-terminal, etc) like this:

[login@domain path]#system-config-network

system-config-network

To make changes, simply highlight the preferred devices and then click on the edit tab. Then the new window will be displayed like this:

system-config-network-edit

On the General tab of that new window, we can edit the configuration as desired. We can set the IP address manually (static IP adress) or automatically by DHCP. And don’t forget to click OK otherwise the changes won’t be saved. The window will be closed and back to Network Configuration window. Save your most recent configuration by clicking File -> Save or either by pressing the shortcut Ctrl+S. It’s so easy, eh…???

Wednesday, June 11, 2008

Mac is back!

My little macbook is back with Leopard and Fedora 8 dual booting .

I tried to install the newly released Fedora 9, but I got a big problem with GNOME desktop missing. I am not a skilled Linuxer, and Fedora 9 is not so stable a version considering for me, so I shifted to Fedora 8. Hope it will gave me a nice experience.

Friday, May 30, 2008

White Macbook dies in blank!

My little while Macbook, with Leopard and Fedora newly intalled, hanged in blank when starting the system in a raing morning. After my last restart, it did not go to my nice rEFT bootloader but in a white screen (actually silver gray, apple style, you know) totally in blank, and later in the middle of the screen came up a gray directory with a question mark on it, flashing!
I was afraid that maybe the package ex2fs i just installed before restarting to access linux partition from mac or my newly made linux partition messed the bootloader up. So I tryed Tiger install disk to reintall a new system to make things visible. But install error, the hfs+ partition had errors and repaire failed. I even did the format and repartitioned the whole disk and still hfts disk remained gray in Disk Utility and undetectable by installer. That's it ! What else I can do? Googling on the internet, one ticket of a forum scared me. It said it is probably a hard disk problem and the Apple is already aware of the problem and there are already some cases about it. It said the most problems macers meet are about the hard disk and the driver. I've alreasy got my superdiver repaired and now it turned to the hard disk? Damn! I am really a lucky dog! Is the Apple really right for me ? Or it is an apple from the witch?
This morning I handed over my macbook to Centro Assitenza "agian". Hope they will fix it for free(under 1 year guarantee).
God Bless!

My ntfs partition revives!!

The ntfs partiton of my removable disk revives ! That is really a good news !
I always got my stuff in troubles. Removable disk and my macbook.
let's talk about the removable disk first. Once it was totally undetectable when pluged to the computer. It was a problem with hardware connection and finnaly fixed by my friend, who opened it and reset up. Now, a few days ago, one of my partions could not be umounted to my macbook. One thing I should mention is that I have 2 partitons in the removable disk:MacJo 30G Hfs+ for mac competibility and Bingo about 90G Ntfs. The last time I mouted and used Bingo was under Leopard and was deleting some huge useless directories. I had problems with Trash, because it hangs when emptying. I could not empty the Trash before unmount the disk. I don't think it is a big problem to umount before empty the trash. But being hanged when trashing is a problem. Then, this Bingo can not be mounted under Fedora, which resulted an error about $MFT, sorry that I can't what exactly (I forget where i recorded the error message). What's more, under Windows Xp system, the disk showed up could not be open. File or directory damaged. It should be a problem with Master File Table.
I got a simple and magical way to fix it . Under windows os, open Run(运行),and enter[chkdisk/j] if your disk is mounted as disk j (it is not important,because anyway you might be got error when checking disk), regardless of those errors and restart you machine with the removable disk pluged . There will be a startup disk check(This must be the key point of the solution, i guess it is using the automatical disk check and repaire when starting up the system). Than, as long as the system is started, we are done! Look, Bingo comes back and you can open it. Maybe just one more directroy name found.0000 is added to you disk. Smile ~ :)
Remember: startup disk check sometime really help!
hints of solution: plug the removable disk to the computer running windows, open Run, input command: chkdisk/j (j is your disk indicator) and enter, regardless of output, remain the removable disk pluged restart the computer, automatically do the disk check ,then start the system and done!
症状:移动硬盘,插上,提示硬盘已连接上并在我的电脑上显示盘符,但是打不开,提示,找不到指定文件或文件夹损坏。
方法:windows系统下,插上移动硬盘,打开运行,输入chkdisk/j (J是移动硬盘挂载的盘符号),不管运行结果怎样,重启电脑,注意这个时候不要拔掉移动硬盘,开始自动运行开机磁盘检测,检测完打开系统,这个时候系统挂载的移动硬盘就已经正常了。