LUG Community Blogs

Adrian Bridgett: Google streethawk

Planet HantsLUG - Thu, 11/03/2010 - 21:52

Finally Google Streetview has gone nationwide. I can even see my first house down in Chandlers Ford when I worked at IBM Hursley, ah, fond memories.

I was just telling my dad how I use streetview when visiting new places - I generally take a look the day before, then on the day I just have a map printed out and use that. The fact that the streets seem familiar really help. Of course now I have a shiny android phone with Google maps anyway

What would be really neat is a Streethawk style “accelerated time” drive though for directions. I don’t think you need the whole journey - generally just the end bit (or complicated junctions). In fact, just being able to find the carpark is often the hardest bit - being able to spot “ah, turn left just before the pub” would be excellent. Naturally as augmented reality takes off we’ll be able to look forward to arrows overlayed on our car windscreens (or bike helmets).

Categories: LUG Community Blogs

Aq: Not a lawyer any more

Planet WolvesLUG - Thu, 11/03/2010 - 21:36

So according to Naked Law, the technology blog for the law firm I used to work for, Centrica contracted Accenture to write some software, and that software turned out not to work like they wanted. The court found Accenture liable for around u00a329 million. The lawyer response?

[This] demonstrates how widely the Courts are willing to interpret 'direct loss'. This will comfort the customer, but IT suppliers may want to consider strengthening their liability clauses.

Or, y'know, writing software that doesn't suck.

This is why I no longer work for lawyers.

Categories: LUG Community Blogs

Richard WM Jones: rich

Planet GLLUG - Thu, 11/03/2010 - 21:17

Creating a file of “all zeroes” is pretty easy. You might start with dd if=/dev/zero .... How about a file of all ones bytes, or alternating zeroes and ones?

A not very well known Perl operator called the “x” operator makes this quite easy:

$ perl -e 'print "\x01" x 100000' > output

makes a file 100000 bytes long containing all 1 bytes.

$ perl -e 'print "\x00\x01" x (100000/2)' > output

makes a file 100000 bytes long containing alternate 0 and 1 bytes.

$ perl -e 'print "\x00", "\x01" x (100000-2), "\x00"' > output

makes a file 100000 bytes long starting with a 0 byte, then 99998 1 bytes, then a final 0 byte.

You get the idea.


Categories: LUG Community Blogs

Alan Pope: Why (I think) Ubuntu is Better Than Windows

Planet HantsLUG - Thu, 11/03/2010 - 16:27

When comparing operating systems people tend to roll out the same old reasons every time. I think those of us who use Ubuntu are already aware that we have less viruses than Windows, less malware, it’s free of cost and so on. I’m sure we’ve pointed out plenty of times that you’re legally entitled to copy the CD and even create your own remix.

However I wanted to look at some of the things I’ve done recently on Ubuntu that under Windows would be costly, difficult or impossible. So without further ado here’s my:-

Top ten things you can do with Ubuntu, that you’d find hard, costly, impractical or impossible with Windows, which clearly makes Ubuntu better (in my humble opinion)

Snappy title huh?

Hardware support is better than you think

In the last year I have added the following hardware devices to my system and they were all fully supported out of the box with zero driver installations, no reboots, no 3rd party downloads. Truly plug and play.

  • HP Printer/Scanner/Copier/Fax – everything worked including the memory card slots and network auto discovery.
  • Logitech USB headset – microphone and headphones worked with pulseaudio, and even enabled me to switch music playback dynamically from speakers to headset with the ‘pavucontrol’ utility.
  • Bluetooth dongles – never had a single one fail, and I’ve bought some really dirt-cheap devices here, where ordinarily I’d be wary about hardware support.
  • Ortek infrared remote control – again, I just plugged in the USB infrared receiver and it was working before I’d put batteries in the remote control.
  • 3G dongle – this was surprising but again, plug in the USB dongle and network manager on Ubuntu spotted it and let me use it for internet access. The same happened with my Android based cellphone
  • USB Apple Ethernet adapter – amusingly on the bag it comes in it says “Only compatible with Macbook Air”. This runs the internal half of my firewall
  • Nintendo Wii USB Ethernet adapter – the list goes on

Of course it’s not perfect, there are still some hardware manufacturers who fail to support Ubuntu, but the point stands, it’s better than most people think. Your mileage may vary, I don’t doubt that, but this is my blog outlining my experience.

Access more than 4GiB RAM on a 32-bit install out of the box

Many 32-bit operating systems including Windows XP, Vista and 7 support a maximum of around 3GiB RAM. With Ubuntu 9.10 the 32-bit install detects how much RAM the machine has and if it’s more than 3GiB you should get a ‘PAE-enabled’ Linux kernel. With no additional work required on your part, you get access to all the RAM in your PC. So you don’t have to switch to 64-bit Ubuntu if you don’t want to, and still access all your RAM. If you’re already running Ubuntu and you upgrade your RAM you can just manually install the above named kernel to get access to all that lovely memory. Om nom nom.

Easily create a bootable, functional operating system on a USB stick

Ubuntu ships with “USB Live USB Creator” which takes an ISO image and creates a bootable USB stick from it. Simply download an Ubuntu ISO image from http://ubuntu.com/download and start the USB creator application on Ubuntu from System -> Administration -> USB Creator.

Tell USB creator where the ISO image is, and it can prepare and write the contents of the ISO image a USB stick of at least 1GB in size. If you have a CD already and not an ISO image then you can use mkisofs to make an ISO image, and then make a USB stick from that, which will save a 700MiB download.

Find out where each file comes from

The typical desktop PC has many thousands of files on the boot disk. Much of this will be your own data in your home directory, but there’s a lot that’s required by the system to boot up and function. Sometimes you might want to know where a file came from.

It may be that you’re a curious user, wanting to know how things got onto your machine, or perhaps you’re diagnosing a problem with an Ubuntu installation. Either way it’s trivially easy to find out where files came from – if you stick to installing packages either from repositories or manually downloaded .deb files.

For example I might be diagnosing a problem with my system – maybe a program is eating CPU – and I want to know where the culprit came from. Knowing which package the process lives in is a good way to find out why you have it (because the name and package documentation may describe it well enough). Also if I wanted to file a bug against that program, I’d need to know what package it’s in. Lets say in this example that my system is sluggish. I might use the System Monitor to identify the process eating up CPU time.


