Posts Tagged by Ubuntu

Network access with Exetel HSPA and Antenna

Update November 2012

On Ubuntu Precise (12.04.1) mobile broadband now “just works”. Plug in the device, right click on Network Manager, follow the configuration wizard for “New Mobile Connection”, choose your provider (eg Exetel) and the correct APN will be filled in (exetel1).

Original Article 2009

I got a Huawei HSPA E1762 USB stick a few months ago for 3G network access, together with Exetel’s $5/month Zero Gig plan (uses the Optus network). Great for when I’m out and about and can’t find a wireless signal to jump onto, or I’m at some client who doesn’t allow laptops onto their network. I’ve been using it regularly and still haven’t gone over about 100M usage, so it’s worked out to be very cheap.

Using Network Manager on Ubuntu Jaunty it mostly “just works” – all I needed to do was set the APN to ‘exetel1′. I’ve also bought an antenna for it from The Antenna Shop – gives me better coverage in shadows in the CBD and out in the country. There’s also other bigger antennas available, as well as car antennas.

antenna

antenna

All-in-all a good buy – thanks Dean for the tip.

Addendum

As per Matt’s comment below, Huawei modems currently have problems on Ubuntu Karmic – Problem with Huawei E1762 Mobile Broadband in Karmic, Bug #413989, Bug # 446146.

Also, if you’re ever prompted to enter an “SP CODE” (ie Mac & Windows), enter “BROADBAND”

Golang – setup and producing .debs

Here’s the setup I use for compiling Go binaries, as well as for writing .deb’s to package them and markdown for README’s – notes for me.

Install build pre-requisites:

sudo aptitude install gcc libc6-dev libc6-dev-i386 make \
  markdown build-essential debhelper dh-make fakeroot devscripts

Install Go from source (so can cross-compile). Download from Go Downloads eg go1.0.2.src.tar.gz

sudo tar -C /usr/local -xzf go1.0.2.src.tar.gz ; cd /usr/local/go/src
sudo GOARCH=amd64 ./all.bash ; sudo GOARCH=386 ./all.bash

Add to /etc/profile, source or re-login:

export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$PATH"

Linux, Ubuntu: how to tell if 32 or 64 bit installed

A question I get regularly from other sysadmins – how to tell if you’re running a 32 or 64 bit install (vs CPU) of Linux?

Here’s one way – use the file command on /sbin/init:


# on a 32 bit install
% file /sbin/init
/sbin/init: ELF 32-bit LSB executable....

# on a 64 bit install
% file /sbin/init
/sbin/init: ELF 64-bit LSB shared object, x86-64...

Update

I got a few comments on this (thank you) saying that I was wrong or “haven’t you heard of uname?”…

1. CPU vs Kernel

One comment said I was wrong and should use grep against the cpu info:

$ grep ^flags /proc/cpuinfo | grep lm

Unfortunately the commenter hadn’t read my post correctly – I’m interested in whether the operating system is 32/64 bit, not the cpu.

2. Use uname

Other comments said I should use uname with particular flags (as if I’d never heard of uname before….). Unfortunately the manpage for uname is a good example of manpage considered harmful. Let’s have a look at what it says for the various options:

% man uname
...
-m, --machine
    print the machine hardware name

-p, --processor
    print the processor type or "unknown"

-i, --hardware-platform
    print the hardware platform or "unknown"
...

What is the difference between the “machine hardware name”, the “processor type”, and the “hardware platform”? Googling doesn’t turn up a good explanation. I could look at the source code for uname, or run uname on a machine I which already has known hardware and interpret the results, then work out the flags to use on the target machine. Or I could just rote-memorise uname -m and not know what it means.

Bzzt, fail. I know what the file command does, I use it regularly for cross-compiling stuff.

file /sbin/init is what I use.

ssh – DISPLAY is not set – Failed to allocate internet-domain X11 display socket

A little ssh error I came across while trying to work remotely on an Ubuntu machine. ssh X Display Forwarding wasn’t working, and I was getting an error:

DISPLAY is not set

Digging through /var/log/auth.log, I also noticed this error:

Failed to allocate internet-domain X11 display socket

After much Googling, it seems that IPv6 was causing the problem. It was solved by adding:

AddressFamily inet

to /etc/ssh/sshd_config, and restarting the ssh server.

Ubuntu 10.10 (Maverick Meerkat) Download

Opinions around the latest Ubuntu (11.04) range from “interesting” (as in the curse “may you live in interesting times”) to “it sucks”.

Anyway, there no longer appears to be a link to the previous version (10.10 Maverick) on the main Ubuntu page – marketing droids seem to have finally taken over Ubuntu. It can be downloaded from here.

No rocket science – I just don’t want to have to look for the location in future.

Next Page »