100
Create your own secure cloud 16-PAGE RASPBERRY PI GUIDE www.linuxuser.co.uk DUALBOOT Build a safe & private cloud with ownCloud Get responsive with Qt Learn to write code that works in any screen format 3 Windows PC 3 RasPi 3 Mac 3 Android Maintain your systems remotely Need to fi x a Linux PC on the other side of the planet? No problem… Practical Raspberry Pi Brand new 16-page mini-mag Build a RasPi-controlled car • Use an accelerometer • Make a music player • GertDuino tested The latest Rasberry Pi add-on board reviewed ALSO INSIDE: » Can the BBC get you coding? » Monitor your network with tshark » Cent OS 6.5 and Mageia 4 rated Linux on any device The essential monthly section for coders & makers NEW NEW INSIDE FIND ALL THE TUTORIAL FILES YOU NEED www.linuxuser.co.uk/tutorial-files ISSUE 135

Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

  • Upload
    iscrbdi

  • View
    364

  • Download
    9

Embed Size (px)

DESCRIPTION

Practical Raspberry Pi.Build a remote-controlled carThe ultimate in 3D image capture?Make a streaming music playerSet up and use an accelerometerIssue 135 of Practical Raspberry Pi User & Developer

Citation preview

Page 1: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Create yourown secure cloud

16-PAGE RASPBERRY PI GUIDE

www.linuxuser.co.uk

DUAL BOOT

Build a safe & private cloud with ownCloud

Get responsive with QtLearn to write code that works in any screen format

Windows PC RasPi Mac Android

Maintain your systems remotelyNeed to fi x a Linux PC on the other side of the planet? No problem…

PracticalRaspberry Pi

Brand new 16-page mini-magBuild a RasPi-controlled car •

Use an accelerometer •Make a music player •

GertDuino testedThe latest Rasberry Piadd-on board reviewed

ALSO INSIDE:» Can the BBC get you coding?» Monitor your network with tshark» Cent OS 6.5 and Mageia 4 rated

Linux on any device

The essential monthly section for coders & makers

NEW

NEW INSIDE

FIND ALL THE TUTORIALFILES YOU NEEDwww.linuxuser.co.uk/tutorial-fi les

ISSUE 135

Page 2: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

AVAILABLE NOW!

Full range of project accessories• Kits and Cases• Expansion, Breakout and Prototyping Boards• Vast Range of Components• WiFi Dongles & HDMI to VGA Adaptors• Video and Audio Leads• Keyboards, Mice and Monitors• GPIO Ribbon Cables• Programming and User Guides

FREE

DEL

IVER

Y

cpc.co.uk

Inc VAT

£83.32 Ex Vat

£99.98SC1323358

Model B - 512MB with 8GB NOOBS SD Card

£19.24 £16.03 Ex Vatcode SC1322358

RaspberryPi NoIRCameraBoard

£19.24 £16.03 Ex Vatcode SC1302358

visit cpc.co.uk for more information

RaspberryPiCameraBoard

AVAILABLE NOW!

£32.99 £27.49 Ex Vatcode SC1313058

Page 3: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Rob Zwetsloot studied aerospace engineering at university, using Python to model complex simulations in class. This issue our resident staff writer fl exes his considerable dual-booting muscles (starting on page 24) and talks to the man that built a 3D full-body scanner using nothing more than Raspberry Pis.

Tam Hanna has been in the IT business since the days of the Palm IIIc. Serving as journalist, tutor, speaker and author of scientifi c books, he has seen every aspect of the mobile market more than once. This month Tam continues his ‘code with Qt’ series with a look at responsive design (pages 48-51).

Mihalis Tsoukalos is a UNIX system administrator with expertise in programming, databases and maths. He has been using Linux since 1993. For issue 135 of Linux User & Developer, Mihalis talks us through testing your network with tshark. It’s a great tool for solving issues – fi nd out more on page 44.

Michael Reed is a technology writer, and he’s been hacking away at Linux for over 15 years. He specialises in desktop Linux solutions among other things. For this issue, Michael helps set us up with remote maintenance. If you’ve got a PC on the other side of the planet to look after, Mike’s your man (pages 36-39).

Jon Masters is a Linux kernel hacker who has been working on Linux for some 18 years, since he fi rst attended university at the age of 13. Jon lives in Cambridge, Massachusetts, and works for a large enterprise Linux vendor. You can fi nd his indispensable Kernel Column on pages 20-21 this month.

Gareth Halfacree is our resident news reporter and brings us the latest from all over the open source ecosystem, starting on page 12. Gareth also unboxes the GertDuino on pages 76-77 this month to see if the new Raspberry Pi add-on board can help your projects shine.

Issue 1353

Yo

ur

tea

m o

f Lin

ux

exp

ert

s…

Get in touch with the team:[email protected]

Welcometo issue 135 of Linux User & Developer

Welcome to the latest edition of Linux User &

Developer, the UK and America’s favourite open

source and Linux magazine.

All eyes are on Linux in 2014, thanks to the massive

success of the Raspberry Pi , continued domination of

Android and Valve’s incredible decision to bring Steam

to Linux. Steam, the dominant digital gaming platform

for PC gamers, has a whopping 65 million active users and

Valve plans to introduce Steam Machines, home theatre-style

living-room PCs that run Linux. There are more than a few

non-Linux-savvy people desperate to get up to speed with all

things Linux and learning how to dual-boot it with their current

operating system is a great way to get started.

Dual booting isn’t quite the dark art it once was and you’ll be

amazed how quickly you can be up and running regardless of

your current platform. In our quest to leave no stone unturned

we’re also showing you how can dual-boot your Android device

and even your Raspberry Pi – get started on page 24.

We’re also rather excited about our new Raspberry Pi

section starting on page 53. Every month we’ll be bringing you

16 pages of the hottest gadgets, projects and interviews from

around the Raspberry Pi community. If you’d like your project

featured in the magazine or would like to request a tutorial on

a particular topic, get in touch using the details below.

Russell Barnes, Editor

Buy online

Get Linux User

cheaper per issue

Page 34

» Create your own cloud» Dual-boot on any device» Responsive design with Qt» Maintain systems remotely

This issue

Visit us online for more news, opinion, tutorials and reviews:

www.linuxuser.co.uk

Facebook:Linux User & Developer

Twitter:@linuxusermag

Page 4: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Contents

Join us online for more Linux news, opinion and reviews www.linuxuser.co.uk

www.linuxuser.co.uk4

12 News The biggest stories from the

open source world

18 OpinionsThe latest from your favourite free software columnists

83 BooksRead all about the latest Linux-related books

92 Letters Your views on the magazine

and the open source scene

OpenSource

96 Cover discFour of the latest distros for you to try outon this issue’s DVD!

On your free disc

Linux Mint 16 PCLinux OSCent OS 6.5Raspbian

Tutorials36 Configure your PC for remote maintenance Need to fi x a remote PC? Make it easy with our expert advice

40 Build your own private cloud with ownCloud Keep your data safe and secure in the cloud with our fast-track set-up guide

44 Monitor your network traffic with tshark Keep an eye on your network, troubleshoot problems and add network data to a database

48 Responsive app development with Qt Master Qt’s layout system to ensure your apps look good, no matter the display size

Features06 Educate, inform and entertain We speak to the designer of the BBC Micro about the future

24 Dual boot Linux on any device Master Windows PCs, Macs, Androids & even the RasPi 86 Q & A Your hardware and software questions answered

Reviews

Subscribe today!

34 Save at least 50% on the shop price. US customers can subscribe via page 82

72 Instant messaging super-test What’s the best way to keep in touch with colleagues and friends?

24 Dual boot Linux on any device Plain English advice to get you up and running

NEW

INSIDE

53 Practical Raspberry PiWe’re excited to reveal a new section in Linux User & Developer dedicated to everyone’s favourite small form factor development board!

Empathy

Telepathy

emesene

Pidgin

76 GertDuino The latest add-on board for the Raspberry Pi tested

78 Cent OS 6.5 A really quick release after Red Hat Enterprise Linux

81 Mageia beta Find out how the latest release

is shaping up

83 Books The latest reads rated

Page 5: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer
Page 6: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Educate, inform and entertainDavid Crookes talks to Steve Furber, designer of the original BBC Micro, about how the BBC can learn from the past in their new push to teach programming to the masses…

6 News | 18 Opinion | 92 Letters

When the MP Elizabeth Truss recently

reiterated her party’s desire for children

aged 11 and over to learn to program in two

languages, her comments were met with

some scepticism. It has been the same since

education secretary Michael Gove spelt out his

plans in July for children to be taught about the

definition of algorithms and to be creating and

debugging simple computer programs between

the ages of five and seven.

One of the accusations some internet

commentators levelled at Truss, the Conservative

parliamentary under-secretary of state with

responsibility for education and childcare, was

she would, most likely, be unable to code herself.

‘Do as I say, not as I do’ seems to be the mantra

among detractors of what will be a revolutionary

approach to the teaching of computing in schools.

Yet that is missing the point entirely. It

could perhaps be said, with a great degree of

accuracy, that Truss has very little knowledge

of the inner workings of a computer and

that she is familiar with Word, Excel and

Powerpoint to a far greater extent than

Python, C++ and the myriad other languages

out there. Never mind getting children to

learn at least one text-based language and

encouraging the learning of data structures

such as lists, tables or arrays, it may well be

that some MPs wouldn’t have the faintest idea

what that sentence even means.

If this is the case, however, then it is because

Truss and her ilk have been failed. Years of poor-

quality IT teaching and an emphasis on using

software rather than creating it has dealt so

many children a bad hand. If Truss and other

MPs who are insistent on promoting coding in

schools can’t program themselves, then that is

not their fault. You really can, in this instance,

blame it on the system. In attempting to prevent

future children from the same fate, though, their

commendable efforts are to be applauded.

DEBATE

www.linuxuser.co.uk6

The BBC Micro helped

introduce a generation to

creative programming

Steve Furber, designer of the BBC Micro

Page 7: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

The latest in the Linux community

News

OPEN SOURCE

www.linuxuser.co.uk7

BBC MicroFor those with long memories, the early days

of computing did come with the idea that we

should be teaching children to code. It is for

this reason the BBC lent its name to a series of

computers which came to be known as the BBC

Micro, and which were introduced into schools

up and down the UK. It was a success in that

it helped to breed a good number of talented

programmers and turned them on to the power

and creativity of computing – but something

went wrong down the line. As computers began

to have glossy icon-driven desktops, children

started to be cut off from what was lying under

the hood and the rot began to set in.

Now we are in a position of crisis – in the

sense that too few children are being introduced

to programming – and the BBC is returning to

the field in which it once played such a great

part. Director general Tony Hall announced

plans to bring coding into every home, business

and school in the UK in an initiative that will roll

out in 2015. “We want to inspire a new generation

to get creative with coding, programming and

digital technology,” he said.

All that remains is working out exactly what

role the BBC wants to play. The plans are still

being formalised; the BBC only knows that

it wants to do something and it has a loose

strategy that it hopes to firm up over the coming

months, in partnership with government,

teachers and technology companies. But one

person in a great position to advise is Stephen

Furber, one of the designers of the BBC Micro.

Today, he is professor of computer engineering

at the University of Manchester and such is his

great work in the field – he went on to design the

ARM 32-bit RISC microprocessor – that he was

awarded a CBE in 2008.

“I chaired a Royal Society study of computing

in schools which came out very strongly with

the idea that we’ve got to get away from being

just users of technology and back to being i

nterested in being creators of technology,”

Furber begins. “That coincided with the report

that Nesta sponsored from the games industry,

which is the Livingston-Hope report, that

basically said the same thing. And, of course,

there was the Eric Schmidt MacTaggart lecture

that said the UK was foolishly risking losing the

heritage of the BBC Micro.”

Welcoming a curriculum that is even wider

than coding: “It’ll include robotics and Raspberry

Why did the BBC notwant a slice of Pi?Linux User catches up with Raspberry Pi

creators Eben Upton and David Braben

Linux User: David, you created Elite for the

BBC Micro back in the Eighties. What do

you think of BBC’s plans today?

David Braben: Anything people do in this

sphere is a good thing.

Was it the case that the BBC turned down

the Pi, though?

The BBC were supportive of Raspberry Pi,

but over a number of years of discussions

repeatedly didn’t move forwards. While this

was not a ‘no’ it wasn’t a ‘yes’ either.

Eben Upton: We approached the BBC a

number of times over the two years to May

2011 with the specific request that we be

allowed to use the BBC brand, making the

Raspberry Pi effectively a new BBC Micro.

So was it a situation of the BBC not

wanting the Pi because it had this initiative

on the go?

No - the issue as I understand it is that

the BBC is unable, as a state entity, to go

and compete in the computer industry, or

to endorse a particular manufacturer’s

product. While this was frustrating for

us, you can certainly see the merit in

this. I believe the proposed new initiative

is intended to be vendor-neutral, which

is a good thing.

But would the Pi be an essential part of the

initiative, do you think?

I think there’s room for an overarching

initiative from the BBC which will run

on all sorts of platforms. We’ll certainly

be arguing strongly that whatever is

produced should run on the Pi (so no

Flash, no dependence on proprietary office

applications or programming environments

that don’t run on Linux). The big advantage

of the BBC is that they have enormous

domestic and international reach, which

is going to be a boon in promoting coding

outside the ‘usual suspects’ (children with

a natural bias towards this sort of thing,

and/or those with parents or teachers with

engineering backgrounds).

The advantage of the BBC is that they have an enormous domestic and international reach Eben Upton

Eben Upton feels there is room for an

overarching initiative from the BBC

David Braben believes any developments

in the Raspberry Pi sphere are a good thing

Page 8: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Your source of Linux news and viewsOpenSourcewww.linuxuser.co.ukFor the latest news and views

Email us directly…[email protected]

www.linuxuser.co.uk8

Pis and all these other little things that bring

people closer to the technology,” he adds –

Furber says the time is right for the BBC to get

involved again. “The move to encourage more

people to get engaged in the creative basis

of technology is fairly broad and the BBC has

latched on to this and recognised that it can,

again, play a role.”

To what extent, though, he is less sure. “I

doubt it can have as transformative an impact

as it did in the Eighties because the world isn’t on

the turn in the same way,” he says. “When things

are starting, the scope to have a big impact is

much greater than when things are in the sort of

more continuous state and today things are still

changing but they’re not transforming – they’re

evolving. I think the BBC realises that it can’t

have the same transformative impact.”

Eighties explosionIn the early Eighties, there was a civilian

explosion in home computing. The

microprocessor developments during the

Seventies had put low-cost computing

within reach of the public but there was no

set standard, so dozens of companies in the

UK designed their own home computers.

The BBC had seen that the introduction of

the microprocessor was going to have a very

signifi cant impact right across general life

from home to business and it wanted to do

something, as part of its educational role, to

bring the wider public up to speed on this (Lord

John Reith, in establishing the BBC, summarised

its purpose in three words: educate, inform,

entertain). The BBC decided it could best

achieve this by adopting a machine and using

that as a basis for a series of TV programmes.

Having begun discussions with Newbury

Laboratories, which was producing a machine

called the NewBrain, the BBC had begun to

despair of the company’s ability to deliver a

working machine on the timescale they needed,

so they opened the contract up and put it out to

tender. Several companies bid for this, including

Sinclair and Acorn, but the BBC was most

convinced by the Acorn offering, even though it

was not really in the centre ground of the spec

the corporation was looking for. It was decided

the new machine would be branded the BBC

Micro and work continued.

It worked well. The BBC brand had – and still

has – a lot of public trust and so, when the BBC

Micro came out, the wider public saw this and

felt computing had arrived in some sense.

In volume terms, it was outsold by Sinclair but it

was able to establish itself in schools and among

the richer, more conservative computer buyers

(the Micro wasn’t cheap by any means). But that

was then. The BBC would be hard pushed to

replicate that kind of success again today.

“I think it’s also the case that the BBC today

would fi nd it very diffi cult to get directly involved

in commercial activity in the way it did with the

BBC Micro,” says Furber. “There’s no doubt that

the BBC’s involvement in offering its brand for

that Acorn product had a very big infl uence on

the commercial marketplace – and Sir Clive

Sinclair was very upset about it – but it was

controversial then and I think it’s probably

undoable now. I don’t think the BBC has got

quite the ability to operate in the commercial

domain in that way today.”

Furber elaborates, noting that the BBC is

much more constrained in terms of how it can

engage: “I don’t think it would be appropriate.

At no point have they said they want to sponsor

a new BBC Micro. Their emphasis is different

The BBC, with its accessible BASIC language, gave us the chance to actually create something Gordon Sinclair

Gordon Sinclair remembers the BBC

Micro having a real impact in schools

Page 9: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

The latest in the Linux community

News

OPEN SOURCE

www.linuxuser.co.uk9

Reintroducing theBBC MicroEven though the technology is more than

30 years old, a UK company is taking BBC

Micros into schools in a bid to create a 1980s

classroom and encourage programming.

We talk to Gordon Sinclair, director of Replay

Events, and creator of 80s Classroom.

Linux User: Why re-introduce BBC Micros into

schools – aren’t they old hat?

Gordon Sinclair: By using the quirkiness

of a 30-year-old machine as a way into

the imagination, we show the games and

educational software that their parents and

grandparents would have been playing, tell

them about the importance of the machine in

shaping an industry and then let them get their

hands dirty with simple programming.

How are teachers reacting to it?

After ten years of teaching kids that computers

are purely for offi ce skills or the internet,

the thought of actually programming the

machine is a scary prospect. Many teachers

are understandably a bit scared by the new

curriculum too, so our 80s Classroom aims to

fuse the past and the future of computing in a

fun and entertaining way. Our hope is that we

are able to get the teachers as excited about

the subject as the kids.

Do you remember the impact the BBC

Micro had?

As a schoolchild in the 1980s, I witnessed

fi rst-hand the impact of computers in schools.

While many kids had a Spectrum (like me),

Commodore 64 or Amstrad at home, which

for most was just for playing games, the BBC

with its accessible BASIC language gave us the

chance to actually create something.

Is it a case of using BBC Micros to introduce

teachers? Linux and the Pi fulfi ls more

advanced needs, doesn’t it?

Absolutely. Programming in BBC BASIC is

fun and a great introduction that shows

how relatively small programs can get great

results, but it does need to translate into

a useable skill. We expand on this using

Scratch and Python. Scratch is a great

drag-and-drop language that gives visible

results very quickly and makes it very easy

to demonstrate routines and logic. Python

on the other hand is a bona fi de modern

programming language that can be the start

of a career in programming.

What do you think of the BBC’s plan?

Whilst the romantic in me would love to see a

new machine released with the BBC brand and

the iconic owl, I think the [current] approach

is wise. We all have computers, smartphones

and tablets so it is much wiser to focus on

existing systems and languages. I can’t see us

getting a main channel TV show like 30 years

ago, but I will be really interested to learn more

of the BBC’s plans.

80s Classroom is reintroducing

children to computing in

an entertaining way

Page 10: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Your source of Linux news and viewsOpenSourcewww.linuxuser.co.ukFor the latest news and views

Email us directly…[email protected]

of teachers don’t think the Government will

provide enough support for them and 96 per

cent would welcome the closer involvement of

business to help them build the practical skills

and knowledge of their students. “From our

anecdotal knowledge and our survey, it is clear

teachers don’t feel able or prepared to teach the

new curriculum,” Mr Akerman said. “There has

been a shift – and it is a tremendous one – but

teachers have to hit the ground running. It could

be fantastic and close the skills gap, but people

will say the initiative has not worked if teachers

are not in the position where they can teach.”

This is something Furber certainly agrees

with: “The biggest issue that has to be overcome

is the training of teachers to cope with this. ICT

was not only, in many schools, fairly passive,

it was also a fairly low-grade subject in terms

of the staff appointment. Quite often the ICT

class would be taken by the slightly underused

geography teacher, because they couldn’t fi nd

anybody else to do it. If you’re going to introduce

some real programming and peering into

operating systems, then you need some people

who’ve got some reasonable computer science

background on the teaching staff and most

schools just don’t have that.”

Rather than partner with a computing

company and badge up another machine,

Furber believes the BBC would do better helping

and quite rightly so. But they are still one of the

world’s biggest and most respected media

companies and they have a lot of infl uence. If

they choose to use that infl uence in this positive

way then I think we could all welcome it.”

There are still lessons to be learned from

those early days, he says. One of the problems

was that the BBC Micro, while booting with a

BASIC prompt and letting you type programs

immediately, wasn’t actually used like that

in the vast majority of schools. “There was a

fairly signifi cant emphasis on programming

but actually if you look at the way BBC Micros

were used in schools, a lot of that was using

software produced by the very large number of

software companies that developed to ride the

bandwagon and a lot of the schools’ use was not

actually around writing programmes.”

BBC’s new pushIt is this aspect that the BBC today will be

hoping to change and yet, as the BBC’s

technology correspondent Rory Cellan-Jones

noted, “Many teachers feel they lack the skills

and the materials needed to teach coding”.

A survey by Will Akerman, managing director

of MyKindaCrowd, discovered 69 per cent

teachers to learn to program and provide

education tools for students to use. He also

believes that Linux would be the answer. He

feels using Linux would help get children away

from the accepted familiarity of a Windows or

OS X environment and would help make them

question, probe and investigate a lot more.

“If you needed a reasonably substantial

operating system, then it seems to me Linux is

the obvious choice because what else are you

going to go for?” questions Furber. “It’s free, it’s

public domain, it’s got enough momentum to

move with the technology and the greatest thing

about it is that it isn’t Windows, right? I live in an

academic world where I use a Mac but all my

students and post docs use Linux. If you went

and scraped around my group hard enough

www.linuxuser.co.uk10

Is bringing back the BBC Micro the answer

to the lack of computing in schools?

Page 11: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

I think digging into operating systems is going to terrify teachers… and the number of teachers who have got the background to cope is limited Steve Furber

The latest in the Linux community

News

OPEN SOURCE

www.linuxuser.co.uk11

you might fi nd one or two machines that run

Windows but Linux has become the standard

platform for most academic work these days

and that is because it is more open.”

Scary Linux?Since a lot of the academic work being

carried out by Furber’s students is software

development, they require that openness: “If you

want to do software development on Windows

you’ve got to kind of live in a fairly closed

box. Unix has always been about software

development – software development is in its

genes – and Linux has carried that tradition

forward: all the standard ways that people build

complex software will fi nd direct force in Linux in

a way that they don’t anywhere else.”

But, we ask, wouldn’t Linux scare the teachers?

“Oh I’m sure it would, yes,” he says. “But of course

Raspberry Pi is doing that. I think any digging into

operating systems is going to terrify teachers,

whatever the operating system and the number

of teachers who have got the background and

experience to cope with that is very limited.”

The BBC, it seems, is therefore entering

a tricky arena. In seemingly having decided

against badging up a BBC Micro 2 –

discussions have been held but ultimately

have come to nothing – the corporation

can concentrate on the central message. It

matters less what computer children use

and the BBC could get caught up in that

whole issue and lose focus. What matters

more is that they develop coding skills that

would make technophiles of the nation’s kids

rather than see them grow into disinterested

technophobes – which is a dangerous

situation in today’s world.

While some may scoff – journalist Willard

Foxton wrote a blog on the Daily Telegraph

website claiming “coding is a niche, mechanical

skill, a bit like plumbing or car repair”, calling the

bulk of developers “exceptionally dull weirdos”

and saying ICT was taught by “the runts of the

teaching litter and seen as pointless by pupils”

– such people will become the exception in the

future should these plans come off. Besides,

the interest in the Raspberry Pi is showing that

there is an appetite for learning programming in

greater depth among the nation’s young.

“I think Raspberry Pi is great. Probably the

greatest thing about it is the kind of buzz it’s

created and the enthusiasm and all these

events that I keep hearing about,” says Furber.

“They’re encouraging people to get interested

and enthusiastic. The Pi itself is not unique but

it has generated a unique buzz and that itself is

great. The BBC is probably right to keep a little

bit of distance from that, but together there is a

sense that real change is coming.”

Furber believes Linux would help to

get children to investigate, question

and probe a lot more

Page 12: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Valve Prepares for SteamOS, Steam Machine LaunchSteamOS GNU/Linux 1.0 ‘Alchemist’ available now

Gaming giant Valve had their long-awaited

offi cial unveiling of the world’s fi rst Steam

Machines, high-performance yet compact

gaming PCs that are designed for the living

room and based around a Linux distribution

the company calls SteamOS, at the Consumer

Electronics Show (CES) 2014.

Valve founder Gabe Newell has been vocal in

his support for the world of Linux in recent years,

following increasing displeasure with moves made

by Microsoft into turning Windows into what he

perceives to be a more locked-down platform

with little room for companies like Valve to play.

“‘I think that Windows 8 is kind of a catastrophe

for everybody in the PC space,” Newell famously

told investment site VentureBeat in 2012 - an

opinion he doesn’t appear to have changed in the

intervening year and a bit.

Having previously been accused of ignoring

Linux as a target platform when porting the

Steam digital distribution platform from

Windows to OS X, Valve corrected its oversight

with the release of Steam for Linux in February

2013 and made much of a partnership with

Canonical to customise its Ubuntu Linux

operating system for gamers.

Now, the fruits of that labour are becoming

apparent. The fi rst offi cial Steam Machine

consoles have already been dispatched to

participants in the closed beta, while SteamOS

itself has been released for the public to

download and test on existing hardware – and

it brings with it some rather interesting details

about the operating system.

While Valve had previously hinted heavily

that SteamOS would be based on Ubuntu,

following its work with Canonical on the

Steam for Linux project, the publicly-released

SteamOS 1.0 ‘Alchemist’ beta is actually a

customised version of Debian 7 ‘Wheezy.’

The reason for the last-minute shift has not

been supplied, with both Valve and Canonical

remaining silent on the matter.

Sadly, the publicly-available SteamOS 1.0

image isn’t exactly feature-complete: written

specifi cally for the 300 limited-edition prototype

Steam Machine systems provided to US-

based beta testers in mid-December 2013, the

software concentrates on the hardware Valve

is testing internally. As a result, early adopters

will fi nd binary-blob drivers for Nvidia graphics

processors but no other manufacturer’s parts

installed – although Valve has promised that

support for AMD and Intel hardware will be

available in a future release.

For those wanting to try the platform out,

Valve mandates a system with at least 500GB

of hard drive space, a 64-bit CPU – despite

including a 32-bit boot option – and 4 GB of

RAM on a motherboard supporting the Unifi ed

Extensible Firmware Interface (UEFI). The

default installer erases any existing operating

system, although it’s possible to confi gure Grub

for dual-booting post-install.

For more information and details about the

SteamOS installer, visit the offi cial website

and store, available at steampowered.com/

steamos/buildyourown.

www.linuxuser.co.uk12

Your source of Linux news and viewsOpenSourcewww.linuxuser.co.ukFor the latest news and views

Email us directly…[email protected]

GAMING

Valve’s SteamOS is now available for testing

– if you’ve got Nvidia graphics, at least

The first commercial Steam Machine gaming systems

were showcased at the Consumer Electronics Show 2014

Page 13: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Linux calendar

25

th J

an

ua

ry

UKGovcamp» City Hall, Southbank, London

» UK

» ukgovcamp.com

An open-access and free unconference designed for anyone interested in how the UK Government uses technology, based on the Govcamp movement

started by Jeremy Gould in 2008.

Mark Shuttleworth, founder of Ubuntu creator

Canonical, has stated that his company has

signed up a hardware partner to produce the

fi rst smartphone based around Ubuntu Touch,

previously known as Ubuntu for Phones.

Announced to press at the LeWeb Conference,

details of the agreement – including the name of

the partner company – were not provided, but

Shuttleworth promised that it would result in the

launch of a high-end Ubuntu-based smartphone

into the market some time in 2014.

The move follows Canonical’s unsuccessful

attempt to raise $32 million through

crowdfunding site Indiegogo to produce an

Ubuntu Touch smartphone, dubbed the Ubuntu

Edge. The target hardware, Canonical claimed

at the time, included 128GB of storage and a

high-end quad-core processor while a bundled

docking system would allow the device to be

used as a fully-fl edged Ubuntu desktop with

monitor, keyboard and mouse.

Shuttleworth also claimed to have at least four

other companies interested in developing Ubuntu

Touch hardware. “We are now pretty much at the

board level on four household brands,” he told

press at the event. “They sell a lot of phones all over

the world, in emerging and fully emerged markets,

to businesses and consumers.” Again, however,

names of these companies were not provided.

Ubuntu Edge failure not the end of company’s smartphone dreams

Snowcode 2014 » Chalet Les Hirondelles, La Clusaz

» France

» snowcode.co.uk

An unconference for NoSQL developers, Snowcode combines hacking on various NoSQL-based projects with a chance to take to the slopes at a French ski resort.

19th

- 2

6th

Ja

nu

ary