Note: In the above screenshot Skype happens to be idle, but this is how I might discover the process name if it was chewing up my CPU.

I can use the command line to discover where that file is located on the file system using the which command:-

$ which skype
/usr/bin/skype

I can then use the dpkg command to find out which package installed this program:-

$ dpkg -S /usr/bin/skype
skype: /usr/bin/skype

We can even combine the two commands:-

$ dpkg -S `which skype`
skype: /usr/bin/skype

Tip!: If you use zsh instead of bash as your shell you can apparently use ‘=’ instead of ‘which’. So that would look like this: $ dpkg -S =skype. Thanks to Scott James Remnant for that tip via IRC

So this tells us that the ’skype’ package installed the ‘/usr/bin/skype’ program. Not surprising really, but you get the idea. Also worth knowing is dpkg -L which lists all files installed by a package.

Email me when system updates are available

I have an Ubuntu PC behind my TV which I use to watch streamed video via Boxee. More often than not the TV is switched off, and when it’s on it’s showing the Boxee user interface and not the Ubuntu desktop. So I don’t tend to see any update notifications – in fact I don’t want to see them – especially if I’m watching telly.

I’d like to know when there are updates pending on that system, so I have configured it to send me an email when there are updates available. Installing a package called apticron. Just edit /etc/apticron/apticron.conf and maintain the “EMAIL” setting, placing your own email address in the quotes, and remove the # from the start of the line:-

EMAIL="alan@example.com"

Then wait. Each day apticron will run and you’ll get an email telling you what packages need updating.

root@revo1 to me
show details 9 Mar (2 days ago)
apticron report [Tue, 09 Mar 2010 21:12:09 +0000]
========================================================================

apticron has detected that some packages need upgrading on:

revo1
[ 127.0.0.1 127.0.1.1 10.10.10.124 ]

The following packages are currently pending an upgrade:

gnome-screensaver 2.28.0-0ubuntu3.5
micromiser-beta 2.1.2-0karmic1

========================================================================

Package Details:

Reading changelogs...
--- Changes for gnome-screensaver ---
gnome-screensaver (2.28.0-0ubuntu3.5) karmic-security; urgency=low

* SECURITY UPDATE: information disclosure via monitor hot-plugging
- debian/patches/11_CVE-2010-0285.patch: make sure to show windows that
are added in src/gs-manager.c.
- CVE-2010-0285
* SECURITY UPDATE: locked screen bypass via monitor hot-plugging
- debian/patches/12_CVE-2010-0422.patch: improve window handling logic
in src/{gs-grab-x11.c,gs-manager.c,gs-window-x11.c}.
- CVE-2010-0422

-- Marc Deslauriers Tue, 02 Mar 2010 16:48:56 -0500

--- Changes for micromiser-beta ---
micromiser-beta (2.1.2-0karmic1) unstable; urgency=low

* Initial release

-- btbuilder Thu, 04 Mar 2010 19:18:06 -0500
========================================================================

You can perform the upgrade by issuing the command:

aptitude full-upgrade

as root on revo1

--
apticron

Note: You may need to some basic configuration of the mail system on the machine sending the mail. The default mail transfer agent is ‘postfix’ and it can be configured with:-

sudo dpkg-reconfigure postfix

Once that is done you can look forward to receiving mail whenever your system needs to be updated with details of the updates required.

Go from blank disk to fully installed in under an hour

On most moderate hardware these days a standard installation of Ubuntu takes around half an hour. Getting all the apps you need for daily use might take a little longer. However if you take note of what apps you use regularly the additional applications can be installed pretty quickly, and in one big hit.

Whenever I’m installing Ubuntu 9.10 whether for myself or friends, there’s a set of things I tend to do post-install that rarely changes from one machine to another. This usually consists of installing audio/video codecs, fonts, updated video driver, flash, java and a few other bits and pieces. Some of that comes from the standard Ubuntu repositories, and some from 3rd party repositories or PPAs. Once the installation of Ubuntu is complete and all updates have been installed there’s just a few lines to paste in and then I leave it to run for a while.


# Add repo for Lifesaver screensaver
sudo add-apt-repository ppa:cmsj/lifesaver
# Add repo for chromium daily build
sudo add-apt-repository ppa:chromium-daily/ppa
# Update local package lists
sudo apt-get update
# Install all the stuff!
sudo apt-get install ubuntu-restricted-extras \ # Installs flash, codecs, java, fonts
chromium-browser \ # Installs daily build of Chromium
lifesaver \ # Install lifesaver screensaver
gtk-recordmydesktop \ # Install app for recording screencasts
gnome-do \ # Install Gnome-Do
vlc \ # Install VLC media player
openssh-server \ # Install SSH server for remote access
smbfs \ # Install samba client for accessing Windows shares
gwibber # Install microblogging client

Building a list like this can significantly reduce the amount of time taken to get up and running with Ubuntu. What’s especially cool about this is there is no need to visit any third party websites or download external installers. Those applications listed above are the ones I use regularly, you will have your own set of “must have” packages. What are they?

Move a hard disk

Ubuntu has no direct equivalent to “Windows Genuine Advantage” fortunately. This is the tool that seeks to reinforce the Microsoft End User License Agreement for Windows users by causing havoc when system hardware changes. Windows also has quite a fit when you move a hard disk from one system to another as it detects and installs new drivers for all the newly found devices.

Ubuntu does most of its hardware detection automatically at each and every boot-up with no user interaction. As a result you can take a hard disk containing a standard install of Ubuntu from one system and put it in another and expect it to work without much effort. The only time I have had an issue is when I have made some manual configuration changes for the specific hardware in the computer.

For example if you have installed and enabled the nVidia binary driver and configured it in /etc/X11/xorg.conf and the target computer doesn’t have an nVidia graphics card then it might fail to start the graphical environment due to it being forced to load the ‘wrong’ driver. In this instance probably the easiest thing to do is backup and remove the /etc/X11/xorg.conf and restart the machine. At that point it will automatically detect the video hardware and should work much the same as a standard install.

Compiling and packaging applications for older OS releases

