Saturday, 23 April 2011

How to access CIFS shares from a user account on Ubuntu Lucid

A friend of mine has a Samba server which I set up for him. His problem was that although he could see the shares from the file browser using Connect to Server, they were not accessible from Thunderbird for attaching to emails, etc. and he had to do a copy to a local directory first.


I did a search and found tips involving setting up fstab. This was not satisfactory because the machine was a notebook and the server would not be accessible while on the road. Tips involving autofs and automount were also not satisfactory because of the complicated setup.


I figured that since the file browser could see the share, it must be mounted somewhere. The output of mount showed that it was mounted on $HOME/.gvfs. The problem is that theThunderbird file selector does not display dotfiles. Other programs may have a similar restriction. My solution was this:


ln -s .gvfs GVFS


I then instructed him to look for his share under GVFS. Actually Thunderbird can navigate to dotfiles, you have to click on the Type a file name icon at the top left and type in .gvfs, but I figured that this was much easier for the user.


If you make a bookmark in the file browser and also tell it to remember the credentials for the connection, it should be one-click to mount. I think this should work for the other types of mounts that the file browser can do, e.g. FTP.

Saturday, 19 February 2011

Cassette sales in 2010 in Australia

From a newspaper report on music sales in 2010 in Australia. This is amazing, they should find the seller and buyer and congratulate them for making an interesting statistic. Exactly 3, wow!

Sunday, 17 October 2010

Retarded industrial designer

I would like very much to torture the designer of the Compaq NC6000 notebook computer. I had one with a dead Real Time Clock cell and it took me a couple of hours, following instructions, to access the cell, which is deep inside the machine, in fact stuck underneath the body top cover. You end up even having to remove the CPU heatsink to lift that cover.


Do designers believe that these cells (CR2016 or CR2032) never die? This is not the first laptop I encountered that had a difficult to access RTC cell. I feel it's a conspiracy to create work for computer technicians.


If you are unlucky to have the same symptoms (computer will not remember time), search on the Internet for the NC6000 service manual which has disassembly instructions. The cell I removed had solder tags. I simply peeled off the tags and sticky taped them on a new cell. Hopefully it will last until the laptop becomes obsolescent.

Thursday, 14 October 2010

A look at Lubuntu 10.10

This review is far in the past so out of date as Lubuntu has advanced a lot, but I'm leaving it here for posterity.

 I'm always interested in lightweight distros for older machines. A while back I looked at Lubuntu 10.04. Lubuntu 10.10 came out recently so I decided to see if the issues I mentioned were fixed.

I burnt the image to a CD-RW and booted an old Celeron 400MHz with 256MB RAM with it.

On the standard Ubuntu splash screen I see there is now an option to install right away, so I picked that. However the machine then churned away for many minutes. Finally I got a desktop with an Install icon. Silly me, I thought that if I picked Install to Disk it would not waste time setting up a desktop but go straight into the installer like Ubuntu does.

I clicked on the Install icon and after a long wait with more CD reading it said that Ubiquity had crashed. I must have clicked several times in succession because one of the attempts did bring up the first stage of the install dialog, but that didn't last long and crashed too.

Ok, maybe I should try it in a VirtualBox VM. Again, assign the same amount of RAM, 256MB, to the VM.

The first try I used the host CD drive. It eventually brought up the desktop with the Install icon, but the desktop was unresponsive, showing a wristwatch wait icon. I noticed that it was doing a lot of probing on the USB port. Why?

The second try I copied the ISO image to the disk and booted from that. This one also brought up the desktop and then Ubiquity crashed again. Again there was a lot of activity on the USB port. What was it doing?

At this point, I decided that this was all a waste of time. Sorry, I cannot recommend Lubuntu 10.10. if anything it's a regression from 10.04. Maybe I don't have enough RAM, but other LXDE distros installed fine with that much RAM. If you want a LXDE desktop, I recommend Mint 9 LXDE or Debian 5 LXDE both of which installed fully on that Celeron.

Wednesday, 19 May 2010

Setting up SSL for MySQL server

I needed to set up SSL for MySQL on RHEL because the remote backup solution I chose, MySQL-zrm requires secure connections.


Most of the information about creating self-signed certificates and keys is here on this page. You can use the script in example 2, but I discovered a couple of things:


First, the script creates both server and client certs and keys. You only need to do one or the other, not both, to have secure connections. The advantage of client certs and keys is that you can use them in GRANT statements. I chose to have only server certs and keys. So I truncated the script after the commands related to the server.