Canonical forges Ubuntu Touch deals

BETT Show 2014 » Excel, London

» UK

» bettshow.com

The UK’s biggest educational technology exposition, BETT frequently includes exhibitions and demonstrations from both the proprietary and open-source software worlds.

22

nd

- 2

5th

Ja

nu

ary

www.linuxuser.co.uk13

The latest in the Linux community

News

OPEN SOURCE

MOBILE

The Ubuntu Edge lives on as Canonical finds

a hardware partner for production

The non-profi t Mozilla Foundation,

creator of the Firefox web browser, has

signed up a raft of companies to its Open

Web Device Compliance Review Board

including previous partner ZTE.

The board, Mozilla has explained, will

work to set technical standards to drive

compatibility of open and web-based

platforms like the FirefoxOS mobile

operating system fi rst launched in the UK

on the ZTE Open handset.

Companies who have joined Mozilla in the

Open Web Drive Compliance Review Board

include chipset manufacturer Qualcomm,

smartphone makers Alcatel and LG, and

mobile providers Deutsche Telekom and

Telefonica along with existing member ZTE.

OPEN WEB

Mozilla signs up more FirefoxOS partners

Mozilla is aiming to target the low- to

mid-range smartphone market with the

FirefoxOS platform, but its initial release in

late 2013 proved buggy and ill-supported

– issues it is now working to fi x for the near

future to attract consumers.

Mozilla has convinced big names to join

its work on open web platform standards

Global Game Jam » Various

» Worldwide

» globalgamejam.org

The world’s largest hackathon concentrated on game development, the Global Game Jam takes place at locations around the globe – and attendees can set up their own if none are close enough.

24

th -

26

th J

an

ua

ry

Page 14: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Your source of Linux news and viewsOpenSourcewww.linuxuser.co.ukFor the latest news and views

Email us directly…[email protected]

www.linuxuser.co.uk14

REFORM

Universal Credit development boosted, but critics complain

Department for Work and Pensions adopts open source

The Department for Work and Pensions (DWP)

Universal Credit welfare reform programme

has offi cially moved to development on open-

source software, but its critics have asked

why this wasn’t done when the project started

nearly three years ago.

Due to roll out nationally by 2017, the new

digital Universal Credit system is based on

open-source technologies according to Howard

Shiplee, the programme’s head of delivery.

“The current system for Universal Credit is a

conventional system being developed on a

waterfall approach,” Shiplee told MPs in his

recent report on the programme. “When you

look at [its replacement], it’s very different; it

relies not on large amounts of tin, black boxes.

We will use open source and use mechanisms

to store and access data in [a web] environment.

It is much cheaper to operate and to build; we

don’t have to pay such large licence fees.”

Shiplee was asked why open source,

frequently adopted by world governments to

reduce costs and improve transparency and

interoperability, wasn’t chosen at the very

beginning of the £2.4 billion project, over two

and a half years ago. “Technology is moving

very rapidly, and such things weren’t available

as they are today,” he claimed.

The decision to build a new Universal Credit

system on open-source software does, however,

have a direct cost. Of the £303 million spent

on the programme so far, the department

has immediately written off £40.1 million with

another £91 million to be written off when the

system has fully rolled out. The programme

does, however, claim to hold £152 million in

assets at the present time.

The DWP is to use open-source software for

the new Universal Credit system

PRIVACY

Reform government surveillance coalition seeks changesTech giants join forces over surveillanceSome of the biggest names in the technology

industry have joined forces to request

governments across the world to change their

stance on surveillance tactics following the

recent damaging revelations from former NSA

contracter Edward Snowden.

AOL, Apple, Facebook, Google, LinkedIn,

Twitter and Yahoo have all signed a joint

statement which reads, in part: “The undersigned

companies believe that it is time for the world’s

governments to address the practices and laws

regulating government surveillance of individuals

and access to their information.”

The coalition proposes fi ve core principles

that will drive that reform: the limitation

of governments’ authority to collect information

on internet users; oversight and accountability

for the agencies requesting or gathering such

information; greater transparency in government

demands for user data to companies; a respect

for the free fl ow of information which is the heart

of the internet; and the creation of a framework

that prevents confl icts across jurisdictions and

between governments.

“The security of users’ data is critical, which is

why we’ve invested so much in encryption and fight

for transparency around government requests

for information,” claimed Google’s Larry Page of

the Coalition. “This is undermined by the apparent

wholesale collection of data, in secret and without

independent oversight, by many governments

around the world. It’s time for reform and we urge

the US government to lead the way.”

The Coalition forms as technology companies

around the world – not least those named above

– receive increased scrutiny amid accusations of

collaboration in illegal wholesale data collection

with government agencies.

Google’s Larry Page is adamant that reform

is needed in the face of the Snowden leaks

London’s Tech City programme has been

added to the list of bodies capable of

putting in applications for visas under the

government’s Exceptional Talent programme,

joining the like of the British Academy and the

Royal Academy of Engineering.

The Exceptional Talent programme

allows named participants to endorse

foreign nationals as having particular skills

important to the UK, to boost their eligibility

for a work visa under the points-based

immigration scheme.

It has not yet been stated how many

endorsements Tech City will be granted, but

it is expected to be around 100.

Tech City addedto visa scheme

ONLINE

Find out more about Tech City at

www.techcityuk.com

Page 15: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

The latest in the Linux community

News

OPEN SOURCE

LINUX

Internet of Things becomes more open

Linux Foundation launches AllSeen Alliance

The Linux Foundation has announced the AllSeen Alliance,

which it claims is the broadest cross-industry effort to advance

the Internet of Things – the concept of giving everything from

intelligent sensor networks to home thermostats, TVs and

microwaves communication capabilities.

Designed to promote interoperability in the burgeoning market

segment, predicted to reach £1.2 trillion by 2020 with an estimated

212 billion devices online, the Alliance looks to extend the Internet

of Things concept into the Internet of Everything and has signed

up some big names to do so. Members of the Alliance include

Qualcomm, Cisco, TP-Link, HTC, LG, Panasonic and Silicon Image,

with more expected to join its ranks in the near future.

“Open-source software and collaborative development

have been proven to accelerate technology innovation in

markets where major transformation is underway,” claimed Jim

Zemlin, executive director at The Linux Foundation. “Nowhere

is this more evident today than in the consumer, industrial

and embedded industries where connected devices, systems

and services are generating a new level of intelligence in the

way we and our systems interact. The AllSeen Alliance

represents an unprecedented opportunity to advance the

Internet of Everything for both home and industry. We are very

happy to host and help guide this work.”

ONLINE

Code hits GitHub even before the site goes live

The Guardian open-sources responsive site code

The Guardian has released the source code to its new front-end

software, uploading it to the GitHub repository platform before

even sending the new software live on its own site.

The site has been designed to offer a fluid, responsive design

capable of adjusting its layout and fidelity depending on the screen

size, resolution and device capabilities of any particular user.

The new front-end package is build on Node.js, the Node Package

Manager, GraphicsMagick, Grunt and Ruby and is compatible with

both Linux and OS X hosts.

The code is released under an Apache 2.0 licence, and was first made

available to the public in May 2012. It is only in the past month, however,

that the code base has improved to the point where The Guardian is

looking to move its own site across following a period of beta testing

concentrating on the use of the front-end on mobile browsers.

The code can be downloaded from The Guardian’s GitHub

repository at github.com/guardian/frontend.

The Guardian’s new responsive front-end design has been made available

under an Apache licence

Freedom from database vendor lock-in.

database to PostgreSQL – the world’s most advanced open source database. Ending expensive licence fees and vendor lock-in for good.

2ndQuadrant.com/

. PostgreSQL Development . 24x7 Support . Training . Services .2ndQuadrant Ltd. 7200 The Quorum, North Side, Oxford Business Park, Oxford, OX4 2JZ, UNITED KINGDOM

For good.

Page 16: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Competition

www.linuxuser.co.uk16

www.linuxuser.co.ukFor the latest news and views

Email us directly…[email protected]

Thanks to the good people of Red Hat, you’re

in with a chance of winning a 90-day Red Hat

online training subscription and themed Red

Hat sports watch worth £2,000 combined. It’s

our biggest prize giveaway and all you need to

do is fi ll out a survey at www.linuxuser.co.uk/

survey.

The winner of the grand prize gets to choose

from one of three top-of-the-line training

courses based on your current skillset and the

expertise you’re looking to gain.

The fi rst choice for fi rst-prize winners is

Red Hat System Administration I Online. This

is ideal if you want to learn fundamental Red

Hat system administration and is designed for

IT professionals looking to learn core Red Hat

Enterprise Linux skills. The course focuses on

essential administration tasks that occur in

the workplace, including installations, network

connectivity, managing physical storage, and

performing basic security administration. See

red.ht/1hkfFlq for more details.

The next choice is Red Hat System

Administration II Online, which helps you build an

arsenal of command-line administration skills

and is designed for IT pros looking to become full-

time enterprise Linux admins (see more at red.

ht/1c0m3gv). Last but not least is Red Hat System

Administration III, which offers advanced skills for

experienced Linux admins looking to brush up on

all aspects of networking and security (learn more

at red.ht/1kUJglr). If that wasn’t enough, the first-

Win £2,000of Red Hat training

prize winner will also take home an exclusive Red

Hat-themed sports watch!

A lucky second-prize winner will walk away

with two Red Hat Certifi ed exams designed

to validate skills and abilities in the fi eld of

system administration. The Red Hat Certifi ed

System Administrator and Red Hat Certifi ed

Engineer exams are worth approximately £800

combined and are a great way to increase your

employability or promotional prospects.

The third prize on offer is an Individual

Exam Session for a Red Hat Certifi ed System

Administrator Exam, which can be redeemed

at any participating location (red.ht/1bORplM).

This prize offers a convenient alternative to

the traditional classroom environment where

students can choose the date, time and location

of the exam. These testing stations are available

in London, Milan, Munich, Utrecht and Vienna.

For more information about the exam, be sure to

check out the website at red.ht/1fEdAjQ.

To be in with a chance of winning these

fantastic prizes courtesy of Red Hat, just fi ll in our

readers’ survey at www.linuxuser.co.uk/survey.

TERMS & CONDITIONS

Imagine Publishing: To submit your entry, go to www.linuxuser.co.uk/survey and complete our Readers’ Survey. The closing date for entries is 9 March 2014. Entries must be submitted via the web address. The fi rst prize is a choice of one of three

90-day online training subscriptions for Red Hat System Administration I, II or III and a Red Hat sports watch valued at approximately £2,000 combined. Second prize is two Red Hat Certifi ed System Administrator exams worth approximately £800

and third prize is an Individual Exam Session worth approximately £400. Prizes will be drawn at random from all European survey respondents. Imagine Publishing reserves the right to substitute the prizes for a similar item of equal or higher value.

Employees of Imagine Publishing and Red Hat (including contractors, their relatives, or any agents) are not eligible to enter. The editor’s decision is fi nal, and no correspondence will be entered into. Prizes cannot be exchanged for cash. Full terms

and conditions are available upon request. From time to time, Imagine Publishing or its agents may send you related material or special offers. If you do not want to receive this, please state it clearly on your entry.

Red Hat: Prize must be redeemed by March 9, 2014. Course and exams must be consumed by the chosen winner. Sorry, no student substitutions. Only valid for customers in United Kingdom, Ireland, Germany, France, Spain, Italy, Netherlands,

Belgium, Luxembourg, Norway, Potugal, Spain, Sweden, Finland, Denmark, Austria and Switzerland. All other purchases do not qualify. Offer good only for regularly scheduled courses. Regularly scheduled courses are subject to availability. Cannot

be used for classes in which one is currently enrolled, nor for concurrent class cancellation and re-booking. May not be combined with other discount programs, bundles, government contracts, or coupons. Participant(s) is/are responsible for

assessing his or her suitability for enrolling in the appropriate course. Open to residents of eligible countries only and at least 18 years of age. Void where prohibited by law. Terms and conditions are subject to change.

Enter now at www.linuxuser.co.uk/survey

Scan & win!Scan the code and

complete our survey for your chance to win

Closing date for entries

9 March 2014

Plus a Red Hat sports watch

Wa

tch

off

ere

d in

re

d

Page 17: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Can you volunteer for Code Club?

We need people who know how to program computers to volunteer to run a club at their

local primary school, library or community centre for an hour a week.

We create the projects for our volunteers to teach, the projects we make teach children how

to program by showing them how to make computer games, animations and websites.

Get involved, let’s teach the next generation to code!

Code Club is a nationwide network of volunteer-led after school coding clubs for children aged 9-11.

Visit www.codeclub.org.uk to find out more

Page 18: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Your source of Linux news and viewsOpenSource

THE FREE SOFTWARE COLUMN

All rights reversed -Copyleft and the GPLThe original goal of the GPL was to ensure that any code that was intended to be free to share, remained free to share...

“The collective advantage to everybody is obvious; costs are shared and development goes at a much quicker pace”

The GPL is essentially a hack on copyright law

that rewrote the rights and responsibilities of

the end user, giving the user the right to use,

copy, share, repackage or sell the software with

the reservation that any changes to the code be

made available under the same conditions.

The GPL’s recursive adaptation of copyright

law, or copyleft, is the reason why opponents

refer to the GPL as viral - the GPL is made to

apply to additions and changes to the code,

and all rights are reversed. The benefits of

copyleft are that it encourages the rollback of

code into a project, discourages forking, and

gives assurance that code won’t be hijacked for

proprietary means and ends.

The name copyleft was inspired by a sticker

that Richard Stallman, the man who wrote the

GPL, saw on the on the back of an envelope

mailed from Don Hopkins to Richard in 1984.

The envelope contained a 68000 manual that

Don borrowed from Richard, that he was

returning. the sticker inspired Richard to use

the word ‘Copyleft’ for licensing free software.

The effect of copyleft is to preserve the

continuity and integrity of a project, as was

demonstrated after the take up of the Linux

kernel. Without the GPL, the corporate

user (be it SGI, IBM, HP or any other) could

find advantage in hijacking and forking

the kernel, as happened with Unix, thus

discouraging wider contributions from other

corporate users. Forking would have been

inevitable, because advantages could be

found in pushing proprietary enhancements

that were unavailable to competitors. In

the long run, the proprietary divisions of

Unix were damaging to the individual Unix

companies. Each proprietary Unix had its own

distinctive advantages over the others, but

each was weaker because of the collective

disassociation from the whole.

The advantage for the Unix companies of

adopting Linux was that there was a collective

reduction in the cost of development - the

code that one company gave came back in

the contributions of others. Companies felt

enabled to share their code contributions,

and the Linux kernel became a collaborative

project across several industries, which almost

certainly would not have been the case without

the protection of the GPL.

The collective advantage to everybody is

obvious; costs are shared and development

goes at a much quicker pace. It is highly unlikely

that the Linux kernel would have retained its

current level of integrity if it had been released

under a more liberal licence. The GPL secures

the source for all participants, and everybody is

allowed to be a participant. The standardisation

of industry on the Linux kernel made it possible

to write applications for a wider market, and

helped to drive open standards, which are to the

advantage of all concerned.

The myth used to be that the GPL is

hostile to business because business can’t

appropriate the code. Also, that the BSD

licence is business-friendly because the

corporate user can do what they like with the

code, close it, spin it, market and enhance

it, without any obligation to return any

enhancements to the community).

In the real world, the opposite has proved

to be true. The GPL was not only the best

protector of the principles of free software,

but was also the most business-friendly of the

licences available, for one reason: companies

such as IBM, HP, and SGI could openly

contribute to the kernel, releasing large chunks

of code under the GPL, in the knowledge

that the developments of their competitors

would also be fed back to the community, and

their contributions could not be laid open to

Richard Hillesley writes about art, music, digital rights, Linux and free software for a variety of publications

www.linuxuser.co.uk18

Page 19: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

The latest in the Linux community

Opinion

OPEN SOURCE

Simon Brew is a technology writer and editor, working across the Linux, Windows and Mac OS X platforms

I was stuck. I had a TIFF file that needed

converting to something workable, and one that

needed to be a JPG within five minutes flat. Had

I been at one of my own machines, this would

have taken seconds. Instead, it induced mild

panic, a near-spilling of my cherished coffee

cup, and a very serious stroking of my chin.

Within two minutes, though, courtesy of a free

online service, it was job done.

It’s not a new development, of course, that

increasingly sophisticated online tools can

take on pieces of work that are ordinarily

the domain of desktop software. In a way, it

reminds me of the old PC budget software

market, where smaller publishers broke jobs

that office suites could comfortably do, and

then sold them for a teasing price.

The inherent problem, of course, is where you

draw the line of trust. I was in such a hurry with

the task I needed doing, and the deadline was

looming akin to one Harry Potter’s most fearful

death eaters. The fine editor of Linux User &

Developer could regale you already with stories

of me and deadlines. He would, of course,

assure you that said deadline performance was

in the ballpark of exemplary. Just, er, not near

the middle of it. Let’s leave it at that.

It struck me that a growing number of

people, thankfully, approach computing and

personal security with a little more common

sense than they once did. Most of us don’t go

around sticking our passwords on a Post-It note

attached to our screens, nor do we leave the

default as ‘password’ anymore. What fun we

used to have going around trade shows, tapping

in ‘password’ on the demo machines and leaving

witty messages behind. How the staff used

to really love those of us who did that. It was

particularly moving when they showed their

appreciation using nothing more than some very

short words, a shower of moisture from their

mouth, and some nonsense about never being

welcome again. The cads.

It occurred to me, then: this picture that I’d

converted in a hurry, I’d thrown caution to the

proverbial wind with. All because I had a clock

ticking. Ordinarily, I’d want to know who I was

uploading my image too. What’s their policy?

Do they claim copyright over it? Is there a

term or condition I’ve accepted somewhere

along the line that I usually shouldn’t and/or

wouldn’t? And, ultimately, by the time I came

round to actually answering those questions

– fortunately with some fairly satisfactory

answers – it was all too late anyway.

It’s hard enough sometimes with desktop

software to work out where you stand with

things. But web-based services do present a

level of extra problems in that regard, especially

when you’re trusting them with your work. You

can hardly set your firewall to deny access.

Convenience is no small feature with some

of the tools that are being offered, and I remain

grateful in my particular instance for the one

that dug me out of problems. While I may be

being a little over-dramatic here – it wouldn’t be

the first time – what did my haste in this regard

potentially expose me to?

It wasn’t even a very good picture that I

needed to convert in the first place...

exclusive development by third parties. The

‘viral’ element of the licence, which so many

people objected to, made the licence more

business friendly, and worked to the advantage

of all contributors and the project as a whole.

The GPL was not created with the intention

of encouraging the participation of business in

the development of free software, but like the

widely perceived notion that the open-source

model of distributed software development

produces better software, its beneficial

relationship with business was an accidental

side effect of the licence.

The line of trustOnline services may be taking on work traditionally done by desktop software – but Simon wonders how we know if they’re safe…

THE OPEN SOURCE COLUMN

This is a scan of the Copyleft (L) sticker that was sent

to Richard in 1984 from Don Hopkins

www.linuxuser.co.uk19

Creative CommonsAttribution-ShareAlike 4.0 International License

Page 20: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk20

Your source of Linux news and viewsOpenSource

Jon Masters looks back upon development in the Linux kernel community throughout 2013 and covers ongoing work toward thenext release of the Linux kernel

Linus Torvalds announced the latest Release

Candidate (RC) 3.13 series Linux kernel, saying:

“I delayed this a couple of days to get back to

my normal Sunday release schedule, but I’m

not entirely happy with the result. Things aren’t

calming down the way they should be [for this

stage in a release cycle], and -rc4 is bigger than

previous RCs. And I don’t think I can just blame

the two extra days.” He pre-announced his

future “grumpiness” at anyone who sends him

unnecessary patches for 3.13 at this stage.

We should begin 2014 with yet another new

kernel, hopefully even better than all of the many

(equally excellent) kernels that have gone before.

3.13 will include novel new features, such as

in-kernel support for ARM’s ‘big.LITTLE’ AMP

(asynchronous multiprocessing) architecture

that allows CPUs built from ‘big’ and ‘little’ cores

to dynamically schedule work according to the

runtime power needs and energy constraints of

the system (this is already used in many shipping

the original SMP (multiprocessor) support, and

still very important contributor to the kernel,

announced that he was “leaving the Linux world

and Intel for a bit” for family reasons. We are

fortunate that he was able to return (on a limited

basis) later in the year.

March featured new architecture support

in the form of ARC, a synthesizable RISC

architecture from chip design tooling house

Synopsys. ARC is configurable and is intended

for use in DSP-like designs where customers

(developers of chips using ARC) might want to

insert custom instruction into the pipeline. Intel’s

PowerClamp driver landed, adding the ability for

a system to inject deliberate idle states to reduce

energy consumption in the case that a rack-level

multi-node power budget must not be exceeded.

David Howells announced that “the end is nigh!”

with regard to his UAPI (user-space API) work,

which was a multi-year effort to clean up the

Linux user-space header files.

April began with the return of Al Viro to fighting

form (following a serious health issue and

unfortunate hospitalisation), with Linus crediting

him for “virtually riding to the rescue on a white

horse” to fix a gnarly VFS (virtual file system)

bug in 3.9-rc5. Also this month, Arnd Bergmann

proposed removing support for the very much

antiquated PReP platform, an early standardised

PowerPC platform that has long since been

replaced by the descendants of CHRP (Common

Hardware Reference Platform).

May offered a new Linux kernel. 3.9 featured

support for semi-transparent caching of I/O onto

fast SSD devices via the new ‘dm-cache’ device

mapper target, while Frederic Weisbecker’s

‘nohz’ patches were queued up for 3.10 merge.

The latter removed the need for a timer ‘tick’

interrupt on CPUs running only one active task,

Jon Masters is a Linux kernel hackerwho hasbeen working on Linux for some 18 years, since he first attended university at the age of 13. Jon lives in Cambridge, Massachusetts, and works for a large enterprise Linux vendor. He publishes a daily Linux kernel mailing list summary at kernelpodcast.org

The kernel column

mobile phones and other devices to great effect),

reworking of existing support for packet filtering

in the ‘new’ nftables code (that has been many

years in the making), and countless other tweaks

under the covers (ARM gets support for big-

endian operation just as PowerPC gains support

for little-endian in the same release). With an

eye toward the future, it would seem that now

is as good a time as any to reminisce upon the

past year…

The year that was 20132013 began way back when Linux 3.8 was the

latest thing since… Linux 3.7. The 3.7 kernel had

been no slouch, adding support for the forward-

looking AArch64 64-bit ARM architecture,

among thousands of other improvements.

And so it was that the year began with the

development merge window for 3.8 closing. A

core new feature merged therein was support for

Transparent Huge Zero Pages, which build upon

existing support for Transparent Huge Pages

but handle pages (the minimal unit of memory

accounting within the kernel) that are filled with

zeros – very popular with virtual machines right

after they have booted, especially Windows-

based machines, since Windows explicitly

zeros them.

February saw the final days of Linux 3.8

development. Linus produced some statistics

showing that the most popular day (historically)

for new kernel releases is on a Sunday. He in

fact would go out of his way later in the year

to get back onto the ‘Sunday schedule’ after

temporarily switching to Fridays. We were

also reminded (as also at several other times

throughout the year) how fragile life is, and

how important family and friends can be. Alan

Cox, one-time ‘Linux number two’, author of

JON MASTERS

Page 21: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk21

The kernel column – Jon Masters

Opinion

OPEN SOURCE

and under certain conditions, including the

need for the ‘boot’ processor (processor number

zero, in general) to keep its timer tick running for

housekeeping (scheduling etc) purposes.

June featured an awesome patch series

from Will Deacon (who has a future career in

stand-up comedy, if the Linux business were

to tank for some reason) entitled ‘Remove any

correlation between IPC and BogoMips value’.

The ‘BogoMips’ value reported by Linux systems

is simply a calculation (of the idle loop, during

bootup) of how quickly a given processor can do

nothing. That is, how quickly calls to no-ops can

complete. Many users enjoy quoting BogoMips

values, but on modern systems they mean little,

and on some systems (especially ARM devices)

they mean even less with the introduction

of – for example – ARM’s Architected Timers.

Newer ARM devices might run at many GHz but

report only a few hundred MHz due to the rate

of the Architected Timer. Will’s patch included

various modes to make BogoMips reflect

either reality or marketing desires, including a

config option briefly considered to be named

CONFIG_MARKETING.

July brought forth another shiny new kernel.

Linux 3.10 was released, and it included support

for both Xen- and KVM-based virtualisation on

64-bit ARM systems. Typically, July and August

are fairly quiet months, since they are mid-

conference season, and also when people take

summer holidays. August did, however, bring the

(eventual) merging of the Lustre distributed file

system, which has been living independently of

the kernel for many years. Lustre joined other

great new features in the 3.11 development

kernel, which was named ‘Linux for Workgroups’

in honour of the Microsoft Windows 3.11 release

‘Windows for Workgroups’. Linus had wanted

to launch 3.11 on the 22nd anniversary of his

original ‘hello everybody’ introductory message

announcing Linux, but instead settled for a late

version RC instead. The final release of Linux 3.11

was not too soon thereafter.

September might as well have been named

‘memory management month’, with a lot of focus

on the virtual memory subsystem feeding into

Linux 3.12 development, in particular of NUMA

(Non-Uniform Memory Access – the kind used

in larger multiprocessors where memory is

very much distributed amongst CPUs, and is

still seen by all CPUs equally, but with differing

performance). Among the non-NUMA work,

Srinvas Pandruvada (Intel) posted support for a

new ‘powercap’ driver used to help with thermal

and power budgets on a single CPU chip (and so in

some ways complementary to ‘PowerClamp’).

October included one of Linus’s now famous

‘PDX kernel releases’ (from the Portland, Oregon,

airport), a new system call proposal from Miklos

Szeredi in which renameat2 would solve the

problem of atomically swapping two directory

entries, among others. Stephen Rothwell,

the author of linux-next, took a three-week

break in October, which led to Thierry Reding

(unprompted) deciding to step up and help cover

for Stephen during the break.

November rounded out the year with a shiny

new Linux 3.12 kernel which, as reported last

month, includes support for automatic GPU

switching from one GPU (in a laptop, for example)

to another without restarting the desktop. The

Linux 3.13 development cycle began with merging

of Intel’s powercap driver, the new ‘nftables’

packet filter, and talk of an eventual Linux 4.0.

That’s all for this issue. Next time, we look

ahead and make some predictions for the year

ahead. Stay tuned.

“November rounded out the year with a shiny new Linux 3.12 kernel”

Ongoing developmentAlexandre Courbot posted patches

providing initial support for ARM’s ‘Trusted

Foundations’ secure firmware – this runs

within the ‘TrustZone’ privilege or execution

level of the ARM processor and is completely

isolated from the (Linux) operating system.

The Trusted Foundations ‘TEE’ (Trusted

Execution Environment – the mini-OS that

runs in the TrustZone on ARM processors)

provides reference support for various

standardised interfaces that an OS can call

for certain services that require standard

support across different ARM-based

devices. Other ARM development this month

included bootable working GRUB2 on 64-bit

ARM devices, and a complete bootable EFI/

GRUB2 set of patches as well.

SELinux will get a new maintainer in 3.13

as Paul Moore steps up to take over the role.

James Morris announced this, along with

various other bits of the security subsystem

that will be merged into the new kernel.

Minchan Kim has requested that the

zram/zsmalloc patches be ‘promoted’ from

the ‘staging’ Linux kernel source tree into

the main Linux kernel proper. The code

enables Linux systems to allocate (zsmalloc)

compressed memory that is stored in a

special ‘zram’ memory-backed block device.

This is especially useful for the billions of

embedded devices out there with limited

memory footprints and such techniques are

already in production on Android today.

Page 22: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Seattle

Frankfurt

Warsaw

PragueVienna

Stockholm

San José

Miami

Los Angeles

DallasAtlanta

Newark

London

Paris

Washington, DC

Chicago Toronto

Amsterdam

1&1’s high-performance data centres are amongst the safest and most effi cient in the world.

Our multiple redundant networks with over 300 Gbit/s connectivity ensure the best availability.

MORE EFFICIENCY:CDN PERFORMANCE

MORE SAFETY:SECURITY SCANS

MORE CONFIDENCE:GEO-REDUNDANCY

* 1&1 Web Hosting packages with 30 day money back guarantee, no minimum contract term and no setup fee. Special offer price inclusive of 12 month billing cycle, prepaid annually,

e.g. 1&1 Basic £2.99/month for 12 months, then regular price of £4.99/month. All prices exclude VAT. Visit www.1and1.co.uk for full offer details, terms and conditions.

DOMAINS | MAIL | WEB HOSTING | ECOMMERCE | SERVERS

MAXIMUM FLEXIBILITY AND PERFORMANCE NEW HOS

An improved CDN (Content Delivery

Network) provides maximum