With the 6-month release cycle some people can feel left behind if they don’t upgrade to the next release promptly. Ubuntu has a Long Term Support (LTS) release every two years to cater for many users who wish to stay with one stable release. Ubuntu 6.06, 8.04 and the upcoming 10.04 are all LTS releases, with all other releases being non-LTS.

There will always be some users who are not on an LTS release, but have still chosen to stick with their currently working system rather than upgrade. There is nothing wrong with this approach, but it can lead to users wanting a newer version of a package to be ‘backported’ to their release of Ubuntu, whilst the rest of the development community have moved on. There are developers who backport applications from newer releases to older ones, but they don’t backport everything, and there is a finite resource of developers available to do this task. The good news is that with a little time and effort, you can do this yourself.

I recently had a friend who was using Ubuntu 9.04 with an nVidia graphics card using the driver supplied, but he wanted to try the newer driver from Ubuntu 9.10. It’s generally not recommended to take a package built for one version of Ubuntu and just install it on an older release. It may work, but there’s no guarantee, and it can break the system in unpredictable and catastrophic ways.

So I took the ’source’ code from Ubuntu 9.10 and used the tools provided in Ubuntu to rebuild the driver for 9.04. This was a trivial thing to do. The really cool thing is that I’m running Ubuntu 9.10 64-bit and was able to build the driver for Ubuntu 9.04 64-bit on my local PC. Once I was confident that it worked I uploaded it to my launchpad Personal Package Archive (PPA) where it was built for Ubuntu 9.04 32-bit and 64-bit architectures.

So not only was I able to backport a driver to an older release, but I also built it for an architecture that I don’t even run myself. The observant among you may have noticed that the package I built is not open source – the nVidia driver is proprietary code. Yet I was still able to take the packagable parts and in only a matter of minutes have it rebuilt for another release.

All the commands I used (dch, debuild, pbuilder-dist, dput) are well documented tools for managing, building and uploading Debian packages (.debs) and their contents, and of course, they’re all freely available in the Ubuntu repositories. The Ubuntu Masters of The Universe (MOTU) are a helpful bunch and their pages can be found at https://wiki.ubuntu.com/MOTU and on irc in #ubuntu-motu.

Fixing a bug

Whilst it’s easy to dismiss this as an advantage only if you’re a coder, let me first say that I’m not a developer at all. I can just about read someone elses very simple code with some help and google, but I don’t really ever write anything myself. So if I can fix a bug, anyone can!

I recently discovered a very simple bug in the ifdata command which I filed in launchpad – the Ubuntu bug tracker . With a little help from some of the Ubuntu developers – who were keen to help me – I was able to create a patch, test it and submit it to Ubuntu and upstream to Debian. The critical step that really made me consider even trying to look at this bug was that the source was available and easily installable. I was able to identify the package containing the buggy command:-

$ dpkg -S `which ifdata`
moreutils: /usr/bin/ifdata

Once I knew the package name I could download and unpack the source code for that package very easily with one simple command:-

$ apt-get source moreutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
NOTICE: 'moreutils' packaging is maintained in the 'Git' version control system at:
git://git.kitenet.net/moreutils
Need to get 37.8kB of source archives.
Get: 1 http://gb.archive.ubuntu.com karmic/universe moreutils 0.35 (dsc) [822B]
Get: 2 http://gb.archive.ubuntu.com karmic/universe moreutils 0.35 (tar) [37.0kB]
Fetched 37.8kB in 0s (191kB/s)
gpgv: Signature made Tue 05 May 2009 20:19:33 BST using DSA key ID 788A3F4C
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./moreutils_0.35.dsc
dpkg-source: info: extracting moreutils in moreutils-0.35
dpkg-source: info: unpacking moreutils_0.35.tar.gz

The tricky part for me is then actually finding the incorrect code in the program. With a lot of help from a good friend and after asking on-line I was able to create a patch. I tested my patch and submitted it to the developers for review. That process is all well documented and I was supported through the process by Ubuntu developers.

All in all it took me a few hours to get this done, spread over a week or so. Not a massive investment of time, and I’ll certainly be quicker next time, now I have learned how to handle bugs like this. Plus I now have a better understanding of the packaging system which helps me with other great things.

Re-install the OS and Applications without losing your data

A default installation of Ubuntu wil place all the operating system files and user data in one partition on the disk called the ‘root partition’ or /, and a second partition for swap. Many users like separating their OS/apps from their user data, so they create a separate partition for /home. This is useful for a number of reasons including allowing you to reinstall the OS on the root partition without touching your data in the /home partition. One little-known feature of the installer on the Live Ubuntu CD is that you can do this – reinstall the OS and not wipe your data – even if you dont have separate partitions for / and /home.

Ok, so you want to reinstall the OS but keep your data in /home. Perhaps you want to upgrade but prefer a clean install, or maybe you’ve played with the system a bit too much and it’s become damaged, and you’d like to quickly ‘reset’ everything with a reinstall. Simply boot from the Live CD and run the installer. When you get to the partitioning step, choose ‘manual partitioning’ which takes you to the more advanced partitioning tool. Select your root partition for installation but don’t tick the “format” checkbox. Continue with the installer as normal.

The installer will recursively delete all files (except those in /home) before copying the new install files onto the disk. Create the same first username during the installer and it will re-use the /home/username folder as your home directory, with all your files intact.

Note: Some user data files (such as mysql databases which are in /var) may be stored in other folders than /home, so you will probably want to back the system up before hand in case there are any files you need to recover.

So those are 10 things I do with Ubuntu that I’d have a hard time doing on Windows. It’s arguable whether you’d need to be able to do some of this stuff, and that I accept.

I realise that there are Windows-based tools that can replicate/emulate some of these tasks, or maybe Windows Vista or 7 can do some of the above tasks. I kinda stopped bothering with Windows after XP, so my knowledge may be lacking. Feel free to correct me in the comments, or suggest what you can’t live without.

                          
Categories: LUG Community Blogs

Simon Stevens: Of course only people involved in chaplaincy will get this

Planet HantsLUG - Thu, 11/03/2010 - 15:30
So I said


and


But Rob reckoned


and Peter prefered


And then I thought


Which then meant


There was some debate about


before we settled on


and everyone agreed on


