Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

Friday, January 23, 2009

Firefox always starting in offline mode?

I got a new laptop a little over a month ago and ever since the first day I've had an annoying little problem with Firefox. Whenever it started, it was stuck in "work offline" mode. I checked the user prefs in my .mozilla folder, and they said that I should be fine. (There is a setting for starting the browser offline, but it was set to false.)

As with many minor annoyances that don't actually stop me from getting work done, I mostly left the problem alone and just looked it up on Google every so often to see if I could find a solution. Mostly, I only found other Linux users complaining of the problem, but no one who had actually fixed it. Today I saw a fix that seemed unlikely, but I tried it anyway.

sudo apt-get remove network-manager

I didn't really need Network Manager anyway, since it wasn't recognizing my wireless card and I have to use iwconfig on the command line to bring my wireless connection up. And, whaddya know? It works!

From what I've been able to gather, Firefox asks your computer if you are logged into the network, rather than actually trying to connect to a server and then giving up when it doesn't work. Since the network configuration tool that Firefox was talking to didn't know what was really going on with my network connectivity, it gave false information and Firefox "saved me from a 404" by setting the mode to "work offline". How annoying.

This is one of those places where I have to point out to those who want everything to be automatic that we just aren't there yet. There has to be a way for the human to step in and say, "Wo! You got it wrong!" and what the human says should trump what other computer programs are telling you. In Firefox, that could translate into a setting something like "Ignore network manager connection awareness".

If you are a Linux user with this problem and don't want to manage your network through the Linux command line tools like ifconfig, iwconfig and dhclient, I'm afraid I'm not sure what to tell you. There may be another gui network tool you can use, but I am not familiar with any. So, either you'll have to keep un-checking the "work offline" box when you load Firefox, or else you should start reading man ifconfig, man iwlist, man iwconfig and man dhclient.

Sorry I'm not more helpful today.

Sunday, October 19, 2008

Wireless connection from the command line

If ever you find yourself stuck with a *Nix box that won't boot into any kind of comfy graphical interface, and you need to connect to a wireless internet connection so that you can look stuff up and maybe solve your problem, here's a helpful tip:

There is a wireless networking utility very much like ifconfig called iwconfig. When you have a chance (and preferably before you really need it) check out the man page for it. Here are some quick and dirty instructions, in case you are desperate right now.

To find out what wireless networks are available to you, type
iwconfig wlan0 scan (see comments)
iwlist wlan0 scan

To attach to an open, non-encrypted network, type
iwconfig wlan0 essid netname
where netname is the essid of the network you want to connect to.

If you only have encrypted networks available, you might be in a bit more trouble. I haven't actually managed to get that working at all yet, though theoretically, it should work something like this:
iwconfig wlan0 key s:password
iwconfig wlan0 essid netname

where password is your password and netname is the essid of the network you want. The s: means that the password is in string format. If you know the hex version of your password, then instead of saying s:password you'd just type in the hex of the password like this:
iwconfig wlan0 key 0123-4567-89

Good luck getting your GUI fixed!

Wednesday, July 2, 2008

Finding a host I couldn't see

Last week I finally broke down and asked IT if they would mind if I switched over to a Linux desktop for my daily development work. Functioning in Windows was driving me absolutely bonkers. He wasn't so sure about it at first. He suggested that I run Windows and then have Linux running in virtualization. That just seemed like a waste of resources to me, though. So, I suggested that I set the computer up for dual boot, and if things went badly I could always go back to Windows.

The IT guy's concern was that, while I might be able to do my programming in Linux, I might not have access to all the company shares, the exchange server for mail, and all that other Windows-based stuff sitting on the company network. And he was right to be concerned. In the past, all those things have been a major pain in the backside to fix.

The good news is that Samba, the tool that lets you hook up Linux or Unix machines to a Windows network, has come a very long way, and the whole thing turned out to be pathetically easy. Not only that, but Evolution for mail kicks the proverbial butt, and I was able to get mail, tasks, contacts, and calendar from exchange working perfectly with the Exchange server with just a few button clicks and no sweat at all.

But, then I need to look something up on the company wiki, and that's when I hit trouble. Firefox turned my http://companywiki/ url into http://www.companywiki.com. Woops! I tried a couple of times before it sunk in to my thick skull that the problem was that my computer wasn't recognizing the internal domain names. Clearly I need another Domain Name Server in my list, but the problem is that I don't want to go back to that IT guy just now. He may just tell me it's all Linux's fault, and that I have to switch back. I don't want that. So, I have a work around.

I checked in Windows what the ip address for companywiki is supposed to be, and then, back in Linux, I edited my hosts file to point the name companywiki to that address. Poof! I have normal access to the wiki using the domain name now. Easy peasy.

There are other uses for the hosts file, too. For instance, if I have server settings in a Web application that I'm working on, I can tell my hosts file that those server names are really my computer. My computer will look where the hosts file tells it to look before asking the Domain Name Server for information, so I can test the application without having to change those server name variables in the code.

Linux is not the only system with a hosts file that can let you find servers by a certain name, either. You can find a list of where to find the hosts file on different operating systems at Wikipedia.

Wednesday, October 17, 2007

Fixing Some Little Network Annoyances

To set your IP address for your Ethernet connection and the gateway address for the world outside your local network, run these as root or sudo them...

ifconfig eth0 [ip address]
route add default gw [gateway ip address]