Linux Configuration

Configuring Wireless Cards under Linux with Ndiswrapper

Posted on


I have configured  an old   laptop I owned  to access the wireless network I have. The box runs fedora core 5 and a mini pci 1350 card.  Since there’s a lack of documentation online on how to install and configure some hardware I decided to share my experise in this area with everyone, so buckle up and enjoy the ride. (Modify the driver names to suit your environment).

1- download ndiswrapper src files from the sourceforge site

2- logging as root using

  • # su –
  • #make && make install

3- after the sources compile and the software installs you need to get install the windows drivers for the mini pci 1350

  • #cd /to/wlan/card/windows/drivers
  • #ndiswrapper -i bcmwl5.inf
  • #ndiswrapper -l ( you should see hardware present)
  • #ndiswrapper -m

 

4- note that if you are using kernel > 2.6.15, it is precompiled with the bcm43xx drivers so you need to prevent loading it during boot up.

  • #echo “blacklist bcm43xx” >> /etc/modprobe.d/blacklist

5- unload the bcm43xx driver using

  • #rmmod bcm43x

6- load the ndiswrapper module

  • #modprobe ndiswrapper

7- scan for networks and connect

  • #iwlist wlan0 scan
  • #ifup wlan0

and voila!!

Dropping to Single Mode from GRUB

Posted on


Lately I have locked myself out my gentoo linux box and not been able to log on to root.

This situation happens to most of Careless! Linux users, but thanks to the GRUB flags, one might

able to overcome this situation with ease.

my /boot/grub/grub.conf looks like this

on your machine, you can do

1. $more /boot/grub/grub.conf to view yours

default 0

timeout 30

splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux

root (hd0,0)

kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 doscsi

initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

2. Now reboot the machine, and at the grub menu press ‘e’ then ‘e’

now what do you wanna do is boot the machine to single mode.

3. Go down to the line kernel /kernel… and add ‘1’ to its end. you’ll wind up with:

kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 doscsi 1

4. Now press ENTER and ‘b’ et voila.

Configuring PXE linux install using TFTP + NFS

Posted on


I recently came across a project in which I had to setup a clustered J2EE system based on TOMCAT and MySQL. The project required fail safe environment, load balancing and clustering of a web based application in a Vmware contained setup. Nevertheless, installing and configuring 15 linux machines is a tiring and time consuming task, so I thought of seting up a PXE server that serves the new computers the distros to install and even better, I created a kickstart file with the package I need to render the installation itself automatic.
These are the Step by step I followed on configuring a working PXE server integrated with the pxelinux boot loader from a fresh install of Red Hat Linux.

PXE Server Setup

Install the tftp server and pxe server

yum install tftp-server pxe

Get the pxelinux boot loader. The pxelinux boot loader is bundled in the syslinux tar file. Retrieve this from http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-2.00.tar.gz. (Or latest version in that directory.)

Copy the boot loader into place. After expanding the compressed tar archive, copy the file ‘pxelinux.0’ into your tftpboot area. As in the following example:

cp syslinux-2.00/pxelinux.0 /tftpboot/X86PC/UNDI/linux-install/

Create the pxelinux configuration directory. The boot loader expects a directory to be present in the same directory it was loaded from. It expects this directory to be named pxelinux.cfg, and looks for a file in that directory based on the IP address of the machine. If it does not find a file whose name is based on the IP address, it will look for a file named default.

Create configuration files. Here is an example pxelinux configuration file named default.

serial 0 9600 0xab3
default localboot
timeout 100
prompt 1
display display.msg

label localboot
        LOCALBOOT 0

label 7.3
        kernel vmlinuz-7.3
        append initrd=initrd-7.3.img lang= lowres devfs=nomount ramdisk_size=8192 console=ttyS0,9600

Create the display message file. In the above pxelinux configuration file, there was a display.msg reference with the display keyword. Below is an example file:

PXE Booting to install Red Hat Linux.

Current images are:
Localboot -- Exit PXE, boot locally

7.3 --- For Red Hat Linux 7.3 interactive installation

Make available the kernel and initrd. The kernel and initrd images are available from the images/pxeboot directory of the install image. (The install image is either on the CD or the base of the individual version’s filesystem tree on an ftp/http/file server.)

Rename the files to suit the boot loader configuration. The filenames of the kernel and the initial RAM disk must match the configuration entries in the pxelinux configuration file. To suit the running example:

mv initrd-everything.img initrd-7.3.img
mv vmlinuz ../vmlinuz-7.3

Configure the PXE server configuration file. With the Red Hat Linux RPM, the PXE server is configured by default to work with the NBP (Network Boot Prompt), which does not work with this example. Additionally, this example opts to have workstations boot off the network by default, load the pxelinux, and then time out to local boot from the pxelinux boot loader.

The two sections that need to be changed look like:
[X86PC/UNDI/linux-install/ImageFile_Name]
0
2
linux
and
[X86PC/UNDI/MENU]
0,Local Boot
13,Remote Install Linux
# 14,Remote Boot Linux
Those sections should look like:
[X86PC/UNDI/linux-install/ImageFile_Name]
0
0
pxelinux
and
[X86PC/UNDI/MENU]
#0,Local Boot
13,Remote Install Linux
# 14,Remote Boot Linux

Confirm that the appropriate services are accessible. The main services that must be started and accessible for the PXE booting process are:

  • tftpdxinetd (for tftpd)pxe
The way to check is to use           chkconfig.
[root linux-install]# /sbin/chkconfig --list tftp
tftp            off
[root linux-install]# /sbin/chkconfig tftp on
[root linux-install]# /sbin/chkconfig --list xinetd
xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off
[root linux-install]# /sbin/chkconfig --list pxe
pxe             0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root linux-install]# /sbin/chkconfig pxe on
In the above example, tftp was not configured to start by           default, nor was pxe. However, xinetd was.  To configure           tftp and pxe to start automatically,  chkconfig           <service> on was run. Since tftp is a part of           xinetd, as long as xinetd is running, nothing past the           chkconfig tftp on needs to be done to use           the tftp service. However, pxe must be started at this point           to begin using it prior to a reboot. The below example           illustrates confirming that xinetd is running as well as           starting pxe.
[root etc]# /sbin/service xinetd status
xinetd (pid 821) is running...
[root etc]# /sbin/service pxe status
pxe is stopped
[root etc]# /sbin/service pxe start
Starting pxe:                                              [  OK  ]

Add the PXE entries to /etc/services. While not required, it may be helpful to add the PXE service entries to the /etc/services file.

pxe 67/udp
pxe 4011/udp

Beryl + Netbeans blank window problem

Posted on


Assuming that you have Beryl installed and configured, it is known that Netbeans will start and display a blank screen. This is due to the fact that Beryl doesn’t support SWT yet. This is a workaround this situation:

  #yum install libXp
  assuming you're using bash
  $ echo "export AWT_TOOLKIT='MToolkit'" >> ~/.bashrc
  $ echo "export AWT_TOOLKIT='MToolkit'" >> ~/.bash_profile

  $source ~/.bashrc
  $~/.bash_profile

and this should work.