The Broadcom Wireless Card Guide

Introduction: Unfortunately, most Broadcom wireless cards need proprietary firmware to get connected; many major distributions make it easy to get this firmware, but the tools they bundle need an Internet connection to get it, which is not always possible. Most tutorials currently online also assume you have a working Internet connection already, but this one will give you instructions on how to install the drivers manually. Don’t worry, it’s not that hard. :D

Step 1: find out what card you have.
There are lots of Broadcom cards out there. To find out what yours is, open a terminal and type or copy-paste (use right-click > Paste to paste into terminals) the following for Ubuntu and Debian:
sudo lspci -vnn | grep 14e4
Or the following for Fedora and others:
su -c "lspci -vnn | grep 14e4
The result should be something like this:
02:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
From this, you need the PCI ID, which has been italicized in the sample above. Now look up your PCI ID in the following table:

PCI ID Chip Driver(s) Notes
14e4:4301 BCM4303 b43legacy
14e4:4306 BCM4306 rev. 2 b43legacy Two IDs, same card (?)
14e4:4307 BCM4306 rev. 3 b43
14e4:4311 BCM4311 b43, wl
14e4:4312 BCM4312 b43 Unsure about this one
14e4:4313 BCM4313 b43, wl Unsure about this one
14e4:4315 BCM4312 b43, wl Requires LP/PHY firmware
14e4:4318 BCM4318 b43
14e4:4328 BCM4321 wl Two IDs, same card (?)
14e4:432b BCM4322 wl
14e4:4353 BCM43224 wl
14e4:4357 BCM43225 wl

Okay, that table above might confuse you, so let me explain. On the first column you get the PCI ID of the card, which you should already know. On the second column, you get the actual chip’s name. These are not the same as Product IDs (the part of the PCI ID after 14e4:); you can probably use those to verify that you have the right card. On the third column you have the drivers that support each card. You will need to pick one of them and install it; details lie below. And on the fourth column you have any notes related to the card.
If your card isn’t listed there, it probably doesn’t work. I recommend you check this page for more details, but watch out for conflicting information!

Step 2: Pick the right driver.
There are two major drivers for the current series of Broadcom cards, plus one for older cards and one in development (not mentioned here).

  1. Broadcom STA (also known as wl) is the official, Broadcom driver for a few cards typically found in Dell and HP laptops. It’s theoretically more stable than b43 and doesn’t need additional firmware, but it lacks some advanced features and is proprietary software.
  2. b43 is a free-as-in-freedom unofficial driver that requires, however, proprietary firmware to work. It offers a lot more features than wl and, in my experience, is also a lot faster. It can have some issues with new cards, but it should generally work.
  3. b43-legacy is a driver for older BCM43xx cards that don’t work with b43; it’s also free-as-in-freedom, but requires proprietary firmware.

Using this information and the table above, pick one of the drivers and skip to the relevant section…

Installing the Broadcom STA (wl) driver
Ubuntu: you’ll need to download the following packages (choose your Ubuntu release, architecture and mirror): dkms, patch, fakeroot and bcmwl-kernel-source.
After you’ve downloaded the .deb files, use a USB flashdrive or some other means of file transfer to get them on the computer you want to install to. Then, just double-clicking each file should bring up Ubuntu Software Center and let you install it.
Then just navigate to System > Administration > Additional Drivers (or Hardware Drivers for older releases) and activate the Broadcom STA driver.
Check out this page for more information about online installation, but please note that the offline installation instructions are pretty much outdated for wl.
Important note: if this fails, use Keryx (0.92, not 1.0) to do an offline upgrade and install the bcmwl-kernel-source package. An up-to-date Keryx tutorial is on my to-do list.
Other distributions: you can compile the STA driver yourself. 32-bit .tar.gz, 64-bit .tar.gz, readme. The readme explains how to compile the drivers pretty well, so I’m not going to do that here.

Installing the b43 driver (non-LP/PHY cards)
If your card’s PCI ID is 14e4:4315 (BCM4312 chip), you should use the instructions a little further down, since it’s a LP/PHY card.
Get b43-fwcutter: for Ubuntu, download and install b43-fwcutter (pick your version and architecture; direct link for the impatient). I believe it’s installed by default with openSUSE and Fedora, and possibly others. If your distribution doesn’t have it, download the tarball and compile it using the following commands (I recommend you only do this if you have some experience with the Linux shell):
tar xjf b43-fwcutter-013.tar.bz2
cd b43-fwcutter-013
cd ..

