Thursday 17 September 2009

Wireless printing with HP Photosmart C4580

C4580 Wireless printer setup

I recently bought an HP Photosmart C4580 All-in-one printer, encouraged by HP's level of support for open source.

First step was to download and install the latest HPLIP drivers from http://hplipopensource.com  then run hp-setup to install the printer. It worked perfectly connected over USB, but I really wanted wireless to work. No joy. hp-setup wouldn't see the printer to set up wirelessly.

Finally at about 10:30 on a Saturday night I went onto the hp website and registered my problem, thinking if I got a response in the next two weeks I'd be in good shape. Next morning a reply was waiting for me. And even better, it worked! the C4580 now prints wirelessly - brilliant bit of kit. See here: https://answers.launchpad.net/hplip/+question/82615

In essence, the C4580 isn't officially supported over wireless, though I confess I'm a bit confused as I've found other posts on the web that say it is. To allow hp-setup to configure it you need to change the wireless support setting in the config for the driver..

> sudo gedit /usr/share/hplip/data/models/models.dat

Then search for the section [photosmart_c4500_series]
in that section, change wifi-config=0 to wifi-config=1

re-run hp-setup and this time the printer will be found when you select wireless setup

Haven't mastered the scanner over wireless yet, but stay tuned

Ripping better quality CDs in Ubuntu


No, I don't mean only recording classical music...

I use sound juicer to rip my CDs into Ogg Vorbis format.

> sudo apt-get install sound-juicer

However, I'm a bit fussy how I wanted to record them - the default bitrate is 160kbps and I wanted a tad more detail


To create a profile that will record at higher quality, go into Sound Juicer and select Edit..Preferences. 
At the bottom of the dialog there's an Output format. It's probably showing "CD Quality, lossy (.ogg type)". And a button marked "Edit profiles". Click that. 

Select the "CD Quality, lossy" profile and click Edit. Copy the GStreamer pipeline value, as this is what you're going to modify in your new profile. Mine was this:
audio/x-raw-float,rate=44100,channels=2 ! vorbisenc name=enc quality=0.5 ! oggmux

See the quality setting of 0.5?The quality setting is a value from 0.1 .. 1. 0.5 represents a bitrate of 160kbps. I wanted 192kbps, which is 0.6. So back in the Edit GNOME Audio Profiles dialog, cick New and enter this line for the GStreamer pipeline:
audio/x-raw-float,rate=44100,channels=2 ! vorbisenc name=enc quality=0.6 ! oggmux
and call the profile "CD Quality, better"

Tuesday 15 September 2009

Mounting a NAS drive share

I have a Maxtor NAS drive on my home network which is a convenient place to store my photos and music. After moving onto Ubuntu one of the first things I wanted to do was get this connected.

Before starting this, make sure winbind is installed and working. See my earlier ping by name post.

As an initial test I tried using the file manager, just to make sure that there weren't any other problems lurking.
Accessing my NAS drive using the file manager in gnome is convenient, but not very easy for applications to access the files, and I'd have to remember each time I logged in. I wanted to mount the NAS as part of the filesystem. I found this article on google:
http://justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html

Creating a mount point by hand
first of all, I create a directory in the /mnt folder to act as the mount point. You could create this anywhere, including in your home folder, but I found that actions like searching in my home area would take ages as it would also try to search the network drive. Same goes for archiving my documents - so I went for the more standard /mnt option instead
> cd /mnt
> sudo mkdir maxtor01-phil

then use smbmount to mount the share on the folder
> smbmount //maxtor01/Phil /mnt/maxtor01-phil -o username=myusername,password=mypassword

things to note:
myusername and mypassword are the username and password for the NAS share, not your ubuntu login
the comma between the parameters must have no spaces around it
If you havent set up winbind, it probably wont resolve the sharename but you could test by substituting the IP address of the drive. See my earlier
ping by name post on how to fix this.

Making the mount permanent
create a file in the home directory called .smbpasswd - this will hold the logon credentials in a secure way
> cd
> echo username=myusername > .smbpasswd
> echo password=mypassword >> .smbpasswd
> chmod 600 .smbpasswd

chmod 600 means only root will have access

next add the mount lines to /etc/fstab (obviously change the share names)
# maxtor01 NAS drive
//maxtor01/Phil /mnt/maxtor01-phil smbfs credentials=/root/.smbpasswd,uid=phil 0 0

now every time I connect to my home network, the remote shares are automatically mounted.

can't ping devices by hostname, only IP

I've got a few devices on my home network, including a Maxtor NAS drive. After installing Ubuntu and connecting to the network I found I could ping the IP address of the NAS but not its name.
To resolve devicenames on the network, you need to install winbind via package manager, which adds the winbind service allowing resolution of user and group information from Windows network devices (including my Maxtor NAS drive)