Quite a lot of people said


I told one person that I thought if


then


and I can't remember if they replied


or


Which prompted someone to suggest


which I said, naturally implies


Which was unanimously rejected in favour of


At which point I decided the whole star trek comparisons was just pointless.


Although that could explain why I am being deactivated in the summer when the rest of the crew is on holiday.
Categories: LUG Community Blogs

Peter Cannon: RatholeRadio Ticket

Planet WolvesLUG - Thu, 11/03/2010 - 08:20

Yay! My Rathole Radio ticket arrived yesterday with a nice little note come letter inside which everyone is getting this a really nice personal touch I think and a testament to Dan’s character in that he really appreciates each and every purchase.

Big Lynch’y has flogged his guts out, and bank balance, to get this event staged and as I’ve said £5.00 +£1.50 admin fee is a pathetic sum to pay for what will be a great first night for what should be an awesome Open Source weekend so don’t say “I’ll buy mine closer to the date” get your credit or debit card out now and head over to http://ratholeradio.org/gig/ buy your ticket today unless you want one of my world famous withering looks?

Categories: LUG Community Blogs

Rob Annable: Links for 2010-03-10 [del.icio.us]

Planet WolvesLUG - Thu, 11/03/2010 - 08:00
  • BirdBox Alarm Clock
    Turn your iPhone into a nesting box alarm clock.' - Brilliant. First example I've seen of an app that integrates with a physical object you make/buy as well.
  • as previously considered (1 August 2005, Interconnected)
    "...snooker is a game of tidying up. As are most field sports (football, rugby, hockey), and tennis and badminton are both arguments about who precisely is going to do the tidying up ("you touched it last, you do it")." - a reminder, via a link from Tom Carden, of the sort of thinking that got me interested in blogging in the first place
Categories: LUG Community Blogs

Alan Pope: A Blue Ocean on the Land

Planet HantsLUG - Thu, 11/03/2010 - 01:22

Google have finally (street)mapped most of the UK. Look at all that blue!

From Land’s End..

..to John o’Groats..

and pretty much everywhere in between.

Including my own back yard! Not found myself on it yet, but have had a great time ‘driving’ around the country. Found anything fun? Leave a comment

                          
Categories: LUG Community Blogs

Graham Bleach: Internal borders

Planet HantsLUG - Thu, 11/03/2010 - 00:26

I've had this idea in my head for some time that the way people run IT organisations is wrong: they're too fragmented into subject-specific areas. Then the DevOps guys came along and started trying to encourage developers to work with ops people, which is a start. But I'm not satisfied with dev-ops collaboration; I want ops-ops collaboration and I had a good old rant to the Build Doctor about it over an ale or two. Kris Buytaert followed up with a blog post describing some of the tensions he sees.

Splitting your operations people up into teams of DBAs, Systems Administrators, Network Engineers, Storage Engineers and all the other ops disciplines is probably causing you pain. You probably don't even know that it's sickness; you probably just think the symptoms are part of everyday life in IT: glacial progress on projects and issue resolution and a lack of interest in the business goals.

The first symptom is that to get some things done seems to require enormous willpower and dedication. These are simple things that require work by multiple teams. There's a delay while the task crosses the internal borders between each team and they try to understand the request. There are times when people forget what the process is and it doesn't get routed correctly to the next team in the chain. It's unlikely that any of the teams have the inclination or the understanding to test that what the customer wants has actually been done. What they test is that their tiny piece has been done.

It seems as if every time things cross internal borders between teams there's a latency cost while you wait for them to do their thing. There's also a cost of doing business with your colleagues, something familiar to anyone who has been asked to fill out numerous mandatory fields in a form to request that someone sitting within feet of you make a relatively insignificant change. The more team boundaries you cross, the more these delays and costs mount up.

The second symptom is that operational issues can take a long time to resolve. In my experience this is particularly true of performance problems. Maybe your users are complaining about some report taking minutes to complete and you pass the ticket onto your application support people and they say, no, there's nothing wrong with the application, maybe it's the database? So the problem baton is passed to the DBAs and they have a look at the database, declare that the database is OK and ask the network guys to have a look. The network guys mutter about 5% utilisation or something and say the network is fine and they pass it to the sys admins, who mutter something about 20% CPU usage and say everything is fine. And now, probably a day or two later, you have a bunch of technical people who have checked their personal fiefdoms are fine and a bunch of angry users who are still have reports that take too long to run.

Of course, all these experts could be right, but it doesn't matter, because optimising the network, the databases, the storage or the servers in isolation is absolutely useless. The report could be running slow because there's an extra few milliseconds of latency between the server and the database and the report does 10,000 database queries, which return a lot of data and the milliseconds add up to a long delay. Unless someone sits down and works out what is going on, while understanding the whole technology stack, your users are going to have to put up with it.

The third symptom is that none of your operations staff seem to actually care what the business wants to achieve. The human mind is odd. As soon as you put people in discipline-specific teams you seem to be sending them a subtle message that their job is not to meet business needs, but to look after some arbitrary technical resource. Don't, therefore, be surprised if the DBAs care more about databases than the business goals. By putting them into the "DBA team" you're telling them that their job is to look after databases. By implication, the business goals are secondary.

Putting people into a bunch of specialist teams doesn't seem to be the right way to do things. There has to be a better way.

Categories: LUG Community Blogs

Rev. Simon Rumble: Sneaky trick to de-obfuscate Omniture JavaScript plugins

Planet GLLUG - Wed, 10/03/2010 - 23:06


My current job involves working extensively with Omniture products. The company has an annoying habit of secrecy, with documentation only available on request for many aspects of their products.

They also attempt to obfuscate their JavaScript, despite the fact that a determined viewer should be able to work it out eventually. I'm told this is so that people aren't tempted to play with the code. The obvious methods of deobfuscation are pretty tedious, and because Omniture don't use standard (minify et al) methods of obfuscation so it seems a little more difficult. Fortunately I lucked onto a better approach.

You'll need Firebug, and if you don't have that already you should anyway. Go to a page that already has the Omniture "plugin" (function) you want. Open the Firebug console and run alert(s.functionNameYouWant) and run it. You'll be shown a nicely-formatted anonymous function, which will be much easier to read than the line noise you'll see in the actual s_code.js file.

