Tuesday, May 31, 2011

Beep Beep - pcspkr and snd_pcsp quiet please!

Having the flexibility to have the pc speaker / beep active in different contexts is useful, however it does require you to know, how to switch off beep, in each context.


tty terminal Ctrl+Alt+F1 - silence the beep:


Here (as root) I created a file named /etc/profile.d/beep-pcspkr-pcbeep-disable.sh and included a setterm command.

Permissions of 644 work okay for this file.


What you should now experience is a TTY console having no beep.

Switch to a tty console login using Ctrl+Alt+F1 and login, your shell completion should now be free of any audible feedback beep.


X terminal - xfce4 terminal - silence the beep:

Graphical desktops (X based) have their own preferences for audio feedback beep, and in my terminal xfce4-terminal, the preference is shown below:

MiscBell=FALSE

...which can be found in the file .config/Terminal/terminalrc


But my MiscBell=TRUE?

Change it to FALSE using an editor if you want to silence the beep.

But my user does not have a file .config/Terminal/terminalrc  - does not exist?

Xfce4-terminal has a preferences screen in Edit->Preferences, go into there and change 'initial title' from Terminal to Xfce4terminal and select 'Close'

What your action above did, was trigger the creation of .config/Terminal/terminalrc

Now you can make your edit.

Why would you want a beep anyway?

Some command line novices find the audible beep a useful feedback mechanism.

Being a novice, back before Red Hat became Red Hat Enterprise Linux, I remember using the feature myself.




But I still have a bootup and reboot Beep - absolute silence please?

Mute the 'PC Beep' column in alsamixer using the 'm' key.


  • Startup alsamixer from a terminal (not required to be root)
  • Navigate right until the PC beep column is highlighted
  • Press 'm' to mute that column
Exit alsamixer using Esc (avoid pressing Q as this is the key for volume increase)

There is no need to explicitly save alsa settings, as simply exiting using Esc is enough to make your new settings persistent.

Note: PC Beep '00' is probably not going to be complete silence. Mute the thing.


Notes and Further Reading:


The alsa-utils package contains the program alsamixer. The package alsa-utils should already be installed on your system. If not use the following:

apt-get install alsa-utils

( apt-get above is for Debian and derivatives including Ubuntu)

yum install -y alsa-utils

( yum for Fedora / Red Hat / MeeGo and similar )

That alsa-utils package includes a utility named aplay, which can be used to check which sound devices in your system are known to alsa.


The above is a Dell Inspiron 1525 laptop, which I am currently setting up with Debian Squeeze. This laptop will have an Xfce desktop, and I have yet to test HDMI audio output, as HDMI port is not something I use regularly.

Saturday, May 28, 2011

Terminal Preferences - #C0C0C0 and "Terminus Bold" 16

Terminal and "Grey on Black":

I am fascinated by folks who use white on black, and often wonder if it is just a lack of knowing, where / how to change the text colour.


#C0C0C0 is an nice Grey for text appearing on a Pure Black (#000000) background


Terminal Font - Monospace or Terminus:

The default in my Xfce terminal on Debian is 'Monospace', which is a perfectly usable font.

Going a little retro with Terminus

For widescreen desktop: "Terminus Bold" 16

For 15" laptop: "Terminus Bold" 14


Terminal Bell - love it or loath it:

For Xfce terminal, there is a MiscBell option in preferences file which should be set TRUE if you want to hear beep.



Terminal programs and terminal fonts - listings:

Just a quick hint or two for programs / fonts you might try.


Thursday, May 26, 2011

Onboard Sata type - Ahci or IDE - which best

If you are a Windows user then you will have to go search based on your particular version - advice varies per version, and read up about install time drivers.

For GNU / Linux there is just a single set of current advice.
However if you are installing with a motherboard that has secure boot / Uefi, then you need to get familiar with these gatekeepers or experiment (some suggestions below )

This post has been edited since it was first published, and this 4 point summary is added:
  1. Use Ahci rather than Ide mode where you are doing a new install
  2. Existing installs should not switch from Ahci to Ide or vice versa once the operating system is already configured
  3. The main thing that Ahci will give you is support for Native Command Queuing which is a hard drive feature.
  4. If you are unable to install GNU/Linux with secure boot / uefi or other restrictive gatekeeper software with Ahci setting, then try ide mode and see if that allows the disk to be recognised (Later you can rebuild initrd and flick the bios switch if you feel you desperately need NCQ support)
If your problem is that the drive (hard drive / usb drive) is not being recognised so you cannot install Linux, then you can either become a master of secure boot zzzzzz, or just switch the thing off (there is usually a secure boot Yes/No in bios)


Choose at the outset - don't try changing it later:


The reasons for choosing Ahci or IDE will be covered next. But first you should make a commitment now to 'get it right' and stick with that setting.

To enable fast booting, grub (by default) will only includes the drivers it really needs, based on your initial system configuration.*

If you set your system up with 'Onboard Sata type' as Ahci, then later try and switch that mode in your bios, then you are asking for trouble.

If you set your system up with 'Onboard Sata type' as IDE, then later try and switch that mode in your bios, then you are asking for trouble.

Read on to make sure you 'get it right' at the outset.

*Sometimes this minimal approach is termed 'targeted' grub.


SATA and IDE emulation:

Do not use 'IDE mode' for Sata for any new install unless you are installing operating systems which had an initial release prior to 2007.

Use Ahci for current Debian and current Red Hat and similar.