I found this article with a spot of googling, which put me on the right track.
http://forums.whirlpool.net.au/forum-replies-archive.cfm/928521.htm

to install winbind:
> sudo apt-get install winbind

next, you need to add the service to the /etc/nsswitch.conf file:
> sudo gedit /etc/nsswitch.conf

find the hosts line (mine looked like this)
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

and I added wins. Initially I added it at the end, which didn't work.
Then I added it before the [NOTFOUND ] clause. It worked. And also stopped Firefox from accessing external websites...
Finally, this order seems to work:
hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4

...and voila. ping device now works!

References
http://forums.whirlpool.net.au/forum-replies-archive.cfm/928521.htm
http://www.softpanorama.org/Solaris/Reference/etc/nsswitch.shtml

Monday 10 August 2009

Installing ubuntu

So I took the plunge... I have an old IBM laptop that positively wheezes and emits bouts of steam whilst running Windows... and am I the only person that imagines their PC get slower every time they use it, and can't figure out why?

I work with IT types, and used to be one myself in my dim and distant past. But don't get much time to do that sort of thing these days. So I was resigned to hammering the credit card and buying a new machine.

This was September last year, just about when the new NetBooks started appearing. I glanced at a couple over people's shoulders, frankly I was a bit surprised at how easy they were to use, and asked what was running on them. Ubuntu. Never heard of it.

A couple of days googling later and I'm now intrigued. So cut to the chase. I set myself a target of a month to go cold turkey on Windows, and see just how usable Ubuntu was for average home use. I remember the Linux installs of old, and they would be trials of epic proportions, with an above-average chance of frying some bit of your hardware if you got a setting wrong, and a pretty thorough knowledge of unix internals needed.
My ultimate goal was to pass the wife-test, and see if the spouse could also use it without complaint. And I don't have the stomach to teach her vi ...

**Sensible Note** I bought a new HDD because I didn't want to put my old data at risk, and my backup strategy at this point was erratic at best. Heartily advise it if you have a go, you end up with a much bigger HDD, and frankly, if I'd installed dual boot I'd have always found an excuse to launch Windows and that was not really the point.

Now, I'll cut out the two installs I did to learn about good and bad practice, and refer you to this page which I found really helpful: http://beginlinux.com/desktop_training/ubuntu/1073-ubuntu-intrepid-ibex-install

You could achieve the same end in Windows using different drive letters and the TweakUI gadget, but it was painful and prone to fouling up. Now if I decide to upgrade or reinstall ubuntu, the home area is safely tucked away. Similarly, if I decide to buy a separate disk to hold my massive antique etchings scans (bear with me on this) I can repoint the home area to this new disk and hey presto...

So far so good, a couple of hours effort and I have a basic build running. Wi-Fi works pretty much out of the box and looks like Windows. Firefox (always my preferred browser) works, so I could just stop here and claim success :-)

I have a way to go though, it won't see my NAS drive, I can't ping anything by its name, and I'm stuck with the web interface for email. But not bad for my first attempt I thought.

Wednesday 29 July 2009

What am I doing???

Good question. I'm not an IT expert any more, although I have a degree in Comp Sci and in my dim and distant past used to get paid to write code.

Now I get paid to tell people to write code, I've got two kids, a mortgage, grey hair, no time and there's always something more important I should be doing...

But one day last year I was chatting to some friends who'd got themselves Netbooks, and reminiscing about the last time I tried to install Linux on my PC (circa 1995, Suse install, came on 9 CDs and took several days to get beyond the taunt of the flashing cursor). And found out about ubuntu.

I was persuaded by the look and feel of the gui, and the massive leaps in the applications that I could use. I decided to get my feet wet again. I gave myself a month to turn my home laptop into ubuntu and not weaken by adding a dual boot option. It was the penguin or nothing.

I got a really big surprise. The first evening I was surfing the web after a very brief install, after three evenings I'd pretty much got everything I needed configured, and I haven't looked back since. What helped me most was blogs, chats and articles that described problems I hit and (most of the time) straightforward solutions.

One year in, and it passed the ultimate test. When my wife's trusty XP machine finally croaked after five years of continuous use, she grudgingly let me build the new laptop with ubuntu as well. She's still speaking to me so I'm quietly confident...

I've kept various notes along the way when I wanted to set something up. I got a lot of benefit from other bloggers who helped me, so I plan to publish these and hopefully help the next soul who wants to give it a go. To misquote Newton - "If I have seen farther, then it is by standing on the shoulders of giants".