In my case I'm after Cross-Visit Participation, and that's used on the Omniture site itself (though an older version than the latest available from Omniture which has a very useful additional feature).

Contact me

Categories: LUG Community Blogs

Richard WM Jones: rich

Planet GLLUG - Wed, 10/03/2010 - 16:05

You’ve got a partitioned disk image, how do you pull out of that just the filesystem(s)? It’s easy with libguestfs tools:

$ virt-list-filesystems -al disk.img /dev/sda1 ext4 /dev/vg_f12x32/lv_root ext4 /dev/vg_f12x32/lv_swap swap $ virt-cat disk.img /dev/sda1 > boot.fs $ file boot.fs boot.fs: Linux rev 1.0 ext4 filesystem data (extents) (huge files) $ virt-cat disk.img /dev/vg_f12x32/lv_root > root.fs

You can also use guestfish to examine the filesystem image:

$ guestfish -a boot.fs -m /dev/sda Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for help with commands 'quit' to quit the shell ><fs> ll / total 15941 dr-xr-xr-x. 5 root root 1024 Mar 8 19:37 . dr-xr-xr-x 19 root root 0 Mar 8 13:40 .. -rw-r--r--. 1 root root 1486532 Nov 7 21:38 System.map-2.6.31.5-127.fc12.i686.PAE -rw-r--r--. 1 root root 103788 Nov 7 21:38 config-2.6.31.5-127.fc12.i686.PAE drwxr-xr-x. 3 root root 1024 Mar 8 19:12 efi drwxr-xr-x. 2 root root 1024 Mar 8 19:49 grub -rw-r--r--. 1 root root 11253019 Mar 8 19:39 initramfs-2.6.31.5-127.fc12.i686.PAE.img drwx------. 2 root root 12288 Mar 8 18:45 lost+found -rwxr-xr-x. 1 root root 3454368 Nov 7 21:38 vmlinuz-2.6.31.5-127.fc12.i686.PAE ><fs> cat /grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/mapper/vg_f12x32-lv_root # initrd /initrd-[generic-]version.img #boot=/dev/sda default=0 timeout=0 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Fedora (2.6.31.5-127.fc12.i686.PAE) root (hd0,0) kernel /vmlinuz-2.6.31.5-127.fc12.i686.PAE ro root=/dev/mapper/vg_f12x32-lv_root LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=uk rhgb quiet initrd /initramfs-2.6.31.5-127.fc12.i686.PAE.img ><fs>
Categories: LUG Community Blogs

MJ Ray: SPI March 2010

Planet ALUG - Wed, 10/03/2010 - 06:50

The meeting agenda is already posted for tonight’s (Wednesday’s) SPI board IRC meeting which will be at 2000 UTC.

It’s another pretty lean meeting, with only some minutes to approve, so why not come along and let the board know what you think they should be doing to promote free and open source software?

Categories: LUG Community Blogs

Jono Bacon: System 76 Lemur Review

Planet WolvesLUG - Wed, 10/03/2010 - 02:49

This blog entry represents the views of me, myself and I, and does not represent the views of my employer (Canonical) or System 76. While I have decided to write a review of this specific machine, there are many vendors out there who ship Ubuntu on their machines and this review does not favor System76 over these other vendors. Heck, I am happy to review their machines too if they want.

Recently I got one of these new System 76 ultra-thin laptops, the Lemur:

System76 are well known in the Open Source community for shipping Ubuntu on their machines, being active community members and for helping LoCo teams with machines too. I have never owned a System76 box so I thought this was a good opportunity to give it a ride and share some feedback.

So first, the specs:

  • Display: 14.0″ HD WXGA Super Clear Ultra-Bright LED backlit (1366 x 768)
  • Graphics: Intel GMA 4500MHD graphics
  • Audio Output: Intel High Definition Audio
  • Networking: Gigabit LAN (10/100/1000), WiFi
  • Wireless: 802.11 agn
  • Expansion: Express Card 34 slot
  • Ports: HDMI, VGA, 3 x USB 2.0, Headphone Jack, Microphone Jack, SD Reader
  • Camera: Built-In 1.3 MP Webcam
  • Security: Kensington® Lock
  • Power Management: Suspend & Hibernate
  • Battery: Lemur UltraThin Li-Polymer Battery Pack
  • AC Adapter: includes one AC adapter
  • Dimensions: 13.38″ x 9.09″ x 0.90″ (WxDxH)
  • Weight: 3.5 lbs

The machine I got has an Intel Core 2 Duo SU7300 1.3 GHz 800 MHz FSB 3 MB L2 (10 Watt), 4GB RAM (DDR3 1066 MHz 1 DIMM) and a 80 GB Intel X25-M Solid State Drive.

Now, in the interests of full disclosure: I don’t really do reviews, so this is going to be a quick run through the details, not a 150-picture unboxing and War And Peace epic of every minor detail of the machine. I just wanted to get my experience down as quickly as possible so I could share my feedback with others.

The Machine

OK, let’s zip through the summary:

The machine is a really sleek looking bit of kit. The first thing that struck me is how well designed it feels: it doesn’t feel like a randomly thrown together collection of components. It is thin and incredibly light, and has a very Apple-ish feel to it. It passed what I am calling the Lost Test: that is, when laid in bed at night watching Lost on Hulu with said laptop rested on your chest (for that IMAX effect), how many episodes can you get though before you feel like your heart is about to overheat and stop working. It’s lightness and lack of heat helped it pass with flying colors.

The screen looks great, doesn’t seem to smudge easily and is nice and bright. I like the fact it is a widescreen, something I miss with my current Thinkpad.

The keyboard is pretty much ok: it ain’t no Thinkpad keyboard, but of all the laptops I have owned and that are buried in my laptop graveyard, the Lemur’s keyboard feels better than most. The keys are wide enough and I love the fact that there is no Windows key, but instead an Ubuntu key. I want to see more of that, yes I do.

The trackpad is long and feels pretty good, and the buttons don’t look like buttons but instead areas on the trackpad near the bottom where you can push down: this makes it look really sleek. Unfortunately at first the buttons are a little hard to press, but I have noticed that they are getting easier, so I think they just need breaking in a little.