The whole point of having a 'IDE mode' for SATA controllers was to help then current software ( Red Hat 5 & Windows XP ) cope with the change in disk standards.

The change to a newer version of Windows from Windows XP is not to be taken lightly for organisations with > 50 employees, which is why some IT departments continue to support that stable release.

Moving versions of Debian (Lenny -> Squeeze -> Wheezy) is much less of an issue, which is why most Debian installs were migrated from Etch long ago.

Moving point release of Red Hat Enterprise Linux (6.2 -> 6.3 -> 6.4) is also not a big deal, however there is just one caveat.

Red Hat is extremely popular as a base system for lots of virtualisation 'hosting containers'. If this is your situation, then that might require a little more planning  as hosting 40->200 VPS atop of Red Hat does make a migration a bit more involved.


Grub (initrd) and Ahci:

What will happen if you have 'Onboard Sata Type' set Ahci, and then do a GNU / Linux install, is that the boot mechanism (grub and initrd) will be built during install with --preload=ahci

To keep boot times down and loading from disk optimal, GNU / Linux installs keep the initrd minimal (only what your system needs*).

This approach gives sub 30 second boot times on my laptop (which I appreciate), however it does put the onus on you to choose the right bios setting and stick with it.

If 'Onboard Sata Type' was IDE mode when you installed, and then later you switched bios to be 'Onboard Sata Type' as Ahci, then ...
the workaround is to build a new initrd containing the AHCI module.
Source: Wikipedia

There is a great Fedora specific posting here describing in more detail why changing the bios setting after your install was done, will lead to issues.

*The latest Debian installer, specifically asks you if you want a 'targetted' boot setup or the more bloated but future proofed version - the choice is yours :)


Initially bios option was set 'Ahci' but for some reason now want IDE:

Hey maybe this is a little dose of nostalgia...what you are saying is in 2011 my system will be set to act like a 2006 / 2007 system.

Have no idea why you might choose to do this, however the kernel boot time option all_generic_ide might be what you require.


Ahci is not listed as an option in my bios - what should I do:

The bios menu selection might be titled 'Sata Controller Mode' or 'Onboard Sata Type' and should list two or three options.

Some bios have a selectable option named 'Compatible (sata only)', which is I guess just another way of saying Ahci



My operating system is very early version of Red Hat Enterprise Linux 5:

Check your kernel version. Kernel 2.6.18 is 5 years old now. Kernel 2.6.19 and newer, all support Ahci.

If you are thinking about doing an install today of a version of GNU / Linux that uses Kernel 2.6.18 then think again. Justify your choice to yourself.

The current 'stable' of Debian uses 2.6.32 and that is pretty conservative.

RHEL6 kernel is RHEL 6.0, Linux 2.6.32-71.29.1.el6.x86_64

Any kernel configured from the current kernel tree in the last 5 years,
should be > kernel 2.6.19 and therefore have Ahci support.

Kernel 2.6.32 and newer and Kernel 3.2 and newer have excellent support for Ahci.



There are other reasons why Kernel 2.6.18 for an OS acting as host container, might not be ideal.


Notes and further reading:


If you are working with bios that make necessary choice between Ahci and IDE today, then perhaps rather than being nostalgic, you are installing GNU / Linux on second hand machines.

Plenty of non-profits and charities are using donated hardware, and this might be your work.

If so, you might also find this link regarding AC97 audio, handy for new installs of Debian Squeeze, on that legacy hardware.