Unload the module: run this command: sudo modprobe -rv b43 ssb (or su -c "modprobe -rv b43 ssb" if you don’t have sudo installed or usable).
Get the firmware: you’ll need to download this package. Then open a Terminal, cd to where you downloaded it and run the following commands (substitute b43-fwcutter with the actual path to the b43-fwcutter executable if you compiled it yourself):
tar xjf broadcom-wl-
cd broadcom-wl-
sudo b43-fwcutter -w /lib/firmware wl_apsta_mimo.o

If you don’t have sudo installed or usable (just su), use this command instead:
su -c "b43-fwcutter -w /lib/firmware wl_apsta_mimo.o"
Finish up: I suggest you restart. You can probably get around with using sudo modprobe -v b43 on some distros (I usually do that on Ubuntu), but please, please, don’t ever run that command on openSUSE, you’ll just completely mess your system up and yell at me. On second thought, please just restart after installing.

Installing the b43 driver with LP/PHY firmware
This seems to only be relevant for BCM4312, which happens to be the card I have. First, you’ll need b43-fwcutter, which you can get using the instructions above. Then, get the correct firmware package and use these commands to install it:
sudo modprobe -rv b43 ssb
tar xjf broadcom-wl-
cd broadcom-wl-
sudo b43-fwcutter -w /lib/firmware wl_apsta.o

As usual, change sudo to su -c and put the rest in quotes if you don’t have sudo.
To finish up, restart your system.