availa bility for your website.

NEW: Now for mobile devices as well!

Plus, over this network (distributed

over 23 PoPs and various backbones

worldwide), the static data, and now

also the dynamic website content is

stored locally (caching) so requests can

be delivered extremely quickly.

With 1&1 SiteLock, your website,

including the content of your pages,

is actively protected from malware,

unauthorised access and other

threats from hackers.

INCLUDED: Daily malware scans

and complete website scans every

30 days, allowing you to protect

yourself and your website visitors

against viruses

and trojans.

1&1 offers the highest security and

reliability through a geo-redundant

infrastructure: Your data is stored

simultaneously in two data centres

in Europe. If one fails, the system

automatically switches to the second,

and your website remains available

online. Daily backups of the entire

infrastructure also ensure maximum

security.

Passed 02-JAN-2014

SECURESiteLock

SITELOCK.COM

Page 23: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Maximum availability from geo-redundancy

Over 300 Gbit/s network connectivity

Up to 2 GB RAM guaranteed

NEW: 1&1 CDN powered by CloudFlare®

NEW: 1&1 SiteLock security scan included!

STATE-OF-THE-ART TECHNOLOGY

1&1 SEO Pro

1&1 Search Engine Marketing

Facebook® and Bing® Credits

1&1 Newsletter Tool

SUCCESSFUL MARKETING

Premium software included: Adobe® Dreamweaver®

CS5.5 and NetObjects Fusion® 2013 – 1&1 Edition

1&1 Mobile Website Builder

NEW: PHP 5.5, Perl, Python, Ruby

POWERFUL TOOLS

Over 140 popular apps (DrupalTM, WordPress,

Joomla!TM, TYPO3, Magento®…)

1&1 Expert App Support for all enquiries

PERFORMANCE APPS

Free domain (.com, .net, .org, .co.uk...)

Unlimited power: Webspace, Monthly Traffi c, E-mail

Accounts and MySQL Databases

Linux or Windows® operating system

ALL INCLUSIVE

1and1.co.uk

FOR YOUR WEB PROJECTS

EVERYTHING FOR PROFESSIONALSFrom

Excl. 20% VAT£ 2.99

per month*

TRIALTRY FOR 30 DAYS

MONTHSHORT TERM CONTRACTS

CALLSPEAK TOAN EXPERT

Call 0844 335 1211

TING

Page 24: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Dual-boot Linux on any deviceFeature

www.linuxuser.co.uk24

Page 25: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Dual booting is not quite one of the dark

computing arts – it’s not like you’re compiling

Gentoo or anything – but there’s still an

element of risk and reward in the process.

Dual-booting a PC is fairly simple, and infi nitely

useful, but what about computer-like devices

that we use or carry around with us? We decided

to see if we could bring the convenience and

power of dual booting to a range of other

everyday devices and give ourselves the

greatest amount of choice possible.

Looking around, we noticed a few extra

devices we wouldn’t normally associate

with dual booting. Live USB keys, Raspberry

Pis, Android smartphones/tablets and even

a Mac that we spied from across the offi ce.

Adding what we already know to the mix

about dual-booting normal PCs, we decided

to set about creating the ultimate guide to

dual-booting anything.

How to run two operating systems on any machine

Dual-boot Linux on any device

FEATURE

Give yourself more choice with your computers as we attempt to dual-boot anything and everything

Dual-bootLinux on any device

Warning!It should go without saying that everything we’re attempting

in this feature carries some risk of losing all your data. While

you should always have a backup solution in place, we know

it can sometimes slip your mind. This is your reminder

to make sure everything you need is backed up, saved

elsewhere or ghosted in case of any problems.!

www.linuxuser.co.uk25

Page 26: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk26

Get more out of your PC by adding a second Linux distro

Dual-boot your PCLinux distros are basically designed these

days to work well with each other in multi-boot

situations. Modern GRUB will automatically

detect other bootable distros during an install

and add them to the list. Even if it doesn’t, it’s

fairly simple to add them – we cover how to do

that and a lot more later on. Going deeper, you

can mount partitions across multiple distros for

sharing fi les, profi les and space. To get started,

though, you’ll have to create some space on your

hard drive. If you used the standard installation

tools with your main distro, you’re likely using up

all the space.

The fi rst step is choosing your second distro

– what exactly are you trying to achieve? Are you

developing and testing across multiple platforms,

or do you need a work and leisure distro? Will your

system have two inherently different functions

while booted into each operating system? Once

you’ve made your decision on what exactly you

need, you’ll then need to create a standard

installation medium – either a burnt CD or a live-

booting USB stick will suffi ce.

You can install in two different ways from here:

either setting up the new boot partitions manually,

or using the Install Alongside option that a lot of

modern distros include. You’ll need to create a root

partition for your new distro – we detail how to best

go about this at the bottom of the page. It’s best

to have a wired internet connection even if your

system has wireless, just in case it doesn’t have

the right drivers out of the box for it. Some distros

like to download updates during the install, or even

download the entire distro during installation, so

having a more guaranteed way of accessing the

internet is useful.

During installation, GRUB will usually be

reinstalled by the new distro so it can boot into

both the new and the old distro, with the new

distro set as a default. We cover the best way

to edit or change it back depending on your

preferences on the next page; however, this

doesn’t cover shared space or auto-mounting

between the two. This can be done by adding

entries to /etc/fstab, as pictured in the fstab

screenshot above.

Reclaim space At the very least, your system will already have a root partition for your

distro, plus a swap partition. This swap can be shared by both distros,

so all you need to do is trim the storage partition for the main distro.

Most live discs and installers will include partitioning tools. However,

dedicated rescue and admin distros such as SystemRescueCD also

include them.

The most effi cient way to set up a hard drive and share multiple distros

Making space

New partitions We recommend having at least 20GB of space for your second distro,

or at least the root partition. Make sure not to reclaim all the available

space from the hard drive, as while the ext3 and ext4 fi le systems don’t

fragment easily, you may still catch an important or essential fi le if you

shrink too much. You can always try having dedicated space for your

home folder on the hard drive as well.

Choose between installing alongside, or

having full control of the partitions

An fstab file, mounting partitions on boot

Dual-boot Linux on any deviceFeature

Page 27: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Get GRUB under your control so you can make startup effi cient and easy

Understanding the boot menu

GRUB is currently the standard Linux bootloader.

It’s the first thing you see after system POST and

is designed to let you easily and quickly choose

what you plan to do on your computer. It’s highly

editable – from small things such as length until

timeout and default selection, to colour schemes

and customised boot entries.

Proper orderOne of the first customisations you’ll usually

want to make to a new boot menu is the default

selection and perhaps the timeout. To do this,

enter the terminal and open the grub.cfg file with:

$ sudo nano /boot/grub/grub.cfg

Find the line set default=”0” and change the

number to the entry in the bootloader that needs

to be default. Timeout can be found in the folder

/etc/grub.d in the 00_header fi le. The fi les here

determine the order in which entries are added to

the bootloader, so as well as changing the default

selection, we can easily change the order of menu

items by renaming the fi les to go in a different

numeric order.

RecoverIf you do decide to reorder the entries, you’ll then

need to run:

$ sudo update-grub

This command can also be used as part of the

recovery of GRUB from the original distro as well

– if that’s your primary distro on this system.

Then instead of reordering the items or changing

the defaults, it will be better to start by using it to

manage GRUB. Boot into it, open the terminal and

reinstall GRUB with:

$ sudo grub-install /dev/sdaX

…where X is the location of your hard drive.

This is more than likely 1 on a single hard

drive system. Afterwards, use update-grub to

update the boot menu.

While the config file warns against it, there’s

no harm in changing the default selection

GRUB’s boot menu also includes recovery

and memory testing options

Which GRUB?There are two versions of GRUB: the older GRUB 1

(or GRUB Legacy) and the newer GRUB 2. Some

prefer GRUB Legacy as parts of it are easier to

use; however, GRUB 2 can be customised a lot

more with themes and images and smarter

boot ordering. Generally though, if your main or

primary distro comes with one version of GRUB,

you should continue using that rather than

installing a different version over it.

hdX,Y and /dev/sdaXHow exactly do we fi nd out the numbers

to replace these with? In the terminal, fi rst

use fdisk -l to list the drives and partitions

currently in your system as sda1, sdb3 etc. For

hdX,Y, start counting the drives from 0, so sda1

would be hd0,1 and so on

www.linuxuser.co.uk27

Create custom boot entries in GRUB 2 and even GRUB to make the bootloader your own

Build your own boot scripts

GRUB2For booting Linux, we point it towards the root of

the distro to boot and the information it needs:

#!/bin/sh -ecat << EOFmenuentry "Linux distro" {set root=(hdX,Y)linux /boot/vmlinuzinitrd /boot/initrd.img}EOF

Windows is a little bit different – after telling it

where Windows lives, we then chainload into the

Windows bootloader:

#!/bin/sh -ecat << EOFmenuentry "Windows" {set root=(hdX,Y)

chainloader (hdX,Y)+1}EOF

GRUBGRUB 1, while simpler looking, needs more

information to boot into Linux properly:

title Linux distroroot (hdX,Y)kernel [/path/to/kernel] root=/dev/sdaX roinitrd [/path/to/initrd]

The Windows boot code is again fairly simple,

using the chainloader command to use the

Windows bootloader:

title Windowsrootnoverify (hd0,0)makeactivechainloader +1

How to run two operating systems on any machine

Dual-boot Linux on any device

FEATURE

Page 28: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Turn a new laptop or PC into a dual-booting machine with dual operating systems for maximum coverage

Add Linux to Windows

As always, we start with partitioning the hard

drive. However, unlike with dual booting with

another Linux distro, there won’t be a swap

partition available for the new Linux distro to use.

The swap partition needs to be the same size as

your system memory, so take that into account

when creating space for the Linux distro. Also

consider that Linux can easily see and mount

NTFS partitions, while Windows doesn’t like

extended fi le systems as much, so keeping the

majority of space to be shared on the NTFS

partition may be wise.

The swap partition can be placed at the end of

the hard drive; this way it’s easy to work around if

you have to recreate or resize partitions at a later

date. This partitioning can be done on the Windows

side, but it’s preferable to use a Linux tool such as

GParted to perform the task. This can be found on

some rescue distros, and a few live-booting distros

will have that or their own partitioning tool. You can

either just make the space before installation, or

set up the partitions while you’re at it. One benefit

of only making space is that you can then use an

install-alongside option if your distro has one and

it will automatically set up a good swap partition at

the same time.

GRUB will automatically add a chainloading

option to boot Windows during startup using

its own bootloader. Windows will be none the

wiser and boot up as normal, albeit now with

a little less space. You can use the fstab tips

from the previous pages in your Linux distro to

automatically mount the Windows partition

and have full access to your fi les and folders;

however, you’ll need to look for specifi c ext drivers

for Windows to access your Linux fi les.

Secure bootSecure Boot and how it

affects UEFI and dual

booting is still an issue –

not all distros work with it.

However, Ubuntu, Fedora and their

derivatives all work just fi ne on systems with

Secure Boot without much more than disabling

it in the UEFI menu at startup.

Ubuntu and other distros will recognise and

know how to install alongside Windows

Chainload straight into Windows with no

extra work thanks to GRUB

www.linuxuser.co.uk28

FragmentationWindows Vista and later has automatic

defragmentation tools built in to cut down on

the issues previous Windows systems used to

encounter. It’s not perfect, though, and NTFS is

still prone to fragmenting more than Linux journal

file systems as files are updated or changed over

time. We suggest invoking the Defrag tool from

within Windows by going to Start>All Programs>

Accessories>System Tools>Disk Defragmenter in

Windows 7 and later.

There are also some open source

tools you can use to defrag Windows

Dual-boot Linux on any deviceFeature

Page 29: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk29

Add or just restore Windows to a system that didn’t always need it

Add Windows to Linux

In some ways, it’s currently a little easier to

add Windows to a system already running

Linux than it is the other way around.

Linux systems don’t invoke any Secure

Boot privileges, giving you free rein over the

hardware, which in this case means installing

Windows. The main issue arising from this is

that Windows will overwrite the Master Boot

Record, meaning you won’t be able to boot into

Linux right after the installation. We’ll cover

a quick way to recover your GRUB bootloader

after installation, but for a more in-depth guide,

look towards the end of this tutorial.

01 Make spaceWe advise allowing Windows to have

as much space as possible, as it can fi ll up a lot

quicker than Linux. Microsoft recommends a

minimum of 20GB; however, that’s far too low if

you plan to use Windows fairly regularly. 100GB, if

you can spare it, should be more than enough.

02 Install WindowsInsert the Windows installation disc

and reboot your system. Select ‘Boot from disc’

from the boot menu and then go through the

basic language setup and licence agreement.

Select Advanced when it asks you how you

want to install.

03 Choose wiselyThe Linux partitions will be labelled as

unknown by the Windows installer; however, it will

recognise the free space on the hard drive. Select

the free space and click Next to continue with the

lengthy Windows install process.

04 Live bootingWe’ll need to recover GRUB now so that

we can boot into both Linux and Windows. Use

an Ubuntu live disc – or your original distro’s live

disc if it has one – and boot it up. Check to see if

you need to install GRUB to the live environment,

specifi cally the grub-pc package.

05 Restoring GRUBOnce you’ve checked if GRUB is installed,

we can now begin to restore it. First, mount the

root Linux partition and then type in the terminal:

$ grub-install root-directory=/[mount point] /dev/sdX…where X is the boot hard drive, more than likely

sda in a one hard drive system. Reboot and log

into your Linux distro and fi nish off with:

$ update-grub

How to run two operating systems on any machine

Dual-boot Linux on any device

FEATURE

Page 30: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk30

Create a portable, dual-booting stick or hard drive for recovery, sysadmin or anything you want

Dual-booting USB storage

Carrying around a live USB or custom

live-booting USB storage device can be

advantageous if you regularly need to do

system maintenance or don’t always know

what computer you’ll be working at next.

Just one distro may suffi ce for some but, as

we’ve mentioned previously, there are many

reasons you might be in need of two at a time.

Having two fully functional distros working on

one USB drive or large USB stick can offer a lot

more than an Ubuntu live USB, and it’s actually

not too different from setting up a dual-booting

system from scratch.

01 Create swapMake sure you’ve saved any important

data on the external drive before we go any

further. The fi rst thing you’ll need to do is format it

and then create the swap partition – make it 4GB

in size so that it can make the most out of more

powerful systems. Put it towards the end of the

hard drive like before.

02 Room to shareYou can create some shared space for

both distros to use, either independently or as

a shared home directory if you’re feeling a bit

braver. Again we’re saving about 15 to 20GB for

the root directories, so keep that in mind while

creating it. Use ext3 or ext4 as the fi lesystem, or

NTFS if you want it to be cross-platform.

03 First rootsNow create the 15 to 20GB space you’ll

want for the fi rst distro in its installer and set

it to be root by selecting ‘/’ in the menu. It will

automatically mount the swap the partition we

created when booting into itself and our other

distro. Carry on with the installation instructions

as before.

04 Second distroPut in the installation medium for the

second distro with the USB storage still plugged

in and boot into its live environment or installer.

Choose the external drive again when selecting

the location, create a custom partition in the

space remaining as ext3 or ext4 and set the

mount point to ‘/’. Install as normal.

05 GRUB reinstallBoot into a recovery distro (or Ubuntu’s)

live environment and make a note of what

fdisk -l labels the main boot partition on the

external drive as. Mount it with:

$ sudo mount /dev/sdXY /mntAnd then reinstall GRUB 2 from the terminal with:

$ sudo grub-install --root-directory= /mnt/ /dev/sda

06 GRUB updateAfter rebooting, you’ll be able to get back

into the main distro on the external drive. Once

there, mount the other distro’s root partition

however you wish and run:

$ sudo update-grubIt will automatically detect the other install and

update the boot menu next time you boot from

the hard drive.

Dual-boot Linux on any deviceFeature

Page 31: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

If ditching stock Android is not enough for you, why not try using multiple ROMs on your device?

Dual-boot Android ROMs

Android being an open source operating

system has resulted in a number of custom

ROMS that extend or update the capabilities

of your phone or tablet. Using only one at a

time, though, means that if you want to change,

you need to spend an afternoon fl ashing and

restoring another custom or stock ROM, leaving

you without the device altogether for that time.

For users of Google Nexus products, the

MultiROM Manager is a fairly straightforward

app that takes the pain out of the process,

requiring you to only have your phone rooted

for it to work. This can be downloaded straight

from the Google Play Store and will then ask

to be granted root access. The next step is

installing MultiROM Manager to the bootloader,

updating the kernel modules and anything

else it suggests installing. It will likely ask you

to reboot to recovery to fi nish installation, and

then show up a boot selection on next boot.

Adding ROMsFind the .zip fi le of your preferred alternate

ROM and download it to the storage of your

Nexus device. Do not extract it. Reboot

the device to recovery with adb reboot bootloader (on a connected PC), or turn it

on by holding down volume-up and power

and select recovery from the fastboot menu.

You’ll be sent to the TWRP recovery, which

now has a new option under Advanced

called MultiROM. Select this, then Add ROM

and hit Next to then locate the zip fi le we

just put on the device. Swipe to install.

www.linuxuser.co.uk31

Compatibledevices

Nexus 4 Last

year’s Android

flagship phone is able

to run the Ubuntu

Touch image as well

Nexus 7 (2012)

The 7-inch tablet that

revolutionised the

market also runs the

Ubuntu Touch image

Nexus 7 (2013)

Google’s latest tablet

offering is much more

powerful, but cannot

run Ubuntu Touch

MultiROM Manager handles all the

flashing and advanced installing for you

Choose your distro from

the simple bootloader

How to run two operating systems on any machine

Dual-boot Linux on any device

FEATURE

Page 32: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Short of SD cards for Pi projects? Put two Pi images on one card

Dual-booting a Raspberry Pi

The Raspberry Pi, with access to only a

limited SD card, may not be the most obvious

dual-bootable device. However, due to the

recent release of the New Out Of Box Software

(NOOBS), multiple Pi distros can be installed

onto one card. The catch is that you need to

have used NOOBS in the fi rst place to get the

dual-booting setup to work.

If you haven’t already done this, installing

NOOBS onto an SD card is easier than copying

an image directly to it. Using the same kind of

partitioning tools we’ve used to shrink space

and create new structures, wipe an SD card

you wish to use on the Pi and create a FAT32

partition that fi lls up the card. Preferably, as

we’re dual-booting, you should use as large

a card as possible, with at least 2GB for each

distro. Once the formatting is complete,

download NOOBS from the Raspberry Pi

website and extract the fi les onto the SD card,

then plug it into the Raspberry Pi and turn it on.

You can then select which distros you want to

install and it will automatically install them all

to the disc, and create a bootloader to use at

system startup.

Apple products can still get a bit of open source love – you just need the right tools

Dual-boot a Mac

While the quality of Apple software is

debatable on a number of levels, the

hardware inside the fi rm’s Mac computers

is often extremely good. Since the switch

to Intel-based architecture a few years ago,

more Linux distros have technically been

able to work on Macs, albeit with some

restricted drivers installed to make the

most of them. It’s not as straightforward as

the other setups we’ve tried in this guide,

though, and involves installing a custom

bootloader to allow us to chainload into live

discs and GRUB. Once this is done, however,

you can enjoy a lot more freedom from your

Mac and make full use of its powerful, high-

quality hardware.

Home & Projects Raspbian is the preferred

distro of the Raspberry Pi, with tons of learning

software and easier access to some of the

more interesting Pi projects and hardware. It’s

easy to set up and can be used as a standard

desktop operating system.

HTPC It’s a tough call between OpenELEC

and Raspbmc – both run on the excellent

XBMC. However, OpenELEC has been

around for longer and has some very special

speed optimisations that put it just ahead

of Raspbmc.

Customisability Arch Linux on Raspberry Pi

allows you to build it from the ground up, only

coming with a command-line interface and

a basic Linux setup to start with. This allows

you to totally customise it and only use the

packages and software you wish, with no bloat.

Which Raspberry Pi distro is best for your needs?

Raspberry distros

01 Some rEFInementHead on over to the rEFInd website

(www.rodsbooks.com/refi nd) and download

the latest binary zip of the tool. Open Terminal

in OS X and cd to the download directory. It’s

much like a Linux terminal, so ls will also list

the contents. Install it with ./install.sh

02 Room for moreOpen Disk Utility from the OS X Utilities;

click on the main hard drive and then the

Partition tab. You should see the main startup

partition, which, unless you’ve changed it, will

take up all the hard drive. Resize it, as we’ve

advised before, and click Apply.

Dual-boot Linux on any deviceFeature

www.linuxuser.co.uk32

If you've previously used NOOBs to install a

distro, you can get back to the OS selector by

holding down shift as you turn it on

Page 33: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

03 Boot from discReboot your Mac and the rEFInd boot

manager should show up at boot. You may need

to reboot a couple of times for it to work. It will

automatically boot into OS X unless you press

a directional key. If the option to boot from

CD isn’t there, press Esc to refresh the boot

selections until it appears.

04 Live bootBoot into your Linux distro from the

disc and follow the normal installation process

we’ve detailed for other dual boot scenarios –

either use install alongside or create your own

custom partition structure. It may take a little

longer than usual, so you’ll need to be a little

patient. When it asks to reboot, stay at the

rEFInd screen.

05 Restricted driversThe wireless drivers, among other

things, won’t be included with most distros for

a lot of Macs. Boot into your distro and update

all the packages over a wired connection, then

go to Settings>Driver Manager and install the

Broadcom wireless driver it suggests.

06 Boot orderYou can change the default selection in

rEFInd by editing its conf fi le. Boot into OS X and

locate the refi nd folder from the EFI directory.

Open refi nd.conf in a text editor and locate

the line default_selection. Uncomment it and

change it to 2 for your Linux installation, or keep

it at 1 for OS X.

Wireless Inventor Kit for the Raspberry Pi ™

www.ciseco.co.ukRaspberry Pi is a trademark of the Raspberry Pi Foundation

Contains

88 Parts

£49.99Powering creative minds

It provides possibly the simplest platform for experimenting with wireless sensor networks I’ve ever seen.

How to run two operating systems on any machine

Dual-boot Linux on any device

FEATURE

Page 34: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Subscribe today and save 50%

Pay only £3 for every future issue – a 50%* saving on the store price

Free UK delivery to your door

Never miss an issue

Money-back guarantee

FANTASTIC SUBSCRIBER OFFER

*Terms & conditions: Pricing will revert to our standard offer of

£25.15 every 6 issues on the third payment made. Subscribers

can cancel this subscription at any time. New subscriptions will

start from the next available issue. Offer code PAL141Q must be

quoted to receive this special subscription price. Details of the

direct debit guarantee are available on request. Offer expires

30th June 2014. Imagine Publishing reserves the right to limit

this type of offer to one per household.

HURRY

ORDER NOW

SUBSCRIPTION VOUCHERYES I would like to subscribe to Linux User & Developer

YOUR DETAILSTitle First name

Surname

Address

Postcode Country

Telephone number

Mobile number

Email address

DIRECT DEBIT PAYMENTUK Direct Debit Payment

I will pay only £18 for 6 issues (saving 50%*)

PAYMENT DETAILSYOUR EXCLUSIVE READER PRICE, ONE YEAR (13 ISSUES)

UK: £62.40 (Save 20%) Europe: £70.00

World: £80.00

Cheque

I enclose a cheque for £(made payable to Imagine Publishing Ltd)

Credit/Debit Card

Visa MasterCard Amex Maestro

Card number

Expiry date

Issue number (if Maestro)

Signed

Date

Code: PAL141Q

Please tick if you do not wish to receive any promotional material from Imagine Publishing Ltd

by post by telephone via email

Please tick if you do not wish to receive any promotional material from other companies

by post by telephone Please tick if you DO wish to receive such information via email

Return this order form to:

Linux User & Developer Subscriptions Department, 800 Guillat Avenue, Kent Science Park,

Sittingbourne, ME9 8GU or email it to [email protected]

You will be able to view your subscription details online at www.imaginesubs.co.uk

Please complete your email address to receive news and special offers from us

Instruction to your Bank orBuilding Society to pay by Direct Debit

Signature(s)

Date

Bank/Building Society account number

Banks and Building Societies may not accept Direct Debit instructions for some types of account A6 instruction form

Instructions to your Bank or Building SocietyPlease pay Imagine Publishing Limited Direct Debits from the account detailed in this instruction subject to the safeguards assured by the Direct Debit guarantee. I understand that this instruction may remain with Imagine Publishing Limited and, if so, details will be passed on electronically to my Bank/Building Society

Branch sort code

Originator’s Identification Number

Name(s) of account holder(s)

To: The Manager Bank/Building Society

Address

Postcode

Reference Number

5 0 1 8 8 4

Name and full postal address of your Bank or Building Society

Please fill in the form and send it to: Linux User and Developer Subscriptions Dept, 800 Guillat Avenue, Kent Science Park, Sittingbourne ME9 8GU

Page 35: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

1. Onlinewww.imaginesubs.co.uk/ludAnd enter PAL141Q

2. Telephone0844 249 0282And quote PAL141Q

3.Post or emailPlease complete and post the form toLinux User & Developer Subscriptions Department800 Guillat AvenueKent Science ParkSittingbourne ME9 8GU

Or alternatively, you can scan and email the form to

[email protected]

THREE EASY WAYS TO SUBSCRIBE

Readers in the US see page 82 for exclusive

offer

SUBSCRIBE50%TODAY

& SAVE

*

Page 36: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Configure your PC for remote maintenance Tutorial

How you can add the ability to log back in and maintain a Linux system remotely

Configure your PC for remote maintenance

If you’ve set up a PC using a Linux distro for a

non-expert user or family member to use, you’ve

made the first step in providing them with a

secure and well-featured computing platform.

However, if the user in question needs a bit of

hand-holding, it’s only a matter of time before you

will need to carry out some maintenance that can’t

be explained over the phone.

This project involves installing SSH for

command-line access and for secure tunnelling,

VNC for remote desktop access, and Webmin

for overall system configuration. Note that once

you have SSH terminal access up and running,

you can carry out the rest of the tutorial remotely

over the LAN. In fact, if you then skip ahead to

the port forwarding section, you can do the other

stages of the tutorial over the internet.

Initially, this tutorial will assume that you

have both the client computer (your computer)

and the remote computer (their computer)

attached to your LAN. Ultimately, we will set up

the router in the owner’s home and a dynamic

DNS server so that we can find the remote

machine on the internet.

ResourcesClient computer running LinuxRemote computer running LinuxLAN

www.linuxuser.co.uk36

AdvisorMichael Reed is a technology journalist and he’s been hacking away at Linux for over 15 years

Install Webmin, the

extremely compressive web-

based system configuration

and monitoring GUI

Open a terminal on the

remote computer and

because it’s SSH, it’s

completely secure

Use VNC over SSH to gain

remote desktop access to

put yourself in full control

of the other computer

Via SSH tunnelling, you can run

full X Window applications on

your desktop while they execute

on the remote computer

Page 37: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Access and maintain a Linux system remotely

Configure your PC for remote maintenance

TUTORIAL

01 Set up the networkThis tutorial presumes that you have

the remote computer and the client computer

on your LAN. Make a note of the login username

and password of the remote computer and its IP

address (type ifconfig to fi nd it).

www.linuxuser.co.uk37

02 Install SSHTo enable remote terminal logins, install

the SSH server by typing sudo apt-get install openssh-server (or yum -y install openssh-server on Red Hat). Open /etc/ssh/sshd_confi g

in a text editor (as root) to begin confi guring SSH.

03 Confi gure SSH serverAlter the line PubkeyAuthentication so

that it reads PubkeyAuthentication yes. Make

sure that PasswordAuthentication is set to no.

This is because we want to use encrypted keys

rather than usernames and passwords to remotely

log into the machine. Save the file and type sudo service ssh restart to restart the server.

04 Generate keysWe need to generate both a public and

private key so that we can log into SSH without

using a password and a username. Type ssh-keygen -t dsa to begin. You can hit Enter to

accept the defaults when prompted, but type in a

password when asked.

05 Copy keyCopy the pubic key over to the machine

that will be used for remote maintenance. You

carry this out by typing ssh-copy-id [remote login name]@[IP address of remote computer]

on the client computer.

06 Test SSHSSH into the remote box from the client

by typing ssh [remote username]@[remote IP address]. This should give you command line on

the other machine without prompting you for a

password. Try out a few commands to test it, and

type Ctrl+D to end the session.

07 File copying (SSH)You can place fi les on the remote

computer or fetch fi les from it with the scp

command. scp [remote user]@[remote IP]:[local file] [destination directory]

to fetch the fi le(s) onto the remote machine

and scp [local file] [remote user]@[remote IP]:[destination directory].

08 Web proxy (SSH)Let’s say that the user complains that

they can’t access a specifi c website or the