Secondly, you might want add the option -days N, where N is the number of days of validity, to the openssl req and ca commands, to suit your needs.


Finally, you need to edit the source argument in the cp command to the actual location of the template openssl.cnf on your system. For my RHEL system, it is /etc/pki/tls/openssl.cnf. For RHEL 6, you also need to edit the replace command because the CA directory in openssl.cnf has changed from ./demoCA to /etc/pki/CA.


Put the script in a directory say /etc/mysql, and run it from the directory with ./mkcert.sh. It will create a subdirectory openssl for the results. You will be prompted twice for cert attributes, once for the CA and once for the server cert.


When you have finished, add these lines to /etc/my.cnf in the mysqld section:

ssl-ca=/etc/mysql/openssl/ca-cert.pem
ssl-cert=/etc/mysql/openssl/server-cert.pem
ssl-key=/etc/mysql/openssl/server-key.pem


You should chown, chmod and chcon (SELinux) the contents of /etc/mysql for security. I did:

chown -R mysql:mysql /etc/mysql
chmod -R g-w,o= /etc/mysql
chcon -R -u system_u -r object_r -t mysqld_etc_t /etc/mysql

Then restart the mysql service and look in /var/log/mysqld.log for any errors re the certs. If no errors,  you can check if SSL is available with mysql:

mysql> show variables like '%ssl%';

Answer for have_ssl should be YES. If not, check the file paths.


If you need to start all over, it suffices to delete the directory /etc/mysql/openssl.


Friday, 7 May 2010

Lubuntu: promising start but needs work

This review is far in the past so out of date as Lubuntu has advanced a lot, but I'm leaving it here for posterity.

Lubuntu has joined the *buntu stable of distros and is supposed to be able to use lower spec machines. I have experience with other LXDE based distros like Mint-LXDE and openSUSE-LXDE, and Crunchbang, which isn't actually LXDE but uses openbox. That last I've found quite good on low-memory netbooks. I decided to give Lubuntu a go.

My test hardware was a 400MHz Celeron with 256MB RAM, 6GB hard disk and a 1024x768 screen. I burned a CD-RW and booted with it. It brings up the familiar splash screen and a language chooser on top of it. I picked Install to hard disk right away since I wanted to see what it was like booting for real from a hard disk. First problem, various text error messages to the screen. Second problem, this one serious, it took ages reading the CD to start up a live GUI session with an icon to do the install. That's kind of self-defeating. If you have a low-resource machine, you don't want the user grow much older waiting for the installer to start. Why not go straight into a minimal X installer? The live installer went through the standard 7-step Ubuntu setup rather sluggishly but finished fine. On rebooting from the hard disk it came up with an openbox desktop which worked ok, considering the speed of the CPU. I note that Chromium is the promoted browser. RAM footprint wasn't too bad, free showed something like 128MB actually used.

Overall it feels like it was rushed out to take advantage of 10.04 LTS release publicity. Note, Lubuntu 10.04 is not a LTS release. So a pass for Lubuntu 10.04 from me, but "can do better" next term.

Monday, 19 April 2010

It's the wireless switch, stupid

A friend of mine asked to see why a HP Mini 5101 netbook with Ubuntu Karmic on it wouldn't connect to a WiFi AP. As far as I could see the best advice was to install bcmwl-kernel-source, which contains a non-GPLed driver and has to be compiled into a non-free kernel module. But I could not get it to see any APs.


Since the release of Ubuntu Lucid is imminent, I suggested trying Lucid Beta2 on it and then installing the official release after April 29. It would provide a netbook remix and LTS install too. (The Karmic install was a vanilla desktop install, not the best use of the small screen.) Installing off a USB memory stick was painless and fast. I connected it up to a wired network and did:



apt-get install bcmwl-kernel-source



That did all the setup required. But it still wouldn't connect to any APs. Wait a moment, I thought, how do I know if the RF transceiver is turned on or not? I remembered that many notebooks come with a RF kill switch. An examination of the keyboard showed no such function key. Time to do an Internet search. Sure enough, there is a RF kill switch, and it's on the front edge. See the first picture in this photo review. If the RF is on, the LED glows blue.


After flicking the switch on, all the neighbourhood APs were visible in NetworkManager. Duh, that will teach me to at least glance through the manual before installing.


And thank you HP for making a RF kill switch that looks so much like a lid latch. (Sarcasm.)