For native English speakers a translation here

    Wednesday, May 25, 2011

    java plugin and Linux - are webex .so security risk?

    Whilst it is useful that Cisco decided to make available a .jar for cross platform webex viewing, a native Linux client would be much better.

    Given that the Apache webserver on GNU / Linux powers two thirds of all internet traffic, and Cisco's business is in routing equipment for the internet (primarily), it seems a little rude not to give back to the GNU / Linux community.


    Clicking 'run' for npatsun.jar when Java plugin asks for confirmation:

    If you want to participate in the webex, or watch a .wrt file you have locally, then you will have to authorise Java plugin to run the Java.

    What this will do is create a .webex directory in your home folder and run the webex process.


    The detail in the above screenshot is provided for reference, but just be aware that the Java jar file has placed a .so file named npatgpc.so, in your plugins directory for your browser.

    I am not so sure this makes me comfortable.
    Most .so files I install on my system come from official Debian repository mirrors.

    User 1000 is an unprivileged user - that much is good, as the harm the plugin can do is limited. However I am really relying on Firefox own plugin sandboxing of privileges, to prevent that .so from doing something unwelcome to my system.

    If all that .so is doing is calling .webex/atrecply to play the .wrt, then maybe there are no worries there.

    My advice - when you have finished watching the webex, move out .webex directory to .webex-movedout. You can always reinstate it when you come to want webex participation again.

    To permanently remove webex, you would have to also remove npatgpc.so from your plugins directory.


    What sort of trail does webex leave when you playback / participate:


    ...and...



    Hopefully those screenshots give you a bit more information, if you want to dig around and find out, what precisely, webex playback / participation will do.


    Mozilla.org reports the plugin as 'ActiveTouch General Plugin Container' ( Version 113 ) as shown here:




    Browser plugins can affect memory usage and stability of browsers, so generally some good advice might be to only have enabled those you really regularly use.

    Move out the webex plugin if you are not using it.


    Notes and Further reading:

    There are plenty of alternatives to Webex if you are planning on hosting your own web meetings. Do some research or have a look at Yuuguu or

    ready meals (vegetarian) - supermarket fare

    Vegetarian Lentil Moussaka ... sounds rather nice.


    ...and lets have a look under the hood (so to speak) ...






    Tomato (16%), Potato (11%), Cooked Lentils (9%), Aubergine (8%)

    Probably better titled Tomato and Potato Moussaka, that is just me being glib :)



    Daily allowance of fat 70g, with only 20g of that allowed as saturates:
    The clue to this using half your daily allowance of fat, and also having 10g of carbohydrate as sugars, is in the ingredients list.

    Largest ingredient in the Vegetable stock is Sugar, followed closely by Salt.
    Third place goes to Vegetable Concentrate.

    The main ingredients list has Vegetable Oil & Double Cream listed.


    Is this meal healthy?

    Depends on your interpretation.

    If you were watching your weight, then you certainly wouldn't want to eat it every day.

    Adding Sugar and lots of salt to ready meals, is something I consider less than healthy, however some folks would argue that bland food is unhealthy also.

    Things to note in particular is that this meal has 35% of your maximum daily intake of Salt.

    This would not be in your weekly shopping if you fit any of these categories:

    • High blood pressure
    • Diabetic
    • Weak liver / renal treatment
    • Known predisposition / risk of Heart Disease
    Not fitting any of those categories, you could happily eat such a meal, provided your other meal of the day was not also high fat.


    But is the high fat content just because it is vegetarian?

    Most folks who eats a meat reduced / meat free diet know that pulses, beans, and legumes are not 'low fat' foods.

    However Tomato and Potato (the main ingredients) are not 'high fat' foodstuffs.

    The legumes (lentils) make up 9% of the meal (by weight) and so are not what is making this a high fat meal on their own.

    What I suspect is making it 'high fat' is the combination of lentils+vegetable oil+double cream+sbrinz cheese

    That would probably do it!


    But I really like the taste of this meal, what else could I do:

    200g of this + a decent portion of Salad (no dressing) is a much healthier way to go.

    300g is about right if it is eaten on it's own. If you are watching your weight, or want to eat a little more healthy, then toss a third of the portion away and add the salad to your plate.


    Are trans fats an issue with this meal?

    Hard to say for sure.

    Going back 5 years or so in the UK, the major supermarkets were supposed to voluntarily stop adding trans fats to these sort of ready meals.

    In fact only Sainsbury's made a public declaration, although other supermarkets were supposed, at the time, to be refraining from adding trans fats during preparation.


    Notes and Further Reading:

    Tuesday, May 24, 2011

    Printing on the go - pogo & zink from polaroid

    Back in the eighties, this was instant photo printing:


    Image courtesy of Wikipedia

    Now the closest you will get today, is a Polaroid device called 'Pogo'

    It uses 'Zink' paper technology, and from personal experience the results are pretty. good.


    Zink 'Smart Sheet' - the magic blue sheet:

    The instructions are pretty clear that the blue sheet is to be the first through the printer, when you open a new pack of zink.


    STOP!

    DO NOT toss the blue sheet in the bin (see comments below)





    But my Pogo printing is streaky - what to do to Zink paper:

    That blue 'Smart sheet' is textured and designed to clean the print head.



    Just take out any remaining sheets from the Pogo, place the blue 'smart sheet' in on its own, and press print.

    Repeat two or three times.

    Each time that textured smart sheet passes over the print heads, it is cleaning up any residue from previous prints.

    There is a blue sheet in every ten pack, and the principle is that before doing a batch of ten prints, that blue sheet will have passed through the printer, to clean up any previous residue.


    Polaroid and 3"x4" photos:

    The Pogo prints business card sized 2"x3" photos.

    Great for customised seasonal greetings cards, or birthday cards - just instaglue the thing inside the card.

    Great for family men, who travel through work, and sometimes need reminding about their family. A couple of recent 2"x3" will fit nicely in the wallet.

    The larger (think 80s or 90s polaroid sized) snaps are coming in June 2011.

    The GL10 is the new model, which Polaroid will be launching soon with a campaign with Lady Gaga.


    Ten packs of Zink paper - where to get them and expiry:

    The zink paper (by law) requires an expiry date as it is classed as a Consumable

    The printing technique for Zink involves the Pogo applying heat to the paper, which activates the crystals.

    ( The crystals, and therefore the paper, do not deteriorate in any other way )

    If you prefer the more classic camera 'all in one', then the One600 is still available today.

    ( Greeting card tip: Apparently you can just peel the photo away from backing paper, to make it even easier to create custom cards )


    Notes and Further reading:


    If you are feeling nostalgic about instant printing, then Polaroid were still issuing the 600 range, in late nineties. As recently as five years back these were still selling well.

    Second hand models of the 690 can still be obtained, however do check that you can get the printing refills / paper, before splashing out.

    The Polaroid 690 image used at the top of this article is courtesy of Wikipedia
       [ Creative Commons Sharealike licensed ]

    Sunday, May 22, 2011

    debian - webgl and canvas capable iceweasel / firefox

    This article has been updated in 2014 to give a testing link for the khronos project. The original article continues below.


    Today has been a little bit of an experiment.

    My regular browser is Iceweasel 4 (Firefox 4), and I am bending the rules of the angry birds beta, by using my browser to beta test.


    Use the 'SD version' and get playable results:


    I don't know precisely which features of Firefox 4 are utilised, but for now I am just having fun completing as many levels as I can.


    But there is no sound in the 'sd version':

    Remember that you are using a non supported browser against a 'beta' setup.

    ( If you are desperate for sound and / or the 'hd version' then chromium from the 'sid' unstable repository is a non-recommended option )

    Hey if you've heard the background music once, you've heard it a thousand times, why not have libre.fm play you some background music instead :)


    But I use Nvidia / Intel graphic card and cannot even play 'sd version':

    I have only tested 'sd version' on two ATI equipped desktops, but I ask a question here to check that there are no issues for other graphics cards.


    Iceweasel 4 freezes on loading on my machine:

    Go directly to the 'sd version' url

    ( Note: I tested that 'sd version' url today, however being a 'beta' it is very subject to change )

    If you still have no joy, then you are free to install firefox nightly and try that.


    If you are able to participate in the 'beta' using either an official browser ( Chromium 9 / Chrome 9 ) or an unofficial mozilla browser, then have fun and enjoy this free game :)

    Using firefox / iceweasel 24 or newer and wanting to test webgl?

    Follow the above link and hit 'run tests' to have your browser tested for webgl conformance. Most of the tests should pass in firefox / iceweasel 24 and newer.

    Saturday, May 21, 2011

    ubuntu upgrades - 'alternate' cd way

    The box shown below is my preferred 'graphical' way of upgrading Ubuntu



    The 'alternate' cd - who uses it and why:

    Quoting directly from help.ubuntu.com:
    If your computer is not able to run the standard Desktop installation CD, you can use an Alternate installation CD instead. The Alternate CD also allows more advanced installation options which are not available with the Standard LiveCD.
    A little vague perhaps, however the idea is to encourage folks, where possible, to use the standard Desktop installation CD.

    As stated earlier, the alternate cd is my preferred 'graphical' way of upgrading Ubuntu, and my reasons are:
    • Detection of existing installation is moot
    • It allows the existing Ubuntu installation some interaction / control over the upgrade process.
    • No partition selection nonsense to go through, and therefore less chance of losing data through eager clicking.

    Regular and 'alternate' cd - some naming examples:
    • ubuntu-11.04-desktop-amd64.iso
    • ubuntu-11.04-alternate-amd64.iso
    If you  plan to download both for experimentation, and have anything other than a fast connection, then do look at the .zsync file if your download has been interrupted.

    ( Description of .zsync and how it might save you bandwidth here. )

    Note: .zsync workings are not like Debian jigdo, however using .zsync to resume a failed download might be useful.


    Kickstarting the Upgrade manually if your prompts do not appear:

    In a terminal window:

    gksu "sh /media/cdrom/cdromupgrade"

    If the above does not work then you might instead try:

    gksu "sh /media/cdrom0/cdromupgrade"

    ( The path cdrom0 or cdrom - one of those should work )

    That shell script cdromupgrade will do the following for Natty:
    • Go to dists/natty/main/dist-upgrader/binary-all/ on the cd
    • Find natty.tar.gz
    • Follow the instructions and python scripts in natty.tar.gz to perform upgrade

    For reference, a copy of natty.tar.gz can be obtained directly from archive.ubuntu.com here , however use that only for reference as the cd version is signed, and is likely gpg verified as part of running of cdromupgrade.


    The cd dialogue shows 'Start package manager' but not 'Run Upgrade'?

    You inserted the wrong cd and the (wrong) dialogue is shown similar to this:


    It is possible to make use of the Standard Desktop cd to help keep bandwidth down during an upgrade (see next section), however if you want to follow the cdromupgrade method, discussed so far in this article, then insert the correct cd.


    Updating instead by manually starting update-manager :

    The earlier method in this article, is not the only way of having some manual control over your Ubuntu upgrade.

    update-manager -c

    ...is the traditional way for command line types, and will work today.

    Having the standard installation cd or 'alternate' cd loaded and starting Synaptic, should add the cdrom as a package source.

    This will save plenty of downloading, as update-manager knows now that it has several hundred .deb files that it can get locally, rather than download.


    Updating instead by manually starting do-release-upgrade :


    do-release-upgrade is an automated alternative to update-manager, and does not require any graphical desktop to be running.

    The 'No new release found' message should not happen on your system, if it does then the cause can be found by grepping like this:


    If yours says 'Prompt=lts' or 'Prompt=never' then adjust things by changing your preference via update-manager.

    ( Emacs / vi editing probably a better alternative for command line types )

    Using do-release-upgrade is a great way to get some hints about issues that will prevent your Ubuntu upgrade from completing.


    ...nothing too bad in the above, but then here is my showstopping issue shown below....


    blcr-dkms in my case is probably safe to remove, as it is only a 'recommends' of another package. So I should remove it and then run apt-get autoremove

    Right now I am not going to update Ubuntu, as I will likely wait for the next LTS in April 2012., however is always good to keep up to date with install procedures.


    Notes and Further reading:

    Before you attempt any upgrade it really is worth ensuring that your system has picked up recent packages from the 'updates' repository.

    Example using Ubuntu Lucid LTS as the system being upgraded.

    Ubuntu LTS is known as 10.04, but there is more to it than that.

    There is a repository named lucid-updates that is used for enhancements and what you might term 'after market' fixes.

    Your Ubuntu LTS system will work just fine and is secure as it is, however enabling the lucid-updates repository, gives you access to fixes that are useful, but not deemed worth retro inserting into stable.

    If the file /etc/lsb-release reports 10.04.2 then you have probably got lucid-updates enabled already, and are using the point release from February 2011.

    Typing lsb-release in a terminal will output 10.04.1 or 10.04.2 and so on, depending on what point release you are running.

    The last piece of the number 10.04.2 indicates the point release of your LTS.

    System -> Administration -> System Monitor reports your version, but unfortunately does not give details of which point release.



    Friday, May 20, 2011

    twitter - this application will be able to - oauth

    Twitter opened up to developer applications several years back.

    What has happened in 2011 is the authorization mechanism has been made more granular.


    Above is a type of authorization I will call 'read only', now for a more clumsy example:


    Both examples have in the 'will be able to' section:
    • Read Tweets from your timeline
    • See who you follow, and follow new people.
    The second example is NOT 'read only' as it has extra access which allows:
    • Update your profile
    • Post Tweets on your behalf

    Friend of Follow or other types of 'read only' services:

    If you go to use a Friend or Follow type service that helps you understand who you follow back and suchlike, then there should only be 2 items in the 'will be able to' section.

    What these sort of services offer is a query of your friend list and some analysis on that friend list.

    There is no need for a friend analysis service to have 'Update your profile' or 'Post Tweets on your behalf'

    So if you go to such a service and the section will be able to shows 4 items:

    • Read Tweets from your timeline
    • See who you follow, and follow new people.
    • Update your profile
    • Post Tweets on your behalf
    ...then do NOT authorize it!

    Instead check the 'About' information or terms of service, and ask the developer why they feel they need 'Update your profile' access, or 'Post Tweets on your behalf' access.

    The developer will probably contact you back and say that they have fixed it and it was an oversight. You might even get a thank you :)


    How did this happen - is the developer doing something bad?

    Probably not.

    Back when the api was first launched, Twitter probably did not have the flexibility and control that it has today.

    Early apps (written more than a year ago) plugged into an authorization system, which likely did not distinguish between the 2 item and 4 item lists you are shown today.

    Rather than just shut down those early apps, Twitter now showing you the item lists is probably hoping your interaction will gee up the developers to modernize to the new api and only request the lesser privileges.

    Shouldn't be a massive change for developers, but will require a little bit of work.

    If a year from now you sign up to a new app service and that shows you 4 items in the 'will be able to' list, then that newer app service might be open to strong criticism :|

      Wednesday, May 18, 2011

      ubuntu install cd - two purposes (1) update (2) fresh

      You have just download an Ubuntu cd - what to do?

      An ubuntu cd has two ways of operating.

      1. You want a fresh install or are installing Ubuntu for the first time
      2. You have a previous version of Ubuntu and you want to upgrade, keeping some settings.

      (1) cd inserted at boot time - menu from the cd:

      This is the classic use. If you have installed any operating system before, and somebody gives you an Ubuntu cd, this is likely what you would do.

      The cd is booted by bios and you get a menu for Ubuntu Natty or whatever the latest version is.

      This mode is generally used for installing Ubuntu for the first time. The default will help you setup that computer hardware for a brand new installation of Ubuntu.


      (2) cd not inserted at boot time - update manager is the key:

      I have Ubuntu, I like it, I want a newer version <-- If this is you then keep reading.

      Have the cd drawer unloaded or grab the cd before it is pulled in.

      Boot your existing Ubuntu (from the hard disk) where you have been using it for the last few months whatever.

      Here you system does not know (just yet) that you are planning to change anything.

      So you have your desktop now loaded and fully updated*. Now you insert the cd.

      Ubuntu should automatically start 'Update Manager' or give you a pop up prompt.

      The message should say "a volume with software packages has been detected.
        would you like it to open with packager manager?"


      You choose 'Start Package Manager' ... (in effect you are saying yes / OK)

      Next you will see a new dialogue title "Do you want to start the upgrade"

      Proceed if you are happy with what you are being asked to confirm.

      Updating this way, you can be sure that your settings (/home) have the best chance of being retained, as there is simply no option to remove them by accident.

      But I am not sure if I want to upgrade - what should I do? See this earlier post describing some factors which you might consider.

      *Quoting from Ubuntu.com:
      Be sure that you apply all updates to your current version of Ubuntu before you upgrade.

      Notes and Further Reading:

      If you have your desktop already running, then you insert the cd and nothing happens, then do the following:

      System -> Administration -> Update Manager

      From the menu you have now started 'update manager'.



      Now you should be able to upgrade your existing system.

      Note: This method is only for existing installs, if you have no existing install then the cd needs to be inserted already at boot time - see (1) above.


      Ubuntu Natty - more menu options on the boot cd:


      Now with the latest Ubuntu cd, an existing installation will be detected and the menu will be headed:
      This computer currently has Ubuntu xx.yy on it

      The second option in that menu, allows you to update an existing version to the latest version.

      The icon for that update option looks a little like the reload icon on Wikipedia:


      ( Creative Commons Icon courtesy of Wikipedia )



      I still suggest (for updating rather than fresh install) booting your system without the cd inserted and updating that way (2), as folks who do not do a lot of upfront reading, seem to find it easy to wipe hard disk partitions* by using the install cd boot menu way to update.

      Updating my recommended way (2), you can be sure that your settings (/home) have the best chance of being retained, as there is simply no option to remove them by accident.

      *Read the forums and you will from time to time see a posting from some eager beaver, who inserted a cd for the latest Ubuntu, and did the happy key dance, resulting in the loss of some partition they wanted to keep.

      If it is your intention to update an existing Ubuntu installation and booting from the Ubuntu cd asks "who are you?", and prompts you to pick a username and password, then you will likely have no alternative but to reboot, and follow instructions for (2) above.

      The problem then is likely that the detection routines have failed. This is unusual but can happen. Ubuntu is pretty good at detecting existing operating systems, here is a Debian / Ubuntu dual boot example:



      Ubuntu - can skip versions? ... say Lucid skip Maverick goto Natty:

      Yes. Look closely at the screenshot above which is promising to upgrade 10.04 to 11.04

      In the example above, not skipping versions would instead see you upgrade 10.04 to 10.10 and then 10.10 to 11.04 by two manual update stages.

      If you are pushed for time and have not kept up with your versions, then go ahead and use that cd boot menu option to jump directly to the latest version.

      My recommendation*: Avoid skipping versions unless you are in an awful hurry. Rather than choosing the above highlighted menu option, do instead follow option (2) at the beginning of this article, and use update manager.

      This will inevitably remove a small utility program or two as part of the upgrade (version shifting usually does). By going the update-manager way you can see what is being removed and manually reinstall those utilities right after the upgrade.

      Run the intermediate Ubuntu version for a week and iron out any issues you find. Then you are certainly ready to use update-manager again, to make the next hop :)

      *my recommendations are based on past experience, I cannot say for sure that you will feel any ill effects from skipping an intermediate version when upgrading your system.

      Save £15 per month - check the fridge and freezer

      Knowing how much your house uses, without your activity, can be a useful fact for managing costs at home.

      Background electricity and refrigeration:

      An 'A' rated freezer might be rated with a maximum consumption of 60 watts, however it should still be checked.

      Today an energy efficient refrigeration appliance should use 1 kilowatt per day or for really modern appliances, only 500 watts per day.

      ( Reference links provided at the end of this article )

      So per hour that freezer or fridge should be taking 20 watts to 40 watts of power.

      It might peak at 60 watts, but that short burst (after you stood with the freezer door open then shut it again), should not affect the hourly average too much.


      'A' rated or otherwise - what happens when appliances get old?

      Signs of age or wear and tear - refrigerator / freezer:
      • They breech the maximum 60 watts and might even peak at over a kilowatt when refrigerator cycle is triggered.
      • They fail to drop to an acceptable 20 -> 40 watts after the moving part buzzing has stopped.
      In the house here, the landlord has an 'A' rated freezer that was left locked on 'overdrive' by the previous tenant. Not sure for how long, but it seems to have affected the efficiency.

      The background usage for that freezer alone never falls below 100 watts.

      The background usage for that fridge and freezer together sometime sticks at 300 -> 400 watts - way too high.

      The fridge has been located next to the cooker, so I imagine it has not had the best time of things either.


      Predicting costs - the simplest mathematics you will see:

      Get an electricity usage monitor - the type that has a clip you loop around the cable leading to the meter, with a separate display you read off in another room.
      ( See "What if I don't have a 'clip to supply'" section if you don't have one and don't want to spend out )

      Turn off all the devices that are non-background (laptops, computers, televisions, whatever).

      What do you read? 100 watts, 200 watts, 300 watts?

      Take whatever you read and divide by ten.

      ( You can round to the nearest hundred and then drop a zero if you find it easier )

      Here you have the monthly electricity bill (assuming you all went away on holiday for a month)

      Was yours 300 watts so £30? Frightening.

      If yours was 500 watts so £50, then you probably have a garage or utility room with some extra fridges or freezers? No. Well seek out an explanation.

      The mathematics is simply assuming a 14 pence per kwh cost - not unreasonable in the UK in year 2011.


      Rechargeable devices - constant drain:

      Modern rechargeable devices should not 'constant drain', once the battery in the main unit is charged, they should draw 1 watt or less.

      Rechargeable Caravan vacuum cleaner - a counter example.

      The Caravan vacuum upright sits in a recharge housing and uses 8 watts constantly. It is a fault with the design or just wear and tear, but the charging circuit never drops to zero watts.

      Going back to the mathematics - that is costing 80 pence per month, whether the device is ever used or not.


      Older devices that have constant drain > 20 watts:

      • Non usb scanner ( 25 watts )
           [ lide scanners that plug into a usb port do not waste power in this way ]
      • Sky+ box ( 25 watts )
      The Sky+ box is probably a design fault :-
          The hard drive (used for live recording playback), runs constantly rather than spinning up and spinning down again.


      If you have a Sky+ box and a non usb scanner, then there is £5 a month in electricity right there.

      Do switch them off when not using them, or upgrade to more energy efficient alternatives, which don't 'constant drain'.


      What if I don't have a 'clip to supply' electricity monitor - they are expensive?

      In that case you probably have time rather than money at your disposal - you will need an hour.

      Pick a time when all the people in the house are out and you only have background electricity usage.

      Read off the current kilowatts used on the electricity meter, wait an hour, read again.*

      *Remember that often the rightmost dial (sometimes coloured differently) is tenths of a kilowatt rather than whole kilowatts

      Do your subtraction (now kilowatts used - then kilowatts used) and you have a figure you can use.

      Was it 1 tenth of a kilowatt - so £10 per month
      Was it 3 tenths of a kilowatt - so £30 per month
      Was it 5 tenths of a kilowatt - so £50 per month


      Notes and Further Reading:

      Adjust the mathematics to suit your situation. If your standard electricity rate is 28 pence per kwh, then double the figure you get using my formula.

      I used the word formula in the sentence above - a bit grand for a simple division operation, however I intend this article to be useful to people having all levels of mathematical ability. 

      Notes about the calculation - 100 watt example - method 1:

      730 hours per month; 14 pence per kilowatt hour; 100 watts constant usage

      100 watts is a tenth of of a kilowatt so begin with 0.1

      730 hours per month and 14 pence (£0.14) per kilowatt hour is 730 * 0.14 is 100 approx. 

      Multiply 0.1 by 100 gives £10


      Notes about the calculation - 100 watt example - method 2:

      Suppose for a moment that your background usage was 1 kilowatt.

      There are 730 hours in a month. So that background usage would cost you 730*'rate per kwh'

      Rate per kilowatt hour is 14 pence (£0.14) so to get a pound figure we replace
      730*'rate per kwh'  with 730*0.14 giving £102.2

      £102.20 is roughly speaking £100



      100 watts is one tenth of a kilowatt.

      So we take our £100 calculated figure and divide by ten, which gives £10.

      Here is one story that demonstrates just how big a portion of your monthly electricity can be taken up by a faulty fridge or freezer.


      Large Upright Freezer - non 'A' rated - real world measured example:

      120->134 watts when the motor is running.

      2 watts when idle / at temperature.

      Cooling override (struggling to maintain temperature), can see temporary surges of 995 watts.

      Measured usage during single day in June was 1.5 KWh

      1.5 * 0.14 * 1.2 gives £0.25 rewritten 25 pence.
      ( Note: The 1.2 final multiplier is VAT )

      25 pence per day is roughly £8 per month

      This particular upright freezer is outside in a shed which does get extremely warm, when there are two consecutive days of unusually warm weather.

      Realistically my hunch is that during June, July, August, that upright freezer will consume £12 per month.

      And £5-£6 per month averaged over the other 9 months of the year.

      Budget for £90 per year to run that 7 cubic feet upright freezer.

      A new 'A' rated upright freezer that is kept inside in a room that does not get excessively warm, should have annual consumption around 250KWh per year.

      The large upright in this example is not 'A rated' and has an annual consumption double that of any new replacement.

      That £90 per year budget buys around 550 KWh per year of running.

      Buying a replacement (assuming current electricity costs remain static), the replacement will have paid for itself in 3 to 4 years.


      A house with 2 fridges and 2 freezers - options for reducing power:

      Some families who have utility rooms and outside storage, but a small kitchen, may have small fridge / freezer in the kitchen, and extra cold storage elsewhere.

      For this example, I will use a house that has small fridge + small upright freezer in the Kitchen, and larger versions of the same in outside storage.

      Fridge capacity: 4.5 + 7 = 11.5 cubic feet
      Freezer capacity 4.5 + 7 = 11.5 cubic feet

      That amount of storage, if managed effectively should be enough for 5 or 6 people.

      Options for reducing power consumption:
      • Turn off one of the 4.5 cubic feet small units during June, July, August.
      • Rearrange kitchen to house one large+one small, rather than two small
      • Buy a new 'A' rated fridge freezer to replace two of the current units.
      In the days when electricity was reasonably inexpensive, having extra storage was not much of a financial issue.

      This year and in the coming 5 years, electricity prices are more in tune with actual generating and cleanup costs, and extra cold storage is a luxury that may be reviewed in your family budget.

      I mentioned earlier that 23 cubic feet or cold / freeze storage is more than enough for a family of 4 or 5 people.

      Students often have the reverse problem - lack of cold / freeze storage.

      People wonder why students eat plenty of food 'on the go' - Subway, chilled food, take away.

      Usually these student shared houses have a single fridge freezer for 5 or 6 people.

      Roughly speaking that is 10 cubic feet of cold / freeze storage between 5 or 6.

      Having other people eat your ready meals is a hazard in any shared house with some friends, some strangers.

      But having only 2 cubic feet of cold / freeze storage per person can also be limiting to any 'health eating' good intentions.



      Monday, May 16, 2011

      mercurial init - git init - summary clone and push

      hg init            or      git init

      ...are generally the first commands I use.


      Have your code ready and a reasonable directory structure in place.

      Add a README and a LICENSE file (OSI approved licenses in my case)

      hg init

      ...and you are up and running (for your git stuff   git init)

      If you are working from an existing codebase then you might want 'clone'

      hg clone http://hg.savannah.nongnu.org/hgweb/someproject


      Publishing one time projects via git lends itself well to a set recipe:

      1. git init
      2. git add .
      3. git commit -m 'first commit of GPL3 licensed python scripts'
      4. git remote add origin git@github.com:someuser/apt-utils-python-shell.git
      5. git push -u origin master
              [ Above we used -u switch (--set-upstream) which is correct ]
      6. git add README
      7. git commit -m 'added some to README'
      8. git push origin master
              [ Note there is no -u switch here which is correct ]

      Openshift and git - what commands there?

      In order to commit to your new project, ...

      Make your changes, then run:

      git commit -a -m 'Some commit message'
      git push

      Then reload this page

      Note: The above is quoted from the openshift page


      Notes and further reading:

      If you feel the desire to host your own Mercurial from which other folks can pull, then:


      hg serve 

      and the point browser at http://localhost:8000/


      Note: If your machine is internet facing rather than on a private company network, then you should think about authentication / security, and follow this guide:
        Setting up a Mercurial CGI server

      Alternatively you could think about Trac



      If you feel the desire to host your own Git from which other folks can pull, then:

      git-daemon 

      and the point browser at http://localhost:9418/

      Note: If your machine is internet facing rather than on a private company network, then you should think about authentication / security, and read up about gitosis or gitweb.


      Saturday, May 14, 2011

      mailserver A is "inherently" better than mailserver B

      For GNU / Linux there are several good mailserver packages.

      Here are a handful (in alphabetical order):
      • Exim
      • Postfix
      • Qmail
      • Sendmail
      There are others, but for the purposes of this article that is enough to go on.

      Each of these packages will have their own fanbase. If you have a long history with Plesk hosting automation, then you might well love Qmail ... why? Because you know it inside out.


      Exim 4 is inherently more secure than Postfix:

      No it is not.

      Neither is Exim 4 inherently less secure than Postfix.

      But there was recently a vulnerability in Exim 4 around dkim signatures?

      Yes there was. Debian users should have the security repository of Debian active (by default) and automatic updates (usually active by default on login to Gnome).
      ( See links at the end for further information about Debian and automatic updates)

      However postfix does get vulnerabilities also.

      Mailservers are complicated and involve a huge codebase. Recent changes have been made, particularly to incorporate functionality around dkim.

      When humans code, other humans will review and sometimes mistakes will be found and then corrected.


      But what about Qmail - there is a stable codebase that has changed little in 10 years? Well Qmail has a small core codebase and recent functionality is added via patches. Is this a better way to maintain a mailserver? You decide.


      Debian and Automatic Updates:

      For Gnome desktop users (including Ubuntu migrants), the easiest way is to install update-manager-gnome

      Here are some other useful packages if you run a different desktop, or prefer to have updates happen, without a graphical interaction:
      • cron-apt which is a utility for background download (optional email output)

            [ once installed issue  ln -s /usr/sbin/cron-apt /etc/cron.daily/ ]
      • aptdaemon another daemon, that can be used with user privileges and an optional frontend

      • package named unattended-upgrades (see below)


      If you are really comfortable with cron anyway, you might just want something like this for your updates:

      50 11  * * * ( apt-get -q update && apt-get -qy upgrade -u )



      The Debian project, and how an active upstream can influence choice:

      Distributions are a little like biological systems in some ways, things become more popular, things become less popular. Not unlike natural selection in a fashion.

      One of the things that Debian novices and even some experienced SysAdmins do not appreciate, is the importance of 'upstream'

      It might be the tastiest code morsal your system has chewed in years, however somebody has to package the thing and maintain it
        
      If upstream is inactive or uncooperative (it does happen), then it sometimes can put undue pressure on the maintainer.

      With no upstream support, a complex package, will perhaps, have more outstanding bugs, or the maintainer might decide the weight it too much to carry alone.

      Even if you are not doing Debian packaging, but might be making a commitment to a certain mailserver, then do ask about upstream.

      How active is the upstream of Mailserver A?
      How active is the upstream of Mailserver B?


      If you are going to build a business around systems that include mailserver installs, then you want to know this!

      Here is Exim own bug tracking system - how convenient :)


      Crackers and mailservers - the case for mailserver diversity:

      ( Crackers: Folks who break into systems - think hackers if that is clearer for you )

      If there was only one single GNU / Linux distribution, and every desktop and server in the world was GNU / Linux - wouldn't the world be great!

      Well actually, NO.

      Folks who make a business out of breaking into systems, have a skillset, just like regular developers and System Administrators.

      The less the diversity in commonly run server based services, the better for the cracker.

      In todays diverse GNU / Linux world that cracker is not going to just crack mailservers, he will likely have a toolkit of useful things s/he is knowledgeable in. SSL, file obfuscation, whatever.

      However the wider the skill set required to be effective, the fewer people will be drawn into seeing 'blackhat' activities as an easy career.

      Now if that cracker wants to compromise the mail server on a Red Hat system, then he needs to know Sendmail and it's vulnerabilities / attack vectors.

      Now if that cracker wants to compromise the mail server on a Plesk automation system, then he needs to know Qmail and it's vulnerabilities / attack vectors.

      Now if that cracker wants to compromise the mail server on a Debian system, then he needs to know Exim and it's vulnerabilities / attack vectors.

      This is all assuming that the mailserver administrator has just 'gone with the flow'. They might not, they might have installed any of the 4 mailservers in my original list.

      You know the Red Hat admin might have installed Exim, or the Debian admin might have installed Postfix.

      My point is, that reducing diversity in mailservers, to the point that there is only one type of mailserver, might be considered making it easy for crackers.

      Modern day cracking toolkits have lowered the barriers to entry for crackers somewhat. Let's not make it too easy for intruders by trying to extinguish choice through rabid fanboyism.

      There are arguments for 'biodiversity' in the plant world. In this article, I have presented one argument for diversity in server based services.

      I personally hope Qmail is around for another decade ... my argument for diversity.


      Notes and Further reading:

      An Extract from the Exim4 description:
      If you build exim4 from the source package locally, you can also build an exim4-daemon-custom package tailored to your own feature set.

      If your business is going to create some custom functionality around a mailserver, then that sort of thing might appeal.

      Here is an example of the type of debate that starts up when somebody asks "What mailserver for Debian".
      ( Nothing wrong with that sort of discussion, however do bear in mind my earlier point, about mailservers and fanbase. )