Installing the b43legacy driver
Again, get b43-fwcutter as described above, then download this package and use the following command to install it:
sudo ./b43-fwcutter-013/b43-fwcutter -w /lib/firmware wl_apsta-
I don’t own any b43legacy-compatible card, so I’m not sure whether you need to unload the b43legacy module (using sudo modprobe -rv b43legacy before you install the firmware. I’d say you should do it, just to be sure, then restart after installing the firmware.


The Beginner’s Guide to Linux Disk Utilities

Knowing how to check the condition of your hard disk is useful to determine when to replace your hard disk. In today’s article, we will show you some Linux disk utilities to diagnose the health of your hard disk.

Image by Scoobay

S.M.A.R.T System

Most modern ATA and SCSI hard disks have a Self-Monitoring, Analysis, and Reporting Technology (SMART) system. SMART hard disks internally monitor their own health and performance.

The SMART tool assesses the condition of your hard disk based on: the throughput of the hard disk, the seek errors rate of the magnetic heads, and other attributes that your hard disk manufacturer built into their hard disk.

Most implementations of SMART systems allow users to perform self-tests to monitor the performance and reliability of their hard disks. The simplest way to perform a SMART system test with Ubuntu is using the ‘Disk Utility’ under the ‘System’ > ‘Administration’ menu.

The disk utility lets you see the model, serial number, firmware, and the overall health assessment of the hard disk, as well as whether a SMART system is enabled on the hard disk.

The ‘SMART data’ button lets you see the SMART features of your hard disk.

The ‘Run Self-test’ button lets you initiate a short,extended, or a conveyance self-test on the hard disk.

When you execute these tests, you’ll see a progress meter, letting you see how far through the test is and what the estimated time of completion is.

The ‘Attributed section’ lets you see the errors and self-test information.

File System Check

There some other tools, beside the Disk Utility GUI, that we can use to diagnose the health of our hard disk. The File System Check (FSCK), that only comes as a command line tool, is one of the tools that we often use to check the condition of our hard disk.

You can use the ‘Check Filesystem’ feature of the ‘Disk Utility’ to perform the same check,if you are not a command line geek like us.

Of course, there are some situations where we have to use the command line tool to check our file system. For example when we are using a headless system, when our Linux box fails to boot, or when we simply want to show off our command line Kungfu skills to our friends.

At first, the FSCK command line tool looks like something that only a computer geek can handle; But you will find that FSCK is a very easy tool to use. There is one thing to note before you run FSCK; You need to unmount the file system using the ‘umount’ command. Fixing a mounted file system with FSCK could end up creating more damage than the original problem.

sudo umount /dev/sdb

The FSCK command is pretty straightforward:

sudo fsck -t ext4 /dev/sdb 

This command checks an ext4 file system (/dev/sdb) for inconsistencies. You should replace /dev/sdb with your own partition. You can run the ‘fdisk’ command to find out your system partitions:

sudo fdisk -l

Scheduled File System Checks

If you’re using Ubuntu, you will notice that Ubuntu runs an FSCK session when you boot your system from time to time. If you find this scheduled check annoying, you can re-schedule the scan using the ‘tune2fs’ command. Here’s how it typically looks like:

The mount count parameter tells us that Ubuntu scans our hard disk after 33 disk mounts.

We can configure the mount count using the ‘-c’ option:

sudo tune2fs -c 35 /dev/sda1

This command will re-configure Ubuntu to scan our hard disk after 35 hard disk mounts when the system boots.

Note: change ‘/dev/sda1/’ with your own partition

Bad Blocks

A bad sector is a sector on a computer’s disk drive that cannot be used due to permanent damage (or an OS inability to successfully access it), such as physical damage to the disk surface.

There are two ways to detect bad sectors in Linux: you can use the Disk Utility GUI, or if you are a command line geek like us, you can use the badblocks command to check your hard disk for bad sectors:

sudo badblocks -v /dev/sdb1

Badblock will give us the number of bad sectors in our hard disk.

zainul@zainul-laptop:~$ sudo badblocks -v /dev/sdb1
Checking blocks 0 to 97683200
Checking for bad blocks (read-only test): 3134528 done, 3:27 elapsed
3134560 done, 8:33 elapsed
3134561 done, 10:15 elapsed
3134562 done, 11:57 elapsed
3134563 done, 13:39 elapsed
Pass completed, 5 bad blocks found.

You have two options when you see bad blocks. You can either look for a new hard disk, or mark these bad blocks as unusable hard disk sectors. This involves two steps:

First we have to write the location of the bad sectors into a flat file.

sudo badblocks /dev/sdb > /home/zainul/bad-blocks

After that, we need to feed the flat file into the FSCK command to mark these bad sectors as ‘unusable’ sectors.

sudo fsck -l bad-blocks /dev/sdb

FSCK, Badblocks, and Disk Utility are some of the disk utilities that we often use to scan our hard disks. Do share with the other fellow readers if you know other Linux disk utilities to scan hard disks.

LibreCAD: open source 2D CAD software

LibreCAD is a free open source 2D CAD drawing software, formerly known as CADuntu. It’s based on the community edition of QCad ported to Qt4 and works natively on OSX, Windows and Linux. And it can easily be installed in Ubuntu, getting a PPA for Lucid, Maverick and Natty.
LibreCAD: open source 2D CAD software
Install LibreCAD in Ubuntu:

For Ubuntu 10.04:

sudo add-apt-repository ppa:showard314/librecad
sudo apt-get update
sudo apt-get install librecad

For Ubuntu 10.10 and 11.04:

sudo add-apt-repository ppa:showard314/ppa
sudo apt-get update
sudo apt-get install librecad

Searching filesystem from command line

There are several commands available on the command line to locate files and folders on the file system. This article reviews three of them, viz whereis ,locate. find.

1) whereis
This command can search for  the binary, source, and manual page files for a comand

$ whereis  whereis
whereis: /usr/bin/whereis /usr/share/man/man1/whereis.1.gz

2) locate:   locate uses a database created by an updatedb to efficiently locate files. Works great, assuming your database is updated often enough to be reasonable upto date. Most boxes using locate have the updatedb occuring in cron.  On my ubuntu box, I got a long list of files when I tried to locate  command.   RTFM locate

$locate locate

3)  find: find is perhaps one of the most powerful commands there is.   However, find is slow compared to locate as it  recursively search the paths supplied to  it.

The syntax of find is specified like this.

find path-list expression

It may look rather cryptic. 
Even though the man page lists only three  parts for the command as above, 
for simplicity  we can imagine  that  find  syntax  is havng  four fields.               
1 2 3 4
find starting point find which files action on result

You can formulate your find command based on the above table. For example,
if you want to find all  avi files in a folder named movies