With the current configuration of processor and RAM, this thing is shit off a shovel fast. It zips along like no-ones business, and Ubuntu is up and running in a matter of seconds. While I didn’t test any hardcore 3D games on there, it runs Compiz great with the extra effects switched on.

Sounds works great, the speakers sound surprisingly good and the built-in webcam works well too. Finally, the battery life seems fine in terms of life, but not outstanding. Then again, I am used to my extra-long-life Thinkpad batteries.

My only real gripe believe it or not is the packaging the machine comes in: it visually looks cheap with a large generic “notebook” logo and doesn’t reflect the swishness of the machine encased inside it. I spoke to Carl Richell, founder of System76 about this and he has acknowledged it is an issue and they are keen to fix it: he said they really want every essence of the System76 experience to feel sleek. Good man.

The Default Install: Ubuntu 9.10 Karmic Koala

It is just incredible driving back from picking up a computer from the UPS warehouse and knowing that it already has Ubuntu pre-installed. I have never bought a pre-installed Ubuntu computer before, so I was curious to see how it looked. I got it home, switched it on and it threw up the installer’s configuration settings: I entered my details and the system was ready to roll. I was left with pretty much a default installation of Ubuntu: there is not the horrible bundled collection of software you don’t want and ugly vendor wallpaper that you find if you buy a typical Windows pre-loaded machine. Good work System76 on shipping what I consider a great representation of Ubuntu.

Other than that, nothing much to say: everything just works as you would expect.

Running Lucid

Being part of the Ubuntu development team, I was keen to get Lucid on there. I used Update Manager to update to Lucid and installation was smooth. Once again everything works: any bugs that I have found have not been specific to this machine, but replicated on my other Lucid machine. What is really noticeable is boot speed on the SSD: it is bonkers fast.

Conclusion

In conclusion, I think the Lemur is a beautiful machine, and combined with what I consider a beautiful Operating System, particularly with the new fit and finish of Lucid. When running the Lemur it really feels like great design in hardware and software meeting well. I would happily recommend this machine to others.

Categories: LUG Community Blogs

Jono Bacon: I Never Realized…

Planet WolvesLUG - Tue, 09/03/2010 - 22:14

…that this part of my desktop could feel so sleek:

Ubuntu 10.04 Lucid Lynx, we are ready for you.

Categories: LUG Community Blogs

Steve Kemp: He's so mean he wouldn't light your pipe if his house was on fire.

Planet HantsLUG - Tue, 09/03/2010 - 21:22

By the time this blog entry goes live I'll be running upon my new machine. The migration process was mostly straightfoward and followed my plan:

  • Using my existing desktop system as a PXE server to install Lenny over the network.
  • Copied over important directories.
  • Restored backups.
  • Turned off old machine.

Of course it wasn't that simple in practise, as previously mentioned the whole reason I was looking for a new machine was because the software RAID upon my old desktop was failing - One of the two drives was completely dead.