web in general. We can test the connection

Page 38: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

In this case, we’re going to ignore the VNC server’s own security features and simply tunnel it over SSH instead

www.linuxuser.co.uk38

by using SSH tunnelling. Type ssh -D 8888 [username]@[IP address] to begin. This will

establish a local proxy server that is actually

accessing the web via the remote machine.

You can then confi gure Firefox to access the

web through this proxy by specifying Socks 5

proxy on localhost. If you can SSH to the other

machine and access the problem site, it must

be a software problem on the other machine,

rather than a networking problem.

Configure your PC for remote maintenance Tutorial

09 Run X applications (SSH)You can use tunnelling to remotely run

X applications. Just the thing to, for example,

edit the confi guration in a GUI application

without using full desktop sharing. Type

ssh -X [username]@[remote IP] to open the

connection. You then start the application

in the normal way from the command line.

Type firefox & to start Firefox on the remote

machine and interact with it on your local

desktop. You can reduce things to a single

command by typing ssh -f -T -X [username]@[ip address] [name of application].

10 Set up the VNC serverWe’re going to install VNC for remote

desktop access. In this case, we’re going to

ignore the VNC server’s own security features

and simply tunnel it over SSH instead. Begin

by installing the VNC server on the remote

machine by typing sudo apt-get install x11vnc (or yum install vnc-server on

Red Hat).

11 Set up VNC tunnellingand start server

Set up an SSH tunnel for VNC by typing ssh -L 5900:localhost:5900 [remote user]@[remote IP]. As well as setting up the tunnel,

this launches a terminal connection. In the

terminal, type x11vnc -safer -localhost -nopw -once -display :0.

12 Connect to VNCThere are a few VNC clients, but this

example presumes that you have installed

Vinagre. Use it to connect to the VNC server at

localhost. Remember, we connect to localhost

because we set up the SSH tunnel for all traffi c to

the remote computer on port 5900 in the previous

step. You should now have remote desktop

access to the remote computer. If there are any

problems with the connection, examine the text

output in the terminal for errors.

13 Install WebminProceed to the downloads section

of the Webmin website (www.webmin.com)

and download the package for your Linux

architecture. In the case of Debian, install the

.deb fi le by typing sudo dpkg -i [name of

.deb you downloaded]. Follow this up by

typing sudo apt-get -f install to satisfy

the dependencies. In the case of Red Hat, type

yum install [name of RPM].

Page 39: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk39

Access and maintain a Linux system remotely

Configure your PC for remote maintenance

TUTORIAL

14 Test WebminWebmin runs in SSL mode by default,

so access it by browsing to https://[IP address

of remote computer]:10000. Accept the

browser certifi cate that it offers. Use either

the root username and password or regular

username and password that can run sudo,

in the case of Ubuntu. In the future, tunnel to

Webmin for maximum security without having

to open up an extra port on the router. We use

the same technique as with VNC. Type ssh -L 10000:localhost:10000 [username]@[IP address] in order to set it up and then browse to

https://localhost:10000.

15 Set up the remote networkIt’s time to return the computer that we

have set up for remote maintenance to its home

base. Once the computer is reconnected to the

network, check that it can access the internet

as usual.

16 Set up static addressHow you set up a static IP address varies

from distribution to distribution. On an Ubuntu

machine, click on the Network icon in the Control

Panel and select Edit… and then select the IPv4

Settings tab. Select Manual from the Method:

drop-down list. Now add an IP address that is

part of the current subnet. For example, if typing

ifconfig reveals that the current IP address is

192.168.0.5, choose something higher such as

17 Port forwardingSet up port forwarding by making

use of the documentation for your router (or

portforward.com). You need to forward port 22

to the static IP address that we set up.

192.168.0.100. You may have to manually add DNS

server addresses for your ISP. Google for them.

Accept the changes and reset the machine.

18 Locate remote IP addresson the internet

You can ask the person who runs the remote

system to simply visit whatismyip.com and email

their current IP address to you, but setting up

dynamic DNS is a more robust solution. Go to the

No-IP website (www.noip.com) and set up a free

account. Now install the ddclient package.

19 Set up ddclientAdd/alter the following lines in

/etc/ddclient.conf:

protocol=dyndns2use=web, web=checkip.dyndns.com/, web-skip='IP Address'server=dynupdate.no-ip.comlogin=user namepassword='password'[hostname].no-ip.bizrun_daemon=true

Now restart it by typing sudo service ddclient restart.

Page 40: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Build your own private cloud with ownCloudTutorial

A fast-track guide to setting up your own file management system in the cloud using ownCloud

Build your own private cloud with ownCloud

ownCloud lets you create your own file

management/sharing/backup system without

having to rely on a third-party cloud service.

It also provides other functionality like contacts

management, calendar management, plug-in

support, users, groups etc. All these features

make ownCloud a fully fledged enterprise-level

file management tool. In this article we will

provide a step-by-step installation guide to set

up ownCloud on your system, although setting

it up on a third-party server (for example a web

server provider) will probably be easy because

you don’t need to install the server. We will

then explore some other use cases where it

can be deployed. Then we will go through some

of the third-party apps/plug-ins available,

which can be hooked onto ownCloud to provide

further functionality.

We’re using the latest ownCloud version 5.0.13

and the dependent PHP versions for this article,

although some of the plug-ins discussed here

may require older versions of ownCloud. Please

check the corresponding plug-in documentation

link before trying to install the plug-in.

ResourcesServer like LAMP/WAMP/MAMP

ownCloud plug-ins:apps.owncloud.com

ownCloud automatically categorises

the uploaded files. Different types

can be accessed via the links here

AdvisorNitish Tiwari is a software developer by

profession and an open source enthusiast by heart. As well as writing for leading open source magazines, he helps firms set up and use open source software for their business needs

www.linuxuser.co.uk40

This is the point from

where you upload your files

to ownCloud

The expanded menu

shows the different admin

actions available

Hover the cursor over a file and a menu

allows you to rename, download, share

or check other versions of that file

The built-in image viewer

can show the pictures

uploaded to ownCloud

Handily, there is a built-in

PDF viewer available

in ownCloud

Page 41: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Set up your own file management system in the cloud

Build your own private cloud with ownCloud

TUTORIAL

01 IntroductionownCloud is an open source file sync and

sharing application, available in a free community

edition as well as an enterprise edition. It allows

you to back up, share and manage files uploaded

to the server. With multiple interfaces – like the

web UI and Android/iPhone apps – it allows

you to be in touch with your data at almost any

point of time. The ownCloud desktop client for

Windows, Mac OS X and Linux lets you sync your

files seamlessly with the ownCloud server, akin

to Google Drive or Dropbox clients. With this full

ecosystem support for file syncing, ownCloud

truly is all about ‘Your Cloud, Your Data, Your Way’,

as they say in the documentation.

www.linuxuser.co.uk41

02 Installing the serverThere are two possible setups here. You

may want to install ownCloud on your system

or in a small home/office setup, where it is

accessible in a LAN. Otherwise you may want it

to be available on the internet. In the latter case,

you can skip this step, but if you are planning the

former, you will have to identify a machine as the

server and install a server such as Apache to that

system. But, as discussed earlier, a server is not

the only requirement for ownCloud. You also need

a database and PHP support. So, a LAMP/WAMP

or MAMP server is probably the best way forward,

since all the required tools come bundled with

these servers. Your advisor uses the MAMP

server in his system to host ownCloud.

03 Installing ownCloudWith the server active, we can try

to host the ownCloud application. Before

that, download the application code from

ownCloud’s official website: just click on

the ‘Tar or Zip file’ link on the ownCloud

install page. Unzip the archive and place the

extracted folder in the root of the server. Now,

access the folder via your web browser. The

welcome page opens up and prompts you

to enter the admin ID and password. Below

the prompt you’ll also see an ‘Advanced’ link,

04 Get going with ownCloudNow that ownCloud is installed, and

the admin user created, you may want to add

more users and then each of those users may

want to upload their files. In this step we will

see how to do this. First, the user management

– click on the ‘admin’ button in the top-right

corner of the homepage. In the drop-down

list that appears, click ‘users’. This takes you

where you can change settings related to the

database etc. Once done, just click on ‘Finish

Setup’ and that’s all! You have your ownCloud.

Page 42: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk42

06 Other applications of ownCloudIt may appear straightforward, but

there is a lot more to ownCloud than just file

syncing. ownCloud not only helps sync files

between multiple devices and platforms,

it also lets you manage your calendar and

contacts. The calendar link on the left side

07 Roundcube mail plug-inWith contacts and calendar support,

you would probably start to think, why isn’t

email supported? Thankfully, with support for

external plug-ins, ownCloud lets you extend the

functionality in any way you wish. Open source

webmail client provider Roundcube offers an

external plug-in which brings your mailbox

to ownCloud. To install the plug-in, go to the

ownCloud official plug-in portal, download it and

paste the downloaded files to the htdocs/apps

folder. Now, click on the ‘apps’ link in the drop-

down that appears after clicking on admin (at the

top-right corner of the page). Here you’ll see all the

apps; go to the Roundcube app and enable it. This

enables the app, but you still need to create the

database and configure the web server. For more

details, you can check the installation guide.

to the user management page where you can

add/remove users and also segregate them

in groups. You also have the option to assign

the admin for a group. To upload files, you can

simply click on the ‘new’ button in the ownCloud

homepage and then select the file to upload in

the upload window.

05 ownCloud sync clientAlong with the server application,

ownCloud also provides the desktop sync client,

which can be installed on the user’s system.

The sync client makes sure any files present

in its folder get uploaded automatically to the

server. Just download the client, point it to your

ownCloud server URL and enter your credentials.

The client then connects to the server seamlessly

and starts syncing. The app is highly configurable

and lets you change many settings, including

bandwidth usage and multiple sync folder

support. Also, it is available for all the major

platforms: Windows, Linux and Mac OS X.

of the homepage lets you create events and

share them with other users or groups. It also

supports multiple calendars and syncing with

iCal. The contacts option supports adding and

managing the contact details. Contacts can

also be uploaded as .vcf files – and, like files

and events, you can even share the contacts

among users or groups.

Build your own private cloud with ownCloudTutorial

Page 43: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk43

ownCloud not only helps sync files between devices, it also lets you manage your calendar and contacts

08 Shorty plug-in for weblinks management

With the internet having grown so vast, it’s become

difficult to track webpages and the content you

like. On top of that, there are now so many devices:

phone, office PC, home PC etc. So, the link you saw

at home yesterday is difficult to find when you want

to show it to your colleagues in the office. Shorty

comes to your rescue. This plug-in lets you create

and store short links from the web. It comes as a

09 File encryption plug-inSecurity and privacy have become major

areas of concern in recent years. With ownCloud

you can be sure of using your own server; still,

encrypting the data makes the whole setup even

more secure. ownCloud ships with an encryption

plug-in and once you enable it, all your files get

automatically encrypted. The encryption is done

server-side and only the ownCloud portal can

decrypt the data, using a key that is generated

10 Journal plug-inThe last plug-in we will look at in this article

is the journal entry one. This plug-in lets you create

journal entries in your ownCloud calendar. The

plug-in ships with ownCloud, but before you enable

it, enable the TAL Page Templates plug-in (also

preloaded with ownCloud). The entries are saved

as VJOURNAL records in the calendar and can be

sorted and filtered by date/time.

preloaded plug-in with ownCloud. To start using it,

you just need to enable it from the apps page. Once

enabled, you can just drag and drop the button

from the Shorty interface to add a site to your list.

You can also shorten the URLs with a configurable

back-end service like goo.gl, ti.ny etc.

with your password. So be careful once encryption

is enabled because if you forget your password,

there is no way to retrieve the data by default. To

protect yourself against such loss, you can enable

‘recovery key’ in the ownCloud admin settings

for encryption.

Set up your own file management system in the cloud

Build your own private cloud with ownCloud

TUTORIAL

Page 44: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Monitor network traffic with tsharkTutorial

Use tshark to examine network traffic, solve network difficulties and add network data to a MongoDB database

Monitor network traffic

Gerald Combs created Ethereal, the ancestor

of Wireshark, back in 2006. When he went to

work in a new job, he could not use the name

Ethereal any more so he renamed his tool

Wireshark. The rest is history!

This tutorial will present you tshark, the

command-line version of Wireshark, which is

a very popular and capable network protocol

analyser. The main advantage of tshark is that

it can be used in scripts. Its main disadvantage

is that it does not have a GUI.

You can get tshark either from its website –

by compiling its source code – or directly from

your Linux distribution. The second way is

quicker and simpler.

If you try to run tshark as a normal user,

you may not be able to use any network

interfaces for capturing network traffic due to

UNIX permissions. Your advisor finds it more

convenient to run tshark as root (sudo tshark)

when capturing data and as a normal user

when analysing network data.

Before you start capturing, it is better to

have a given issue that you want to solve or

examine in mind. This is the first step for a

successful network traffic analysis.

If you are already familiar with Wireshark,

learning how to use tshark will be easy for

you. Having a good knowledge of TCP/IP

comes in handy too.

Resourcestshark:www.wireshark.org/docs/man-pages/tshark.html

Wireshark: www.wireshark.org

DHCP, RFC 2131: www.ietf.org/rfc/rfc2131.txt

Display Filter Reference:www.wireshark.org/docs/dfref/

Capturing network data

and displaying it on

screen using tshark

www.linuxuser.co.uk44

AdvisorMihalis Tsoukalos is a UNIX system administrator with expertise in programming, databases and maths. He has been using Linux since 1993

Applying a display filter

using tshark

Applying a filter during

network data capturing

Displaying statistics on

the captured data

Page 45: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Use the command-line version of Wireshark to monitor your network

Monitor network traffic with tshark

TUTORIAL

01 Installing and running tsharkIn order to install tshark on a Debian 7

system, you just have to run the following

command as root:

# apt-get install tshark

To fi nd out if tshark is properly installed, as well as

its version, you can execute this command:

$ tshark -v

www.linuxuser.co.uk45

02 Capturing networkdata using tshark

Tshark can be used as a replacement for tcpdump,

which is the industry standard for network data

capturing. Apart from the capturing part where

both tools are equivalent, tshark is more powerful

than tcpdump and therefore if you want to learn

just one tool, tshark should be your choice.

The fi rst command you should run is tshark D

to list the available network interfaces.

The simplest way of capturing data is by

running the tshark command without any

parameters. You will get the output on screen

– which, as you can easily understand, is not

helpful at all!

03 Two command-line parametersThe single most useful command-line

parameter is -w, followed by a fi lename. This

parameter allows you to save network data to a

fi le for later processing.

The following tshark command captures 500

network packets (-c 500) and saves them into a

fi le called test.pcap (-w test.pcap):

$ tshark -c 500 -w test.pcap

Another useful parameter is -r, followed by a

fi lename, which allows you to read and analyse a

previously captured fi le.

04 Applying fi lters during capturingTshark allows you to fi lter network data

by capturing specifi c types of traffi c, avoiding the

creation of huge capture fi les. This can be done

using the -f command-line parameter followed by

a fi lter in double quotes.

The most important TCP-related fi eld names

are tcp.port, for fi ltering the source or the

destination TCP port; tcp.srcport, for checking

the TCP source port; and tcp.dstport, for

checking the destination port.

Generally speaking, applying a fi lter after

data capturing is considered more practical and

versatile than fi ltering during the capture stage

because most of the time you do not know in

advance what you want to inspect. Nevertheless,

using fi lters during network capturing can save

you time and disk space and that is the main

reason for using them.

Remember that the fi lter strings should always

be written in lower case.

05 Applying fi ltersafter network capturing

Filters that are applied after data capturing are

called Display Filters by tshark and Wireshark.

You should use the -R command-line parameter

followed by the Display Filter in double quotes.

The http.response.code != 404 display

fi lter searches for HTTP traffi c with a

response code not equal to 404. The tcp.port

== 80 && ip.src == 192.168.2.2 display fi lter

searches for TCP traffi c that both uses port

number 80 and comes from the 192.168.2.2 IP

address. If you have an error on your Display

Filter, tshark will let you know by displaying an

error message.

As you can easily understand, the possibilities

are endless and only depend on your imagination

and the problem you are trying to solve.

If you deeply understand Display Filters and

have a good knowledge of TCP/IP and networks

then network problems will not be a problem!

06 Exporting captured datainto a readable format

Imagine that you want to extract the frame

number, the relative time of the frame, the

source IP address, the destination IP address,

the protocol of the packet and the length of

the network packet from previously captured

network traffi c. The following tshark command

will do the trick for you:

Page 46: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

The Python script inserts network data into a MongoDB database for further processing and querying

www.linuxuser.co.uk46

$ tshark -r login.tcpdump -T fields -e frame.number -e frame.time_relative -e ip.src -e ip.dst -e frame.protocols -e frame.len -E header=y -E quote=n -E occurrence=f

The –E header=y option tells tshark to fi rst

print a header line, the –E quote=n dictates

tshark not to include the data in quotes and

the –E occurrence=f tells tshark to only

use the fi rst occurrence for fi elds that have

multiple occurrences.

07 Solving a DHCP problemThe problem: some computers on

a network could not connect to the network

although other computers were okay. All

computers were using the DHCP protocol to get

their network settings. The IP of the offi cial DHCP

server was 10.0.10.10.

DHCP is short for Dynamic Host Configuration

Protocol and is a protocol that provides

configuration information to hosts on TCP/

IP networks. DHCP is based on BOOTP (the

Bootstrap Protocol) and extends it by adding more

capabilities. DHCP and BOOTP protocols are both

using the UDP protocol with UDP ports 67 and 68.

08 More about the DHCP protocolThe fi rst packet of a usual DHCP

transaction between a DHCP client and a DHCP

server (IP 192.168.1.1) has a DHCPDISCOVER

message from the machine searching for a DHCP

server. Since the machine does not have an IP

address yet, the source IP of the packet is 0.0.0.0

and the destination IP is the broadcast IP address

(255.255.255.255).

What distinguishes the network card of a

machine from another network device found

in the same LAN is its MAC address, which is

unique. Therefore the DHCPDISCOVER message

should include the MAC address of the device

requesting a DHCP server.

The next message is the DHCPOFFER

from the DHCP server (IP 192.168.1.1) and is a

broadcast message since the client machine

still has no IP address.

Then the client machine requests from the

DHCP server confi guration parameters with

the DHCPREQUEST message. Next, the DHCP

server sends a DHCPACK message back to the

client machine that includes all the confi guration

parameters. From now on, the DHCP client can

use the offered confi guration information and

Monitor you network traffic with tsharkTutorial

Page 47: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk47

any parameter that is unique to that particular

machine, like the IP address, is reserved by the

DHCP server and is not offered to any other

networked device.

09 Solving the problemTshark output shows that there were

two DHCPOFFER messages on the network

from two different IP addresses (192.168.1.254

and 10.0.10.10) instead of only one DHCPOFFER

message from the legitimate 10.0.10.10 DHCP

server! This was the fi rst truly useful hint for

solving the actual problem.

As the DHCP server did not get any answer

from the client, it re-sent the DHCPOFFER

message (packet number 6), but as you can see, it

was already too late (packet number 4)!

The IP address of the ‘extra’ DHCP server

was 192.168.1.254. The 192.168.1.254 DHCP

server offered the 192.168.1.60 IP address to the

10 Creating a Perl script that uses tsharkThe purpose of the checkIP.pl Perl script

is to fi nd invalid IP addresses. The checkIP.pl

script assumes that the network data is already

captured with tshark.

Several steps are needed in order to solve the

problem. The fi rst step is reading the fi le with

the network data. Next, it is running the tshark

binary using the appropriate command-line

arguments using the following Perl commands:

machine. As you can guess, all computers that

could not properly connect to the network were

getting IPs in the 192.168.1.1-253 range.

The client machine preferred the wrong DHCP

server to get its information. The reason for

choosing the 192.168.1.254 DHCP server was

that it responded fi rst! Pretty naive reason, yet it

caused many problems.

After fi nding out that there was a second DHCP

server that triggered the problem, it was easy to

fi nd out the computer that caused the problem.

This particular computer was running a Linux

virtual machine (VM). The OS on the VM had its

DHCP server running and that was the cause of

the problem! Pretty tricky, don’t you think? 11 More about the Perl scriptThe next step is reading the output of the

tshark command that was saved in the @netDATA

variable line by line. After cleaning up input lines

from unnecessary space characters and parsing

it, the script uses the Data::Validate::IP Perl module

for catching erroneous IP addresses and then

prints the IP on screen:

if ( ! is_ipv4($sourceIP) ){print "Packet number $frameNumber contains a bogus source IP!\n";

}

You can alter the script in order to catch the type

of errors you want, such as traffi c from unwanted

hosts or traffi c to specifi c TCP or UDP ports.

Use the command-line version of Wireshark to monitor your network

Monitor network traffic with tshark

TUTORIAL

12 Inserting network data into a MongoDB database

The Python script supplied (on the cover disc)

inserts network data into a MongoDB database

for further processing and querying. The name of

the script is insertMongo.py and it assumes that

the network data is already captured with tshark

or tcpdump. The next shell command runs the

Python script with input from tshark:

$ tshark -r ~/1000.pcap -T fields -e frame.number -e ip.src -e ip.dst -e frame.len -E header=n -E quote=n -E occurrence=f | python insertMongo.py

Total number of documents written: 1000

The 1000.pcap fi le contains 1,000 network

packets and the script informs you that there

were 1,000 documents written in MongoDB, so

you know that everything is okay. You can now

start querying the MongoDB database!

my $command = "$TSHARK_BINARY -r $filename -T fields -e frame.number -e ip.src -e ip.dst -E header=y -E quote=n -E occurrence=f";

my @netDATA = $̀command̀ ;

Page 48: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk48

Monitors and devices come in all shapes and sizes. Qt’s layout system ensures that your app looks good, no matter how big the display

Responsive development with Qt

Since Trolltech set out to develop Qt, screen

sizes have increased rapidly. Ten years ago, a

15-inch CRT monitor was considered a decent

screen – today, cheap notebooks come with a

17-inch Full HD display. Developers were left

standing in the rain – an unadjusted application

looks ‘lost’ when running on a large screen.

A well-made Qt application looks great on

a large variety of screen sizes. Your advisor is

aware of some products which use the same .ui

file on smartphones and workstations – on both

systems, users are satisfied with the results.

This is achieved by a ‘reversal of control’. In

traditional user interface systems, controls are

positioned where the developer drops them. Let’s

assume a window with a size of 200x200 pixels.

The size of the controls would be specifi ed inside

the window – a button is located at 60|60//120|70.

If the user increases the size of the window, the

button remains ‘stuck’ at its original position.

Additional screen real estate would be occupied

by white space.

AdvisorTam Hanna has been in the IT business since the days of the Palm IIIc. Serving as journalist, tutor, speaker and author of scientifi c books, he has seen every aspect of the mobile market more than once

Further reading...planet.qt-project.org

qt-project.org/doc

qt-project.org/forums

blog.qt.digia.com

Applying a layout to

the form immediately

arranges the controls

TutorialTutorial Responsive development with Qt

An ideal computer analyses the user interface.

Elements would be resized and repositioned

as to their ‘usefulness’: content controls would

gain size, whereas modifi ers and buttons would

remain clickable.

This can be achieved by liberating the layout

engine from the constraints of developer-

provided co-ordinates. A ‘fl exible’ user

interface is specifi ed in terms of relations

and growth behaviours. At runtime, a layout

engine performs the actual positioning and

determines the actual co-ordinates using the

‘description’ provided by the developer.

QtGui-based user interfaces achieve this via

the layout system. Controls are to be placed in

containers which contain information about

the intended arrangement. In addition to that,

invisible meta controls (spacers) expand at

runtime, pushing widgets to the border of their

relative container.

The knowledge gained in the following article

is not limited to the QtGui stack. Cascades, XAML

Our empty layout shows

up as a red line

Page 49: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk49

and most JavaScript frameworks take a similar

approach to dynamic resizing of elements. Web

developers refer to it as ‘responsive web design’,

but tend to use the same processes and idioms

outlined here.

A first layoutIt is now time to start applying this knowledge in

practice. Our first example will consist of a group

of buttons which are arranged above one another

– we will then expand it to include a group of other

widgets which will be arranged in a more or less

complex fashion.

Start out by launching Qt Creator. The following

tutorial uses Qt Creator 2.8.1, the examples are

based on Qt 5.1.1. Older editions of the integrated

development environment will behave similarly

– the layout system itself has not been changed

much since Qt 4.0.

Layouts tend to be based in forms. Double-

click the file mainwindow.ui in order to open

it in the WYSIWYG editor. The toolbox on the

left side of the screen contains a group of

controls. Drag a few buttons into the form and

drop them off at a convenient position. Then

run the program and resize the MainWindow

by dragging its borders. The positions of the

buttons will remain unchanged.

Close the application after you have convinced

yourself that static layouts cannot adjust to

changes in the form size. Return to the WYSIWYG

editor and take a look at the icons next to the

filename chooser displayed in the top-right corner

of the screen.

The sixth button from the left has a symbol

made up of three horizontal lines shown above

one another. Select the form in the tree and click

the button in order to add a horizontal layout to

the form.

Your buttons will immediately be arranged

above one another. Changing the size of the form

will not affect this placement – the three buttons

will stay in the middle of the window as it keeps

changing its size. This behaviour is shown in the

editor and at runtime.

More layoutsForgetting to assign a form layout disables the

layout system in its entirety. Sadly, most cases

require more than one layout per form – arranging

a group of buttons horizontally under a list is not

possible with just a horizontal or a vertical layout.

Qt permits nested layouts. A horizontal layout

can contain a vertical layout which then, in turn,

contains another horizontal layout. The high

performance of contemporary computer systems

ensures that complex forms will still be rendered

in real-time. In the last ten years, your advisor has

not experienced a single case of lag caused by

overcomplex layouts.

Creating nested layouts is relatively easy. In

our example, add a text widget to the main form

by dragging it in from the toolbar. Qt Creator will

display a blue line in the form. This informs you that

the control will be placed in a layout and provides

indication of its location in the layout hierarchy.

Keep in mind that you should not affect the size of

the elements of a layout-managed form – this is

achieved by more subtle means discussed later in

the article.

For now, it is enough to place the text box above

the buttons. The toolbar on the left side of the

screen contains a group called Layouts. Select a

horizontal layout and drag it onto the form in order

to add it. Initially, the layout will show up only as a

slim red line.

Due to an internal limitation of the editor,

layouts can not be modified while a form layout

is in place. This can be fixed by clicking the

form and selecting the option ‘Break layout’ in

order to strip the form of its layout intelligence.

When this is done, the layout will show up as

a small red square – drag the three buttons

into the rectangle in order to add them to the

internal HorizontalLayout.

TUTORIAL

Use dynamic resizing of UI elements to suit all screens

Responsive development with Qt

Changing the size of the form will not affect this placement – the three buttons will stay in the middle

When a form is first created, Qt Creator

does not provide it with a layout. This does

not hinder you from placing widgets and

sublayouts onto it – you can even set size

policies and other layout-related attributes.

These will, however, be ignored

completely at runtime. This strange

behaviour is caused by a rarely documented

property of the Qt layout engine: forms

which do not contain a form layout are not

managed. Therefore, attributes such as size

policy will not be adhered to.

Fortunately, identifying this problem

is relatively easy. Resize your form in the

designer and look at the behaviour of the

controls: if they do not adjust their sizes

accordingly, your form is likely missing

a layout…

Missing form layout!A tiny issue causing strife and troubles since day one

The three buttons have become part of the layout

Page 50: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk50

Analysing and comparing the sizes of the widget to the ‘base size’ allows you to compute the ideal font size

When done, the three controls will be displayed

inside the red rectangle. The layout can be moved

en bloc: selecting the layout as a whole is easiest if

you drag a ‘selection rectangle’ around part of the

controls. Actual movement is then accomplished

via the arrow keys.

In the final step, don’t forget to re-enable

the form layout. If this is done, the resulting

form is made up of a large and expanding

text box and three slim buttons glued to the

bottom of the screen.

A question of policyLooking at the text box and the buttons in the

example leads to a puzzling conclusion. The Qt

framework somehow knows that some controls

can profit from extra height, whereas others do

not. This information is used at runtime in order

to give additional height to the textbox, while the

buttons remain small.

Each widget has a sizePolicy attribute for

the vertical and the horizontal direction. These

properties can be modified by selecting one of the

widgets and setting up its properties accordingly.

The seven attributes that are supported, as of Qt

5.0, are outlined in Fig 1.

This, however, is not the only possible way

the layout system can be affected. If controls

are intended to grow at different rates, this can

be configured using the Horizontal and Vertical

Stretch properties. By default, they are set to zero

– so the controls all ‘grow’ and ‘shrink’ together.

Assigning a value to horizontal stretch and/or

vertical stretch permits you to modify the size-

gaining behaviour. When controls are laid out, each