1 2 3 4
find movies -name “*.avi” -print
$find  movies   -name "*.avi"  -print

Here are some examples you can try

a) to find all directories on the system whose permissions of 777

$        find / \( -type d -a -perm -777 \)     -print

b) find all core files in home directories and remove them

$         find /home -name core -exec rm {}     \;


c) find all files owned by a particular user no matter whose home directory they are in:

$       find /home -user      -print

d) find all files that have been modified (or had their modification time changed) in the last 30 days:

$      find / -mtime -30 -print

e) find all tmp files older than 30 days and remove

$ find /dirpath \( -name \*.tmp -a -mtime     +30 \) -exec rm {} \;

The man page of find has several other option that you can try.

Overview of Xrandr

I bought a new monitor at home and added a second monitor in the office, so I had a lot to do with the graphics of my Linux setup. What do you use in these cases? My preferred tool for all these operations is certainly xrandr.

In particular I’m used to use it from the command line version and after doing some tests using the syntax that i’ve found in the startup of the graphic environment.

In this article we will see some common use case.

The X Resize, Rotate and Reflect Extension (RandR) allows clients to dynamically change X screens, so as to resize, rotate and reflect the root window of a screen. The initial X11 design did not anticipate the need for dynamic resizing and it was necessary to restart the X server to bring about the changes. However, changing the screen resolution on the fly without changing the desktop size had been available under XFree86 since the beginning. RandR extension framework brought the ability to change display characteristics without restarting the X session. The extension framework allows laptops and handheld computers to change their screen size to drive external monitors at different resolutions than their built in screens.

If one’s desktop environment doesn’t provide a graphical tool for interfacing with this functionality, the xrandr command line tool may be used.

Most Linux distributions have the xrandr package in their repository, so you can install it using your package manager for ubuntu:

aptitude install libxrandr2


First check what version you are using:

#xrandr -v
xrandr program version       1.3.3
Server reports RandR version 1.3

In my example I will always use the version 1.3, some features may not work on former version.


To find out what monitors are connected you can use the query command with the following:

#xrandr -q
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 4096 x 4096
VGA-0 connected 1440x900+0+0 (normal left inverted right x axis y axis) 476mm x 268mm
   1920x1080      60.0 +
   1600x1200      65.0     60.0
   1680x1050      69.9     60.0
   1600x1024      60.2
   1400x1050      74.8     70.0     60.0     60.0
   1280x1024      75.0     60.0
   1440x900       75.0*    59.9
   1280x960       60.0
   1360x768       60.0     59.8
   1280x800       74.9     59.8
   1152x864       75.0     75.0     70.0     60.0
   1280x768       74.9     59.9
   1024x768       75.1     75.0     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   848x480        60.0
   640x480        72.8     75.0     72.8     75.0     66.7     60.0     59.9     59.9
   720x400        70.1
DVI-0 connected 1440x900+0+0 (normal left inverted right x axis y axis) 476mm x 268mm
   1920x1080      60.0 +
   1600x1200      65.0     60.0
   1680x1050      69.9     60.0
   1600x1024      60.2
   1400x1050      74.8     70.0     60.0     60.0
   1280x1024      75.0     60.0
   1440x900       75.0*    59.9
   1280x960       60.0
   1360x768       60.0     59.8
   1280x800       74.9     59.8
   1152x864       75.0     75.0     70.0     60.0
   1280x768       74.9     59.9
   1024x768       75.1     75.0     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   848x480        60.0
   640x480        72.8     75.0     72.8     75.0     66.7     60.0     59.9     59.9
   720x400        70.1
LVDS connected (normal left inverted right x axis y axis)
   1024x768       60.0 +   60.0
   1360x768       59.8
   800x600        60.3     59.9
   848x480        59.7
   720x480        59.7
   640x480        59.9     59.4
S-video disconnected (normal left inverted right x axis y axis)

In my output you can see that I connected both VGA and DVI (I am still doing tests with my new monitor) and that LVDS (laptop screen) is switched off and the S-video is not connected.

You can also see that with this simple command you can see all the resolution and refresh rate supported by the screens.

Basic use with screens

The basic use to give command to screens is xrandr --output SCREEN COMANDO, so for example to turn off the VGA screen you can use:

