I run Ubuntu on a Toshiba laptop. As I have stated in the past, I am pretty much done with desktops and going strictly with laptops (see previous entries here). But sometimes the wireless card does not work. The message is that the wireless card is “disabled by hardware switch”.
I did some searching, and here is a solution that I found that worked.
First as root, I ran the command
rfkill unblock all
Then I pressed the FN-F8 key combination (function key and the F8 key, or whichever one has the wireless icon).