widget is assigned the minimum required space.

If additional display real estate is available, it is

shared according to the stretch values set in the

corresponding direction.

For example, if you had three buttons with their

horizontal stretch factors set to one, two and three

they would correspondingly take up one, two and

three times as much space at the bottom of the

created form.

Minimum and maximum sizesIn an ideal world, the computer would be able to

automatically detect the minimum and maximum

sizes needed by widgets. Sadly, practical attempts

at using artificial intelligence for determining

minimal and maximal heights has, by and large,

proven to be unworkable. Instead of that, Qt

provides developers with two properties called

minimumSize and maximumSize.

Their behaviour is largely logical. A control will

never become smaller than the values specified

in its minimumSize, and never exceed the size

of maximumSize. A newly set up control usually

has a minimumSize of 0 and a maximumSize of

TutorialTutorial

Inflating the size of the form does not affect the arrangement of the widgets

In the last years, the diagonals of screens

have grown considerably. At the same

time, the aspect ratio has become flatter

and flatter: today, screens tend to be

much wider than they used to be. This new

situation provides considerable challenges

to user interface developers. Very wide texts

are difficult to read – it is for good reason

that most books and newspapers are

printed in portrait mode.

When creating an application optimised

for very wide displays, try to think about how

the additional horizontal screen real estate

can be used.

Android tablet apps tend to provide

useful inspiration thanks to their fragment

layouts, which are used to give additional

context. For example, an email client would

display a hierarchy of folders next to the

actual message.

Attention,excessive widthManufacturers of monitors have their own agenda

QSizePolicy::Fixed This widget can neither shrink nor grow

QSizePolicy::Minimum This widget can theoretically grow, but the minimumSize is more than enough

QSizePolicy::Maximum This widget can be reduced in size if other widgets can use the space better – it can NOT grow

QSizePolicy::Preferred This widget can be shrunk if needed – growing is possible but does not lead to advantages

QSizePolicy::Expanding This widget can profit from extra space, but can be shrunk if the need arises

QSizePolicy::MinimumExpanding This widget can profit from extra space, but can NOT be shrunk if the need arises

QSizePolicy::Ignored This widget tries to grab as much space as possible

Responsive development with Qt

Fig 1

Page 51: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk51

16777215 – this means that the framework can

compute the minimal size from the content and

can make the widget as large as possible.

Advanced layoutsMost computer problems can be solved by using

the vertical and horizontal layouts. Sadly, some

more complex layouts can not be addressed in this

fashion. Qt provides developers with two additional

layout components which simplify the creation of

advanced forms.

Grid layouts permit you to arrange widgets

in a shape similar to the ones used in Excel or

LibreOffice spreadsheets. After dragging one of

them onto the screen, the layout will pop up on

the screen as an empty rectangle. Then, controls

can be dragged in by one another. When dropping

the widget, a blue line will be shown on the right or

the left side of the layout – dropping it there adds a

new row or column to the layout.

Form layouts are a specific from of the

aforementioned grid. A form is made up of two

columns: the one on the left contains the labels,

whereas the control on the right side is intended for

collecting the actual input.

Spacers for efficiencyCreative use of layouts permits you to create a

large variety of attractive forms. Sadly, some

effects can not be achieved without the use

of spacers. Spacers are a design-time-only

component which is not visible to the user.

At layout time, spacers have the habit to try to

extend to the maximum size possible. Placing a

spacer on the left side of a control ensures that

it will be pushed to the right side of the screen as

far as possible. Aligning a control to the middle

of the screen is possible by using two spacers at

the sides of the control.

Font sizes?As screen densities increase, font sizes eventually

become problematic. Keeping them inline

is currently not possible in the framework.

TUTORIAL

class Ui_MainWindow{public: QWidget *centralWidget; QVBoxLayout *verticalLayout; QTextEdit *textEdit; QHBoxLayout *horizontalLayout; QPushButton *pushButton_3; QPushButton *pushButton_2; QPushButton *pushButton; QMenuBar *menuBar; QToolBar *mainToolBar; QStatusBar *statusBar;

void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(395, 228); centralWidget = new QWidget(MainWindow); centralWidget->setObjectName(QStringLiteral("centralWidget")); verticalLayout = new QVBoxLayout(centralWidget); verticalLayout->setSpacing(6); verticalLayout->setContentsMargins(11, 11, 11, 11); verticalLayout->setObjectName(QStringLiteral("verticalLayout")); textEdit = new QTextEdit(centralWidget); textEdit->setObjectName(QStringLiteral("textEdit"));

verticalLayout->addWidget(textEdit);

Use dynamic resizing of UI elements to suit all screens

Responsive development with Qt

The three buttons have become

part of the layout

Fortunately, addressing the issue is easily done

in code. Most controls contain an event handler

which will be invoked whenever the layout engine

changes the size of the elements of the screen.

Analysing and comparing the sizes of the widget

to the ‘base size’ allows you to compute the ideal

font size. The actual ‘correlation’ can be done

in a linear or in a stepped fashion – advanced

information on this can be found in classic

typography literature.

ConclusionDue to a long tradition of Visual Basic, Windows

users do not expect their applications to show

an overly large amount of flexibility as forms

are resized. Due to the widespread adoption

of Qt, Linux and UNIX users are far less

tolerant of applications which do not resize

themselves intelligently.

Creative use of the layout system provides you

with the aforementioned logic with minimal extra

code. Arranging your controls in layouts can be

done in mere seconds, but leads to significantly

better applications.

Practical experience shows that the layout

system can be daunting due to the large amount of

functionality offered. Most developers tend to get

acquainted with the handling within few hours –

let this article be your guide to more attractive and

responsive user interfaces.

When a .ui file is saved, the Qt toolchain

transparently creates a ui_*.h file. This

header usually contains a setupUi method

which assembles the windows described in

the ui file out of the classes provided in the

QtGui stack.

As an example, take a look at the snippet in

Fig 2, which was taken from one of the forms

created as this article was written.

Please keep in mind that these files are

automatically regenerated whenever the

form is saved. Due to this, manual changes in

the ui file are not recommended – developers

using source control systems are advised to

keep these files out of the CVS at all expense.

Where is the intelligence?Analysing the process behind the WYSIWYG editor

Fig 2

Page 52: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.computeraid.org/donate020 8361 [email protected]

Or find us on...

Registered Charity No. 1069256 Registered Company No. 3442679

Page 53: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

PRACTICAL

Raspberry Pi54 “Nearly anyone

can take an idea from nothing to a working product in a week and at very little cost”

62 Make a streaming music player 64 Set up and use

an accelerometer 68 What exactly is an Onion Pi?

Contents

THE ESSENTIAL GUIDE FOR CODERS & MAKERS

www.linuxuser.co.uk53

54 Build a remote- controlled car 60 The ultimate in 3D

image capture?

Page 54: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Build a Raspberry Pi-controlled carMake use of cutting-edge web technologies to take control of a remote controlled car with a smartphone or tablet…

www.linuxuser.co.uk54

Page 55: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Build a Raspberry Pi-controlled car

Shaun Butlerworks in web software development and support by day, but by night he’s a prolific Raspberry Pi hacker. You can find his RasPi-controlled car project on YouTube viabit.ly/1jbBHeu

Web technologies are moving forward at a huge pace, cloud

technologies are bringing mass computing to individuals,

and hardware has reached a perfect moment in time where

sensors, displays and wireless technology have all evolved

into efficient and affordable devices. We truly are at a point

where nearly anyone can take an idea from nothing to a working

product in a week and at very little cost. Just like this project,

which is fun, quick and easy to build on and a fantastic way to

learn. We’re going to grab an old remote-control car, rip off its

radio receiver and replace it with the Raspberry Pi, hook it up on

the network, fire up a bleeding-edge web server and then get

your smartphone or tablet to control it by tilting the device. By

the end of this, not only will you have a fun toy – you will have

learnt about the basic technologies that are starting to power

the world’s newest and biggest economy for the foreseeable

future. Welcome to tomorrow!

www.linuxuser.co.uk55

Page 56: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Components list A toy RC car with two channels (steering and drive)

Adafruit PWM I2C servodriver

Female-to-female jumpercables

5V battery power bank

Components fromwww.modmypi.com

Estimated cost: £60 / $100

Before you can take control of your car with a smartphone, you’ll need to make some signifi cant changes to the chassis

Raspberry Pi-controlled car build process

To help our toy car come to life using

the latest web technologies and our

credit card-sized computer, we’re

going to need to make some pretty

signifi cant changes to its workings.

Fortunately, the most complex aspects

of the build can be accomplished with a

couple of affordable purchases, namely

a servo controller board to take care

of the steering and throttle, and a 5V

battery pack to keep the Raspberry Pi

running smoothly.

01 Identify and remove old radioThis project is effectively replacing the car’s normal

transmitter and receiver. Notice the three sockets on the original

receiver: one goes to the motor controller and one to the steering

servo. Some remote-control cars also have separate battery for

the electronics, but those (especially with an electronic speed

controller with BEC) get their 5V power supply directly from

the speed controller, saving on components. If you don’t have

a speed controller with 5V BEC, you’ll need to get a 5V supply

elsewhere. Many shops sell 5V battery power supplies – often as

mobile phone emergency top-ups. www.modmypi.com sells a

suitable 5V battery power bank for under £20.

Tutorial Build a Raspberry Pi-controlled car

www.linuxuser.co.uk56

Servo control We’ve used the Adafruit PWM I2C servo driver board from www.modmypi.com

Pi-powered The Raspberry Pi sits front and centre to keep it as safe as possible

Power up This 5V battery pack keeps our Raspberry Pi running for a good few hours

Pick a car You can use pretty much any affordable car for this project

Page 57: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk57

We’re using the Raspberry Pi’s I2C bus to control the servo interface board

Build a Raspberry Pi-controlled car

02 Attach the servo cables to the new controller

We soldered our 16-channel I2C servo

controller board from www.modmypi.com

as per its instructions and simply plugged

channel 0 (steering) and channel 1 (motor)

headers onto it. There are six cables in

total: the bottom two are ground, the

middle two are the power and the top two

are the PWM (pulse-width modulation)

signals. This is a good time to think of

places to mount the extra components

and the best fixing method seems to be

sticky-back Velcro.

03 Connect the I2C bus to the Raspberry Pi

We’re using the Raspberry Pi’s I2C bus

to control the servo interface board,

which only needs four cables – they all go

between the Raspberry Pi and the servo

controller board as pictured. This month’s

accelerometer tutorial explains how to set

up I2C on the Raspberry Pi.

From top to bottom we need to use the

1. GND, 2. SCL, 3. SDA and 4. VCC, which

map directly to the same ports on the

Raspberry Pi. Essentially this is power,

ground and two communication channels

– it’s all pretty straightforward so far…

04 Hooking it up to the Raspberry Pi

On a Rev 1 Raspberry Pi, the cables look

the same. Though the Rev boards have

different labelling, the physical pins are

in the same place. Bottom left (closest

to the RasPi power connector) is the 3.3V

power; next to that is the SDA header,

05 Overview of the main components

You should now have the servo board in

the middle with the steering servo and

speed controller on one side and the

Raspberry Pi on the other. The motor is

connected to the other end of the speed

controller (that end should have much

thicker wires); the speed controller

also has two thick wires going to the

main car’s battery – in this case a 7.2V

NiCad. We now have two very separate

power systems with the high current

motors on one side and the low current

electronics on the other. Let’s make

sure it stays that way!

06 Find everything a homeNow it’s time to find a home

for the new components. Use plenty of

sticky-back Velcro, tie wraps or elastic

bands to keep everything secure and

find spaces in the car’s body to hide the

wires where possible. While it is possible

to stick or screw the Raspberry Pi directly

to the car, we recommend to use at least

the bottom half of a case for added

protection and ease of access. Insert your

SD card, network cable or Wi-Fi dongle (if

programming from another machine) and

power supply. Sit back and admire your

hacking. Next we’ll tackle the software

side of the project…

which is the data channel. Next to that

in the bottom right is the SCL channel,

which controls the clock of the I2C

devices. And finally – on the top-right port

– is the Ground.

Step 02

Step 03

Step 05

Step 06

Page 58: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

What you’ll need A RasPi car, ready to go

An internet connection

A reasonably modernsmartphone/tablet

Pi car source codegithub.com/shaunuk/picar

Control a toy car with a smartphone and the latest web technologies

Controlling your Raspberry Pi-powered car

Now we have our fantastic Raspberry

Pi-powered car all wired and charged,

it’s time to make it come alive. We’re

using the best web technologies

that the JavaScript programming

language offers, to harness the natural

movement of your hand and wirelessly

drive the vehicle. Each little movement

will trigger an event that calculates

what the car should do and then sends

it over a socket connection up to 20

times a second.

01 Download and installthe software

To get the I2C connectivity working,

you can follow the steps from pages

64-65. Next we’ll need to fi nd a home

for our new project code – how about /

var/www/picar? Type sudo mkdir /var/www/picar in the terminal to make

the directory and then change into that

directory: cd /var/www/picar

Now, to download the project using

Git, type sudo git clone http://github.com/shaunuk/picar. If you

haven’t got Git, install it with sudo apt-get install git.

This will download the custom

software for driving the car, but we still

need the web server and some other bits

before we can start burning rubber…

02 Download and installNode.js

We now need to get the awesome Node.

js and its package tool, the Node package

manager (npm). Type sudo wget http://nodejs.org/dist/v0.10.21/node-v0.10.21-linux-arm-pi.tar.gz. This

will download a fairly recent version of

Node.js – the version Raspbian has in

its repositories is way too old and just

03 Confi gure Node.js To make it easy to run from

everywhere, we will create symbolic

links for Node and npm binaries. In the

terminal, type sudo ln -s /var/www/node-v0.10.21-linux-arm-pi/bin/node /bin/node and then sudo ln -s /var/www/node-v0.10.21-linux-arm-pi/bin/npm /bin/npm. Then,

to get the extra modules, type npm install socket.io node-static socket.io adafruit-i2c-pwm-driver sleep optimist

04 Get to know the projectNow we have everything, you

should see three fi les: the server (app.js),

the client (socket.html) and the jQuery

JavaScript library for the client. The

server not only drives the servos, but it

is a web server and sends the socket.

html fi le and jQuery to the browser when

requested – it’s a really neat and simple

setup and just right for what we’re trying

to achieve.

05 Test the servosOur handy little program (app.js) has a special mode

just for testing. We use two keywords here: beta for servo 0

(steering) and gamma for servo 1 (motor control). Type node app.js beta=300. You should see the front wheels turn. Now the

numbers need experimenting with. On our example, 340 was left,

400 was centre and 470 was right. Do the same for the motor by

typing node app.js gamma=400 and take note of the various

limits of your car.

06 Confi gure sensible defaultsNow you know what your car is capable of, we

can set the defaults in app.js and socket.html. Edit app.js

and fi nd the section that says ‘function emergencyStop’.

Adjust the two numbers to your car’s rest values. Then open

socket.html and adjust the predefi ned values under ‘Defi ne

your variables here’.

07 Going for a spinWe’re almost ready to try it out, but you need to know the

IP address of your Pi car, so type ifconfig at the terminal. Then

fi re up the app by typing node app.js. Now grab the nearest

smartphone or tablet, making sure it’s on the same network

as your Pi. Open the web browser and go to http://[your IP

address]:8080/socket.html. You should get an alert message

saying ‘ready’ and as soon as you hit OK, the gyro data from your

phone will be sent to the car and you’re off!

Above You need to adjust some of the variables to control your particular remote controlled car set-up

Tutorial Build a Raspberry Pi-controlled car

doesn’t work with the new technologies

we’re about to use. Extract the node

package by typing sudo tar -xvzf node-v0.10.21-linux-arm-pi.tar.gz.

58

Step 05

Step 07 Below All you need to fi nish off your project is access to a smartphone or tablet

Page 59: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk59

Build a Raspberry Pi-controlled car

socket.html <html><head><script src=”jquery-2.0.3.min.js” language=”javascript”></script><script src=”/socket.io/socket.io.js”></script><meta name=”viewport” content=”user-scalable=no, initial-scale=1.0, maximum-scale=1.0;” /><script>

//------ Define your variables here var socket = io.connect(window.location.hostname+’:8080’);var centerbeta = 400; //where is the middle?var minbeta = ‘340’; //right limitvar maxbeta = ‘470’; //left limitvar multbeta = 3; //factor to multiply the raw gyro figure by to get the desired range of steeringvar centergamma = 330;var ajustmentgamma = 70; //what do we do to the angle to get to 0?var mingamma = 250; //backwards limitvar maxgamma = 400; //forward limitvar multgamma = 1; //factor to multiply the raw gyro figure by to get the desired rate of accelerationwindow.lastbeta=’0’;window.lastgamma=’0’;

