Twitter Updates

    follow me on Twitter

    G-AVLN in front of her home

    G-AVLN in front of her home

    Flying UNIX

    Unix and Linux fly...

    Thursday, June 25, 2009

    Booting from CD/DVD inside VMware guest

    We are now using CentOS 5.2 in VMware. Last time we tried to boot from CentOS 5.2 DVD (to experiment with its rescue image), it flatly refused. I'm still relatively new to using the VM setups, so it took time to sort it out...

    It turned out that there were two issues:

    1 - the accessibility of the CD/DVD from the guest
    2 - the booting sequence in the guest BIOS

    Below are the steps resolving both.

    First enable CD/DVD visibility in the guest:
    1. Power off the guest OS
    2. In "Devices" tab (right-hand side of the screen) select CD/DVD(IDE)
    3a. Tick "Connect at power on" and
    3b. Mark "Use physical drive"
    3c. From the drop-down list select "Auto detect"

    Now fix the BIOS boot sequence (in the guest). Notice that you have to change the focus into the guest screen before you can do anything (CTRL-G)
    1. Power on guest OS
    2. Intercept the boot - hit CTRL-G followed by hit F2 *quickly* - it doesn't hang around for long!
    3. In the BIOS menu, identify the boot sequence screen, and change to place CDROM before the hard disk
    4. Save and continue boot...

    Wednesday, June 10, 2009

    Forcing Solaris 10 to recognise network interface

    Installed six PCs with Solaris 10 (10/08). Only two out of of them installed with correct network configuration. The unfortunate four didn't recognise the card at all, no kernel module included.

    Standard (well, for Solaris) tools like kstat -c net, or dladm show-dev had no network card information ...

    Quite a bit of trial and error later (not forgetting googling), here is a working solution:

    1. Identify the PCI vendor/device information:

    # prtconf -pv | more

    Search for Ethernet paragraph (you can do it within more using /Ethernet) and identify its vendor/device data. On my system, it showed:

    vendor-id 00008086
    device-id 00001050

    The last 4 digits of these two values is what we are after.

    To find out which particular card this is, I googled for "pci8086,1050" and it's "Intel 82562EZ PRO/100 VE Ethernet"

    2. Configure device database

    # vi /boot/solaris/devicedb/master

    Go to the section with pci8086 entries, possibly using vi's search:

    /^pci8086

    Insert the following line (ensure it goes in the proper numerical order of the vendor/device pairing):

    pci8086,1050 pci8086,1050 net pci iprb.bef "Intel 82562EZ PRO/100 VE Ethernet"

    3. Add a new alias to the card

    # vi /etc/driver_aliases

    Search for the iprb related section and insert the following line (in the right alphabetically place):

    iprb "pci8086,1050"

    4. Load the kernel driver module for the interface

    # modload /kernel/drv/iprb

    5. Perform a 'reconfigure' reboot. First initialise the reconfigure flag file, then reboot the machine:

    # touch /reconfigure
    # reboot


    6. After the reboot, 'plumb' the card in and complete the configuration (here, I'm assuming IP address of 192.168.1.100):

    # ifconfig iprb0 plumb
    # ifconfig iprb0 192.168.1.100 up
    # touch /etc/hostname.iprb0

    Make sure that the hosts file under /etc/inet is fine. Mine has the following lines:

    127.0.0.1 localhost localhost.qa.com
    192.168.1.100 yogi yogi.qa.com loghost

    Notice that on Solaris the main /etc/hosts file is a symbolic link to /etc/inet/hosts and in addition it will be replicated (automatically) into /etc/inet/ipnodes as well.

    Tuesday, June 02, 2009

    Time ticket with sudo

    The sudo facility has been available in UNIX for a long time. Often as an add-on, it provides secure and highly configurable mechanism for "delegating" tasks. It is meant to step in where the basic "switch user" command, su, leaves off.

    In the sudo configuration file (/etc/sudoers) we define who can do what on which machines with whose identity. The configuration can be as complex as it is powerful, so a lot of the time administrators start with a basic facility, which specifies that a user can do every command, on every machine as any user:

    fred ALL=(ALL) ALL


    So how does that differ from login as user root in the first place? Well, with sudo you don't disseminate root's password. Users attempting to use the sudo facility will have to authenticate themselves by providing their own password (not the password of the 'target' identity!).

    Once authenticated, the user can continue executing sudo commands for a default timeout (typically 5, 10 or 15 minutes). This timeout is known as the 'time ticket'. Once the time ticket expires, the user will have to provide his/her password again.

    The default for the time ticket is not always appropriate. Depending on the job role, there may be a requirement to extend (or indeed shorten) the time ticket's length.

    To do that, edit the /etc/sudoers file (using visudo tool), and add the line into the Defaults block of instructions (it actually doesn't matter where the line ends up, the suggested location is for clarity reasons only):

    Defaults:fred timestamp_timeout = "X"

    where X stands for the number of minutes you want the time ticket to last.

    If you want for the timetickets to never expire (not really recommended - it defeats the purpose!) replace X with -1.

    You can add a line for each user you want to modify, and you can replace the user name with ALL - meaning.... all users ;-)

    Monday, May 11, 2009

    Changing 'Places' in Gnome panel


    Distros using Gnome have pretty much standardised on the main panel's appearance and content. We get three main drop-down menus: Applications, Places and System.

    Customising Applications and System is straighforward, and quite intuitive (right-click on either of them, choose Edit Menus, and have a play...). However, the same cannot be said for Places. By default, the top part of it gives a direct access to user home directory and their Desktop. But if you want to add another quick-access location, you need to realise that the Places represents a shortcut to the Nautilus Bookmarks.

    So, to modify the list of directories accessible via Places you need to edit file manager's Bookmarks. Open your file manager, select the Places view for the left hand-side pane, then edit it by dropping or deleting directories into it (see the screenshot).

    Wednesday, April 29, 2009

    Test posting from e-mail directly into blog


    Just set up an "email2blog" account, and this is the test of the post.

    Including an attachment picture (Barry flying LN over our garden).

    Thank you http://www.linuxjournal.com/video/blogger-email for the hint !

    Thursday, April 23, 2009

    Fixing MS in VMware keyboard mappings

    When using VMware (host: Linux, guest XP), keyboard mapping are not correct.

    To fix, modify the VMware configuration file, by adding the following directive:

    xkeymap.nokeycodeMap = true

    Add it to the configuration file relevant to your product. If you have VMware server - it's /etc/vmware-server-console/conf.

    For you have Workstation or Player, it's /etc/vmware/config.

    It's been reported (see: http://communities.vmware.com/thread/177321) that the local file, in ~/.vmware/config can be used for the purpose (not tested by me either).

    Open Source Interoperability Initiative from Microsoft

    It's discussed at http://www.microsoft.com/opensource/interop/default.mspx. Great, isn't it?

    I have written before about the current configuration of my main laptop (Dell XPS M1330): I am running Ubuntu 8.10, which is 100% adequate for all my personal needs.

    However, for as part of my work I need to be able to edit Microsoft Office files (all our slides are produced in Power Point). Well, tried using Open Office - it can do just as good a job. However, the niggling and subtle (sometimes very subtle) style and font differences made it so frustrating that I gave up. I was spending far too much time converting between Open Office - Power Point and back.

    That gave rise to the second best solution: install Crossover Office, a product based on Wine, allowing access to MS native applications. Again, this works the treat, at least in principle. Then I bumped into more hiccups, like font colour changing, or various boxes being over sized. In isolation, I would be totally satisfied with the solution, but I need to comply with company's strict branding and design style, and I can't achieve it with this setup (at least not without additional fiddling with the files).

    So, (grudgingly) on to the next solution. I already have a license for VMware Workstation (6.5). I installed XP into it, added MS Office 2003, and thought that I might be able to get some work done, at last. No! MS Office working in VMware does not recognise any of the extended keyboard mappings. Arrow keys, Page Up, Page Down, etc, all either totally dead, or generate VM-associated actions.

    So why is it that I'm wasting all this time just to stay afloat. This is like an engineer having to calibrate his meters or file his screwdrivers before every use.

    Open source is meant to unite. If Microsoft truly opened their code, it would allow other designers to create applications that are workable and provide permanent solutions. Instead, these designers are still having to reverse-engineer, outguess, invent emulators and create work-around fixes. Fixes are never perfect.

    Microsoft are boasting about interoperability: "... agreements between Microsoft and open source distributors. including Novell, Xandros, Linspire, and TurboLinux". That probably explains why my EeePC (Xandros) seems to have more robust drivers, character rendering and application selections, etc. But that is not what commitment to open source should be. If you are selective, you are still prescriptive and closed.

    Unless you find a way of being only a bit pregnant.

    Sunday, April 19, 2009

    Ubuntu training (and Spreed conferencing)

    Canonical have revamped their courses and certification paths. Sounds very sensible - there is so much entry level training, why not concentrate on distribution specifics and more advanced server issues achievable with Ubuntu. The Ubuntu Certified Professional programme is still based on the LPI 101 and 102, followed by LPI 199 exam (the later is Ubuntu specific) and the main difference is in the changed bias in the Canonical-authored courses, which now concentrate on the more advanced desktop and server configuration topics. Canonical have high aspirations for Ubuntu as a fully fledged desktop system, hence the Ubuntu Desktop Course in addition to the server courses (all described at www.canonical.com/training/certificationcourses).

    To get the detail and the philosophy of the new training content over to the accredited trainer base, (as well as a fresh and original delivery approach) Canonical are holding several TTT (Train The Trainer) sessions. Considering that the number of people being trained is relatively small, and they are splattered literally all over the world, arranging the logistics for such a session was not trivial.

    I have attended the event run 13:00 - 17:00 EST, which put it at 18:00-22:00 “my” time. I wasn't the worst off, there were people from US, Canada, but also from countries much further East than I am, so it was even later into the night for some of them. I was a bit worried, because the joining instructions, although very clear, involved configuring technologies either totally new to me, or ones that, regrettably, I have never made a proper use of.

    The underlying conferencing engine was a product new to me, called Spreed. It impressed me straight away: it supports _all_ contemporary operating systems, including MacOS and Linux. Once on Spreed site, quick test confirmed that connection speed and other communication elements are suitable for conferencing. Patiently waited for an e-mail invitation to join and, once that arrived, a single click on the link and I was in. I understand this was the first time Canonical tried this particular conferencing method for the TTT purposes, so there was new grounds to cover for both the students and the moderators. But, with few (mostly humorous) hiccups the event went very smoothly, the time past surprisingly fast and my overall impression was very positive.

    Although the product supports full audio and video from all participants, we didn't use cameras at all (something about Spreed and Flash 10 being incompatible - well, we had to have hardware incompatibility ;-)). Most of us stayed away from the audio as well, the interactive and real time “chat” pane provided more than satisfactory interaction. 10 points to the moderators for looking out for our comments and reacting to them swiftly. The whole experience was smooth, painless and very effective. Thank you EmmaJane, Belinda and Billy!

    Bottom line - my resistance to these elaborate e-based methods of collaboration is well and truly broken, bring them on!



    Friday, April 03, 2009

    Well, I have decided to take a plunge with the all new and shiny QA blog. Although it's only as new as my "new" 3-year old LPG car I bought recently. Xpertise had the blog designed and active well before the merger.

    It is rather ironic, and indicative of the state of the game, that the blog is only expected to be accessed / updated from Windows and Explorer.

    So, despite the fact that I haven’t used Windows for a couple of years, (and had used Firefox for years prior to that), it seems that the popular believe that life begins and ends with Windows is still there...

    Luckily, Firefox 3 managed to overcome whatever the .NET or activeX components compatibility issues might be (I don't really know what I'm talking about here, so I'll stop speculating any further!). Opera 9 wasn't as helpful, and would not connect at all (although I could&#39ve tried changing its personality to Explorer in the setup)…

    Thursday, February 12, 2009

    Filesystem with "relatime" attribute

    Many debates have been carried out on the subject of time wasting when writing to i-node table (i.e. accessing the disk) when a user performes file access. Many alternatives have been offered over the years to avoid this.

    One of them is a filesystem attribute called relatime. It has been in existence for a while, but because nobody has been using it (by this I mean vendors rather than users), I never took sufficient time to remember how it works.

    Well, Ubuntu now uses relatime by default. Time to learn...

    Here is a quote from the best resource I found on the subject. It comes from an article posted by Jonathan Corbet on lwn.net

    "Another approach was added in 2.6.20: the relatime mount option. If this flag is set, access times are only updated if they are (before the update) earlier than the modification time. This change allows utilities to see if the current version of a file has been read, but still cuts down significantly on atime updates. This option is not heavily used, perhaps because few people have heard of it and many distributions lack a version of mount which is new enough to know about it. Using relatime can still confuse tools which want to ask questions like "has this file been accessed in the last week?"

    Hint: if you want to exeriment with the behaviour, use the stat command. Read and modify a file few times, and observe how the atime (access time) is only updated if the last access was done before the last content change.

    Friday, January 23, 2009

    HPOfficeJet H470 in Ubuntu 8.10 over Bluetooth

    It was all working in Hardy, but a week ago I reinstalled my Dell M1330, no Vista anymore - just Ubuntu 8.10. Very impressed, added Crossover Linux (still need MS Office), and I don't think I'm going to look back.

    Hardware recognition fantastic, my 3G dongle, which used to give me a lot of grieve before - now is running with a single click on the panel...

    Bluetooth seemed fine as well (connecting to other laptops and exchanging files OK). However, got stuck on the HP H470 printer. It worked with Hardy, now, attempts to connect only showed "Pairing Failed". Checking Ubuntu forum confirmed that there is a known bug in Intrepid, and there is seemingly a disagreement between the forum members and the developer on how to handle this. Shame...

    Never mind, time to get under the hood. The bug indicates that the gnome front end configuration is broken. Instead, one can use the CUPS web-based configuration, available through your browser.

    First check that your CUPS daemon is running, is listening for tcp connections:

    $ /etc/init.d/cups status

    Status of Common Unix Printing System: cupsd is running.



    $ netstat -a | grep LISTEN | grep cups


    unix 2 [ ACC ] STREAM LISTENING 62711 /var/run/cups/cups.sock

    If not, you may have to (re)start the CUPS daemon (replace "status" with "start" in the first command above).

    Now to the actual configuration:

    1. First of all, identify the printer's number with the following command:

    $ hcitool scan

    Scanning ...

    00:21:86:XX:XX:XX PIECORNERENG

    00:1A:0E:XX:XX:XX Officejet H470


    2. Now start your browser and enter the server's URL: http://127.0.0.1:631. This will point it at CUPS administration server (strictly speaking it is IPP - Internet Printing Protocol using CUPS).

    3. Select Add Printer, then Continue

    4. Enter values for Name, Location and Description, then Continue

    5. In Device: screen select from the drop-down list HP Printer (HPLIP), then Continue

    6. In the Device URI screen enter the protocol and the address for your printer, as identified in step 1. Notice no ':' characters used in the string below:

    bluetooth://001A0EXXXXXX, then Continue

    7. Complete the configuration with the:

    Make: HP, then Continue

    Model: HP Officejet h470 Foomatic/hpijs (en), then Add Printer


    Hopefully, you are looking at "The Bluetooth printer has been added successfully"

    8. Test the setup from the command line. Run:

    $ lpstat -t

    scheduler is running

    no system default destination

    device for Bluetooth: bluetooth://001A0E79AF32

    Bluetooth accepting requests since Fri 23 Jan 2009 16:39:02 GMT

    printer Bluetooth is idle. enabled since Fri 23 Jan 2009 16:39:02 GMT


    From now on, whether you print from the command line, or from applications, the printer will work hard for you!

    Wednesday, January 21, 2009

    Handling MAC addresses in VM

    We are working on setting up all our UNIX and Linux courses as guests in VMware workstation. There are many advantages of taking this route, as there are some penalties. We setup a 'master' VM, then ghost it, which allows us to dump an image on demand. Once we have used this method for a while, I might elaborate a bit more, with more insight...

    In the meantime, just a comment on preventing new images from duplicating original MAC address in Linux configuration. All this is new for me, but our techie in Swindon has sent me an e-mail documenting the solution. Thanks, Martin!

    "If you don't do this before taking the image, each subsequent VM that you deploy will have the same MAC Address and you get that annoying "did you copy or move the VM" question on first boot......The fix is...

    1. Delete the file /etc/udev/rules.d/70-persistent-net.rules [in the guest]
    2. Shutdown the VM
    3. Find the .vmx file on the host (in this case, D:\VMRun\Linux C\Linux C.vmx). Edit it with Wordpad and look for 2 lines called uuid.bios and uuid.location. Underneath those 2 lines, add a line as follows:

    uuid.action = "create"

    4. Save the file and take the image"

    Should Gnome-terminal read shell startup files?

    I say it should. If not by default, then at least users (ordinary users) should be able to set the capability permanently and easily!

    It's very easy to set is for a session. Open terminal, go to Edit --> Current Profile --> Title and Command and tick the "Run command as a login shell" box.

    Problem is, you have to do it every time you log in. Your first terminal never gets to see your environmental settings. We need permanent solution. Searched and googled, googled and searched. Found a wealth of information on the Red Hat site.

    They definitely put me on the right track (and convinced me that I do need to learn xml after all!). However, the article omitted to mention one important bit of information. When you change the settings with the gconftool-2, you must stop the gconfd-2 daemon. I didn't, and had all sorts of desktop problems, including Nautilus crash.

    So, to make every gnome-terminal a login shell (e.i. read your environmental files) first stop the gconfd-2 process. There may be a clean way of doing this in runlevel 5, I chose to go to runlevel 3, which is a full multi-user mode of operation, but without X (GUI).

    Do the following steps only if you *don't* have any applications or users requiring GUI - you risk P45 or your tyres slashed otherwise.

    Log in as root and enter:

    # init 3

    Press Enter (after few messages) - that will show the prompt again. Enter:

    # gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type boolean --set /apps/gnome-terminal/profiles/Default/login_shell true

    Return to GUI runlevel:

    # init 5

    From now on, every user's terminal will source their startup files...

    Wednesday, January 07, 2009

    Kiosk mode in Firefox

    I had a few e-mails from my local Linux User Group (NLUG, Northants LUG). Somebody asked for help in fixing Firefox. His browser lost all toolbars. An answer appeared within minutes: "F11? (Toggles kiosk mode)".

    Two thoughts went through my mind. First of all I remembered that I had the same problem some months ago, and never found the solution. In fact, it was at that point when I decided to investigate Opera (which I have been using ever since). Why didn't I ask the forum? I would probably have had the same answer within minutes!

    The other thought related to a question a delegate asked me only yesterday about a "kiosk mode" in an application. I regret to admit, but my answer was a rather ignorant "don't know anything about your application, so can't comment" statement.

    Will I ever learn? Not knowing anything about the 'kiosk' thing, I assumed the term was peculiar to the application the chap was talking about!

    So I'm feeling rather depressed. Not only is this questioning my style in interaction with delegates, but also exposing massive gaps in my knowledge - everybody I mentioned the "kiosk mode" since then knew about it. It seems I'm the only person in the Universe that thought a kiosk is a type of detached cabin selling newspepars and cigarettes...

    Saturday, January 03, 2009

    My first ever new year resolution

    Will mantain this blog more regularly!

    Thursday, October 09, 2008

    Upgrading Ubuntu 7.10 to 8.04 - lesson learnt

    I never liked upgrades - so many of them had gone wrong for me in the past... But having now been using Ubuntu for so long, I have become comfortable with it, and although I tried to document all add-ons and changes I made to the system (and I have a full data backup), I didn't really fancy re-building the system from scratch, just to go a version up.

    So, for the first time in ages - I decided to take a plunge. I went for the network upgrade, using the front-end software tool - which, coincidentally kept encouraging me to do just that at least once a day ;-)

    I left it overnight - no point in watching and agonizing over every slow down or apparent freeze.

    However, next morning it sat on a message " Generating locale... en_AU.UTF-8...". Clearly, that was it. The process was well and truly stuck. I ended up doing a hard restart - nothing else responded.

    Having tried several things (that got me into a system without GUI) I could not progress the upgrade any further. What was worse, the fresh installation didn't work either - the hard disk was not recognised (that bit I still need to investigate!).

    I left it for a few days, using my little toy EeePC as a stop gap (a pretty effective one too!). Last night I decided to do a bit of googling - and bingo - within the first attempt! The full discussion and the actual solution is at http://ubuntuforums.org/showthread.php?t=865679.

    In summary: if you got stuck like me, reboot into the older kernel (-15 or -14) failsafe mode and run :

    dpkg --configure -a

    Then boot the old kernel (-15, proper, not failsafe), at GUI login screen select in Options Failsafe Gnome session, the run the dpkg command again:

    sudo dpkg --configure -a

    Next reboot - standard kernel and GUI session - all is well!

    Lesson learnt?
    Do your homework before embarking onto a major system upgrade/maintenance, etc. The problems with upgrade from the latest 7.10 kernel to 8.04 are very well documented, if I only looked...

    Thursday, September 25, 2008

    CD to disk file transfer on HP-UX

    After a long pause, and several projects later, I'm back getting ready our uxheaven.com (our back-room of variety of UNIX boxes, that will be used for training multi-vendor courses).

    Today, it's configuring HP-UX boxes: one is the B.11.11 U9000, the other B.11.23 on Itanium.

    Had to look up some of my old posts to fix various network settings, and I reckon the /etc/rc.config.d/netconf file will now stay in my memory (sad - it takes few weeks and the detail is gone!).

    Once the network was fine, needed to add software from CDs, to a central repository of documents and future depot files. For the time being, all I need is to have it all on hard disk. Quick refresher on the process:

    1. Identify the special file for CD-ROM:

    # ioscan -funC disk

    showed it to be /dev/c1t0d0

    2. Create mount point directory
    I like the way Linux treats removable media, so my new mount directory became:

    # mkdir -p /media/cdrom

    3. Mount the disk:

    # mount -F cdfs /dev/c1t0d0 /media/cdrom

    4. Finally, create directory for the documents, and copy the CD content

    # mkdir /usr/doc
    # cp -rf /media/cdrom /usr/doc


    Ready for use...

    Blog Archive