xrandr --output VGA-0 --off

Turning off an output media is useful sometimes, for example i’ve at work a screen with resolution 1600×1200 while my laptop screen is 1680×1050, i use the laptop in a docking station with the lid closed so turning off LVDS help in getting a good resolution on the screen.

Change the resolution of a screen

To change resolution size, you can use xrandr and the –mode option:

xrandr --output DVI-0 --mode 1440x900 --refresh 75

With this command you’ll switch your DVI screen at 1440×900 resolution and with a refresh rate of 75.

Cloning a screen

Assumed to attach a VGA output to your laptop and you want to clone your main screen, so what appears on the laptop screen is also shown on the external screen, nothing more easy with xrandr:

 xrandr --output LVDS --auto --output VGA --auto --same-as LVDS

In general use $ xrandr -q to discover the appropriate output names for your configuration. The –auto option will select the preferred resolution for each output, this is identified with a plus (+) in the $ xrandr -q listing and is normally the best resolution available.

2 screen side by side

it’s possible to create a virtual desktop putting 2 screen side by side, it is possible to set screen locations as –left-of, –right-of, –above and –below. Assuming displays sizes of the LVDS 1024×768 and the VGA 1200×1600 you can use one of these 2 commands:

$  xrandr --output LVDS --auto --output VGA --auto --right-of LVDS
$  xrandr --output LVDS --mode 1024x768 --pos 0x0 --output VGA  --mode 1600x1200 --pos 1024x0

They will give the same result, so i suggest using the first version, –right-of it’s much more easy to rembember and to use.

Automate it on login

You can automate your xrandr operation putting them in the directory /etc/X11/Xsession.d/, so for example you could add a file: /etc/X11/Xsession.d/45custom_xrandr-settings

# If an external monitor is connected, place it with xrandr
# External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
# EXTERNAL_LOCATION may be one of: left, right, above, or below
               EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
               EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
               EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
    xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION
    # Alternative command in case of trouble:
    # (sleep 2; xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION) &
    xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off


Several graphical frontends are available for xrandr (all using GTK):

  • Grandr
  • URandR
  • ARandR
  • Zarfy — A GUI to libxrandr. It presents the user with visual representaion of active displays on an interactive map of the screen memory. Features free postioning, configuration saving, scripting for R&R and an alternate gui for switching between monitors.

How to password-protect GRUB

Password-protecting the bootloader is one method you may employ to enhance the physical security profile of your computer. GRUB, the GRand Unified Bootloader, is the default bootloader on virtually all Linux distributions, but on a significant number, the installer does not have support for setting a GRUB password. This article presents the step involved in password-enabling GRUB – on a running system.

Before we go through the steps involved in setting a password for GRUB, it’s best to understand why this is even necessary. Principally, we password-enable GRUB to:

  1. Prevent Access To Single User Mode — If an attacker can boot into single user mode, he becomes the root user.
  2. Prevent Access To the GRUB Console — If the machine uses GRUB as its boot loader, an attacker can use the edit the command’s interface to change its configuration or to gather information using the cat command.

If your distribution’s installer has support for setting a GRUB password, the process involved should be similar to the one shown in the image below, which was taken from a similar Fedora 13 tutorial. Just check “Use a boot loader password” and the installer will prompt for a password.

GRUB password

Specifying boot loader password

If your distribution’s installer does not have support for setting a password for GRUB, you can still do it after installation. The process involved in this exercise is the same across distributions. However, for this article, an installation of Fedora 13 was used. Here are the steps involved:

  1. From a shell terminal, run the grub-md5-crypt command. The password that’s requested will be the one that’ll be used to protect GRUB. It should not be the same as that of any user account on the system, certainly not the same as the root password. Note the md5 hash generated. You will need it in the next step.

    GRUB hashGenerate the md5 hash for password-protecting GRUB

  2. Edit /etc/grub.conf as shown in the image. Just add another line below the “timeout” line and type in password –md5 (md5 hash generated from step 1) as shown in the image. Save the file. Reboot and try to access other features of GRUB by pressing the “p” key. Did it work?


  3. Edit grub.conf

Complete this simple process, and you would have taken a small but significant towards enhancing the physical security profile of your computer