$(function(){ window.gyro = ‘ready’; alert(‘Ready -- Lets race !’);});window.ondeviceorientation = function(event) { beta = centerbeta+(Math.round(event.beta*-1)*multbeta); if (beta >= maxbeta) { beta=maxbeta; } if (beta <= minbeta) { beta=minbeta; }gamma = event.gamma; gamma = ((Math.round(event.gamma)+ajustmentgamma)* multgamma)+ centergamma;//stop sending the same command more than oncesend = ‘N’;if (window.lastbeta != beta) { send = ‘Y’ }if (window.lastgamma != gamma) { send = ‘Y’ }window.lastbeta=beta;window.lastgamma=gamma;if (window.gyro == ‘ready’ && send==’Y’) { //don’t send another command until ready... window.gyro = ‘notready’; socket.emit(‘fromclient’, { beta: beta, gamma: gamma } ); window.gyro = ‘ready’; }}

app.js//declare required modulesvar app = require(‘http’).createServer(handler) , io = require(‘socket.io’).listen(app) , fs = require(‘fs’) , static = require(‘node-static’) , sys = require(‘sys’) , PwmDriver = require(‘adafruit-i2c-pwm-driver’) , sleep = require(‘sleep’) , argv = require(‘optimist’).argv; app.listen(8080);

//set the address and device name of the breakout boardpwm = new PwmDriver(0x40,’/dev/i2c-0’);

//set pulse widthssetServoPulse = function(channel, pulse) { var pulseLength; pulseLength = 1000000; pulseLength /= 60; print(“%d us per period” % pulseLength); pulseLength /= 4096; print(“%d us per bit” % pulseLength); pulse *= 1000; pulse /= pulseLength; return pwm.setPWM(channel, 0, pulse);};//set pulse frequencypwm.setPWMFreq(60);//Make a web server on port 8080var file = new(static.Server)();function handler(request, response) { console.log(‘serving file’,request.url) file.serve(request, response);};console.log(‘Pi Car we server listening on port 8080 visit http://ipaddress:8080/socket.html’);lastAction = “”;function emergencyStop(){ pwm.setPWM(0, 0, 400); //center front wheels pwm.setPWM(1, 0, 330); //stop motor console.log(‘###EMERGENCY STOP - signal lost or shutting down’);}if (argv.beta) { console.log(“\nPerforming one off servo position move to: “+argv.beta); pwm.setPWM(0, 0, argv.beta); //using direct i2c pwm module pwm.stop(); return process.exit();}if (argv.gamma) { console.log(“\nPerforming one off servo position move to: “+argv.gamma); pwm.setPWM(1, 0, argv.gamma); //using direct i2c pwm module pwm.stop(); return process.exit();}//fire up a web socket serverio.sockets.on(‘connection’, function (socket) { socket.on(‘fromclient’, function (data) { console.log(“Beta: “+data.beta+” Gamma: “+data.gamma); //exec(“echo ‘sa “+data+”’ > /dev/ttyAMA0”, puts); //using http://electronics.chroma.se/rpisb.php //exec(“picar.py 0 “+data.beta, puts); //using python adafruit module pwm.setPWM(0, 0, data.beta); //using direct i2c pwm module pwm.setPWM(1, 0, data.gamma); //using direct i2c pwm module clearInterval(lastAction); //stop emergency stop timer lastAction = setInterval(emergencyStop,1000); //set emergency stop timer for 1 second });});process.on(‘SIGINT’, function() { emergencyStop(); console.log(“\nGracefully shutting down from SIGINT (Ctrl-C)”); pwm.stop(); return process.exit();});

We’ll harness the natural movement of your hand and wirelessly drive the vehicle

Full code listing

Page 60: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

60 www.linuxuser.co.uk

Left The image scan is rendered before being sent to be printed as a 3D model Below Sit back and relax, the scanner will take less than a second to get your best sideComponents list

40 Raspberry Pis

40 Pi camera modules

40 8GB SD Cards

1 60A 5V power supply

LED strips

Wood pylons

The Raspberry Pi camera allowed Garsthagen to set exposure, ISO and shutter speed like a manual camera

Page 61: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk61

3D full-body scannerWe talk to Richard Garsthagen about why he needs 40 Raspberry Pis to take a picture of you

How did you get started creating

these practical projects and working

with the Raspberry Pi?

“In the last five to six years I began

working with 3D printers and CNC

machines. I started to build stuff, such

as furniture and gadgets, and my first

Raspberry Pi project was the Pi Snap

Box. It’s the size of a mini-PC and is a

box you put on the wall with one button

on it. If you press the button, it takes

three photos. It posts the first photo to

a Facebook account for whoever the box

belongs to. So for example, if you hang

it up in a hairdresser’s salon and get

your hair done all nicely, people could

then see the good results on the

hairdresser’s Facebook page.

This is good commercially to attract

visitors, but we’ve had one of those boxes

in my home for a year now, and my son

has been posting pictures of himself to

Facebook on his own for the past year.

That was my first Pi camera project, and

I really fell in love with the camera as it’s

easy to use and very low cost. That gave

me the idea that if one was so cheap, I

could scale it up to 40 at least.”

What gave you the idea to create the Pi

3D scanner in the first place?

“I have to say that as I have kids in my

life I have a lot of challenges I’d like to

do – kids give you a lot of reasons to

build projects. As for my 3D scanner,

my youngest kid is two, and of course

there are lots of methods out there to

do 3D scanning. But pretty much all of

them [require you] to sit still, and my

two-year-old does not sit still, I can tell

you that! So I really wanted them to be

able to be actual 3D scans and then

print my youngest son.

I was aware that Hollywood did this

with multiple cameras, but it is very,

very expensive to do – typically they

use 80-100 cameras, costing about

$1,500 plus all the other gear. I could

buy a house for that!”

What made you decide to use the Pi

Camera over standard digital cameras?

Surely they wouldn’t be much more

than a Pi and Camera board together?

“I started researching that, thinking

maybe I could buy a cheap digital camera,

very cheap, with an eye at $40 to $50

for each camera. I probably could wire

them up so that I could automatically

synchronise them, but then I would still

have the problem of all the images sitting

on all the SD cards in each camera. With

the Raspberry Pi, at the time I had only

one, it had a camera and it was network

connected so I could see its potential.

One thing I liked a lot about the

Raspberry Pi camera was that I could

set full shutter speed, exposure, ISO

settings like a manual camera. Plus I

could upload, fully automatically, all

the images, so the whole process was

completely automated. You hit the button,

all the cameras take an image, they send

a copy to a central file server where you

can either render the 3D image yourself

locally or send it to Autodesk’s free cloud

software to turn it into a 3D model.”

How have you been able to use the

scanner so far? How much time does it

need to develop an image?

“We went to the Maker Faire in

Gronigen where we allowed everyone

to get a scan of themselves for free

– and the system worked extremely

well. Taking the images to create the

3D object takes a second – less than a

second actually.”

Richard Garsthagen has worked in IT his entire career and is self-taught in coding. He’s been making practical projects for almost six years now.

If you like Richard’s Pi Snap Box project is a much simpler implementation of the Pi and Camera, and can be found at www.pisnapbox.com

Further readingTo learn more about the 3D Scanner and where you might see it next, visitwww.pi3dscan.com

I was aware Hollywood did 3D scans with multiple cameras, but it is very expensive – typically $1,500 each plus other gear. I could buy a house for that!

My Pi Project

3D scans can then be sent to a 3D printer, to give you a physical record of your appearance

Page 62: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk62

Tutorial Raspberry Pi music streamer

Remotely control a Raspberry Pi that plays your music collection and stream your music to your phone

Raspberry Pi music streamer

Components list

A router or switch on

your network to plug your

Raspberry Pi into

Latest Raspbian image www.raspberrypi.org/downloads

An iOS or Android device to

control your music from

A Linux computer that can

scp (secure copy protocol)

music to the Pi and

optionally act as a client

For this project you’ll need…

Liam Fraser Liam is the creator of the RaspberryPiTutorials YouTube series and volunteers as a Linux server administrator for the Raspberry Pi Foundation

Android & iOS While there are lots of applications suitable for this project, we recommend MPDroid for Android and MPoD for Apple’s iOS devices

Server connection Once your Android or iOS app is set up, we can connect to our music server using the Raspberry Pi’s IP address

Streaming daemon We can confi gure the Raspberry Pi Music Player Daemon to listen on all interfaces so we can access the music from all kinds of devices

Music collection Your music collection must be stored in the directory /var/lib/mpd/music on your Raspberry Pi. Once the daemon is set up, you can access it from any mobile device or computer

1 Daemons You’ll learn how a background process can help you share data across the network conveniently.

2 Networking Often considered a dark art, network confi guration isn’t always as scary as it seems at fi rst glance.

Skills to learn

Page 63: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk63

Raspberry Pi music streamer

Music Player Daemon (MPD) is a piece

of software that acts as both a music

player and a music server. It can output

audio to any sound card connected to

the system, and be controlled by an

MPD client. Clients are available for

almost any platform, including iOS and

Android. MPD can also output audio to

a stream, which can be used by most

clients. This is great for people with

large music libraries who can’t fi t it all

on their device.

01 Install the required software

Log into the Raspbian system with

the username pi and the password

raspberry. First, fi nd the IP address of

the Pi using ip addr | grep inet and

note it down for use later. Get the latest

package lists using the command sudo

apt-get update. Then install MPD using

sudo apt-get install mpd. There may

be some errors, but you should be able

to ignore those.

02 Add musicThe default music directory

for mpd is /var/lib/mpd/music. We will

fi rst make this folder world-readable,

writable and executable so that the Pi

user can write to it. Do this with sudo

chmod 777 /var/lib/mpd/music. Then

fi nd some music you’d like to copy on

your Linux computer and use scp to

copy it. For example: scp -r Alt-J/

[email protected]:/var/lib/mpd/music/

03 Fix permissionsThe fi les that we just copied

will be owned by the Pi user, which isn’t

what we want. We’re going to change the

ownership of the music directory, and

all subfi les/subdirectories, to the mpd

user and the audio group: sudo chown

-R mpd:audo /var/lib/mpd/music

04 Confi gure the daemonWe want to edit /etc/mpd.conf

(using sudo). The fi rst change is to make

the daemon listen on all interfaces,

so we can use MPD clients from other

devices. Do this by changing the line:

bind_to_address “localhost”

to…

bind_to_address “any”

05 Confi gure a streamAt the moment, the only audio

output is the 3.5mm one on the Pi. To set

up a stream, scroll down the confi g fi le

until you fi nd the httpd stream output

that is commented out. Uncomment

the entry, and change the format line to

produce stereo output instead of mono.

Our entry was as follows:

audio_output {

type “httpd”

name “My HTTP

Stream”

encoder “vorbis”

port “8000”

quality “5.0”

#bitrate “128”

format

“44100:16:2”

}

Save the changes and restart the

daemon with sudo /etc/init.d/mpd

restart

06 Set up a clientIt’s diffi cult to walk through

setting up a client on each different

platform, but the steps translate fairly

easily. For Linux, we suggest Sonata,

for Android we suggest MPDroid, and

for iOS we suggest MPoD. We’re going to

set up MPDroid on Android, so go ahead

and download that from the Play Store.

07 Connect to the serverOnce in the MPDroid app, select WLAN-based

connection and choose your access point. Then fi ll in the Host

fi eld with the IP address of your Pi and fi ll in the ‘Streaming

host’ fi eld with the same details. Everything else should be

the default. Once you’ve done this, go to the Now Playing

screen. We need to update the music library, as it has never

been scanned before. To do this, press the Menu button,and

go to Settings. Then select the Update option, with the caption

‘Refresh MPD’s Database’.

08 Playing musicstream.png

Press the ‘treble clef’ button in the bottom-left corner to go

to the music library. This will take you to the Artists section

of the library. To play music from an artist, long-press on the

artist and select ‘Add, replace and play’. If you have speakers

or headphones connected to the Pi, you should hear music

coming out of them. Use the volume slider on the Now Playing

screen to adjust the volume.

To enable the stream, press the Menu button and tick the

Stream option. After about ten seconds of buffering, the

sound will be coming out of your Android device. Although this

is a long time to buffer, once you have a playlist the device will

play it seamlessly. You may be able to reduce this buffer time

by looking at the improvements section…

09 Further improvementsThis article has illustrated a very simple MPD setup.

Further possible improvements include:

Putting music on an external hard drive so that you have

more storage space;

Tweaking the streaming settings to tax the Pi’s CPU less

(look at the ‘encoder plugins’ section of the user manual at

www.musicpd.org/doc/user);

Setting up a Samba share, to give access to the music fi les

over the network.

Music Player Daemon can output audio to any sound card connected to the system, and be controlled by an MPD client – on almost any platform

Above Stream your music library to a mobile device using a compatible client

Above This is the Sonata client for Linux

Step 04 Step 06

Page 64: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk64

Adding tilt technology to your next Raspberry Pi project is easier than you might think

Use an accelerometer with Raspberry Pi

1 I2C It’s a very useful and convenient form of device connectivity and used by many add-on peripherals.

2 Pygame The core mechanics of Pygame are straightforward and make interactive programs very easy to prototype.

Skills to learn

Tutorial Use an accelerometer with Raspberry Pi

Components list

ADXL accelerometershop.pimoroni.com

Latest Raspbian Imagewww.raspberrypi.org/downloads

Breadboardshop.pimoroni.com

Male-to-female

prototyping cablesshop.pimoroni.com

30W soldering ironshop.pimoroni.com

Components fromshop.pimoroni.com

How to get prototyping…

Russell BarnesRussell is the editor of Linux User & Developer magazine and a keen Python programmer and Raspberry Pi hacker

We use accelerometers every day.

They’re in our phones, game controllers

and help keep our cars on the ground

and planes in the air.

In this project we’ll be using an

ADXL345 accelerometer kit to create

a prototype controller for a Space

Invaders-style game we’re working on –

we’ll return to this code in later issues.

The kit is only £20, but does require

about 15 minutes of basic soldering.

Beyond that, the physical setup is

simple. We’ll be placing the ADXL345

on our breadboard controller and using

just four wires to communicate with the

Raspberry Pi’s GPIO pins using I2C.

Let’s start by making sure your Pi is

up to date. Open a terminal window and

type: sudo apt-get update && sudo

apt-get upgrade

01 Install i2c-toolsFirst, ensure your Pi can use

I2C to talk to the ADXL345 module. In a

terminal, type: sudo apt-get install

i2c-tools followed by sudo nano /etc/

modprobe.d/raspi-blacklist.conf

This will open a fi le in nano – locate

the line ‘blacklist i2c-bcm2708’ and

comment it out so it looks like this:

#blacklist i2c-bcm2708

Save with Ctrl+X, then press Y and Enter

to exit. Finally, edit the /etc/modules fi le

with nano, adding the line i2c-bcm2708

i2c-dev to ensure it loads every time you

boot. Reboot to fi nish the operation.

02 Connect the hardwareSince we’re using I2C with

Python, we’ll need to install the smbus

Python library. Type sudo apt-get

install python-smbus in the terminal.

Then wire up the accelerometer to the

Pi with male-to-female prototyping

cables. The correct pins are marked on

the ADXL345, but check our pictures for

where to plug things into the Pi.

03 Final checksWith accelerometer attached to

Pi, power it up, open a teminal window

and type: sudo i2cdetect -y 1. The ‘1’

at the end assumes you’re using a Rev 2

Pi – replace it with ‘0’ if yours is older.

You should see some numbers denoting

that the ADXL345 has been recognised.

Finally, we’ll use Git to grab the project –

type the following into the terminal:

sudo apt-get install gitAbove The fi nished project uses free images from opengameart.org

Step 02

Page 65: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk65

Use an accelerometer with Raspberry Pi

04 Cloning and testingFrom the terminal, navigate to your home folder

(with cd ~) and create a project folder for the project to live in

using: mkdir adxl345_project. Cd into the folder and from the

terminal, type the following to clone the fi nished project from

our Github.com account: git clone https://github.com/

russb78/adxl345_project.git

05 How it worksTo run the project for the fi rst time, from the

adxl345_project folder type:

sudo python adxl_345_project.py

A Pygame window will open and a spaceship will appear

on screen on a space backdrop. Pick up your breadboard

‘controller’ and tilt it around. The ship should move around the

screen in reaction to your movements. If the movements are

backwards in either direction, you can adjust the orientation of

the breadboard – it might be ‘upside down’!

06 Why it worksThe code for this project is an excellent backbone for

a Space Invaders-style game written in Python and Pygame.

The code collects data from the ADXL345 accelerometer in

the update_pos() function using the move_data variable. This

data is piped to the player_position array – which is in the

form of x and y co-ordinates. The move_data is added to the

player_position co-ordinates to push the image of the

spaceship around the screen. You can adjust the multiple (for

us, 20 was a good number) to change the speed of the ship.

We’ve also used a check_pos() function, which makes the ship

‘wrap around’ the screen. If it exits the screen on the left, it will

reappear on the right.

import pygamefrom adxl345 import ADXL345

adxl345 = ADXL345() # Initialise the accelerometerpygame.init() # Initialise Pygame

# Create a screen of 800x600 resolutionscreen = pygame.display.set_mode([800, 600])

# Name the game window# Set the mouse visibility and start an FPS clockpygame.display.set_caption(‘ADXL345 Space Test - Press ESC to quit’)pygame.mouse.set_visible(False)clock = pygame.time.Clock()

# Load the images we’re using from:# http://opengameart.org/users/rawdanitsu background_image = pygame.image.load(“Space-Background-4_0.jpg”).convert()player_image = pygame.image.load(“ship0.png”).convert()

# We can use colour key method to remove the background from the shipplayer_image.set_colorkey([0, 0, 0])

player_position = [450, 350] # Initial starting point of the shipgame_over = False # Global variable to decide if the game should end

def update_pos(): “““ Poll the adxl345 and update player pos based on readings””” move_data = adxl345.getAxes(True) # Returns a dict of axes results if move_data[‘x’] < -0.1 or move_data[‘x’] > 0.1: player_position[0] += move_data[‘x’] * 20 if move_data[‘y’] < -0.1 or move_data[‘y’] > 0.1: player_position[1] += move_data[‘y’] * 20

def check_pos(): “““ Check player pos to make it wrap-around the game window””” if player_position[0] > 850: player_position[0] = -75 elif player_position[0] < -75: player_position[0] = 850 if player_position[1] > 650: player_position[1] = -75 elif player_position[1] < -75: player_position[1] = 650

###### MAIN PROGRAM LOOP ######while not game_over: # Handle control events while the game is in play for event in pygame.event.get(): if event.type == pygame.QUIT: game_over = True # Quit if close button is pressed if event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: game_over = True # Quit if escape key is pressed

update_pos() # Update the player’s position check_pos() # Check the player’s position

# Update the background then the player’s position on the screen screen.blit(background_image, [0, 0]) screen.blit(player_image, [player_position[0],player_position[1]]) pygame.display.flip() # Refresh the screen clock.tick(20) # Force frame-rate to desired number pygame.quit() # Game quits gracefully when ‘game_over’ turns True

Full code listing On the Disc

We’ll be using an ADXL345 accelerometer kit to create a prototype controller for a Space Invaders-style game

Above The ADXL345 accelerometer only requires four cables – two for power and ground and two for I2C communication with the RasPi

Step 02

Page 66: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk66

The object of PythonPython is built as an object-oriented language. But how do you use Python objects? Joey Bernard explains…

Welcome to the first of what will be a

series of articles talking about what

is great about Python. Even though

all of us at Linux User are fans of the

language, we’re not so enamoured as to

be blind to its weaknesses.

So over the coming months we will not

only learn about how to do certain tasks

in Python, but also what pitfalls you

may run into during your travels. Once

we have some Python basics under our

collective belts, we will start looking at

ways to apply this new-found knowledge

to create some small programs for the

Raspberry Pi.

The first subject we will look at is

using objects in Python. According to

the official documentation, objects are

Python’s abstraction for data. All data

in a Python program is represented by

objects or by relationships between

objects. Actually, almost everything

in Python is an object. So learning a

bit more about how they behave is

important if you intend to develop code

of any real value.

More specifically, we will look at

classes and how to work with objects of

your own design.

Classes in Python support all of the

most common concepts in object-

oriented programming. The mechanisms

of classes in Python were inspired

by C++ and Modula-3. A class can

inherit from multiple base classes

and can override any methods in the

base classes. All of the methods in

the base classes are also available to

be called from the inheriting class. As

for data, objects can contain arbitrary

amounts and types. And because

Python is a dynamic language, all of

this is modifiable at runtime. As an

example, let’s say that you want to

develop a program that will do some

kind of geometric processing. One of the

core objects that you will want to use

is something that represents a point

in space. Looking at two-dimensional

geometry first, you will need to store two

values, an x and a y. In code, this would

look like:

class Point: pass

This gives us a blank class called

Point. The first line is how you define a

new class. It is very similar to how you

define a new function, except that you

exchange the keyword ‘def’ with the

keyword ‘class’. A class always needs to

have at least one statement. If you don’t

want your new class to do anything yet,

you can use the keyword ‘pass’. This

essentially tells Python, ‘there’s nothing

to see here just yet’. You can now use

this class to create new objects of type

‘Point’. You can do this with:

my_point = Point()

This is not really all that useful yet. There

is nowhere to store our point values. Or is

there? One of the really cool things about

Python objects is that they are fully

dynamic. You can add x and y values with

the statements:

my_point.x = 10.0 my_point.y = 20.0

This particular instance of the Point

class now has an x and y value. That

was easy! Unfortunately, we can’t

really use them effectively just yet.

It would be better to have them as

part of the definition of the class so

that we can write methods that know

how to use this data. It many cases, it

also makes sense to initialise these

variables. One way to do this is to

simply write statements within the

class definition directly:

class Point: x = 0.0 y = 0.0

The other way to initialise values is to

use the __init__ method in classes. This

method gets automatically called when

a new object gets instantiated, so every

object you create will have those values

by default:

class Point: def __init__(self): x = 0.0 y = 0.0

You can then reset your values for x and y

after creating a new instance with:

my_point = Point() my_point.x = 10.0 my_point.y = 20.0

While this works well, one thing to

remember is that programmers are

inherently lazy and do not want to

type more than absolutely necessary.

Following this idea, it would be great if

you could assign your x and y values at the

same time you are creating a new object.

In Python, you can. The __init__ function

can be written to take parameters.

class Point: def __init__(self, xvalue, yvalue): self.x = xvalue self.y = yvalue

Joey Bernard As a true renaissance man, he splits his time between building furniture, helping researchers with scientific computing problems and writing Android apps

All data in a Python program is represented by objects or by relationships between objects. Actually, almost everything in Python is an object

Why Python? It’s the official language of the Raspberry Pi. Read the docs at www.python.org/doc

Page 67: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk67

Python column

# If Pygame isn’t installed, this code won’t work for you. # You can find pygame in the package manager for all major distros. # Debian-based users can install it with:# sudo apt-get install python-pygame

import pygameimport sys

# initialise pygame with the following:pygame.init()

# we’re creating a clock to control the frame rate:clock = pygame.time.Clock()

# We’re assigning some global variables, hence they are all caps.BLACK = [0,0,0]SIZE = WIDTH, HEIGHT = 640,480

# we need to create a pygame surface to display everything to:screen = pygame.display.set_mode(SIZE)

# Let’s create our small class:class My_ball: speed = [2,2] ball = pygame.image.load(“ball.png”) ballrect = ball.get_rect()

#Next we create an object from it:ball = My_ball()

# This is our pygame ‘loop’. While true, we’ll do the following:while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() # If we close the window, it quits gracefully sys.exit() ball.ballrect = ball.ballrect.move(ball.speed) # This is our main ‘game’ logic.

# We’re telling the ball to flip direction horizontally if it hits the sides: if ball.ballrect.left < 0 or ball.ballrect.right > WIDTH: ball.speed[0] = -ball.speed[0]

# and to flip vertical direction if it hits the top or bottom: if ball.ballrect.top < 0 or ball.ballrect.bottom > HEIGHT: ball.speed[1] = -ball.speed[1]

# wiping the screen stops the old ball location from still showing screen.fill(BLACK) screen.blit(ball.ball, ball.ballrect) # draw our ball to the screen pygame.display.flip() # ‘Flipping’ the screen shows us the new ball location clock.tick(60) # We’ll limit it to 60 frames a second

Pygame If you’re looking to create any project with graphics, sound, animation or game elements, Pygame is a great place to start. Read the docs at www.pygame.org/docs

Full code listing

Now when you want to create a ‘Point’

object with values you want to assign at

its creation, all you need to do is type:

my_point = Point(10.0, 20.0)

Isn’t that much easier? Now that you

have a point defined, you can add

methods to work with this data. One

of the first methods for a point is its

absolute value. To add this to your class,

you can just add the function definition

to the class definition like this:

class Point: def __init__(self, xvalue, yvalue): self.x = xvalue self.y = yvalue def abs_val(self): sqr_val = self.x**2 + self.y**2

return sqr_val**0.5

Now that you have a basic two-

dimensional point defined, you may

want to create objects that can handle

three-dimensional points. Ultimately,

code reuse is something that should be

aimed for – especially within the realms

of object-orientated programming – and

it’s easy to do in Python. You can create

a new class that builds on the existing

code for two-dimensional points. This

would look like:

class ThreeDPoint(Point): def __init__(self, xvalue, yvalue, zvalue):

self.x = xvalue self.y = yvalue self.z = zvalue

Written this way, the initialisation

method has been overridden to take

three parameters rather than two. But,

nothing has been done to the method

abs_val, inherited from the Point

subclass. So when you call this from an

instantiated ThreeDPoint object, you

will get the length of the x and y parts

of this point. If you want a proper three-

dimensional absolute value, you will

need to override the abs_val function.

Now that you’ve seen how to create

your own objects, next month we’ll look

at some details around how Python

manages these objects in memory. On

most desktop systems, memory is not

really a concern. But the Raspberry Pi is

relatively constrained, so knowing how

memory is handled will become more

important for your code.

This ball class could be the

perfect backbone to a game. It’s

easy to replace your ball picture

with anything you like too

Page 68: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk68

Not a poorly named competitor to the Raspberry Pi, but an interesting way to use your Pi for added security

Q So what is an Onion Pi then? You

say it’s not a competitor?

A That’s correct. Onion Pi is the name

for a Raspberry Pi kit that Adafruit

Industries has put together which

enables you to create a secure wireless

router using the Raspberry Pi.

Q Okay, so it’s a product that uses

the Raspberry Pi. What is Adafruit

Industries, though?

A Adafruit Industries is an online

resource for learning about

electronics and helping makers of

every age and skill level build projects.

Adafruit also provides and sells tools and

equipment that its experts have tested

themselves to make sure these meet its

quality standards.

Q You said it’s for makers – who and

what is a maker?

A The term ‘maker’ has been hitting

the mainstream media a lot recently,

but it’s still not widely known. Makers are

people that do simply that – they make.

It’s mostly used for people who create

practical projects in their spare time for

fun, although some of the more famous

maker projects have gone on to be sold

as actual products.

There are several Maker Faires held

around the world where people can

showcase their creations just for the

fun of it. You can learn more about these

Maker Faires at the official website:

makerfaire.com. If you can attend a

Faire, we recommend it: they’re fun

and inspirational.

Q Okay, so Adafruit Industries is

for makers. How is this related to

Linux, FOSS and even the Raspberry Pi?

A As we’ve showcased often in

the magazine, the Raspberry Pi

has become extremely popular as a

cheap and effective way to power the

computerised and/or automated parts

of a practical project. Adafruit itself is

a champion of open hardware and has

its own distro image for the Pi, based on

Raspbian. This image comes preloaded

with drivers for some of the products

Adafruit sells.

Q All right, that’s Adafruit explained.

Tell me more about the Onion

Pi. First of all, you’re making it a

wireless router?

Rob Zwetsloot models complex systems and is a web developer proficient in Python, Django and PHP. He loves to experiment with computing

If you like this…For other ways to stay private, the Tails distro is preconfigured to run all networking through Tor. For more ways to use a networked Pi, you can also make it a file server or web server.

Further reading You can read up more on the Onion Pi from the Adafruit article explaining how to build it: bit.ly/1jctkPS

Basically, all the information is encrypted every time it’s sent to another node in the network, and it creates several layers of encryption

FAQ What is Onion Pi?

What is Onion Pi?

Page 69: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk69

A That’s correct – the simple concept

is that we’re using the hardwired

Ethernet port to deliver internet directly

to the Raspberry Pi. This can be done by

just plugging in the cable, nothing too

diffi cult. We then also set up a wireless

USB stick to work as a wireless receiver

or hotspot, effectively allowing other

devices to connect to the Raspberry Pi.

We then pass-through the internet via

this wireless connection, allowing the

connected devices to connect wirelessly

to the internet through the Raspberry

Pi itself.

Q Right. What would you really use

that for, though?

A Many things, really. Some hotels

offer a wired connection but no

Wi-Fi, so this way you’d be able to

connect multiple devices to the internet,

such as phones or laptops, that you may

not necessarily want to tether to one

location. It may also be cheaper than

the Wi-Fi service they offer, and only

requires you to register one device on

their network. It could also work as a sort

of cheap wireless repeater in a house

with bad signal strength, or replace a

temporarily broken router.

Q Fair enough I suppose. What’s the

secure part all about then?

A Well, the Onion Pi routes all

the internet traffi c through Tor,

an ‘anonymity network’. Traffi c is

redirected through a worldwide network

of thousands of volunteer relays,

effectively hiding a user’s location and

internet usage. Like when someone’s

doing a trace in a bad Nineties hacking

fi lm and they’ve ‘bounced the signal’

off various satellites or something. Only

a little more complex, and with less

Robert Redford.

Q Hey hold on, what’s wrong with

Sneakers?

A Actually, we really like Sneakers. We

retract our previous statement. No

more secrets.

Q Good. Anyway, what’s all this signal

bouncing in aid of?

A Security and anonymity, as we’ve

already mentioned. It’s for your own

privacy, makes you diffi cult to trace.

While it could technically be used for

secret spy work, most people use Tor

so they don’t get hammered with weird

targeted ads and increased prices from

particularly shady online companies.

This was before the whole NSA and

PRISM thing.

Q So Tor let’s me hide what I’m doing

from the NSA?

A According to recent news reports,

maybe not, but you probably have

bigger things to worry about if there’s

a possibility the NSA is keeping an eye

on you.

Q Just checking. Wait, hold on, why is

it called the Onion Pi?

A Tor stands for the The Onion

Router, and performs onion

routing. Basically, all the information is

encrypted every time it’s sent to another

node in the network, and it creates

several layers of encryption. Onions

have several layers. Computer scientists

like to give things simple or descriptive

names, so it stuck. It’s actually patented

by the US Navy apparently.

Q I think I’m starting to understand

now. Why would you want to do this

on a Raspberry Pi, though?

A Well, some of the same reasons as

the normal Raspberry Pi wireless

router apply; however, you can also use

this as your main, encrypted router.

Most commercial wireless routers won’t

allow you to do this unless you start

fl ashing the fi rmware, whereas you

can just hook a Raspberry Pi up and it

handles all the Tor information. Anything

connected to the network won’t need to

be set up specifi cally to use Tor itself, as

the Pi will already be routing it through

the network.

Q Okay, I think you’ve sold me on the

concept. Convenient privacy. Do I

need to buy the specifi c kit to make an

Onion Pi, though?

A No, you don’t! It doesn’t even

specifi cally require the Adafruit OS

either. What you need is a Raspberry Pi

running Raspbian, a wired connection,

and a USB wireless adaptor that can be

used in this specifi c hotspot setup. You

can fi nd out more on what you need,

and how to do it, on the Adafruit tutorial:

bit.ly/1jctkPS

Q You seem to know an awful lot

about this. Have you covered this

before in the magazine?

A I’m glad you asked, yes we have. We

fi rst did the wireless router tutorial

in issue 129 of the magazine, and did a

full tutorial on it in issue 131. You can buy

both digitally on GreatDigitalMags.com,

or buy the physical copy in the Imagine

Shop (imagineshop.co.uk) – the printed

back issues disappear fast, so you’ll

need to be quick.

What you’ll needRequired components for an Onion Pi

FAQ

SD card with RaspbianThe easiest distro to get, frankly, but the one you’ll need in order to turn your Raspberry Pi into a fully functional privacy box.

Compatible Wi-Fi adaptorAdafruit sells Wi-Fi adaptors that it knows work, and provides some general drivers that some adaptors can use to work as a wireless hotspot.

Internet connectionIt might seem obvious, but to actually allow other connecting devices to browse the web, you’ll need the Pi to be able to connect to the internet itself.

Stable power supplyWhile it’s always recommended to power a Raspberry Pi with a dedicated power supply, the Onion Pi will happily run off a laptop’s USB port.

Page 70: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

facebook.com/webdesignermag twitter.com/webdesignermag

DESIGN INSPIRATION BEHIND THE SCENES STEP-BY-STEP ADVICE

BUY YOUR ISSUE TODAYPrint edition available at www.imagineshop.co.uk

Digital edition available at www.greatdigitalmags.com

Available from all good

newsagents and supermarkets

ON SALE NOWHot 100 2014 | 15 Best browser developer tools | Supercharge your CSS

PRACTICAL TIPS INDUSTRY OPINION

BUILD A BETTER WEBwww.webdesignermag.co.uk

Available on the following platforms

Page 71: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk71

Empathy

KDE Telepathy

emesene

Pidgin

Find out the best way to keep in touch with colleagues and friends across all chat services

Instant messaging clients

EmpathyThe GNOME instant messaging

client is popular among distros that

use a GNOME or GNOME-based

desktop. It has great integration

with GNOME, and allows the use

of multiple services that even

include voice and video support.

It’s currently the default client in

Ubuntu and Fedora.

Download from bit.ly/1kOJNoU

emeseneInitially designed to ease Windows

users over to chat on Linux,

emesene evolved from just an MSN/

Windows Live Messenger client to

supporting a wide range of services

via XMPP and more. Development

has currently slowed since the MSN

servers went offl ine, however it can

still be easily used.

Download from bit.ly/1cM8GAG

KDE TelepathyThe successor to the venerable

Kopete, KDE Telepathy is the

new default KDE IM client. It’s

based on Telepathy, an IM

framework, and is still in the

process of replacing Kopete in

KDE-based distros. It supports

VoIP along with the usual text

applications as well.

Download from bit.ly/19NcQ76

PidginCross-platform and highly

customisable, Pidgin was once

the best instant messaging client

around. Development seems to

have slowed considerably on it for

Linux, with only bug fi xes released

every now and then for the software.

New features are slowly making

their way in, however.

Download from bit.ly/1dG9vJR

71 Group Test | 76 GertDuino | 78 CentOS | 81 Mageia Beta

GROUP TEST

Page 72: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk72

CompatibilityEmpathy does not come with a large variety of chat services supported

from the start, although it at least allows you to connect to some major

services such as Google Hangouts, Facebook and anything on the Jabber

network. It does, however, allow you to connect to social media services, so

you can keep track of personal messages and integrate it with Gwibber or

any other social media clients.

Empathy

The way Empathy connects to various chat services

and social networks is unique

The GNOME standard, with access to a lot more than just instant messaging

Add-on supportThe full range of libpurple plug-ins is supposedly compatible with Empathy,

although not all of them work quite as they should do. However, as these are

the same plug-ins as Pidgin uses, there are a wide variety to choose from if

you need to look for something else, and they’re mostly well maintained.

InterfaceEmpathy keeps things simple and readable – there’s only one menu item

on the main chat window, and this opens up to more packed options and

account management. Everything used for actually chatting day-to-day

is designed to maximise the area that contacts and conversations take up,

with no extra buttons or functions for emoticons or font customisation.

Account managementAccount management is part of a larger GNOME-based account structure,

allowing you to add Google or other feature-rich services and take full

advantage of all the functions they offer such as fi le storage, social media,

emails and more. As this is system-wide in some distros and desktops,

it’s very easy to use and edit.

emesene

emesene’s interface is interesting, taking the best and most

noticeable parts of older MSN Messenger clients

Is the lack of support an issue, or is it a great client regardless?

CompatibilityUnfortunately, emesene only offi cially supports three specifi c chat

services: Google Hangouts, Facebook chat and MSN/WLM. There’s a

manual ‘dummy’ service you can sign into as well that supports XMPP

clients, however there’s still a limit to the services that covers.

Add-on supportThere is a selection of offi cial plug-ins that add a few basic features, such

as integration with GNOME availability settings, some better notifi cations,

and so on. While there is also a handful of community-made plug-ins,

nothing adds extra services or any meaningful interface options in the

same way the other clients in this test do.

InterfaceThe look of emesene is possibly the best part of the software, although it

does work a bit differently to most other services – chat windows are part

of the main contact window interface, opening up when someone sends a

message or if you decide to instigate a chat. It’s made to resemble the older

Windows Live Messenger clients, although it takes the best parts of the

design and leaves out the bad bits.

Account managementYou can only sign in under one account at a time, and none of the plug-

ins allow you to change this. It will at least attempt to remember your

username and password for the main three chat services you’ve used,

however you then need to log out to access the others every time, cutting

off any conversations and fi le transfers.

Instant messaging clients group testReview

OverallEmesene was created to be a good way to ease

Windows-converts into using Linux, but unfortunately it

doesn’t have any lasting appeal when compared to the

the more advanced, and more capable, clients on offer

even within this group test. 5Overall

Empathy is a powerful client that focuses more on

delivering a good experience than offering every feature

possible. Luckily, most of these features can be added

later with plug-ins. It’s also well integrated into the

distros that fully support it. 8

Page 73: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk73

Find out the best way to keep in touch with friends across all chat services

Instant messaging clients

KDE TelepathyThe KD-bound instant messaging client has a huge amount going on

PidginOnce an IM king, it still has tricks up its sleeve and an active community

CompatibilityTelepathy offers a wide variety of different services to connect to, insisting

that you at least create some before getting to the main interface. A few

popular defaults are offered to start with, but digging deeper allows you to

get access to almost 30 different services used by people all over the world.

Account management in Telepathy is handled with the core

services in mind, but will also check the local network

Add-on supportUnfortunately, there’s not a huge amount of third-party plug-in support for

Telepathy – in fact it doesn’t really support anything more than enabling

fi rst-party service plug-ins. As some features don’t work on every desktop,

such as notifi cations, pop-ups, etc, it’s a bit of a shame that there’s no add-

on community behind Telepathy to get these features working.

InterfaceLike a lot of KDE applications, Telepathy has a great, user-friendly

interface that fi ts into the KDE design aesthetic. The main contacts

window is incredibly simple, showing the minimal features you need to just

chat to people – same with the chat windows themselves. The Settings

menu on the other hand is much more elaborate, although offers few

functions compared to the other clients.

Account managementThe account settings in Telepathy are a bit inconsistent – in some ways it’s

very easy to create and edit your various accounts. In other ways, it doesn’t

always offer the full range of features for the individual services, or smart

prompts for any extra information you might need for something like two-

step verifi cation from Google services.

Pidgin is highly confi gurable depending on your work fl ow

or how much screen real estate you have to work with

CompatibilityWith a great selection of chat services to start with, Pidgin can connect to

about 20 different services, and anything else that supports XMPP. Some

profi le options are also accessible for the more major proprietary services,

although fi le transfers are not always compatible. In this case, Pidgin uses

its own service, which can be a little slow.

Add-on supportDue to Pidgin’s popularity, there are plenty of plug-ins and add-ons for a

whole manner of different functions, either to add extra services, send

SMS messages or create toast pop-ups for new chat interactions. Plug-

ins are written in C, and the Pidgin Wiki has plenty of information on how to

create your own should you want to.

InterfacePidgin is simply laid out, with the contacts list making up the majority

of the main window, and plenty of options accessible without digging

through lots of different menus. Major parts of the overall aesthetic

are also editable, such as the way contacts are listed and system or

account-wide fonts and profi le settings.

Account managementAdvanced account creation allows for the potential to set up different

services through proxys or specifi c servers, with context-sensitive

menus for each. You can then easily disable or remove any accounts,

or just edit them if any future changes require extra information in

order for the service to work properly.

REVIEW

OverallPidgin is a very solid all-round client, although some of

its design elements have been with it for years. A newer

version with updated visuals could make it the best

again, but for now it’s still good. It remains one of the

best instant messaging clients available. 9Overall

KDE Telepathy is a nice, simple IM client – however, it may

be just a little too simple. Not supporting notifi cations

on non-KDE based desktops limits its usage on anything

GTK-based, especially if you like to be able to fully

customise your account details. 7

Page 74: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk74

PidginWe came into this test expecting to find that

Telepathy or Empathy had far outpaced Pidgin,

as there hadn’t been any major developments

on it for the last few years. Pidgin, while still

excellent, seemed a little dated visually, and

various minor issues weren’t getting fixed or

seen to. We were surprised to find that it was

still basically the best IM client around.

Empathy and the like have made waves in

catching up though – more services have been

added, accounts have better customisation

options and there’s just generally a lot more

you can do to make your chatting experience

quicker and easier. These features take the

best of the changing way we use the web,

and how our desktops can interact with that,

although it wasn’t enough to overlook the

missing features from Pidgin.

AND THE WINNER IS…

In brief: Compare and contrast our verdicts

With a huge variety of features, supported accounts and a rich plug-in

selection, Pidgin can do whatever you want

Emesene on the other hand was a bit

dead on arrival. Without any development

on it, its very basic design and usage limits

the way you keep in touch with people and

work colleagues. Even when this was being

supported, all the other clients were still far

better for Linux users that required access to

multiple types of accounts.

In the future, we’d like to see Pidgin maybe

use some of the features that Empathy has.

Connecting to social networks using their own

sign-in, being able to check tweets or messages,

and making the experience better by not having

to look up guides on why the latest change to

Facebook privacy has broken user accounts.

Rob Zwetsloot

www.linuxuser.co.uk

GROUP TEST

WINNER

Instant messaging clients group testReview

Empathy emesene KDE Telepathy Pidgin

Compatibility

Although it offers only a few services, it has better connectivity to various social networking options

8While it offers access to the three popular accounts, that’s nowhere near enough for Linux users

3Telepathy can connect you to the most amount of services by default, including the most important ones

9Pidgin can access all major and most minor services through its own defaults or additional plug-ins

10

Add-on

support

It has the full Pidgin plug-in support, but there are problems with them not always working properly

8There are some decent add-ons available for the interface, but nothing to increase service selection

5Telepathy has no plug-in support whatsoever, stopping it from connecting to any more services than it offers

0Extremely well fleshed out with a huge community backing some excellent add-ons

9

Interface

Fairly simple, maximising the area for chat, and keeping settings hidden neatly away until needed

7Quite well laid out, although the chat being attached to the contacts window defeats the point

7A very simple, KDE-esque interface that fits in well with that desktop, but loses some functionality

7Aesthetically it could use some updated visuals, but it’s kept fairly simple and laid out logically

8

Account

management

Handled by GNOME account management, this can be used to handle your system-wide settings

8Accounts are remembered, but unfortunately you can only connect to one of them at a time

3Accounts are laid out nicely, with the basic functions available and the more advanced ones buried away

8Accounts can be accessed through quick menus or a dedicated manager for changes or disabling

9

Overall

A solid chat client that, for the most part, integrates relatively well with a variety of distros and desktops

8There’s a lot of useful features missing in emesene that should have been in before support stopped

5Telepathy doesn’t integrate well with all desktops, but is a decent chat client otherwise

7Still the best IM client around due to an overwhelming feature set and great community support

9

Page 75: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

EXPERT REVIEWS

DOWNLOAD THE FREE APP NOW

WHEREVER YOU ARENOW

DIGITAL100%

BEST FREE APPSAPP GROUP TESTSiOS & ANDROID OVER 300 REVIEWS TIPS & TRICKS

Page 76: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

GertDuinoReview

The stand-out feature of the Raspberry Pi that lifts it

above rival devices like the APC Rock and standard PCs is

its general-purpose input-output (GPIO) header. Designed

to interface with add-on boards and home-brew electronics

projects, it offers a wealth of potential - but could be improved.

The Gertboard, made by engineer Gert van Loo, was one

of the fi rst attempts to achieve that ‘better’ by protecting

the GPIO header against shorts, providing additional

capabilities and even promising Arduino compatibility.

Unfortunately, a high price, fi ddly assembly process and

inadequate documentation let the device down.

Now, van Loo is back with a second crack of the whip:

the GertDuino. Based around the microcontroller portion of

Designed to bring Arduino compatibility to the Raspberry Pi, has the GertDuino benefited from its predecessors’ critical reception?

the original Gertboard, the GertDuino is simpler, cheaper and

quite signifi cantly smaller than its predecessor.

The board itself is cleverly designed to give the Raspberry

Pi full support for the many add-on ‘Shield’ boards designed

for the Arduino microcontroller project. As a result, the top

is dominated by two rows of female headers in the Arduino’s

peculiar offset pitch for immediate plug-and-play compatibility.

Well, not quite ‘immediate’. Like the Gertboard before it,

the GertDuino requires some confi guration before you can

use it with a Pi. The documentation, a 30-odd page PDF, is

ostensibly provided to walk newcomers through the process

– but does so by sending them on a chase through various

subsections. Eventually, users are shown how to alter the

ProsMore powerful than an Arduino, no need to sacrifi ce a USB port, includes real-time clock with battery backup

ConsRequires risers to use serial-based Shields, ill-suited to beginners, doesn’t play well with overclocked CPUs

GertDuinoPERIPHERAL

£22.20

An IRDA port, connected

to the ATmega48, is a

welcome bonus to the

GertDuino’s feature set

www.linuxuser.co.uk76

Adding a button-

cell battery, not

supplied, allows the

GertDuino to act as

the Pi’s missing

real-time clock

A header section

requires the installation

of jumpers to confi gure

the GertDuino for its

various modes

An ATmega328

microprocessor

provides Arduino

Uno compatiblity

Page 77: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

The powerful followup to the original Gertboard

GertDuino

REVIEW

confi guration of the Pi to support the GertDuino then set

the fuses on the supplied ATmega328 microcontroller –

something done at the factory on a genuine Arduino board –

before hand-compiling and uploading an example program.

Reading further into the manual, it’s possible to confi gure

the Arduino IDE software to work with the GertDuino

directly – a much more attractive proposition. A script is

provided, which automates most, but not all, of the process

of installing customised software packages and modifi ed

board defi nition fi les. There, the manual abandons the user

and leaves it up to them to fi nd out through experimentation

that uploading only works when the Arduino IDE is confi gured

to use the Raspberry Pi as an in-system programmer (ISP)

rather than directly as with a true Arduino.

These hassles – combined with a sensitive serial

implementation which doesn’t take kindly to timing changes

brought about by overclocking the Pi’s processor through

the Turbo Mode menu – really detract from the experience.

Painful too, is the process of shifting jumpers, supplied with

the board, to communicate with the GertDuino’s various

subsections, while the use of any Arduino Shield that relies on

serial communications requires the use of jumper straps (not

included), which then get in the way of the Shield’s mounting.

It’s a shame that more effort hasn’t been put into the

documentation of the GertDuino, because – jumper

positioning aside – its technical design is impressive. As cpc.farnell.com

More information

well as the ATmega328 microcontroller, which gives the

GertDuino full compatibility with anything designed for the

common Arduino Uno. The board includes an ATmega48 that

provides the Pi with a real-time clock, interrupt-based sleep,

infra-red communication capabilities and additional IO –

although some features require the installation of a button-

cell battery, again not included with the board. The top of

the board also includes some built-in inputs and outputs,

offering a pair of buttons and six LEDs to get users started.

For those willing to program the GertDuino’s

microcontrollers directly, there’s a lot of power in the board; for

beginners unwilling to spend some considerable time fi ghting

the documentation, however, it offers little above a cheaper

Arduino Leonardo or Uno beyond saving a USB port on the Pi.

Gareth Halfacree

SummaryThe GertDuino is certainly more compact than its predecessor,

the Gertboard, but a reduction in size has sacrifi ced many

features. Poor documentation is the GertDuino’s real killer,

although if you can fi ght through the initial learning curve

you’re left with an extremely powerful add-on for the Pi.

Compatibility All Raspberry Pi models

Processors Atmel ATmega328, ATmega 48

Dimensions 85mm x 57mm x 26mm (excluding Raspberry Pi)

Weight 34g (excluding Raspberry Pi)

Connectivity 15 Digital IO pins (6 PWM), 6 analogue input pins, IrDA, 2 push buttons, 6 buffered LEDs

Extras Real-time clock, battery backup (ATmega 48 only), RS232 Level Converter

Technical specs

www.linuxuser.co.uk77

An oversized rubber

foot sits the GertDuino

at an unfortunate

angle on Raspberry Pi

Model B units

The Gertduino

includes headers

fully compatible

with the standard,

and unique,

Arduino pin layout

Six LEDs offer far

more on-board display

capability than found on

a stock Arduino model

Two user-addressable

buttons are included to

get users started with

simple projects

Arduino Leonardo£19The latest ATmega-based Arduino, the Leonardo is low-cost and very beginner-friendly. Although it lacks certain features of the GertDuino, it offers a quicker set up and can be wired to the GPIO header through a logic level shifter so as to leave the Pi’s USB ports free.oomlout.co.uk

Gertboard£31.20The GertDuino’s predecessor, the Gertboard is signifi cantly larger and more expensive but includes many features – including digital-to-analogue conversion and motor control – missing from its diminutive sibling. The Gertboard is distinctly unfriendly to those just starting out in electronics, however, with confusing ‘strapping’ required to confi gure it for every use.cpc.farnell.co.uk

Also consider

Page 78: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

CentOS 6.5

www.linuxuser.co.uk78

Review

Red Hat is a very big name in the open source community.

Not only is it one of the most well-known companies that

profit from open source, but they’re also responsible

for Fedora, one of the most popular home distros. Their

dedication to open source and free software is admirable,

and because of this, most of the packages that make up Red

Hat Enterprise Linux are readily available. This is how CentOS

is made: by taking these files and using them to create a

distro that is near identical to RHEL.

CentOS firmly sits in the stable category of Linux releases

– packages are rarely the very latest versions, the kernel

used is much older and it even still has GNOME 2 as its

desktop environment. While it is stable and running on older

Red Hat Enterprise Linux for the masses, the Community Enterprise Operating System has been upgraded with new features from RHEL

tech, it isn’t nearly as resource friendly as distros specifically

geared towards being lightweight. This is especially true if

you pick up the full DVD image of the distro, clocking in at

nearly 2 GB, which carries multiple desktop environments

and a lot of default apps.

Setting upThe live environment for CentOS runs well, using the

GNOME desktop environment and including a majority, if

not all of, the default applications it installs. The installer

itself is still the older style Red Hat-based affair, as the

current Anaconda installer used in Fedora has yet to

be implemented yet. It’s fairly quick, although you don’t

ProsSuper stable, and a subscription-free way to use a distro almost identical to RHEL. Low system requirements as well

ConsNo Red Hat support, not fully compatible with all Red Hat technologies and the packages are not all up-to-date

New features:Precision Time Protocol support • Kernel 2.6.32-431 • upgraded OpenSSL • updated Hyper-V and VMware drivers

CentOS 6.5DISTRO

Minimum Specs: CPU 2.4 GHz RAM 512MB STORAGE 2GB

Best for: Office

CentOS, like Red Hat Enterprise

Linux, uses GNOME 2, and is one of

the few remaining distros that does

The available software is all truly

free, however that may be a little

limiting to some people

The networking is excellent thanks

to its RHEL roots, and it’s been

improved further in this release

Page 79: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

An upgrade that offers users real stability

CentOS 6.5

REVIEW

www.linuxuser.co.uk79

It is an almost identical version of Red Hat

www.centos.org

Download now

up-to-date software. This can be partially rectified with the

use of something like RPM Fusion. However, if you truly want

to be on the cutting edge with some software while keeping

the core stability, you’ll have to start compiling a lot of your

packages from source – fine for some people, but not the

way everyone wants to use Linux.

CompatibilityWhile it is very stable, and it is an almost identical version of

Red Hat, there are the odd, very minor bugs. These mostly

occur in a situation where you’re using both RHEL and CentOS

on the same network trying to share resources – pattern

matches for non-RHEL systems can cause issues. Red Hat

won’t help with support in these cases, however in such

cases it’s usually better to have a homogenous ecosystem,

or just to remove the offending matching altogether.

CentOS is still a fantastic Linux distro, and one of the best

for doing some serious work. While some may not be too keen

on its approach to pure free software and the use of older Red

Hat packages, it allows for a very secure and stable experience

with proven and familiar technology. For Fedora users, it’s a

good first step into a more Red Hat-like experience – in fact

some people use it to help get their RHCE certification. It may

not be the best for your home office though.

Rob Zwetsloot

have much more control over what’s installed other than

some advanced drive partitioning – no package groups or

desktops can be selected or deselected.

User creation is handled post-install, which has its

advantages, especially for OEM uses. Some options also

require users to perform an extra reboot before finally getting

to the desktop, however it’s short and generally improves the

experience and stability of the distro.

Straight to desktopWhile CentOS is perfectly usable via a CLI, it installs with

both GNOME 2 and KDE 4/Plasma with the DVD version.

These are the only two available desktops in the CentOS

repos, so you’ll have to compile other desktops yourself

if you want to make it a little more lightweight. For some

older systems though, the GNOME 2 implementation is

light enough not to cause too many issues, and the kernel is

smaller than some of the newer versions.

For the enterprise situations it’s marketed towards,

CentOS is well prepared. With the focus on stability, all the

available and default applications are fairly solid, and the

networking and security is top notch. One of the major new

features added to this version of COS was the Precision Time

Protocol, allowing for much greater accuracy in syncing

clocks over a network. For very time-sensitive operations

this is essential, and a great addition that expands its uses.

In terms of using it at home though, some people may be

a little frustrated by the limitations for media, and lack of

Screenshot Gallery

bit.ly/COS65LUD

CentOS has a great selection of free apps in the

repository, but is lacking in some areas

CentOS uses a newer version of KDE than

GNOME, and both have the full DVD version

There are no options for installing

specific desktops or package types

CentOS is a great

distro for anything

that requires safety

and stability, and a

good move for those

that like Fedora at

home. There are

a few minor bugs

here and there

when trying to use

specific Red Hat

technology, but

nothing that can’t

be worked around.

Summary

Page 80: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

HARDWARE REVIEWS ANDROID HACKING HELP & ADVICE APP REVIEWS

UNLOCK THE POWER OF ANDROID

ON SALE NOW> Expert tablet tips > Future of Android > Android Awards > Galaxy NX review

w w w . l i t t l e g r e e n r o b o t . c o . u k

TIPS & TRICKS

BUY YOUR ISSUE TODAYPrint edition available at www.imagineshop.co.uk

Digital edition available at www.greatdigitalmags.com

facebook.com/littlegreenrobot twitter.com/lgrobot

Available on the following platforms

Available from all good

newsagents and supermarkets

Page 81: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

User-friendly distro for all experience levels

Mageia 4 Beta 2

REVIEW

The fourth Mageia plans to make the distro even easier to use for both newcomers and veteran users alike

ProsInformative welcome screen is a great new addition, especially along with the rest of the already-present features

ConsStill some work to be done on some of the newer features, and the draklive installer could also use an overhaul

Although not expected until February, the next edition of

Mageia is under development. The last version of the distro

was pretty much the pinnacle of what the team set out to

do – fixing all the major bugs to make it a great distro. This

means that the next version of Mageia has room to grow, in

adding new features or just generally improving the quality.

One of the features that desperately needs an update is

the draklive installer – a very basic-looking install wizard,

it has the benefit of offering good partitioning tools and

the ability to customise the boot menu. The latter is rare

among Linux installers, however most of the bigger distros

also have a much better-looking interface for the installer.

As Mageia is going for a user-friendly route, some of the

options could be portrayed a little better for newer users.

A major new feature added to Mageia in the beta is a

new welcome screen, providing a lot of information and

the ability to perform system set ups. The Mageia Control

Center is explained thoroughly, and the first system update

can be performed using a button directly on it. Afterwards

you can even install software from some recommended

entries such as VLC, Flash player and media codecs. Each

package is labelled as free, tainted or non-free so that open-

source advocates can know exactly what they’re installing. www.mageia.org/en

More information

For now, everything else important has received

standard package updates and bug fixes. Cinnamon and

MATE have been added to the repos, making it yet another

distro with access to the two. The Mageia Control Center

hasn’t been touched, which is fine as it’s already a pretty

fantastic graphical tool for system management.

However, there are still a few things to come in time for

the final release. The welcome screen still needs a little

work, and the updated artwork has yet to be added to the

distro. As it is though, it looks as though Mageia 4 should

be another great release for users of all experience levels.

Rob Zwetsloot

SummaryMageia 4 is off to a good start, with some great new features

for users of all levels to take advantage of – so the distro is on

the right track even after being integrated back into Mandriva.

Hopefully this innovation will continue over the rest of the

development cycle for 4, and well into 5.

Mageia 4 Beta 2 Installation is good, but could

use a visual overhaul

www.linuxuser.co.uk81

DISTRO The Mageia welcome does more than normal welcome pages

The old favourite Control Center is still

here, and still very good

Page 82: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Subscribe today & start savingSubscribe

• Subscribe today and pay just $130

for 13 issues*

• Pay as little as $10 an issue –

usually $16.99 in stores

For more information and to order visitwww.imaginesubs.co.uk/ludOr call +44 (0) 1795 418661

Exclusive subscriber benefits

*Terms and conditions: This is a US subscription offer, please don’t forget to quote USA when ordering. You will actually be charged £80 sterling for an annual subscription. This is equivalent

to $130 at the time of writing, although the exchange rate may vary. Five free issues refers to the newsstand price of $16.99 for 13 issues being $220.87, compared with $130 for a subscription.

Your subscription will start from the next available issue. This offer expires 30 June 2014.

Imagine Publishing publishes more than 20 monthly magazines, some of which have been running for over 10 years, reaching over 4 million readers every year

Non-USA readers see page 34

5 free issues*today and get

Subscribe

USA special offer

82 www.linuxuser.co.uk

Your exclusive

offer code:USA

Page 83: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk83

Latest Linux books revealed

Book Reviews

REVIEWS

A web application development framework

that is Pythonic to the core, Django’s design is

guided by the 19-line Zen of Python, and its own

reinterpretation of the MVC idea - controllers

within what Django calls View; data presentation

is delegated to Templates.

From how Python builds classes and the

internals of Model classes, through URLs and

views and declarative syntax for forms, to Django’s

custom language Templates, Pro Django is

structured to give you a real understanding of how

Django works. Further chapters on how Django

handles HTTP, and the various protocols and tools

that can be used to build your app, and co-ordinate

with other apps are also offered.

Not for the Django beginner, Alchin’s book shows

the reader throughout not just how and why Django

does something, but the same for Python itself

because, as the authors say: ‘Anything that can

be done in Python can be done in Django, which

makes the possibilities nearly limitless’.

Zero to Maker: Learn (Just Enough) to Make (Just About) Anything

Lang’s ‘Zero to Maker’ column set out his mission to learn ‘just

enough to be dangerous’. The story told here is of the writer’s

progress to Maker mastery, and the reader gets some level of

insight into all the skills worth investigating along the way.

Lang is concerned with the ‘Maker Mentality’ and in particular

how it can be acquired. Practical advice, such as where to obtain

tools, is usually to just look to the community and your local

hackerspace or Maker Space. There are many examples here to

back up the idea that good things happen when you get involved

with your local community of Makers.

From traditional crafts to CAD, CNC and 3D printing, Lang

offers a map of the Maker Landscape, which shows pitfalls to

avoid, and touches on scores of interesting people and projects.

This is an encouraging call to action for the beginner Maker, but

also an interesting and thoughtful tour of the growing Maker

world for those who are already involved.

Pro Django: The Expert’s Voice in Web Development –2nd EditionCoding for creative,

artistic people - and the rest of us

Delve into the Pythonic web app development framework

Diverting guide to discovering your inner Maker

Processing, used widely to teach ‘software

literacy, particularly within the visual arts, and

visual literacy within technology’, runs on the

JVM. It’s a great language to get creative people

involved with and excited about coding.

The opening part of the book gets the

learner involved in doing, while still expressly

introducing algorithms and concepts of

computational thinking. Next comes conditional

logic, then Processing’s random function. With

variable scope, more conditionals, loops and

functions, the authors build to creating across

time, with programmatic animation.

Interactive curves with more maths,

combining geometry and art, then big data, keep

the reader going as OOP introduced during a

discussion on organising chaos of ideas – and a

word cloud shows drawing with recursion. After

a fi nal look at expressive art works, the authors

round off with where to go next: 3D, Android –

and even Java. This is real artistic fun.

Author David Lang

Publisher Maker Media

ISBN 978-1449356439

Price £15.50

Score

Author Ilan Goldstein

Publisher Addison Wesley

ISBN 978-0321822369

Price £22.99

Score

Editor Hassan A Karimi

Publisher CRC Press

ISBN 978-1466518186

Price £82.00

Score

Authors Ira Greenberg, Dianna Xu & Deepak Kumar

Publisher Friends of Ed

ISBN 978-1430244646

Price £35.49

Score

Author Richard Bejtlich

Publisher No Starch

ISBN 978-1593275099

Price £34.49

Score

Agile, particularly with

its fun rugby-inspired

incarnation as Scrum,

promotes a way of managing projects that

is relatively simple in conception, but often

fails in implementation for a variety of

reasons. A framework, not a one-size-fi ts-

all approach, and Goldstein is full of insight

and practical advice.

Scrum Shortcuts without Cutting Corners: Agile Tactics, Tools & Tips

Advanced Location-Based Technologies and Services

Processing: Creative Coding and Generative Art in Processing 2 - 2nd Edition

A diverse collection

of thoughtful and

academic essays that

relate to different aspects of location-

based technologies, from multi-modal

route plans to geo-crowdsourcing and from

using GPS traces to generate pedestrian

paths to philosophical questions of

how location-based services affect our

understanding of the environment.

Authors Ian Robinson, Jim Webber & Emil Eifrem

Publisher O’Reilly

ISBN 978-1449356262

Price £22.99

Score

Graph Databases

It’s not just about

discrete data items, but the connections

between them. From PageRank to social

networks, relational databases won’t cut it

for relationships. In Graph Databases, the

authors show exactly how to model your

data and build a graph database app for

many real-world problems.

Page 84: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Classifi ed Advertising

Explore the world of LAIKA + RASPBERRY PI

BUY THE LAIKA RANGE FROM: www.kitronik.co.uk/laika

FOR TUTORIALS, EXAMPLES & SUPPORT SEE: www.project-laika.com

EXPLORER BOARD£34.99

Explore the world of LAIKA + RASPBERRY PI

BUY THE LAIKA RANGE FROM: www.kitronik.co.uk/laika

FOR TUTORIALS, EXAMPLES & SUPPORT SEE: www.project-laika.com

FEATURES:

Start exploring the world of physical devices with your Raspberry Pi.

+ = ROBOTICS

and more

AVAILABLESOON

AVAILABLENOW!

Page 85: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

01202 586421

MAGAZINES BOOKS DVDS DOWNLOADS GIFTS

Follow@imagineshopuk

on Twitter for exclusive

discountcodes

Read anything good lately?

Shop for quality magazines, books and DVDs from

Imagine Publishing

[email protected]

To Advertise In

Contact Rhian on 01202 586421

Page 86: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Questions & answers

www.linuxuser.co.uk86

Give a dog a boneI’m running on a BeagleBone Black, using their

provided distribution, 3.8.13, with the CircuitCo

3.5-inch TFT LCD display. My intentions were

to autostart a GUI application at power on, not

presently caring whether or not it’s under the

root user.

I’ve managed to get the X server running with no

display manager. I have a UI-based application

which runs fi ne, full-screen and all. The X server

also will start automatically at boot.

What I’m having diffi culty doing is getting the

app to automatically run just after the X server

is running. So far I’ve installed xf86-video-fbdev

to get the X server so that it would allow me to

rotate the screen and removed the gdm scripts

to stop GNOME in /etc/rc#.d. I’ve also edited

xorg.conf to this:

Section "Device" Identifier "Frame Buffer" Driver "fbdev" Option "Rotate" "CCW"EndSection

In order to run the X server after boot, I added this

script to /etc/init.d:

#!/bin/sh

/usr/bin/setterm -blank 0/usr/bin/setterm -powersave off/usr/bin/startx -- -nocursor

And run that from levels 2345, after any other

scripts were run.

Contact us...Email: [email protected]: www.linuxuser.co.uk

Facebook:Linux User & Developer

Twitter:@linuxusermag

Send us your questions and we’ll do our best to answer them! answered

Your questions

FAQ:Get moreout of FedoraQ: How can I install non-free software

in Fedora?

A: RPM Fusion is a popular optional Fedora

repository that allows you to install a load

of software that Fedora doesn’t initially

carry. To install it, you can either go to the

RPM Fusion website (rpmfusion.org) and go

through the automated process, or open a

terminal and use:

$ su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'

Q: Is there a more stable Fedora?

A: Fedora is the upstream version of Red Hat

Enterprise Linux, which could be considered

the stable version of Fedora. You require a

subscription for that, though, so for most

people the best alternative is CentOS – read

our review of the latest version, starting on

page 78.

Q: Do I have to use GNOME?

A: Most defi nitely not – aside from there

being a number of different versions

of Fedora, each with various desktop

environments, you can also install all major

DE alternatives from the native software

repositories, including Cinnamon and MATE.

X can be a little confusing,

whatever platform you use it on

Page 87: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

All your technical problems solved

Questions & answers

www.linuxuser.co.uk87

Q/A

LibreOffice is fairly easy to customise this way

Wine cellarI recently lost all the contents of my

hard drive when it decided to fi nally die.

Luckily I made sure to get backups of the

one Windows program that I run in Wine

that I need, but not it’s installer, so I just

reconstructed the entry in Program Files.

The result is that I can run the program from

a terminal emulator with the command:

$ wine "c:\Program Files\QemuLator\QemuLator2.4.exe"

…but using the same command from the

menu or a keyboard shortcut doesn’t work. I

tried using:

$ gnome-terminal -e wine "c:\Program Files\QemuLator\QemuLator.exe"

The terminal just starts and stops again.

Running that command from another

terminal doesn’t leave an error message.

Do you guys have any ideas? Is it because

the program hasn’t been installed in the

normal way? If so, can Wine be made aware of

it somehow?

Miles Peterson

Well, fi rst of all, the fact you can get it

running via the Wine command means

that the program is working just fi ne: you

wouldn’t even get that far if there were any

problems with the actual program itself. It’s

more likely a problem with Wine.

Here’s where you’re going wrong, though

– you’re using the Windows-style address

rather than the absolute path from the

distro’s perspective. Give

it a go with something like

this instead, for shortcuts

and such:

$ wine "/linux/path/QemuLator.exe"

…Of course, switching

out ‘linux/path’ for

the actual path of the

.exe fi le. That should fi x

your problems.

Thus far this gets my display manager run and

gets me to a prompt. Interestingly, if I don’t auto-

run the X server, and run the startx command from

the command prompt, the path available at the

prompt once in the server matches root’s home

directory and all of root’s environment are there.

Auto-running the X server, the directory is ‘/’,

and root’s environment information is not there;

however, the user is root.

Therefore, trying to create a .xinitrc in root’s

home does not appear to work. I’ve placed an

echo line to place info into a fi le to see if the script

gets run and the UI happened to fail for some

reason. It seems pretty clear that the .xinitrc

script is not being run. So I looked into playing

with the default xinitrc – no dice there; it ran the

script but did not load the server. I’m not sure if

that’s all backwards either: for instance, if the

xinitrc runs before the server or any window

manager runs. But I’m not running any window

manager, just the server.

The reason I need the server is that Qt was

near impossible to build for this, and FLTK worked

extremely well. However, FLTK does not yet work

directly out of the frame buffer, hence it requires

the X server.

Any suggestions on this? Should I try to fi gure

a way to auto-login as root and from within there

have a script which runs startx and then next get

my UI running?

Arthur

X is tricky to get your head around, but it seems

like you’re very nearly there.

What you need to do is edit the xinitrc fi le.

Normally you’d need to put it at the end of

the fi le; however, you will have a few xterms

sessions running, even if you’re not using them,

so the best way is to change the way xinitrc

works. Change the entire script to:

#!/bin/shexec /home/root/[UI]

This should load your custom UI automatically

at boot.

Auto slideshowI’ve been looking up some automation tasks for

Linux – I regularly have to give presentations,

and was wondering if there was a way I could get

a LibreOffi ce Impress or PowerPoint fi le to open

automatically. I found out about the command-

line uses of LibreOffi ce, so I’ve managed to get it

to boot and turn on.

At this point I still have to load my .ppt fi le and

then press F5 to begin my slideshow. Can this be

done automatically at startup as well? It would

really help me out if it could.

Luke Davis

This is perfectly possible actually, and really only

works in LibreOffice. You’ll need to change the

command you created to make the office suite

start. The command we’ll use will be able to launch

a specific presentation in Impress at startup is:

libreoffice --impress [pathtofile.ppt]

That’s the fi rst step, although it will only launch

fi les that you specify. So if you want to switch it

for a new presentation, you either need to give it

the same name or change the command.

It’s really not

an emulator

Page 88: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Questions & answers

www.linuxuser.co.uk88

Bitcoins. I know there’s the SETI application,

but is there any way to help with anything a bit

more pressing, like cancer research?

Gaz Williams

Well, SETI, while perhaps not quite the service

you want to donate resources to, is actually a

good starting-off point. It uses a service called

the Berkeley Open Infrastructure for Network

Computing, or BOINC, which while initially

developed for SETI@home, is now used in a

variety of projects. By downloading the software

and creating an account, you can search the

available groups and what they do, including

maths-based causes, protein folding, gene

linkage and more.

Anyone else also looking for a way to

donate idle cycles should also check

it out, and maybe help to solve some

important problems.

On the PulseI’m using a beta of Debian Wheezy amd64 that

uses PulseAudio instead of ALSA by default. My

headset works perfectly with all programs except

for Skype, which I unfortunately need to use.

Regardless of how I adjust my sound

settings, Skype always plays through my

laptop speakers at a very quiet volume, and

I don’t have an inbuilt mic even for that. I’ve

seen people with this similar problem fi x this by

going under the ‘Applications’ tab and setting

Skype’s sound levels there. I, however, can’t

To get it to play automatically, you’ll need

to install the extension ImpressRunner. Once

installed, go to File> Properties>User Properties

menu and place in one of the four fi rst fi elds a

text fi eld containing a value named autostart.

This should mean that when you start your

system, the presentation runs after the desktop

loads in. You’ll still need to manually advance it,

though, unless you’ve set up auto timing for it.

Split imageHi there, I’m wondering if there’s a way to

recombine a DVD image on Linux? It’s a disc of

digitally converted home videos, and a friend

of mine split it up so he could send it to me via

email. Unfortunately, he’s not around to tell me

how to put it back together again, and I haven’t

been able to fi nd any software in my repos that

could help me out.

If it helps, I know he split it up on Windows,

but I’m not sure if the software he uses exists

for Linux. Any solutions would be greatly

appreciated, as I want to give it as a gift ASAP.

Paul

There are a number of methods you could use to

get this done, but fi rst make sure the names of

the fi les are fairly uniform; eg fi le.iso.1, fi le.iso.2

etc. You can use the concatenate tool in Linux to

try and put the fi le together with a command like:

$ cat file.iso.i >> file.iso

That should join all the parts together into one

ISO. If it doesn’t like that so much, which it

sometimes doesn’t depending on the software

used to split it up, you can also try using lxsplit.

This tool can split and merge fi les and ISOs; to

merge fi les back together, you can use:

$ lxsplit -j file.iso.1

And it will fi nd the rest of the parts to join back

together. Finally, if you’re still having problems,

then there is a graphical tool called HJSplit. It

will guide you through the process of putting

them together again.

Charitable actionI have a powerful system. I’m talking serious

power: I managed to pick up a server board, so I

have a couple of processors running in parallel.

It’s pretty glorious. However, I very rarely make

the most out of it when I’m on Linux. I know

there are some projects that let you donate

cycles for charity to help them process and

such, and I’d much rather do that than mine for

Facebook:Linux User & Developer

Twitter:@linuxusermag

HJSplit is a popular and cross-platform file splitter

Folding@Home is a good example of sharing

computing power to help cure Alzheimer’s

Anyone looking for a way to donate idle cycles should check out BOINC

Page 89: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

All your technical problems solved

Questions & answers

Q/A

get Skype to show up in this tab. Is there a

place where default sound settings for specific

applications are saved? If a file like this exists,

that may solve the problem.

Any help is appreciated. Thanks in advance.

Charlie

Unfortunately if you’re having this amount

of trouble with PulseAudio, it sounds like

you’d very likely need to switch to using ALSA

unless you want to try completely purging both

PulseAudio and Skype and trying again. This

offers no guarantee of success, though, so you

might as well try it with ALSA first, which is very

simple to add. First of all, remove PulseAudio:

$ sudo apt-get remove pulseaudio

And then install ALSA:

$ sudo apt-get install libasound2 alsa-utils alsa-oss

You’ll have to tweak your settings again, but at

least Skype should now work.

Sharing is caringI’m having a weird issue with Samba 3.6.6 on

both Debian 7 and Ubuntu 12.10 while using

‘security=share’ (security=user works okay, but I’d

like users to not be prompted for a login/password).

Here’s the issue: I can create/copy files and

directories from Windows (7 and XP), I can

modify the content of a file, but Samba won’t

let me rename/delete files and directories.

This is puzzling, since the owner and access

rights look fine:

# ll /usr/share/samba/shared-dirdrwxr-xr-x 2 nobody nogroup 4096 Nov 30 12:24 dummydir/-rwxr--r-- 1 nobody nogroup 4 Nov 30 12:24 test.txt*

Unless otherwise set, Samba uses user

‘nobody’ when using ‘guest=ok’, so I guess the

issue isn’t related to UNIX file access rights.

www.linuxuser.co.uk89

Here’s the minimal smb.conf:

[global]workgroup = WORKGROUPnetbios name = LINUX

;Important: Otherwise, doesn't switch to Unix "nobody" -> Err 5 Access deniedsecurity = share

[shared-dir]path = /usr/share/samba/shared-dircomment = No need for Unix/Samba passwordsreadonly = nopublic = yesguest ok = yes

Any idea what it could be?

Josh Scarlet

You’re on the right track here, and in fact you

almost fixed the problem yourself when you

mentioned how security=user works fine. You

can make it so it doesn’t ask for a password by

changing smb.conf to this:

security = user;forces user to "nobody"map to guest = Bad User

This should connect without asking for a

password, and do it the way you want.

ALSA sometimes works better than using PulseAudio

Samba is great for sharing over a home network, once you get it working

Page 90: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Whether you’re a hosting firm or

a happy customer who wants a

favourite provider listed, drop us

a line with the details!

Got a deal you think we should list?

[email protected]

www.linuxuser.co.uk90

HA

RD

WA

RE

RA

ID

PR

IVA

TE

SU

BN

ET

24

/7 P

HO

NE

SU

PP

OR

T

UP

TIM

E G

UA

RA

NT

EE

CP

U C

OR

ES

/

SP

EE

D

DIS

K S

PA

CE

RE

MO

TE

PO

WE

R R

EB

OO

T

NE

TW

OR

K B

AC

KU

P

ST

OR

AG

E

PE

RM

AN

EN

T K

VM

MIN

IMU

M

CO

NT

RA

CT

TE

RM

CO

ST

PE

R

MO

NT

H

PH

ON

E

NU

MB

ER

1G

BP

S I

NT

ER

NE

T

CO

NN

EC

TIO

N

PA

CK

AG

E

NAME AND URL

Dedicated server listings

O = Option

PoundHostwww.poundhost.com

FlexServer2 01628 777730 From £2912

months

Dual/Quad

Core

160GB

to 2TB10Mbps 99.90% 10 GB

BudgetBox III 01628 777730 £36 1 month Intel Xeon 3065 1 x 250GB100

Mbps99.90% 10 GB

SSD 4 01628 777730 £60 1 monthQuad Core Intel

Xeon X3430

120GB Intel

520 SSD

100

Mbps99.90% 10 GB

Merlin 01628 777730 £199 1 month2 x Intel Xeon

Quad Core

2 x 500GB

SATA II

100

Mbps99.90% 10 GB

DS6.5 01628 777730 £295 1 month2 x Intel Xeon

Hex Core

4 x 1TB

SATA III

100

Mbps99.90% 10 GB

Cloud Server 01628 777730 £52 1 month 2 vCPU (4GB) 40GB

Gbit

shared /

node

n/a 99.90% O

Cloud Server 01628 777730 £98 1 month 4 vCPU (8GB) 40GB

Gbit

shared /

node

n/a 99.90% O

Bravo14 (http://bravo14.co.uk) Starter Linux N/A £20 N/A N/A 2,000MB N/A

Bravo14 (http://bravo14.co.uk) Starter Windows N/A £20 N/A N/A 2,000MB N/A

Bravo14 (http://bravo14.co.uk) Business Linux N/A £45 N/A N/A 4,000MB N/A

Bravo14 (http://bravo14.co.uk) Business Windows N/A £45 N/A N/A 4,000MB N/A

Bravo14 (http://bravo14.co.uk) Ultimate Linux N/A £60 N/A N/A Unlimited N/A

Bravo14 (http://bravo14.co.uk) Ultimate Windows N/A £60 N/A N/A Unlimited N/A

Heart Internet (www.heartinternet.

co.uk/dedicated-servers)Linux Dual Core 0845 644 7750 £79.99 12 months

Dual Core Xeon

2.33GHz160GB

99.99%

24/7 Ticket

support

Heart Internet (www.heartinternet.

co.uk/dedicated-servers)Windows Dual Core 0845 644 7750 £89.99 12 months

Dual Core Xeon

2.33GHz160GB

99.99%

24/7 Ticket

support

Heart Internet (www.heartinternet.

co.uk/dedicated-servers)Linux Quad Core 0845 644 7750 £129.99 12 months

Quad Core Xeon

2.5GHz250GB

99.99%

24/7 Ticket

support

Netcetera www.netcetera.co.uk/linux

2200DC 0800 8085450 £50 1 monthDual Core

2.2GHz160GB N/A Raid 1

3000DC 0800 8085450 £80 1 monthDual Core

3GHz 2 x 250GB N/A Raid 1

2660QC 0800 8085450 £130 1 monthIntel Quad Core

2.66GHz2 x 500GB N/A Raid 1

Developer 0800 8085450 £32.89 1 month N/A 1GB N/A

One 0800 8085450 £109.99 1 month N/A 5GB N/A

Reseller 0800 8085450 £274.89 1 month N/A Unlimited N/A

Sponsorship opportunityBring attention to your brand by sponsoring this section. Contact Rhian Carter on +44(0)1202586421Hosting listings

Webfusion (www.webfusion.co.uk) Dell PowerEdge R210 0845 130 1602 £79.99 12 months 2x 3.06GHz 250GBUp to

100Mbit99.99% Free O

Webfusion (www.webfusion.co.uk) Dell PowerEdge R210 0845 130 1602 £119.99 12 months 4x 2.66GHz 2x 250GBUp to

100Mbit99.99% Free O

Webfusion (www.webfusion.co.uk) Dell PowerEdge R210 0845 130 1602 £149.99 12 months 4x 2.66GHz 2x 500GBUp to

100Mbit99.99% Free O

Page 91: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk91

SH

OP

PIN

G C

AR

T

NAME AND URL

PA

CK

AG

E

DA

TA

BA

SE

SU

PP

OR

T

PH

ON

E

NU

MB

ER

CO

ST

WE

B S

PA

CE

MO

NT

HLY

BA

ND

WID

TH

PO

P3

AC

CO

UN

TS

VIR

US

FIL

TE

R

FIR

EW

AL

L

PH

ON

E S

UP

PO

RT

EM

AIL

SU

PP

OR

T

WE

B C

ON

TR

OL

PA

NE

L

SE

RV

ICE

LE

VE

L

AG

RE

EM

EN

T

eHosting (www.ehosting.com) Starter 0844 999 4100 £23.88 1GB 25GB 10

eHosting (www.ehosting.com) Personal 0844 999 4100 £59.88 2.5GB Unlimited 50

eHosting (www.ehosting.com) Expert 0844 999 4100 £95.88 5GB Unlimited 250

eHosting (www.ehosting.com) Virtual 0844 999 4100 £227.88 50GB Unlimited Unlimited

Equiphase (www.equiphase.net) Bronze 0121 314 4865 £30 200MB 2GB 10

Equiphase (www.equiphase.net) Silver 0121 314 4865 £42 400MB 5GB 20

Equiphase (www.equiphase.net) Gold 0121 314 4865 £72 800MB 10GB 100

Equiphase (www.equiphase.net) Platinum 0121 314 4865 £114 1,200MB 40GB 200

Eurofasthost.com (www.eurofasthost.com) Email Only 02380 249 823 £40 1GB 2GB 10

Eurofasthost.com (www.eurofasthost.com) Essential 02380 249 823 £75 2GB 5GB 10

Eurofasthost.com (www.eurofasthost.com) Superior 02380 249 823 £140 5GB 10GB 25

Eurofasthost.com (www.eurofasthost.com) Premium 02380 249 823 £250 10GB 25GB 100

Evohosting (www.evohosting.co.uk) Starter N/A £29.99 500MB 1GB 3

Evohosting (www.evohosting.co.uk) Home N/A £54.99 2.5GB 30GB 50

Evohosting (www.evohosting.co.uk) Business N/A £79.99 6.5GB Unlimited Unlimited

Evohosting (www.evohosting.co.uk) eCommerce N/A £159.99 30GB Unlimited Unlimited

Giacom (www.giacom.com) Business Pro 0800 542 7500 £199 100MB 2GB 100

Heart Internet (www.heartinternet.co.uk) Starter Professional 0845 644 7750 £29.80 2.5GB 10GB 1,000

Heart Internet (www.heartinternet.co.uk) Home Professional 0845 644 7750 £89.99 10GB 50GB 10,000

Heart Internet (www.heartinternet.co.uk) Business Professional 0845 644 7750 £129.99 Unlimited Unlimited Unlimited

Heart Internet (www.heartinternet.co.uk) Reseller Professional 0845 644 7750 £299.99 Unlimited Unlimited Unlimited

Hostway (www.hostway.co.uk) Silver 0808 180 1880 £79.50 150MB 3GB 5 O

O = Option

Dedicated and Shared server listings

LISTINGS

NameHog (www.namehog.net) Email Only 0845 612 0330 £11.75 25MB 1GB 5

NameHog (www.namehog.net) Standard Package 0845 612 0330 £35.25 100MB 4.5GB 10

NameHog (www.namehog.net) Professional Package 0845 612 0330 £58.75 250MB 8GB 25

NameHog (www.namehog.net) Expert Package 0845 612 0330 £105.75 500MB 15GB 75

Skymarket (www.skymarket.co.uk) Standard 1 0800 321 7788 £49 10MB 2GB 1

Skymarket (www.skymarket.co.uk) Standard 2 0800 321 7788 £69 20MB 2GB 1

Skymarket (www.skymarket.co.uk) Premium 1 0800 321 7788 £99 25MB 2GB 1

Hosting [email protected]+44(0)1202586421

GET YOUR LISTING HIGHLIGHTED! CONTACT RHIAN

1&1 Internet Ltd www.1and1.co.uk

1&1 Starter (Linux) 0844 335 1211 £29.88 5GB Unlimited 1,000

1&1 Standard (Linux) 0844 335 1211 £59.88 50GB Unlimited 3,000

1&1 Standard (Win.) 0844 335 1211 £59.88 50GB Unlimited 3,000

1&1 Unlimited (Linux) 0844 335 1211 £83.88 Unlimited Unlimited 5,000

1&1 Unlimited (Win.) 0844 335 1211 £83.88 Unlimited Unlimited 5,000

1&1 Business (Linux) 0844 335 1211 £119.88 Unlimited Unlimited Unlimited

1&1 Business (Win.) 0844 335 1211 £119.88 Unlimited Unlimited Unlimited

WebFusion (www.webfusion.co.uk) Fusion Professional 0845 130 1602 £107.40 5GB 50GB 1,000

WebFusion (www.webfusion.co.uk) Fusion Business 0845 130 1602 £179.40 10GB 150GB 1,500

WebFusion (www.webfusion.co.uk) Fusion Developer 0845 130 1602 £227.40 20GB 300GB 5,000

WebFusion (www.webfusion.co.uk) Fusion Reseller 0845 130 1602 £329.99 Unlimited Unlimited Unlimited

Blacknight (www.blacknight.com)Minimus

Linux / Windows+44 (0)845 5280242 €49.95 10GB 150GB 1,500

Blacknight (www.blacknight.com)Medius

Linux / Windows+44 (0)845 5280242 €89.95 20GB 300GB 5,000

Blacknight (www.blacknight.com)Maximus

Linux / Windows+44 (0)845 5280242 €149.95 30GB 600GB Unlimited

Page 92: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.linuxuser.co.uk92

Your source of Linux news and viewsYour viewContact us…Register and post your comments…www.linuxuser.co.uk/forum/

Email us directly…[email protected]

Linux User Letters

A Red Hat update brings an updated CentOS, the Community

Enterprise OS. The release of 6.5 was met with great excitement

from the rest of the community – especially when our story

about its release hit Reddit.

Join in with r/linux here: bit.ly/LUDCOs65

csmuk said:Have upgraded my laptop and DigitalOcean droplet already. As

usual, was a totally fl awless upgrade:

# yum updateWait a couple of minutes. Reboot. Done.

e40 said:The long life of CentOS/RHEL, for me, is the killer feature. Also, it’s way

more stable than Fedora, which I ran on my main box at home for

years. Living on the bleeding edge was just not fun, though. Too many things

broke over the years, and some stuff was really hard to diagnose.

dragonEyedrops said:These versions have been there since 6.0 (and only patched where

necessary), so you can update your system without having to fear

about breaking anything. Same versions and compatibility for a long time

(RHEL 6 support will be until 2020 or something like this) -> stability.

Bigger changes only happen with major version numbers.

Normalized said:As a scientist I legally have to use Scientifi c Linux (not really), another

RHEL recompile project – but good on the CentOS dudes for being so

quick ... SL[Fermi] will probably take about 30-45 days, which is fi ne with me.

Springdale is also nice.

karkov said:Is it just me or does the oldness of a packages make it diffi cult to have

more advantages than disadvantages?

I mean: such an old kernel (2.6.32) does not have all the Hyper-V, NFS,

Samba, ext3, etc, goodness of new kernels. Or am I missing something here?

Even Apache is 2.2 instead of 2.4. For server purposes it has PHP 5.3 instead

5.5, Samba 3.6 instead 4.1 and so on. How can this be an advantage?

For example, I depend on NFS shares. With such an old version I’ll

probably run into troubles…

Your opinions about the magazine, Linux and open source

Content ValveI would love to see Netfl ix and Hulu on a Linux

PC via SteamOS, however it will never happen.

Actually Netfl ix and Hulu have both already

developed and released clients for embedded

(ie locked-down) Linux platforms. They won’t

ever release it for Linux PC though because

they are under the thumb of Hollywood,

who is paranoid about Linux because they

can’t control them like they can with Microsoft

and Apple. They are also scared because Linux

is a powerful and highly fl exible OS, so

already incorporates much that would make

it trivial to circumvent Hollywood’s dumb DRM

strategies. For them the extra 0.2 per cent

market share just isn’t worth the risk.

Justin

It will be interesting to see – Valve claim

that SteamOS will be open, however as the

Steam client itself isn’t open, there may be

certain parts of it that are still closed off

to developers. This might include the video

apps. There are some workarounds to get

both working on Linux right now anyway,

however they wouldn’t particularly apply to a

SteamOS. Hopefully at the very least it will be

easy to dual boot, so you can consume your

media via XBMC.

We still don’t quite know exactly what

Steam will do for video content

Centre of attention

YOUR VIEW

THREAD BARE

Page 93: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

SteamOS video, CentOS, Mageia, Ubuntu Touch

Your view

Facebook:Linux User & Developer

Twitter:@linuxusermag

LETTERS

Linux for meI’m glad you’ve started to give a use for Linux

distros you now review – I sometimes fi nd it

diffi cult to fi gure out what newer distros I could

be using for specifi c tasks. While I’m happy

to use a more established name for certain

things, if there’s a newer distro that offers

something a bit different for the same type of

function, I do like to check it out. If I hadn’t done

this, I would never have discovered Magiea, one

of my new favourite home desktop distros.

Dan Harrison

Well technically, all Linux distros can be

used for any task, but having these distros

pre-confi gured for a certain use in mind

does make it easier and quicker to get down

to work – especially when they’re based

on an already popular distro in the fi rst

place. We’d also suggest having a look at

DistroWatch.com’s advanced search feature

– it includes a fi lter for distribution category

that might help you drill down a bit more into

specialist distros.

RaspberryfreedomWhen I read about the whole

Wolfram and Mathematica

thing on Raspberry Pi, I

was a bit worried. I wish

they’d stick with free

software, because it’s free

software that lets you ‘hack’ around. That

doesn’t mean you shouldn’t be able to use non-

free software, you need it for the Pi to even boot

up, but I’d still like for them to stick with free

software for the core project.

Jason Bean

The Raspberry Pi Foundation is in a bit of a

tough situation with this one – in this case

the non-free software is a lot better than the

free software for their purpose of teaching. To

them, the Raspberry Pi isn’t about being open

source, but about teaching a new generation

of kids how to code. Last issue we talked to

Eben Upton about it, who mentioned that

they do have a big open-source focus at least,

spending a lot of money on various open-

source projects every month. So while not all

the software is free, they do lean towards free

software more often than not.

Somethingto TouchWell done Mark in getting actual hardware

sorted for Ubuntu Touch. I cant wait for the

phone next year. Now I think someone needs to

make an all-in-one docking station specifi cally

for the device that makes it even easier to use

as a PC. When this happens, Ubuntu will make

Mageia was an overnight success

a very large dent in the mainstream desktop,

laptop, tablet and phone market. Microsoft are

only just starting to think in that direction, and

Apple are lagging behind.

Harold Alderman

We’ll believe it when we see it – Canonical

and Mark Shuttleworth have been cagey

since the OS’s unveiling about hardware

and carrier partners, although this is the

fi rst time he’s specifi cally talked about

having actual hardware coming up. It will be

interesting to see who exactly will be making

the Ubuntu Phone, and exactly what the

fi nal product will be.

Web DesignerDevelopment for

the web is a huge

part of modern

computing, with the

majority of services

available online

and in the cloud.

While we pride

ourselves on having

some fantastic open-source web design

tutorials, our sister magazine Web

Designer is dedicated to bringing you

many more of these features at the same

level of quality. Regularly covering the

newest technologies such as HTML5,

CSS3, jQuery, WordPress, and mobile

apps, Web Designer is the best choice

for hobbyists and professionals that

want a more dedicated web development

magazine. You can fi nd out more at

www.webdesignermag.co.uk.

Will the Ubuntu

Phone look like the

Edge concept?

www.linuxuser.co.uk93

Page 94: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

Practical inspiration for the 3D/CG community.

TAKE THE £1 JANUARY CHALLENGEChoose a trial subscription to any one of our inspiring and informative magazines and you are guaranteed to learn something new with every issue.

Whether you are interested in science, history, photography or technology, you can get 3 trial issues of any magazine for only £1*.

The magazine for Adobe® Photoshop® professionals.

Making history entertaining for the whole family.

Discover the wonders of the solar system and beyond.

How to shoot, edit and share better photos.

The leading magazine for Adobe Photoshop® inspiration.

The number one independent PlayStation magazine.

Packed with all the monsters kids aged 6-14 love most!.

ORDER NOW

www.imaginesubs.co.uk/challenge

or call 0844 856 0644

Please quote offer code

JAN141

1

32

£1for 3

issues*

START

www.imaginesubs.co.uk/challenge

*This offer entitles new UK direct debit subscribers to receive their fi rst 3 issues for £1. After these issues standard subscription pricing will apply. Subscribers can cancel this subscription at any time. New subscriptions will start from the next available issue. Offer code JAN141 must be quoted to receive this special subscription price. Details of the Direct Debit guarantee are available on request. This offer expires 01/03/2014. Imagine Publishing reserves the right to limit this type of offer to one per household.

Page 95: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

www.imaginesubs.co.uk/challenge

Knowledge / Science / Technology / Design / Videogames

Join the revolution with the world’s most exciting technology.

The photography magazine for enthusiasts and professionals.

The magazine for people who can’t live without games.

The science and technology magazine that feeds minds.

If Apple made a magazine it would be iCreate.

The essential magazine for the GNU generation.

The number one magazine for classic gaming.

Number one for sci-fi , fantasy and horror.

The only Porsche magazine dedicated to the 911.

The premier magazine for digital online creatives.

The new, action-packed animal wildlife magazine.

The ultimate XONEmagazine for the true fan.

£1for 3 issues*

£1 for 3 issues*

Page 96: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

iPad iPhone Android phone Android tablet Apple Mac Windows PC

Page 97: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

To get the most out of your digital editions, be sure to enjoy all of our fantastic features, including:

Many of the fi les you’re looking for can be found on the magazine’s website

Page 98: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

98

What’s coming up…Next issue Look out for issue 136

on sale 13 FebWant it sooner?

Subscribe today!

www.linuxuser.co.uk

Imagine Publishing LtdRichmond House, 33 Richmond HillBournemouth, Dorset, BH2 6EZ

+44 (0) 1202 586200Web: www.imagine-publishing.co.uk www.linuxuser.co.uk www.greatdigitalmags.com

Magazine team Editor Russell [email protected]

01202 586272

Designer Sam Ribbits Staff Writer Rob ZwetslootPhotographer James SheppardSenior Art Editor Will ShumEditor in Chief Nick JonesHead of Publishing Aaron AsadiHead of Design Ross Andrews

ContributorsJon Masters, Phil King, Richard Smedley, Richard Hillesley, Michael Reed,

Gareth Halfacree, Simon Brew, Tam Hanna, Liam Fraser, Shaun Butler,

Mihalis Tsoukalos, Joey Bernard, David Crookes & Nitish Tawari

AdvertisingDigital or printed media packs are available on request.

Advertising Director Matthew Balch 01202 586437

[email protected]

Head of Sales Hang Deretz 01202 586442

[email protected]

Account Manager Rhian Carter 01202 586421

[email protected]

Cover discJunior Web Designer Steve [email protected]

InternationalLinux User & Developer is available for licensing. Contact the International department to learn more.

Head of International Licensing Cathy Blackman +44 (0) 1202 586401

[email protected]

SubscriptionsHead of Subscriptions Gill Lambert

For all subscriptions enquiries 0844 249 0282 (UK) +44 (0) 1795 418661 (Overseas)

Email: [email protected] issue subscription (UK) – £25.1513 issue subscription (Europe) – £70 (ROW) - £80

CirculationHead of Circulation Darren Pearce

01202 586200

ProductionProduction Director Jane Hawkins

01202 586200

FoundersGroup Managing Director Damian ButtGroup Finance & Commercial Director Steven BoydGroup Creative Director Mark Kendrick

Printing & DistributionPrinted by William Gibbons, 26 Planetary Road,Willenhall, West Midlands, WV13 3XT

Distributed in the UK & Eire by Seymour Distribution, 2 East Poultry Avenue, London, EC1A 9PT.

0207 429 4000

Distributed in Australia by Gordon & Gotch, Gordon & Gotch Corporate Centre, 26 Rodborough Road, Frenchs Forest, NSW 2086.

+ 61 2 9972 8800

Distributed in the Rest of the World by Marketforce, Blue Fin Building, 110 Southwark Street, London, SE1 0SU.

0203 148 8105

DisclaimerThe publisher cannot accept responsibility for any unsolicited material lost or damaged in the post. All text and layout is the copyright of Imagine Publishing Ltd. Nothing in this magazine may be reproduced in whole or part without the written permission of the publisher. All copyrights are recognised and used specifi cally for the purpose of criticism and review. Although the magazine has endeavoured to ensure all information is correct at time of print, prices and availability may change. This magazine is fully independent and not affi liated in any way with the companies mentioned herein.

If you submit material to Imagine Publishing via post, email, social network or any other means, you automatically grant Imagine Publishing an irrevocable, perpetual, royalty-free license to use the images across its entire portfolio, in print, online and digital, and to deliver the images to existing and future clients, including but not limited to international licensees for reproduction in international, licensed editions of Imagine products. Any material you submit is sent at your risk and, although every care is taken, neither Imagine Publishing nor its employees, agents or subcontractors shall be liable for the loss or damage.

THE MAGAZINE FOR THE GNU GENERATION

COMING IN THE NEXT ISSUE

© Imagine Publishing Ltd 2014

ISSN 2041-3270z

Steam OScracked open

All you need to know about the future of gaming

ALSO INSIDE:>> 16+ pages of Raspberry Pi guides>> Build a blog with Django>> Master the Twitter API>> 14+ pages of reviews

Turn documents into PDFsLearn how to make quality PDF documents the open source way

Typesetting with TeXStep-by-step guide to perfecting the art of typesetting with open source tools

Manipulate files with QtLearn how to work with the file system using Qt

Page 99: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer

We have a SERVER to suit your requirements!

Flexibility, performance, power... you want it, we have it!

Our entire range of servers has been designed with you in mind; to provide the hosting power you need as your business grows.

WHATEVER YOUR BUSINESS NEEDS

Prices and features correct as of November 2013. Prices shown are ex VAT (charged at 20%).

Find your perfect server NOW!Visit www.123-reg.co.uk/servers

and the perfect introduction to the

The performance of a dedicated

server for a fraction of the cost,

the obvious step-up from a VPS.

When your business grows and

you need more power, get your

own dedicated hardware server.

FLEXIBILITY PERFORMANCE POWER

From just

£9.99 per month

From just

£59.00 per month

From just

£109.00 per month

Page 100: Practical Raspberry Pi.Build a remote-controlled car The ultimate in 3D image capture? Make a streaming music player Set up and use an accelerometer.Issue 135 of Linux User & Developer