As I'd feared the second drive failed partway through my migration. But thankfully I'd copied off the important stuff before then, and the backups I have off-site mostly covered everything else. (The things I lost were things I can find again such as ~/Music, ~/Videos. On the one hand they're too large to backup, on the other hand I should probably do it next time as they never change.)

Unfortunately the version of X in Lenny refused to work with the GeForce G210 video card I had. To be more correct using the Vesa driver I could get a picture and a smooth desktop, but when watching videos with xine I got maybe two frames a second. Both the open nv driver and the closed nvidia driver failed to support the card - so I swapped hardware, and I'm now running with the GeForce 7300 GS card from my previous desktop. This allows me to watch videos at full-screen with no issues. (Desktop size is 1600x1200 FWIW).

So now it's just a matter of tweaking the system. I've installed enough to be useful:

  • miredo - So I have IPv6 connectivity despite Virgion.
  • squid - So that I have a decent cache for surfing.
  • pdnsd - So I have a caching nameserver and am not at the whim of Virgin.
  • kvm - So I can setup scratch machines for play.

I've still got to setup pbuilder, but that'll be done shortly, and I've installed backported packages such that I can watch youtube videos. I'm currently running firefox from lenny but I expect that will change soon enough - not least because that version fails to support "adblockplus", only "adblock".

Two partitions md0 for /boot and md1 used as LVM, from which I've taken /, /home, etc:

Filesystem Size Used Avail Use% Mounted on /dev/mapper/birthday--vol-root 9.9G 2.8G 6.6G 30% / /dev/mapper/birthday--vol-home 22G 4.3G 16G 22% /home /dev/mapper/birthday--vol-music 127G 43G 78G 36% /mnt/music /dev/md0 988M 38M 901M 4% /boot /dev/mapper/birthday--vol-kvm 22G 8.8G 12G 44% /mnt/kvm /dev/sdg1 163G 143G 12G 93% /media/disk skx@birthday:~/hg/blog/data$

 

skx@birthday:~/hg/blog/data$ sudo pvs [sudo] password for skx: PV VG Fmt Attr PSize PFree /dev/md1 birthday-vol lvm2 a- 464.82G 274.51G

Update: Three irritations with this machine:

  1. As supplied the BIOS was set with "USB Mouse" and "USB Keyboard" set to "disabled". I had to beg the loan of a keyboard from a neighbour.
  2. As supplied the BIOS had virtualisation set to "disabled". Not a huge shock, but it caught me out regardless.
  3. As supplied the system had only a single SATA power connector. Annoying given that the motherboard is advertised as having "onboard RAID" and I'd purchased it with two hard drives. Happily I had a spare adaptor to hand.

I'd still recommend Novatech, but the last point had me swearing for a few minutes until I realised I did have a spare adaptor in the house.

ObFilm: Chitty Chitty Bang Bang

Categories: LUG Community Blogs

Simon Stevens: In other news...

Planet HantsLUG - Tue, 09/03/2010 - 20:31
...7 of 9 assimilates ECS Drone.

And yes I'm so going to get slapped for that one tomorrow. Hard. And I'm going to deserve it!



Says it all really!



Speaking of facebook relationship status (as we were) this made me smile.

Categories: LUG Community Blogs

Peter Cannon: RatholeRadio EP 21

Planet WolvesLUG - Tue, 09/03/2010 - 14:31

This week Dan’s podcast RatholeRadio hit it’s 21st episode and to be fair it seems to be going from strength to strength. It’s a really nice way to round off Sunday evening I’m not sure why but I don’t feel the ‘urgency’ that I sense when other podcasts do their ‘Live’ shows. Maybe its the smaller IRC audience but I think its more to do with the fact that Dan plays what he wants, while you could heckle him from the IRC channel “Dan I’m stabbing myself with a Biro” I doubt very much if he would change the playlist that he had set up for that particular shows performance.

This week I decided to listen on my main openSUSE box rather than my Ubuntu Dell mini the first problem I encountered was appalling sound level, level? there was no sound! Actually that was not strictly true I could hear a faint noise coming from the left headphone. I have two shuttle PC’s both of which have audio in/out on the front, now dear reader you would have thought ‘remove two jacks from top machine plug same into bottom machine’ right? Erm apparently not! The bottom machine has the two ports cunningly swapped! Arrrrgghh I am now deafened and sentenced to suffer from tinnitus for the next week or so as 50 billion decibels burst my not so young eardrums.

As per usual Dan started off with some demo music just to test out his sound systems and the icecast http://65.60.11.2:8216/live we all seem to enjoy this part heaps as its not included in the podcast so its sort of our little groups pre-show party so to speak.

Hold On To Your Structure by The Hoboscopes
This is a fun track, gypsy punk with a heavy accordion lead. This had us all jigging around like lunatics, I like the way Dan plays something lively to kick the show off, gypsy punk always seems to put a smile on my face I suppose the musicians take it seriously I just think its a sort of mickey take on main stream punk or is it a more palatable version? Thumbs up on this one.

These Days by Robin Grey
A guitar based semi folk type song nothing special in my opinion but was a pretty easy listening track so fitted in well with the ‘Sunday Evening’ theme that permeates throughout these reviews.  I would have thought Dan would have played a second lively song rather than hitting us with this mellow track? Over all it was a so so track gets a “Meh” on this one.

Loneliness Of The Shot Down Bomber by Paindonor
Now this is an interesting song a cool mellow techno start with a heavy violin influence slightly strange but pretty haunting. I’m not sure if you could “Get down and shake your bootee” to this one but ideal for chilling out to or maybe while driving to work. I really like the title of the song and you did sort of feel, I presume, the pain in the track. Thumbs up on this one.

Words Of Wisdom by George Carlin
This was one of those political ’message’ monologues Dan seems to favour I’m not a big fan of it myself I’m not sure how it fits into a music show although having said that music and political messages have been intertwined since time began. I suppose it was enjoyable if you’re into that sort of thing it sort of reminds me of those free concerts where you have to listen to Red Robbo after each song to justify getting in for free. Thumbs down on this one.

Sad Man by Dub Rebellion
A Ska, Dub, Reggae band Dan seems to think I’m a huge fan of reggae I like it but its not my sole interest. The cohesion of Ska and Reggea is defiantly right up my street I wonder what a Bob Marley song would have been like given a Ska makeover? I enjoyed this track even doing a few ‘skanking‘ moves which is perfectly acceptable in the privacy of your own home. Thumbs up on this one.

The first ever live Rathole Radio gig tickets go on sale
The first ever live Rathole Radio gig is happening in Liverpool on Friday April 30th at the Bad Format Social Club. It kicks things off nicely for the OggCamp10 weekend to follow. Dan is trying to promote Creative Commons artists and has some amazing acts playing live. There’ll be interactive message walls, many laughs and the bar is also very reasonably priced apparently. I have paid my measly £5.00 so maybe I’ll see you there?

Live Fast Lie Down by BeatSix
This was a fairly lively Rock ‘N’  Soul mix reasonably enjoyable but nothing to set my socks on fire to be honest. I had a quick read-up on their Jamendo profile where they state “Think, very early Duran, mid-era Echo and the Bunnymen, a touch of David Sylvian/Japan with a potent stabs of art-rock guitar stings over a chocolaty bass and drums groove”. which in my opinion translates as “I’m not too sure what we are?” it wasn’t a bad song just nothing special. Gets a “Meh”

Superhero by Lab7
We was back on track with this Electro Spanish group, the song does the classic quiet start building to a heavy typical electro beat, quick as a flash out came the glow sticks and we was pumping to the beat. Apparently they are “An alter ego of a normal someone who uses electronic music to express himself through a kidnapped mind” which is a little bit scary. I like this one a lot and would probably download it. This one gets a thumbs up.

Mr Weirdo by Fresh Body Shop
Dan then hit us with this indie group with a very good beat and guitar rhythm I tried to resist performing as a virtual drummer and made do with ‘foot tapping’ instead. The group hail from France and have a huge list of so called influences listed on their MySpace website I did like the first influence “My cat” which I thought was kinda funny but over all I liked the song so this one gets a thumbs up.

LIVE TRACK – Billy Bragg – “Waiting For The Great Leap Forward”
Within the first two or three chords I recognised this emotional song from my youth with that epic line which is the title of the song. Dan gave us what to date has been my favourite rendition of a song which he belted out with all the passion that Billy himself would have been proud of. I’ve always liked Billy Braggs stuff I wonder if Dan fancies having a crack at the Levi Stubbs cover Tears? Have a listen to some of Billy’s stuff he is a political musician but the words of his songs still have value today. Thumbs up on this one.

Weapons by Keep Cool Vibration
Billed as Reggae Live Dub Rastafari this would be the classic big band Bob Marley type presentation, yes you guessed it we was all doing that slow motion bottom thrusting dancing. Yet another good tune to take up the penultimate slot of the show, I did want to read a bit more about them but their profile on Jamedo is in French and Google translate usually gets French wrong or so I’m told. Some strong trumpet sections and pretty clear vocals all in all a pretty good song which would be well worth downloading in my opinion or at least have a listen on line. Thumbs up on this one.

The Horse & Cart by Kagnee
Yet another song from the catalogue of the band Dan was a member of, this one apparently is about Pamela Anderson who made a porn tape with her partner Tommy Lee Jones back in the days when I had hair. Now I do like some of the stuff on the album but this particular track turned me off  while it was probably a laugh making the song and it has some low level historical value, apparently Tommy Lee heard the song and sent a signed copy back to the band, I thought it was terrible just an excuse to say what a slapper she was. Thumbs down on this one.

With seven thumbs up it would seem this weeks show was better than I thought I had a feeling it was slightly down on the last two podcasts that I’d attended but I must be wrong? I obviously enjoyed myself more than I thought.

Categories: LUG Community Blogs

Elisabeth Fosbrooke-Brown: Stars and sea

Planet ALUG - Tue, 09/03/2010 - 14:02
Last night was cold again, though unlike the south-east there was no snow. The sky was completely clear. On the way home from rehearsal I stopped the car in the vineyards and turned off the lights, to look at the mass of stars without getting frozen.

On Sunday Ginette went to Port Maubert (5 miles away) to see how the flood is receding. This stretch of coast didn't get into the tv reports because no-one died, but the water came right up into the houses. It wasn't so serious here, as there are no houses right on the sea's edge. The marsh was completely under water, and the roads to the ports were impassable: roads and ports are still being drained.
Categories: LUG Community Blogs

Richard WM Jones: rich

Planet GLLUG - Tue, 09/03/2010 - 12:41

Something unknown was changing the labels on certain devices behind my back. We couldn’t find out what it was using ordinary diagnostics, so I decided to investigate if we could do this with SystemTap. I quickly found an existing script to monitor changes in ordinary file attributes. This won’t work for SELinux labels though because those are stored in ext2/3/4 extended attributes (xattrs).

Basically I had to modify that script to monitor calls to setxattr instead.

Using the LXR I found that the call is implemented in Linux in fs/xattr.c, function vfs_setxattr. I had to modify the script to probe that kernel function, and the parameters are slightly different too.

I also had to install the correct kernel-{,PAE-}debuginfo package corresponding to my installed kernel. This is how SystemTap is able to resolve symbols in the current kernel.

/* Watch changes to xattrs on an inode. * http://rwmj.wordpress.com/2010/03/09/tip-use-systemtap-to-monitor-selinux-changes-to-files/ */ probe kernel.function("vfs_setxattr") { dev_nr = $dentry->d_inode->i_sb->s_dev inode_nr = $dentry->d_inode->i_ino if (inode_nr == $1) printf ("%s(%d) %s 0x%x/%u %d %s %s\n", execname(), pid(), probefunc(), dev_nr, inode_nr, uid(), kernel_string ($name), kernel_string_n ($value, $size)) }

Then run it with:

# stap -v /tmp/inodewatchxattr.stp inodenum

The bug turned out to be udevd, which I don’t think anyone was expecting …

libvirtd(4338) vfs_setxattr 0x5/166267 0 security.selinux system_u:object_r:svirt_image_t:s0:c177,c272 udevd(28299) vfs_setxattr 0x5/166267 0 security.selinux system_u:object_r:fixed_disk_device_t:s0 udevd(28299) vfs_setxattr 0x5/166267 0 security.selinux system_u:object_r:fixed_disk_device_t:s0 udevd(28299) vfs_setxattr 0x5/166267 0 security.selinux system_u:object_r:fixed_disk_device_t:s0

All in all, I’m impressed with SystemTap. It’s a simple, strongly-typed, sane programming language with type inference. Thankfully Python was not an influence on it.


Categories: LUG Community Blogs

Daniel Roseman: Easy create or update

Planet GLLUG - Tue, 09/03/2010 - 10:38

One common database operation that isn't supported out of the box by Django's ORM is create_or_update - in other words, given a set of parameters, either update an existing object or create a new one if there isn't one already.

The naive implementation is to do a get() on the model, catching the DoesNotExist exception if there's no match and instantiating a new object, then updating the attributes and saving. (You wouldn't want to use get_or_create here, as that doesn't allow you to update the instance if it already exists, so you'd have some duplication of code and db queries).

try: obj = MyModel.objects.get(field1=value1) except MyModel.DoesNotExist: obj = MyModel() obj.field1 = field1 obj.field2 = value2 obj.save()

The only problem with this is that it creates multiple queries: one to get the existing row, and then two to save it - Django checks to see if it should do an insert or an update when you save, which costs another query. Most of the time, this doesn't massively matter: creating and updating is usually done outside of the standard page rendering flow, so it's not a huge problem if it's a tiny bit slower.

But there are times when you do want to optimise this. One, which we recently ran into at work, is when you want to log items to the database in the course of normal page rendering. We do this to let users of our CMS know when they've put items on a page that aren't rendering how they should be, usually because they don't have the right selection of image assets. (There are good operational reasons as to why we can't stop them from entering them in the first place: I won't go into that here.) A further wrinkle for us is that we want to ensure each error only gets one entry in the log table, but should always record the most recent time that particular error scenario was encountered. So, an ideal case for create_or_update, if only it existed.

Of course I can't stand to see unnecessary db queries, so here's an implementation that uses QuerySet.update to do the initial getting and updating if a match exists. The trick is to realise that update returns the number of rows affected by the query - which has been true more or less ever since queryset-refactor landed nearly two years ago, but which was wrongly and explicitly denied in the documentation until recently (and still is denied in the 1.1 docs, even though it's true). We can use this number to tell if a matching row existed - and if it doesn't, we can then simply call create with the same arguments. Simple.

attrs = {'field1': 'value1', 'field2': 'value2'} filter_attrs = {'filter_field': 'filtervalue'} rows = MyModel.objects.filter(**filter_attrs).update(**attrs) if not rows: attrs.update(filter_attrs) obj = MyModel.objects.create(**attrs)

The attrs dictionary contains the field names/values to use to update the object, and filter_attrs is the filter names/values to find the object to update. If we're creating a new object, it will of course need to set both the attrs values and the filter_attrs, so we update one dictionary from the other.

Now, note that this will always call a db UPDATE, and if no match exists, it will additionally call an INSERT. Compare this with the original version, which always calls a SELECT, plus another SELECT and an UPDATE if the match exists, but just an INSERT if there's no match. So whether this is more efficient will depend on the use case - if you expect more updates than create, this version should be better (a single UPDATE versus SELECT+UPDATE), but if the reverse is true the original implementation will probably be better.

Categories: LUG Community Blogs
Syndicate content