DOKK Library

Linux Voice [Issue 31]

Authors Linux Voice

License CC-BY-SA-3.0

Plaintext
         PROUDLY INDEPENDENT SINCE 2013
                                                                                    Banish Twitter!
                                                                                      Build your own
                                                                                      social network
                                                                                       to share daily
October 2016                                                   www.linuxvoice.com        blatherings
 Why you need to try…
                                                        BOINC: HELP
                                                       SCIENTISTS DO
                                                      SCIENCE BETTER
                                                            P72


   The best performance
   The newest technologies
   The most passionate community


 GAMES EMULATION

RetroPie
 Enjoy the glory days of
 gaming all over again –
 on a humble Raspberry Pi


 FRUGALWARE

Hardware
 Put old hardware to
 good use with Linux
 and Free Software                                                FOSSPICKS –
                                                                 THE BEST FREE
                                                                 SOFTWARE FOR
                                                                   LINUX P64
                                                                                     BURSTING
                                                                                     WITH AWESOME
 SOLR Build a searchable archives of your chaotic PDFs
 PHOTOGRAPHY Advanced tricks for image processing                                    TUTORIALS!
 VERACRYPT Keep your top-secret cat videos safe from The Man


 MARTIN WIMPRESS                                 GAMES DEVELOPMENT
                                                                                          O c tob e r 2016 £5.9 9 Pr inte d in the UK




 MR MATE                                         LUMO
 Why we have this                                Take an exclusive look
 man’s family to thank                           inside the creation of a
 for Ubuntu Mate                                 minor masterpiece



STELLARIUM › AFTERSHOT › OPENVR & MORE!
The only Linux magazine available
   as DRM-free PDFs and ePub




shop.linuxvoice.com
                                                                                                  ISSUE 31 WELCOME



FREE SOFTWARE AHEAD
The October issue                                                                        What’s hot in LV#031
                                                                                                  ANDREW GREGORY
                                                                                                  I’m pretty sure that computer
                                                                                                  games reached their peak on the
                                                                                                  SNES. I’m going to give up on
                                                                                                  new games and take Mike’s
                                                                                                  advice on retro gaming with the
                                                                                                  Raspberry Pi and RetroPie.
                                            BEN EVERARD                                           p22
                                             Long-term Linux user and
                                             best-selling author Ben is                           GRAHAM MORRISON
                                             usually found knee-deep in                           I’ve never liked Facebook, but I do
                                             either Python code or a                              want to keep in touch with
                                             tangle of wires.                                     people. I’ve decided to run my
                                                                                                  own social network, so I’ve been




T
                                                                                                  reading Mayank’s group test to
        his month I’ve been thinking a lot about what makes a                                     find the right platform.
        distribution great, as I’ve taken a close up look at Fedora for                           p56
        the cover feature and interviewed Ubuntu Mate’s Martin
Wimpress. I’d love to say that I’ve come up with some deep insight                                MIKE SAUNDERS
that we can use to make all distributions perfect, but I haven’t. There                           Networks have always been a bit
are lots of trade-offs to make…                                                                   of a mystery to me. Usually
   Some distros do a great job of packaging lots of latest upstream                               everything just works, but when it
software. Others do a great job of curating software so only the best                             doesn’t, I’m stuck. Valentine’s
in class in each area is available. Some are constantly changing,                                 Core Tech this month has helped
while others guarantee a stable base for a long period of time.                                   me understand what’s going on.
                                                                                                  p94
Rather than try to work out what is objectively the best distro, you
should think about what’s important to you so you can find a distro
that shares your values.


Ben Everard
Editor, Linux Voice

                                            Linux Voice is different.
  THE LINUX VOICE TEAM
                                            Linux Voice is special.                        SUBSCRIBE
  Editor Ben Everard
  ben@linuxvoice.com                        Here’s why…                                    ON PAGE 62
  Deputy editor Andrew Gregory
                                             1 At the end of each financial year we’ll
  andrew@linuxvoice.com
                                            give 50% of our profits to a selection of
  Editor in hiding Graham Morrison          organisations that support free
  graham@linuxvoice.com                     software, decided by a vote among our
  Editor at large Mike Saunders             readers (that’s you).
  mike@linuxvoice.com
  Games editor Michel Loubet-Jambert         2 No later than nine months after first

  michel@linuxvoice.com                     publication, we will relicense all of our
  Creative director Stacey Black            content under the Creative Commons
  stacey@linuxvoice.com                     CC-BY-SA licence, so that old content
                                            can still be useful, and can live on even
  Malign puppetmaster Nick Veitch
                                            after the magazine has come off the
  nick@linuxvoice.com
                                            shelves
  Editorial contributors:
  Mark Crutch, Simon Phipps,                 3 We’re a small company, so we don’t
  Les Pounder, Mayank Sharma,               have a board of directors or a bunch of
  Nate Drake, Alexander Tolstoy and         shareholders in the City of London to
  Valentine Sinitsyn                        keep happy. The only people that matter
                                            to us are the readers.



                                                                www.linuxvoice.com                                                      3
     CONTENTS ISSUE 31 OCTOBER 2016




                        Contents
                          Make your computer great again!


    Regulars                                     Cover Feature
News                                      06
Debian and Firefox are now doing more to
protect users’ privacy, Skype is coming back                                                                                                        14
to Linux, and the government of Bulgaria
embraces open source.

Distrohopper                               08
Automotive Grade Linux for your car
and Clear Linux (thanks to Intel) for your
enterprise-grade Linux containers, plus the
latest goings-on in BSD land.

Speak your brains                         10
Suggestions, praise, and a vote of thanks




                                                      FEDORA.NEXT
for Linux Mint from a man after our own
heart who just wants the machine to do as
it’s told.

Subscribe!                           12/62
Never miss another issue of your favourite
magazine in the whole wide world. You’ll
save money compared with buying it in the
                                                Server, cloud or desktop – Fedora can do it all. Discover the cutting-edge
shops too!                                      features that the other distros won’t have until next year.
FOSSPicks                                64
Graham plays a tune on his pipes and the         Interview                                        Feature
Free Software applications follows him into
the shire, where he studies them before
releasing them back into the wild.
                                                                                      40                                                            22
Linux Inside                             98
The cheekily named Robonaut R2: proficient
in zero forms of communication, but quite
handy to have around on board the ISS.




                                                Martin Wimpress                                  RetroPie
        SUBSCRIBE                               The man behind Ubuntu Mate on being an           Easy-peasy retro games emulation for your Raspberry Pi,
        ON PAGE 62                              unpaid family tech support person.               wrapped in a single distro install. Let’s play!


                                                 FAQ                                   Group Test
                                                OSVR                             38   Social Networks                  56
                                                The mad rush for a virtual reality    Build your own network for work,
                                                standard has many contenders –        school, or just to keep idiots out
                                                could Open Source win here?           of your life.

                                                                                                         SECRETS OF PiTVi
                                                                                                         TURN TO PAGE 26
4                                                                 www.linuxvoice.com
                                                                                         ISSUE 31 OCTOBER 2016 CONTENTS


 Feature                                                                                                          Tutorials


                                                                                                      28


                                                                                                                 Boinc                                     72
                                                                                                                 Contribute a few spare CPU cycles to help
                                                                                                                 scientists solve climate change, synthesize
                                                                                                                 proteins and more.




Diary of a developer                                                                                             Veracrypt
                                                                                                                 Protect files, folders and partitions with
                                                                                                                                                            74

Inside the creation of this isometric puzzle fest.                                                               serious encryption. Keep your cat videos
                                                                                                                 secret, keep them safe…

 Reviews                                                                                                         Raspberry Pi                            78
                                                                                                                 Take your first steps into physical
                                                                                                                 computing with a Raspberry Pi, a couple of

AfterShot Pro                                                                                         48         LEDs and a smattering of Python.

Take photographs,                                                                                                Photography                               82
then make your images                                                                                            Processing and editing tricks to improve
better than you could                                                                                            your holiday snaps and fix those grainy old
have imagined with this                                                                                          photos scanned from old film.
feature-packed RAW
image editor.                                                                                                     Coding


LibreOffice 5.2                            43                 Stellarium                                    50
Yet again, the flagship office suite gains                    Look outside: if it’s daytime, or cloudy, or you
more features and more polish, this time                      live in a built-up area, you uprobably can’t see
with a focus on collaboration.                                the stars. That’s why Stellarium is here!



                                                                                                                 Solr                                      86
                                                                                                                 Build a search index for your PDF archive.
                                                                                                                 Perfect for magazine back issues!




Gaming on Linux                                   46   Books                                             48
Go back to the future with the 8-bit charm of          Once the forests have gone, we’ll need clever people      Packaging                                 90
Undertale plus a refreshed version of an all-time      to repair the broken environment. So read more –          Understand the magic that goes into
classic: Day of The Tentacle.                          expand your mind while you still can!                     packaging an app with Flatpak.



                                                                 www.linuxvoice.com                                                                         5
     NEWS ANALYSIS




NEWSANALYSIS
The Linux Voice view on what’s going on in the world of Free Software.
Opinion


Public software
Developers don’t need to mess about with legal stuff – we can do that for you.

                          Simon Phipps             founders has led to a serious conflict that        there’s also the Software Freedom
                          is ex-president of the   can have an unfair outcome based on who            Conservancy, which provides a broader
                          Open Source Initiative
                                                   accidentally ended up as the holder of the         range of services, and now hosts a number
                          and a board member
                          of the Open Rights       assets. If that asset holder is the employer       of important projects. Both have a US focus,
                          Group and of Open        of one of the participants, things can get         as well as being very much in demand.
                          Source for America.      even more ugly.                                       That’s why it seems a good idea to start
                                                                                                      an umbrella entity for Europe. We chose to
                                                   Don’t go it alone…                                 start it in the UK where the Community
                                                   It’s a natural instinct for makers to try to fix   Interest Company legal structure seemed
                                                   their own problems directly, so it’s not           perfect for open source projects. Thus



B
        ack in the January issue, I talked         surprising to find so many developers              Public Software CIC was created!
        about thse proliferation of                expecting the next step for their collection of       “Public Software” refers to software that
        Foundations for open source                co-developers is to start a non-profit             members of the general public can use
projects. All the most important freedoms          association of some sort – a “foundation”          without restriction, improve as they wish and
– to use the software for any purpose, study       – to host their project. But experience            share with anyone. By using the name
and improve it and share with anyone – are         shows that making a new legal entity is            “Public Software” we are alluding to the
secured by using an OSI-approved licence.          often as poor a solution to the problem as         name of the key free software and open
But open source projects that develop              remaining unincorporated. Running a                source licence, the GNU General Public
beyond the first commits do end up needing         not-for-profit entity takes time, experience       Licence (GPL) — a copyright licence for the
a set of capabilities, including:                  and administrative attention. Moreover, once       benefit of the general public. Public Software
  An “Asset Lock”, guaranteeing that               the activity scales, all of those are needed in    CIC exists to promote software freedom
  community assets can only be used in             amounts that distract from development.            delivered under any copyright licences, both
  ways the community approves (including               For some projects, that’s a price worth        approved by the Open Source Initiative as
  domain names, trademarks and                     paying. The Document Foundation was                conforming to the Open Source Definition
  copyrights).                                     created in just such circumstances, based          and recognised by the Free Software
  A “bank”, handling donations, paying staff       on the expectation that many people would          Foundation as “free software licences”.
  and fulfilling tax-reporting obligations.        be willing to share the funding and running            Public software means more than just
  An impartiality guarantor, anchoring the         of a large, independent legal entity. But not      the essential of an acceptable copyright
  representation of its community and              every project is like that, least of all on day    licence. Our projects also allow participation
  ensuring decisions are made in the way           one. For most projects, the best choice is to      by anyone and reserve project governance
  that the community wants independently           move into the shelter of an “umbrella”             to those actually participating. We are
  of any one participant.                          Foundation, until the project grows to the         convinced that code and community
  An infrastructure provider, hosting code,        point that an independent entity is feasible.      created together in public are the best recipe
  mailing lists, forums and bug trackers and           In the USA, there are a few of these           for software freedom. We expect some
  also hosting events.                             “umbrella” entities that provide shelter for       projects to move on to their own CIC or
Without a seperate legal entity to look after      assets and governance. Software in the             charity once they are established, but hope
these things, there are plenty of examples of      Public Interest was set up many years ago          many will stay to form a critical mass of
projects where a disagreement between the          to host the Debian project’s assets, and           shared resources for the benefit of all.
                                                                                                         It’s early days for Public Software CIC but
    It’s natural for makers to try to fix their own                                                   projects are already exploring membership. I
                                                                                                      hope this will become a force for good
    problems, so it’s not surprising so many                                                          through software freedom in the UK and
                                                                                                      Europe. You’ll find us at
    developers… start a non-profit association                                                        https://PublicSoftware.eu.



6                                                              www.linuxvoice.com
                                                                                                        ANALYSIS NEWS



    LibreOffice 5.3 • Skype • Bulgarians • Firefox encryption • Let’s Encrypt •Lumina



CATCHUP                                                         Summarised: the biggest news
                                                                stories from the last month

          Debian sites now                               Linux comes to the                            LibreOffice 5.2 released
   1      available as privacy-                   2      Microsoft Surface 3 tablet             3       Sporting new document
          friendly onion services                         Many of us in the GNU/                        classification features,
Hidden onion services on the                   Linux world aren’t big fans of Microsoft      OOXML signature import and a bunch
Tor anonymity network are often                software (to put it mildly), but some         of user interface improvements,
associated with dodgy shenanigans,             of the company’s hardware isn’t too           LibreOffice 5.2 is a decent upgrade and
but there are legitimate uses for them         shabby. If you’ve picked up or been           keeps moving way ahead of the mostly
as well. Now the Debian GNU/Linux              given a Surface 3 tablet but want             abandoned Apache OpenOffice. See our
distribution has set up many of its            to move away from Windows, you                review on page 49 for the full lowdown
websites as hidden services, so you can        may soon be in luck – Linux kernel            on what’s changed in this version.
access them completely anonymously.            4.8 will add hardware support for
The full list is available at https://onion.   the machine. The biggest change in
debian.org – including news, blogs and         that kernel release is support for the
security updates. Anything that protects       tablet’s touchscreen, arguably the most
our online privacy is welcome.                 important driver.




          Bulgarian government                           Skype for Linux returns –                     Firefox 50 will trust Let’s
   4      goes pro open source                    5      well, sort of                          6      Encrypt by default
           Another win for free software!                  Ever since Microsoft bought                   Let’s Encrypt is awesome:
The government of Bulgaria has                 Skype, questions have been raised             it’s a free SSL/TLS Certificate Authority
enacted its Electronic Governance Act,         about the software’s long term future         (CA) which makes it possible for many
which includes the following clause:           on Linux and other non-Windows                websites to enable HTTPS (secure
“computer programs must meet the               platforms. Indeed, it looked like the         browsing) without having to shell out
criteria for open source software”.            Linux client was dead not so long             lots of money. Until now, Let’s Encrypt
So anything written for use inside             ago. But now it’s back: Microsoft has         has piggybacked on another CA, but
the government must be FOSS and                announced Skype for Linux Alpha, a            wants to ultimately become completely
accessible via a public repository. Not        “not fully functioning Skype client” that’s   independent. When Firefox 50 is
only could this save Bulgaria money            available in Deb and RPM formats.             released in November, it will support
in the long run, but it’s an important         Helpful to Skype users, then, but we          Let’s Encrypt by default – and hopefully
step towards transparency and open             much prefer open and standardised             other browsers will follow suit in time.
standards for the country as well.             communication protocols.                      Your move, Google, Microsoft, Apple…




          Lumina Desktop 1.0                                                                           Mozilla awards $585,000
   7      released                                                                              8      to nine open source
           You could argue that we have                                                                projects
enough desktop environments already,                                                         The Mozilla Open Source Support
but Lumina is worth keeping an eye on                                                        Initiative has channelled funding
nonetheless. It originally came to life in                                                   into various FOSS projects that
PC-BSD, a desktop-oriented flavour of                                                        “meaningfully advance the Mozilla
the FreeBSD operating system. Now it’s                                                       mission”, giving them a development
available on other Unix-like OSes as well,                                                   boost. Some of these are related to
including various Linux distributions,                                                       infrastructure that Mozilla uses; others
and is relatively memory-friendly                                                            are for security software. For the full
when compared to the mighty Gnome                                                            details, see http://tinyurl.com/z6t9rl5
and KDE. For more information and                                                            – you can even put your own Free
screenshots galore, see the website:                                                         Software project forward for a funding
https://lumina-desktop.org.                                                                  request there too.




                                                         www.linuxvoice.com                                                              7
     DISTROHOPPER LINUX DISTROS




DISTROHOPPER
What’s hot and happening in the world of Linux distros (and BSD!).


Clear Linux
Intel’s container-based distro.


I
     ntel has quietly been working away on a
     cloud computing distro for some time
     now with relatively minimal publicity in
one of those rare cases where a big
company develops its own Linux distro and
actually retains the Linux name. The aim of
the project is “not to provide yet another
general-purpose Linux distribution”, but
rather a very fast container-based distro
much like CoreOS, using what it calls “Clear
Containers” while using “the isolation of
virtual machine technology”. The distro does
not ship with a GUI by default, instead
offering separate “bundles” offering a range
of things, among them being a full Xfce           Clear Linux does away with a lot of legacy baggage, which also boosts performance.
desktop, enabling the user to pick and
choose and keeping the distro light.              particularly in the realm of integrated              Installation is not that straightforward and
   Clear Linux is a rolling release and updates   graphics, providing significant performance       is comparable to an Arch install in that
constantly with over 20 builds per week.          boosts over conventional Linux distros.           you’re greeted with a command line and the
Recent updates include performance                Clear Linux’s “bundles” are based upon RPM,       aforementioned bundles must be installed
improvements, Mesa 3D 12.0 and kernel             but use swupd built atop bsdiff and are           to add further functionality. ClearOS is
4.6.4. Being a distro developed by Intel, it      conceptually different to conventional            meant as a showcase to demonstrate just
doesn’t play nice with AMD hardware and           packages. There are a number of images            what Intel’s hardware is capable of under the
doesn’t package Radeon drivers. The flipside      available, including KVM-based images, live       right conditions, though it could be put to
is that it is extremely well optimised,           images and cloud deployment images.               good use in a data centre.




Automotive Grade Linux
Linux under the hood


O
        K, so you might not want to install       approach, in which the vast majority of the
        this on your PC unless it has wheels      system is provided, while the automotive
        and an engine, but Automotive             manufacturer tweaks and adds the rest
Grade Linux (AGL) is a fascinating project        based on the features they want, also adding
supported by the Linux Foundation that            their own branding. Some of the partners          The current release drives the entertainment
aims to power the car of the future and its       include Toyota, Honda, Mazda, Ford and            system; future releases will also drive the car.
entertainment system.                             Nissan, as well as sound system suppliers
  The foundation has clearly recognised the       like Panasonic.                                   lot of sense given how much cars have
potential and widespread use of open                 Version 1.0 was showcased at the               lagged behind, often using slow and clunky
source operating systems and software in          Consumer Electronics Show (CES) in                systems. Although Apple CarPlay and
an era where the days of companies building       January 2016 and made quite a splash, and         Android Auto already exist, AGL has some
their own software from scratch is mostly         the first cars running the distribution should    big advantages in being fully open source
behind us. Instead, AGL takes an 80/20            be hitting the streets by 2018. This makes a      and having so many industry backers.



8                                                             www.linuxvoice.com
                                                                                                  LINUX DISTROS DISTROHOPPER



News from the *BSD camps
What’s going on in the world of FreeBSD, NetBSD and OpenBSD.


I
     n the OpenBSD world, version 5.9 of
     LibertyBSD has been released.
     LibertyBSD aims to remove all non-free
elements from OpenBSD in a “deblobbed”
version of the OS – an approach not often
seen in the BSD realm, which has
traditionally differed from the puritanical
approach of the Free Software Foundation.
The biggest change in version 5.9 is that
support for i386 has been added, where
previously only amd64 was supported, while
other changes include additional
“deblobbing”. On OpenBSD itself, usermount
is being removed, thus removing the ability
for non-root users to mount filesystems,
citing security concerns as a result of a
number of bugs relating to it, which have
been described as “the tip of the iceberg”.
   On the FreeBSD side of things, work is
going on to bring AMD’s newer graphics
binaries to the system and porting amdgpu
from Linux 4.6. This is close to being
completed and when finished will mean that
FreeBSD users will have access to much                   LibertyBSD takes a hard-line approach to non-free binary blobs comparable to that taken by the
newer AMD graphics hardware. Also in                     Free Software Foundation and distros such as gNewSense and Trisquel.
FreeBSD, it is now getting to the point where
replacing OpenSSL with LibreSSL is                       has also entered beta at the time of writing       seen a new release with a number of
becoming a viable option. This would be a                and the final release is expected soon.            changes. These changes include the added
big step for web developers looking to close               NAS4Free, a FreeBSD 10.3-based                   ability to set and change UPS monitoring
security vulnerabilities; however, it is far from        embedded storage distribution which aims           credentials, support for deleting multiple
being standard on a FreeBSD base and                     to provide the famed BSD reliability and           items at once in the snapshots page and
patches are currently required. FreeBSD 11               longevity in lieu of store-bought boxes, has       adding a search function to Diagnostics|Log.


  AtheOS – discontinued and forgotten
  AtheOS is one of those forgotten dead ends that had a relatively
  short shelf life of four years from 1997 to 2001, when it was
  discontinued. It was originally designed to be a clone of AmigaOS
  to provide some continuity given the dire situation Commodore
  was in at the time and also making use of the GPL, releasing the
  system as free software.
      Despite this initial aim, it was soon abandoned in favour of a
  general system that aimed to be largely POSIX compliant, but not
  a Unix clone. One major departure from Unix-like operating
  systems of the time was not using the X Window System, instead
  having its own integrated GUI built from scratch. This meant it
  was more responsive, at the cost of being able to easily port
  readily available applications. Other components, like the kernel,
  filesystem and web browser were also created from scratch.
      Development had become stagnant on the project by 2002
  when the main developer began to dedicate his time to other
  things, and another group of developers decided to create a fork
  of the OS known as Syllable Desktop. Syllable picked where the
  short-lived AtheOS left off, thanks to the GPL-published source,
  and is still in reasonably active development and installable on
  modern hardware, available at http://web.syllable.org.               AtheOS’ ABrowse web browser reminding us what the internet was like in 2000.



                                                                       www.linuxvoice.com                                                                 9
     MAIL YOUR LETTERS




YOUR LETTERS
Got an idea for the magazine? Or a great discovery? Email us: letters@linuxvoice.com


             THANKS!
             I know you don’t make Linux, but I thought this was as         things just work the way I expect them to do. Using Mint
             good a place as any to publicly air my thanks for Linux        feels like the first time I picked up an iPod – nobody needs
             existing, specifically Linux Mint.                             to explain it to you, because you can figure it out for
STAR            I’ve been working with a new-ish laptop that I bought       yourself just by playing with it. That’s truly amazing, and
LETTER       last year. Like most people I didn’t pay too much heed to      the fact that I didn’t have to pay any money for it is the
             the operating system – the term itself was a new one to        icing on the cake.
             me until recently. What prompted me to learn what an           David McKenzie, Sheffield
             operating system is was the number of intrusive
             messages that Microsoft kept sending me about                  Andrew says: Cheers David! Linux is indeed ace,
             upgrading my version of Windows. I’d put some effort into      and we can’t take any credit for it at all. However,
             learning how it worked and I didn’t want to have to put that   we know someone who can take a little bit of credit
             effort in all over again learning a new system.                – Martin Wimpress, who we speak to on page 40. If
                I mentioned this to a friend who suggested I give Linux     you like Linux Mint, you might like Ubuntu Mate. It
             Mint a try. I only ever use the machine for email and using    was born out of a desire to not reinvent the wheel,
             the internet, and he assured me that Linux could do            so to speak, so it sounds like just the sort of thing
             everything that Windows can, so I gave it a go. In contrast    for a chap who has better things to do than re-learn
             to Windows, I haven’t had to learn anything new at all –       where the Start button is.




             AND NOW FOR SOMETHING COMPLETELY DIFFERENT
             I know Python is popular with new users, but I’d really like   really, is why we stick with a more welcoming
             to see some other languages in Linux Voice from time to        language (Python) for the entry-level stuff.
             time. How about explaining the LAMP stack, with MySQL,            I love the idea of a LAMP series of tutorials; we
             PHP, Perl and a bit of Apache configuration, for example? I    have the knowledge, it’s just a matter of puling
             don’t think messing about with LEDs and GPIO pins will         it all together, so watch this space. And in the
             help my career too much…                                       meantime, if it’s PHP you want it would be remiss
             Sean Dwyer, Dublin                                             of us not to direct you to www.hackingwithphp.
                                                                            com, a brilliant series of tutorials written by our
             Andrew says: You can please some of the people                 former comrade Paul Hudson. He’ll take you from
             some of time, but try any more than that and you’re            newb to ninja!
             asking for trouble. We did run a couple of Perl
             tutorials last year, but we ended up getting flak
             from Perl programmers for doing it one way when                PHP is an old language,
             we should have been doing it another way – this,               but it works.



10
                                                                                                              YOUR LETTERS MAIL


SPACE!
The Apollo 11 guidance code is up on GitHub. Well done
NASA for sharing with us; it’s really made me appreciate
how far I have to go to become a decent programmer, and
how much modern languages do for you. Now back to
playing Elite Dangerous…
James Newsome

Ben says: Indeed so. I wonder how much other
cool stuff is out there mouldering away, lost to the
annals or time? Could MI6 let us have the source to
some of James Bond’s toys, or would that be asking
too much?

Thanks, Margaret Hamilton, for your sterling work.



IT’S ONLY WORDS
Cheers for the Calibre tutorial last issue. I’ve been spending
far too much time down the rabbit hole of online news
what with recent events in UK and US politics, so the
ability to filter my own sources has saved me massive
amounts of time and get my life back. I’ve taken back
control, as it were. Here’s hoping the internet will be safe to
go back to when the US election is all over – I like being
able to check up on the world without becoming obsessed
with it.
Michael Dwyer, London

Graham says: Ah, the internet will never be safe. It’s
full of rubbish, which is why we like the power to
filter off the worst of the nonsense and leave only
the best bits, like old Prince bootlegs and NASA
source code (https://github.com/nasa). Thanks for
the feedback!                                                      You decide what’s important, with a Calibre-curated news feed.




                                                                  www.linuxvoice.com                                                11
     SUBSCRIBE




Subscribe
shop.linuxvoice.com

                                                                        Get your regular dose
                                                                        of Linux Voice, the
                                                                        magazine that:
                                                                          Gives 50% of its profits
                                                                        back to Free Software
                                                                          Licenses its content
           SUBSCRIBE TO                                                 CC-BY-SA within 9 months
                                                                          US/Canada subs prices
           TODAY!                                                         1-year print & digital: £95
                                                                          12-month digital only: £38


        Get many pages                                     Access our                                         Save money on
          of tutorials,                                  rapidly growing                                       the shop price
      features, interviews                            back-issues archive                                    and get each issue
          and reviews                                 – all DRM-free and                                        delivered to
          every month                                  ready to download                                         your door

               Payment is in Pounds Sterling. 12-month subscribers will receive 12 issues of Linux Voice a year. 7-month
            subscribers will receive 7 issue of Linux Voice. If you are dissatisfied in any way you can write to us to cancel your
                      subscription at subscriptions@linuxvoice.com and we will refund you for all unmailed issues.

12                                                         www.linuxvoice.com
                                                                       SUBSCRIBE


                                All subscribers get access to every
                                single digital back issue –
                                that’s about 1,000,000 words of
                                tutorials, reviews and free software
                                hackery at your fingertips




Overseas subs prices
12-month print & digital:
Europe: £85
US/Canada: £95
Rest of world: £99                               DIGITAL
                                                 SUBSCRIPTION*
                                                 ONLY
                                                  *
                                                      £38
                                                     WHEREVER IN THE WORLD YOU
                                                   ARE – IT’S DIGITAL, SO THERE ARE
                                                          NO POSTAGE COSTS


                            www.linuxvoice.com                                        13
     FEATURE FEDORA




         FEDORA.NEXT
           Speed freak Ben Everard dives into Fedora to get the
                     very latest in Linux technology.


         F
                edora is a fast-paced Linux distribution that’s   distribution to take advantage of the latest trends in
                constantly pulling all the latest software from   the Linux world. This fell under the moniker Fedora.
                around the Free Software world into a solid       next. Two years and four releases later, we can now
         distribution. The last sentence is as true now as it’s   see just how much effect this change has had. It’s
         been since the Fedora project released Core 1 back       transformed the distro from a great option for the
         in 2003, but this doesn’t mean that Fedora is running    Linux desktop to one that also perfect for cutting-
         the same as it always has. In 2014, the project          edge server deployments. Join us as we delve deep
         started to look at how to best position the              into the heart of Fedora to find out what’s going on.



14                                                    www.linuxvoice.com
                                                                                                               FEDORA FEATURE


FEDORA.PAST AND FEDORA.NEXT
Where we’re coming from and where we’re going

Things change quickly, and if you’re a
Fedora user you typically have to
                                           long time. However, since the early
                                           2010s, there’s been a rapid evolution
                                                                                     FEDORA FOR THE AGES
upgrade your OS every year or end up       in server technology mostly driven by     25 AUGUST 1991                     31 MARCH 2007
on an unsupported version. For most        the desire to serve ever more rich user   Linus announces the Linux          Fedora 7 (Moonshine) released
                                                                                     Kernel on comp.os.linux.           without ‘Core’ in the name.
of its life, this means that Fedora has    experiences to ever more people on
been more suited to desktop use than       internet-connected devices. This push     15 SEPTEMBER 1993                  8 NOVEMBER 2007
server. The standard Linux server          has led to new databases, web servers     First version of Debian (0.01      Fedora 8 (Werewolf) is the first
                                                                                     pre-alpha) released.               Linux distro to include
stack – LAMP – was already mature          and even paradigms of controlling                                            PulseAudio.
by the time the first release of Fedora    access to an operating system kernel      12 NOVEMBER 1994
came out, while the Linux desktop          (containers and lightweight VMs).         Red Hat version 1 (Mother’s        13 MAY 2008
                                                                                     Day) released.                     Fedora 9 (Sulphur) brings KDE
environments are still rapidly evolving,   With these new technologies coming                                           4 to users.
so it’s only on the desktop that getting   along – and evolving rapidly – the        12 JULY 1998
the latest software (and putting up          stable server Linux distros such        KDE version 1 released.            25 NOVEMBER 2008
                                                                                                                        Fedora 10 (Cambridge) brings
with the issues of a                                  as RHEL and CentOS             MARCH 1999                         support for the ext4 filesystem
changing distro) actually                                 struggled to keep up       Gnome version 1 released.          and LXDE desktop.
gains you features.                                          with the expectations
                                                                                     2002                               9 JUNE 2009
For users wanting a                                            of modern system      Fedora Linux starts as a           Fedora 11 (Leonidas) includes
more stable                   If you’re a Fedora                administrators.      volunteer project to package       experimental support for the
                                                                                     extra software for Red Hat.        advanced BTRFS filesystem.
environment, the              user you typically                   The Fedora.next
base of the distro,                                             project, launched
once it’s matured
                              have to upgrade                   in 2014, aims to
                                                                                     6 MAY 2002
                                                                                     First version of RHEL (2.1)
                                                                                                                        17 NOVEMBER 2009
                                                                                                                        Fedora 12 (Constantine)
in the crucible of            your operating                    enable Fedora to     released.                          comes with a preview of
                                                                                                                        Gnome Shell.
Fedora, goes on to            system every year                move into this new    31ST MARCH 2003
form the core of                                             technological space     last version of Red Hat Linux      25TH MAY 2010
Red Hat Enterprise                                        while still catering to    released (version 9 aka shrike).   Fedora 13 (Goddard) has a
                                                                                                                        new Internet install option
Linux (RHEL) and                                      desktop users. The most        5 NOVEMBER 2003
CentOS. These                              obvious outcome of Fedora.next is         First release of Fedora Core       2ND NOVEMBER 2010
distributions take the heart of Fedora     that there are now three different        (version 1 aka Yarrow).            Fedora 14 (Laughlin) is
                                                                                                                        released concurrently on
and build it into a release that changes versions of Fedora: Desktop, Server         18 MAY 2004                        Amazon’s EC2
far more slowly.                           and Cloud. Each of these is tuned to      Fedora Core 2 (Tettnang)
   This split between rapidly moving       the needs of different users in the       introduced SELinux.                24 MAY 2011
                                                                                                                        Fedora 15 (Lovelock) includes
desktop distributions and slower           modern technological landscape. We’ll     20 OCTOBER 2004                    the new Gnome 3 desktop.
moving server distributions served         look at these over the next few pages     First Ubuntu release (4.10 aka
the Fedora community well for a            to see how they fit together.             Warty Warthog).                    8 NOVEMBER 2011
                                                                                                                        Fedora 16 (Verne) boots using
                                                                                     8 NOVEMBER 2004                    Grub 2.
                                                                                     Fedora Core 3 (Heidelburg)
                                                                                     First release to come with         29 MAY 2012
                                                                                     Firefox and switches from Lilo     Fedora 17 (Beefy Miracle)
                                                                                     to Grub bootloader.                introduces /run/media.

                                                                                     13 JUNE 2005                       15 JANUARY 2013
                                                                                     Fedora Core 4 (Stentz) ships       Fedora 18 (Spherical Cow)
                                                                                     with OpenOffice 2.0 and Xen.       supports Secure Boot, and
                                                                                                                        offers Mate and Cinnamon.
                                                                                     20 MARCH 2006
                                                                                     Fedora Core 5 (Bordeaux)           2 JULY 2013
                                                                                     drops up2date and rhn-applet in    Fedora 19 (Schrödinger’s Cat)
                                                                                     favour of Yum for package          replaces MySQL with MariaDB.
                                                                                     management.
                                                                                                                        17 DECEMBER 2013
                                                                                     24 OCTOBER 2006                    Fedora 20 (Heisenberg) has
                                                                                     Fedora Core 6 (Zod) includes       ARM as a primary architecture.
                                                                                     AIGLX to GL-accelerate the
                                                                                     desktop.                           9 DECEMBER 2014
                                                                                                                        Fedora 21 is the first release
                                                                                     7 DECEMBER 2006                    without a codename
                                                                                     OpenSuse first release (10.2)
                                                                                                                        3 NOVEMBER 2015
                                                                                     22 JANUARY 2007                    Fedora 23 comes with
Fedora users are among the first to get the latest versions of Gnome Shell.          Linux Foundation formed.           LibreOffice 5.




                                                                www.linuxvoice.com                                                                    15
     FEATURE FEDORA


FEDORA WORKSTATION
Fedora continues to dominate on the desktop




 The notifications area in Gnome
 Shell makes it easy to keep up
 with any important messages
 from your system.


                The workstation release of Fedora                  this in the previous issue of this        For those of you seeking
                boots into a live Gnome Shell (see                 magazine, but our favourite features    the ultimate desktop graphics
                boxout for other desktops). Fedora 24              are the improvement to the help         performance, Fedora is probably the
                brings this bang up to date with                   system and a more polished interface.   distro that best supports Wayland.
                version 3.20 of the desktop                          Also new with Fedora 24 was the       Although it’s not yet the default
                environment, so you get all the latest             Flatpak packaging format, which         graphical server, you can enable it. The
                features. You can see our full review of           makes it easy to ship desktop           Wayland experience is getting better
                                                                   applications packaged into containers   with every release, and many users
                                                                   for security and ease of distribution   now use it on their normal system
 Spins                                                             across multiple distros.                without problems.
 Spins are Fedora distributions that come with a different
 set of default software to the standard Workstation
 release. Basically, they’re for people who want a desktop
 environment other than Gnome. Here are our favourites:
 • KDE There has been competition between Gnome and
   KDE for almost as long as there have been Linux desktop
   environments. Gnome may be the default on Fedora, but
   KDE is the first option on the spins page.
 • LXDE Don’t wast computing power on a flashy desktop –
   save it for real work instead. LXDE is a perfectly functional
   desktop without any of the bells and whistles that waste
   CPU cycles, making this spin great for older machines.
 • Mate When it comes to the traditional desktop metaphor,
   nothing is better than Mate, a desktop forked from the
   now defunct Gnome 2.                                              Gnome 3 caused controversy
 • SOAS The least familiar of the desktop spins, Sugar On A          when it came out, but has
   Stick is a desktop designed for children initially used by        matured into an easy-to-use
   the One Laptop Per Child project.                                 desktop environment.



16                                                                  www.linuxvoice.com
                                                                                                                 FEDORA FEATURE

  None of the things we’ve mentioned
so far are exclusive to Fedora, but they
are all technologies that are rapidly
changing, and Fedora users are well
placed to benefit from them before
users on other distros. This adoption
of technologies at the cutting edge is
the real advantage of Fedora rather
than any particular piece of software
that’s unique to the distro.
  Fedora is the fastest moving of
the non-rolling release distros. Arch
users have the very latest software
constantly available, but the price
they pay for this is not being able to
easily predict when big updates come.          If you prefer a more
                                               traditional desktop
With Fedora, you’ll only ever be a few
                                               experience, the Fedora Mate
months behind Arch, but you can
                                               spin retains the classic
know exactly when things will change.          Gnome 2 look and feel.

All aboard
When it comes to picking a distro, the   what’s going on with the project, you          distros tomorrow. Having a rounded
community behind the project is          can browse through the past IRC                set of Linux skills means being familiar
important. An active community                meetings, as logs are recorded            with multiple distros, but if you’re using
means that more software                            at and posted online at             a RHEL-derived distro professionally,
will be packaged and                                    https://meetbot.                using Fedora Workstation will help you
bugs are more likely                                      fedoraproject.org.            stay ahead of the game.
to be fixed, while an                                         A significant, and          There is no perfect desktop distro
open community               An active                      often overlooked,           for all people, but Fedora is a great
means that you               community                       advantage                  option for anyone who wants a
can get involved             means that bugs                 to Fedora for              cutting-edge distro with an active
and help shape the                                          sysadmins and               community, especially if they want to
                             are more likely
direction that the                                          other people who            use enterprise distros as well.
distro goes in. The          to be fixed                   work in operations is
Fedora community                                        that it’s the upstream
is both active and                                   distribution for RHEL                Labs
open with most of                               and CentOS – the underlying
                                                                                          Labs are collections of software curated for a particular
the activity happening on IRC and        system in Fedora today will be the               use. To make it easy to get started in a particular area, you
mailing lists. If you want to know       underlying system in these server                can download Fedora releases with all the software already
                                                                                          installed, or you can add a lab to an existing Fedora install.
                                                                                          • Scientific If you’re a student or otherwise working in the
                                                                                            scientific community, this lab will pull together all the
                                                                                            open source software you need, including iPython, R, Latex
                                                                                            and Gnu Octave. Spend time probing the mysteries of the
                                                                                            universe, not searching through the repositories for the
                                                                                            software you need.
                                                                                          • Security Security is critical to every tech project, and
                                                                                            achieving a good level of security means having a good
                                                                                            range of security tools to hand and knowing how to use
                                                                                            them. Whether you’re just getting started with IT security
                                                                                            or are a seasoned pro, the Fedora Security lab is one of
                                                                                            the easiest ways to get the software you need.
                                                                                          • Games If your machine is more for leisure than work,
                                                                                            this is the lab for you. Packed with the best open source
                                                                                            games (no Steam here), you’re ready to play as soon as
                                                                                            you start up. With the live version, you can introduce
                                                                                            others to the joys of free software gaming.
                                                                                          • Design Suite Free Software has close ties with the design
                                                                                            world, and slowly but surely, many designers are reaching
                                                                                            for open source as a replacement for the Adobe Creative
                                                                                            Suite that has been the industry standard for years. The
                                                                                            Fedora Design Lab brings all the software you need –
                                                                                            whatever your creative medium – into your distro.
The Gnome Software tool makes it easy to find and install whatever software you need.


                                                              www.linuxvoice.com                                                                       17
     FEATURE FEDORA


FEDORA SERVER
Cutting edge software to help your business run smoothly




 You can get an overview of how
 your machine’s performing from
 your web browser with Cockpit.


               Let’s be honest, if you’re looking for a          making the distro reliable under heavy      repeat the same tasks to get your
               server distro, Fedora probably doesn’t            loads, and workable through upgrades,       servers running that thousands of
               spring immediately to mind. The                   there’s been work put into making the       other people did: you had to install the
               though of having just a year or so’s              distro easier to set up and manage.         software you needed, configure it to
               support is enough to make most                       While a standard Linux distribution      behave as you wanted, then configure
               sysadmins' toes curl.                             is a very flexible thing that can be        any system-level components (such
                  Since the creation of Fedora Server            turned to almost any computational          as firewalls) as necessary. This gave
               (in version 21 of the distro), the project        tasks, there are a few things that          you complete control, but could be a
               have thought about what makes a                   servers are very commonly used to do.       little complex, especially for people
               great Linux server, and how to apply              Despite these common tasks, Linux           only managing a couple of servers
               that to a fast moving distro. As well             system management has traditionally         who aren’t full-time system admins,
               as all the usual back-end work on                 been a little disjointed. You had to        or Windows sysadmins who don’t


 What can I do for Fedora?
 On of the great aspects of Fedora is the community.
 Although it’s sponsored by Red Hat, Fedora is really created
 by volunteers coming together to work on a great distro.
 These volunteers come from all walks of life and have a
 huge range of skills – and they could include you. If you
 like the idea of helping make the next version of this OS a
 little more awesome, the Fedora project would love to hear
 from you. They’re so keen to get more people on board that
 they’ve made a simple tool to help you find the area within
 the project where your talents are best put to use. Head to
 http://whatcanidoforfedora.org/en to find out more. You
 don’t have to be a coder or sysadmin to help (though if
 you are, that’s great) – the project is in need of designers,
 translators and writers. There’s something for everyone!
                                                                 The Cockpit interface provides an easy way to manage Docker containers on Fedora.



18                                                                 www.linuxvoice.com
                                                                                                                    FEDORA FEATURE




  If you’re interested in helping make
  Fedora even more awesome, head
  to http://whatcanidoforfedora.org to
  find out what you can contribute.


yet know their way around the Linux          ability to tweak your system from your         runs on the latest code from upstream
system.                                      web browser. You can control system            projects. There are a few new server
   Fedora has created roles that enable services, configure the network,                    projects that are currently iterating
you to very quickly set up a                         launch containers, update your         really quickly, such as Docker and
server to a particular task.                               system and more with just        Kubernetes. If you’re using one of these
For example, with just                                         a few clicks of the          on a more traditional Linux server
a single line of code,                                           mouse. If you’re a         distro, you may find that you have to
you can transform                                                  seasoned system          manually keep the software up to date.
your fresh Fedora
                               If you're coming                     administrator, this     Fedora Server might seem like a great
instance into a                to a Linux server                     probably won’t         solution here, but the Fedora project
running database               for the first time,                   make things easier     has singled this area out for its own
server that’s set              Fedora will help                     for you as can do       version of the distro – Fedora Cloud.
up with best                                                       all this from the
practices.
                               you get started                   command line just as
                                                                                              An alternative route to Fedora on the server
                                                               quickly, but if you’re
                                                                                              You may be reading this section on Fedora for the server
In the driving seat                                        coming to a Linux server
                                                                                              and thinking that having cutting-edge software on a server
Not everyone running                                 for the first time, it will help you     would be great, but you don’t want to have the underlying
a server is comfortable using the            get started.                                     distro change every six months. It turns out that the Fedora
command line. This might sound like             We’ll be honest, Fedora Server isn’t          project themselves had this want with the infrastructure
heresy in a Linux magazine, but it’s         for everyone. If you’ve already got a            they use to run the project.
                                                                                                 Their solution was to get the latest version of common
true. The terminal interface is hugely       swarm of servers running, and are
                                                                                              server software and package it for RHEL. This way, they
powerful and with practice can reduce        happy with the process of managing               got the benefits of the stable base of RHEL, but also the
complex tasks to a single line, but it       them, it’s unlikely that there’s anything        benefits of faster-moving packages. Seeing that other
can take a long time to learn to use         in the plain Fedora Server distribution          people wanted this solution, the Fedora project grouped
well. It’s a little excessive to expect      to tempt you away from your current              these new packages into a repository called Extra Packages
                                                                                              for Enterprise Linux (EPEL). Although these repositories
someone to become familiar with              setup. However, if you’re new to Linux
                                                                                              are maintained by Fedora, they’re for installation on RHEL,
Bash just to keep a single server            servers, some of the new features                CentOS, Scientific Linux and Oracle Linux.
running. Fedora has built Cockpit – a        could make it a lot more accessible.                This is something that we at Linux Voice appreciate,
web-based management interface                  So far, we haven’t mentioned the              because our servers run on CentOS with EPEL additions.
– to make life easy for system               software. Fedora is well known for               Like many others, we find the balance between stability
                                                                                              in the core OS and having up-to-date software in the
administrators. You can install it with      bringing the latest software to the
                                                                                              repositories the best solution for our needs.
a single command and then have the           desktop, and the server version also



                                                                www.linuxvoice.com                                                                       19
     FEATURE FEDORA


FEDORA CLOUD
Master your containers for easy deployment and scalability.




                                                                                                                   Had an update go wrong? If you’re
                                                                                                             using Fedora Cloud this isn’t a problem,
                                                                                                              as you can roll back the upgrade either
                                                                                                               from the terminal or the web browser.


                                                                 Before we delve too far into the Fedora     a software platform available over
 Fedora Cloud images                                             Cloud images, let’s stop for a moment       the cloud is a Platform as a Service
 Fedora Cloud comes as image files that can be put directly      to work out what we mean by Cloud.          (PAAS); whereas a provider of online
 on to virtual machines rather than ISO files that need to       It’s been a computing buzzword for          virtual machines is Infrastructure as a
 be installed. The obvious problem with missing the install      over 10 years, but it’s still used by       Service (IAAS).
 step is that it doesn’t catch the useful information that       different people to mean different
 users typically entersuch as such as login credentials
 and any necessary network details. You can pass all this
                                                                 things. At its heart, cloud computing is    What is the cloud?
 information to the Fedora Cloud instance using an init.         any computing that can easily be done       Cloud computing is when you contract
 iso image. This is a CD image that contains two text files      on different remote machines. This          out a specific part of your computing
 detailing the data that Fedora needs. The most basic setup      can be true on a variety of levels. At      needs to a third party. This can have
 is the following. A text file called user-data containing:      the top level, it’s about applications      huge organisational and cost saving
 #cloud-config
                                                                 that can run anywhere. Take, for            advantages because it means that
 password: fedora
 chpasswd: { expire: False }                                     example, a cloud office suite such as       one company can specialise in one
 ssh_pwauth: True                                                Google Docs – this runs in your web         thing (such as running online office
 and a file called meta-data containing:                         browser but the back end could be           suites) and do so highly efficiently,
 instance-id: iid-LV02;                                          anywhere; it doesn’t matter to you as       while another can focus on its core
 local-hostname: LV01;
                                                                 long as you can access it through           business rather than try to keep their
 With these files in place, you can create the ISO image with
 the following (run in the same directory as the above files):   https://docs.google.com.                    office suites running and updated.
 genisoimage -output init.iso -volid cidata -joliet                 A level lower, you can access a             The biggest problem with this view
 -rock user-data meta-data                                       software platform that could be an          of the cloud is that it requires you
    You’ll now need to download either the Base or the           operating system or a programming           to hand over much of your data to
 Atomic Host image. Whichever you pick will come as a
                                                                 language environment. The lowest            the third party. If they go bust or get
 QCOW file that can be booted up in Qemu (or KVM), but we
 ran ours in VirtualBox as it makes it more straightforward to   level is providing virtual computing        hacked, you’re in trouble. In order to
 sort out networking. Before you can use VirtualBox though,      power (such as virtual machines)            solve this problem, large organisations
 you need to convert the image into a VDI file with:             though the cloud.                           run a private cloud where the IT
 qemu-img convert -f qcow2 <downloaded-                             The essential part of all this is that   department provides some facilities to
 filename>.qcow2 -O vdi <output-filename>.vdi
                                                                 the user pays for a specific service        the rest of the organisation in a cloud-
    You can now create a virtual machine with the VDI
 image as the hard drive and the ISO file in the CD drive. We    they want rather than a specific            like manner. Typically this is a Platform
 used Bridge networking (in Settings > Network > Bridged         piece of hardware or software. The          as a service (PAAS) or Infrastructure
 Adapter) to simulate the virtual machine as being on a new      abbreviations of cloud software often       as a service (IAAS).
 network interface. Starting the machine will take you to a      end in AAS (As A Service) to denote            Phew! That’s quite a lot of detail to
 login prompt where you can log in with fedora/fedora.
                                                                 this. For example, an online office         get through before we even look at
                                                                 suite is Software as a Service (SAAS);      what the cloud release of Fedora does.



20                                                                 www.linuxvoice.com
                                                                                                                 FEDORA FEATURE




  The Project Atomic website
  is the best place to get
  information about how to use
  Fedora Atomic Host.


   Firstly, let’s just discard Software as   images. This reflects the way they’re       roll back to any previous state. With
a Service – it has its place, but it’s not   designed to be used. Rather than            this roll-back option, keeping up with a
the sort of cloud we’re talking about.       installed onto a machine through            fast-moving distro poses fewer risks.
This distro is really about working with     the traditional install process, they’re       Fedora Cloud offers a radically
a PAAS or IAAS system.                       imaged in a state ready to run.             different server management paradigm
   You could use a Fedora Cloud                It’s the Atomic Host version of           that aims to make it easy to manage
image to control containers running          Fedora Cloud that is really bringing        servers and scale applications. Much
on Docker that are hosted on someone         next-generation system administration       of the technology behind this approach
else’s PAAS; you could build your own        to the Linux world. It’s part of Project    is new and evolving quickly, and
private PAAS using Fedora Cloud as           Atomic (which also spans CentOS             Fedora is ideal for making make the
the host OS; or you could                             and RHEL) and aims to create       most of this new approach.
use Fedora Cloud on an                                     a platform that makes it
IAAS. There are three                                         as easy as possible
versions of Fedora                                               to build and deploy       Kubernetes, Docker & LXC
Cloud that suit                The Atomic                         containerised            The new technologies that Fedora Cloud is built on can be a
different uses                                                     applications            little baffling even to people who have been using Linux for
cases:
                               Host version of                     across a pool           a while. Let’s take a quick look at these three:
   Base A minimal              Fedora    Cloud  is                 of computing
                                                                                           • Linux Containers (aka LXC) is the name given to a group
                                                                                             of technologies that isolate a set of system resources
Fedora release for             bringing next-gen                   resources.                running on top of a Linux kernel. This effectively gives
creating virtual               Sysadmin to Linux                  The underlying             you the ability to run two or more Linux systems on a
machines on IAAS.                                               technology for this is       single CPU. Only a single kernel runs, but the two systems
   Atomic Host A                                             Linux Containers, Docker        are so well isolated that the two systems appear to be
                                                                                             completely separate from each other.
Fedora build                                             and Kubernetes, but Project
                                                                                           • Docker Using a system of images, users can design
specifically for running                      Atomic hides as much of this as                containers using Dockerfiles that define what distribution
containerised applications with Docker possible behind a single interface (the               the container should be based on and how it should be
and Kubernetes.                              atomic command and the nulecule                 configured. These images and Dockerfiles can be shared
   Docker This release is purely for         container specification) that makes it          through a Docker registry that makes it really easy to
                                                                                             create, modify and share containers for almost any need.
running inside Docker, and you               easier to manage.
                                                                                           • Kubernetes controls groups of Docker containers to
shouldn’t usually download it directly.        With all your applications in                 make it easy to build systems running across multiple
Instead you can get it through Docker        containers, the base system should              machines. Take, for example, a situation where you
either directly or by creating a Docker      always be small and easy to manage.             had 10 physical machines and wanted to deploy a web
file that builds from it.                    The base system is upgraded using               app that required a web server and a database. Using
                                                                                             Kubernetes, you could define Docker containers for the
   Whichever you choose, you’ll find         the rpm-ostree command, which
                                                                                             web and database server, then spin up instances of these
that they don’t come as ISO DVD              keeps track of all previous system              containers across your 10 machines and load-balance the
images as is normal for Linux distros,       states so that if you encounter a               system to keep everything running smoothly.
but as virtual machine hard drive            problem with the upgrade, you can



                                                             www.linuxvoice.com                                                                       21
     FEATURE BACK TO THE FUTURE




                Turn a spare Raspberry Pi into an awesome retro gaming station.
                      Mike Saunders gets misty eyed reliving the classics.


W
             e often hear from readers that     and play”. With the right software on the SD    and having a bulky PC under your TV (or a
             many of you now own multiple       card and a HDMI cable, you can plug it into     laptop that can’t be used for another job at
             Raspberry Pis. As they’re so       almost any TV made in the last five years       the same time) isn’t idea.
cheap, it’s not the end of the world if one     and it just works.                                So the Raspberry Pi is perfect for this: low-
spends the next few years sitting in a                                                          power, silent, plug-and-play as mentioned,
cupboard, but we always have this nagging       Now you’re playing with power                   and with a couple of USB ports for joypads.
feeling that any working technology should      And this is especially useful for emulating     Over the next few pages we’ll show you
be doing something useful.                      classic video games consoles and                how to set up a spare Pi using the very, very
   Now, there are obviously a million and       computers. You can do this on a desktop         cool RetroPie distribution, so that you can
one things you can do with a Pi, from home      PC or laptop of course; Linux has a wealth      play old games from the 1980s and 1990s
servers through to robotics, but one thing we   of first-rate emulators for pretty much every   with minimum fuss. Sure, there are some
like about it – especially thanks to its HDMI   platform under the sun. But setting up          excellent modern games, but very little
output port – is that it’s very much “plug      emulators on a typical distro can be fiddly,    compares to multiplayer Super Bomberman…



22                                                         www.linuxvoice.com
                                                                                              BACK TO THE FUTURE FEATURE




                     Install RetroPie and prepare to beat your old high-scores.
The first thing you need, of course, is a
Raspberry Pi. Excellently, all models of the Pi
can be used with RetroPie, so you’re not just
limited to the latest versions – but there is
an impact on performance. In our
experience, the earlier models (and Pi Zero)
do a decent job of emulating the 8- and
16-bit classic consoles such as the Atari
2600 (VCS), NES, SNES, Master System,
Mega Drive (Genesis), Game Boy and Game
Gear. If you want to try emulating more
advanced machines, like the Sega Saturn or
Sony PlayStation, a Raspberry Pi 3 is highly
recommended – and even then, you’ll get
mixed results. We recommend RetroPie
mainly for 8-bit and 16-bit emulation.
   Next, you’ll need the usual bits and pieces
to get a Pi running and connect it to a TV:
a power cable, a HDMI cable, and an SD
card (8GB minimum recommended). Then
you’ll need a USB joypad (or two) to actually
play the games – you can pick up SNES
knock-offs from Amazon for a few pounds/          Every Pi model works well with RetroPie, but for the best performance (eg for PlayStation
dollars/euros. Finally, if you want to do some    emulation) we’d recommend the beefed-up version 3.
tweaking of your RetroPie installation, it’s a
good idea to have a USB keyboard around             Next, enter df -h, which shows a list of         you have any doubts or need more help, see
that you can plug in. You don’t need it to        disks (or SD cards) currently in use on your       the official Raspberry Pi SD card installation
play games, but you’ll need to use it to gain     Linux distribution, along with how much            documentation at www.raspberrypi.org/
access to certain advanced features.              space they have. Now plug in the SD card           documentation/installation/installing-
   So once you have all your equipment,           you want to use for RetroPie, and run df           images/linux.md.
head over to the RetroPie download page           -h again. This second time of running the             Anyway, the above command could take
at https://retropie.org.uk/download. You’ll       command, you’ll see the difference from            anything from a few seconds to several
see that there are two download options:          the first output, showing which card you’ve        minutes depending of the speed of your SD
one for older Pis (models Zero and 1), and        added. Note the SD card name in the list –         card, so go off and make a cuppa. When it
another for the Pi 2 and 3. Choose which is       eg /dev/sdd1. We want to access the SD             has finished, enter sync at the command
appropriate for your device, and after a few      card directly, and not via a file manager, so      line, then remove the SD card and plug it into
minutes of downloading you’ll end up with a       unmount it like so:                                your Pi. You’re ready to go!
.img.gz file containing the filename. This is a   sudo umount /dev/sdd1
compressed Raspbian image, much like the          (Change the device name accordingly.) If           Play it loud!
normal ones you install on a Pi, but highly       the output of df -h before showed multiple         Now connect your Pi to the TV, plug in your
customised for retro gaming.                      partitions on your SD card, you’ll need to         USB joypad(s), and RetroPie will boot for the
                                                  unmount those as well.                             first time. It will expand the Raspbian
Play your cards right                               Now we need to directly write the                installation to completely fill the SD card,
Next you need to write it to your SD card.        Raspbian image to the SD card. To do so, we
Move the file to your home directory (eg          use the name we had before (eg /dev/sdd1),
/home/mike), then open up a Terminal              but this time removing the number, as we
(command line) window and use gunzip to           don’t want to access any specific partition
extract the compressed image like so:             but rather the whole device. So:
gunzip retropie-v3.8.1-rpi1_zero.img.gz           sudo dd bs=4M if= retropie-v3.8.1-rpi1_zero.img
   Note that the filename may be different        of=/dev/sdd
in your case – and remember you can hit             Be very careful with this command – if
Tab after typing the first few characters of a    you put /dev/sda or something else, you
filename to auto-complete it!                     could end up overwriting your main drive! If



                                                               www.linuxvoice.com                                                               23
     FEATURE BACK TO THE FUTURE

                                                                                                   assigned to Start and Select simultaneously.
                                                                                                   This will return you to the RetroPie front-end,
                                                                                                   where you can navigate to other emulators
                                                                                                   and games. (Press A to go into an emulator,
                                                                                                   and B to switch back out.) If your joypad
                                                                                                   wasn’t configured correctly, press Start in
                                                                                                   the main RetroPie screen to open a menu,
                                                                                                   go to Configure Input, and then go through
                                                                                                   the process again.

                                                                                                   Adding ROMs
                                                                                                   Now you’ll want to add some ROMs (see the
                                                                                                   “Thorny issue of ROMs” box for more
                                                                                                   information on these). If you’re savvy with
                                                                                                   the command line, you can plug a USB
                                                                                                   keyboard into your Pi, hit F4 to switch to the
                                                                                                   command line, and then cd into the /home/
                                                                                                   pi/RetroPie/roms directory. There you’ll see
                                                                                                   subdirectories for various consoles – most
                                                                                                   of the names are obvious, but note that gb is
                                                                                                   for Game Boy, gbc for Game Boy Colour and
                                                                                                   gba for Game Boy Advance.
                                                                                                      You can now copy ROMs into these
A Raspberry Pi running RetroPie, playing Sonic 1, but with a SNES pad connected via a Retrode.
                                                                                                   directories, eg from a USB key. If you’re not
What kind of black magic is this?
                                                                                                   so au fait with the command line, press
                                                                                                   Ctrl+D to return to RetroPie, and then shut
then reboot and you’ll see a shiny splash         search for a SNES joypad to get an idea          it down by hitting the Start button and then
screen. Once the emulator front-end has           of the standard layout). If your joypad has      Quit in the menu. Once your Pi has fully shut
loaded, you’ll be prompted to press and hold      fewer buttons or you don’t want to assign a      down, remove the SD card and insert it into
a button on your joypads to configure them.       physical one to an emulated one, just press      your computer.
  RetroPie will ask you to assign each            and hold any button when prompted.                  In your file manager, navigate to the
button on your USB joypad to a button in the         Once the joypad(s) are configured,            retropie partition of the SD card, and go into
emulators (eg A, B, X, Y – do a web image         RetroPie will display a list of emulated         /home/pi/RetroPie/roms. Here you can add
                                                  consoles and computers – use the left and        ROMs into the appropriate directories as
                                                  right buttons on your joypad to navigate         mentioned previously. When you’re finished,
                                                  between them. As you have no ROMs                unmount the SD card, pop it back into your
                                                  installed at this stage, you won’t have much     Pi, reboot and enjoy playing the classics!
                                                  to play, but you can test your installation         RetroPie has many advanced features
                                                  by going to the Ports option and choosing        including the ability to scan for ROMS,
                                                  Doom. If all goes well, you’ll be able to play   so visit https://retropie.org.uk for
                                                  a bit of classic Doom and ensure that your       documentation and forums where you can
                                                  joypad is set up correctly.                      get help and share ideas. And if you discover
                                                     To exit out of Doom – and indeed any          an absolute gem from the 80s or 90s that
                                                  emulator – press the buttons you have            everyone should play, drop us a line!




An emulator isn’t much fun without any               Now, the internet is awash with ROMs,         – look at Nintendo with its new NES Classic
games to play on it. But where do you get         but their legality is dubious. Some people       Edition.
them? If you’re new to emulation, it’s            argue that downloading a ROM for a game            So play it carefully. If in doubt, buy a
important to understand what the term             you already own is fine – after all, you have    machine to directly extract ROMs from
“ROM” (read-only memory) means. In this           a right to own a backup copy in case your        cartridges you own (eg a Retrode). Or play
context, it’s a file that represents the          game breaks. Others say it’s still a copyright   the many home-brew ROMs created more
contents of a video game cartridge (or            infringement. Many people would argue            recently by fans of classic consoles – most
floppy disk or CD-ROM). It essentially            “Ah, these games are so old, it’s not like the   of those games are released for free and
contains the very same bits and bytes of the      original vendors are losing any money.” But      their developers actively encourage copying
original game.                                    some companies are still selling old games       and distribution.



24                                                            www.linuxvoice.com
                                                                                                          BACK TO THE FUTURE FEATURE




                       Mike’s selection of relatively obscure but unmissable retro games.

     1                                                                                                                    2




                                                                                                                          3




     4                                                                              5




1 Umihara Kawase (SNES) From the outside, this looks like a traditional                 huge challenge for a machine that had character-cell graphics – 3D images have
jump-and-run platformer, but it has a twist: your character welds a fishing rod, and    to be mapped onto sprites. But it works well, with a clever joypad-based input
you can fire its hook onto other platforms to swing around, Spiderman-style. It         system and top-notch battles.
makes you think about level structure in a wholly different way, and there’s some       4 Kaeru no Tame ni Kane wa Naru (Game Boy) This was only ever released in
corking music to accompany your antics too.                                             Japan, but the ROM has been translated by hardcore fans and is playable in
2 Unirally (SNES) Known as Uniracers in the States, and created by DMA Design           English. It’s based on the engine used in Zelda: Links Awakening, and it’s also an
(of Lemmings and later Grand Theft Auto) fame, Unirally is a side-scrolling racing      great role-playing game (although very tough in places).
romp in which you perform stunts on a unicycle at breakneck speeds. It’s shallow,       5 Dragon’s Revenge (Mega Drive/Genesis) Most pinball games tend to be shallow
but tremendous fun to play – especially in split-screen two-player mode.                affairs with pretty sounds and shiny graphical effects, but not much else to keep
3 Elite (NES) We’ve talked about Elite (and Frontier) plenty of times in Linux Voice,   you glued to the joypad. Dragon’s Revenge is way better: a fantasy world, boss
but you may not be aware that it was ported to Nintendo’s mighty NES. This was a        levels, bonus balls and other tricks make it one of the superior pinballers.




                                                                          www.linuxvoice.com                                                                            25
     SECRETS PITIVI




SECRETS OF
PITIVI
Get the most out of your motion pictures with open source video editing


F
       ast internet speeds and the proliferation of smartphones             some serious competition, this is our favourite of the open source
       mean that we’re creating and sharing more video than ever            video editing options. Pitivi is a powerful and rapidly developing piece
       before. As a result of this, video editing software is becoming      of software that has really started to shine in the last couple of
more popular for stitching together GoPro camera footage of sports,         releases. The stability problems that plagued it for years have now
mobile phone footage of current events and, of course, videos of            mostly been consigned to the past, and the new-look GTK 3 interface
cute cats.                                                                  makes it a pleasure to use.
  This month, we’re taking a close-up look at one of the most                  We’ve been using Pitivi for a few years – here are our eight
popular open source video editing options, Pitivi. Although there is        favourite features.




                                                                                                  01                                          02



                                                                                                           help you with these, but it does provide
                                                                                                           vast numbers of options that are easy
                                                                                                           to add to your movie. There are over 70
                                                                                                           transitions and over a hundred effects
                                                                                                           for you to play with – this is more than



             01
                          Flatpak                           supports this format. We were able to          enough to add a professional look to
                          Installing software in Linux is   download and install the software on           your projects – just don’t add all of
                          easy, provided your distro’s      Ubuntu with just two commands,                 them at once.
              repository has the version you want. If       which makes it just as easy as apt-get.



                                                                                                           03
              you’re after the very latest version                                                                       Nanoseconds



                                                            02
              though, things can get complicated.                        Transitions and filters                         There are a lot of
              The Pitivi developers have packaged the                    Good use of graphical                           components to a video
              latest version up with Flatpak to make it                  effects requires an eye for       – multiple tracks, effects and audio are
              easy to install on any distro that            style and plenty of creativity. Pitivi can’t   all pulled together to make the final
                                                                                                           video and these all have to happen at

     Pitivi has over 70 transitions and over a hundred                                                     the same time to get the right result. If
                                                                                                           this synchronisation is off by just a
     effects for you to play with – more than enough                                                       small amount, the result is a video that
                                                                                                           looks amateur. Just how accurate does
     to add a professional look to your projects                                                           this timing have to be? Well, precision to



26                                                            www.linuxvoice.com
                                                                                                                   PITIVI SECRETS



                                                                               03                                                     04




                                                                                                                                      06
                                                                               05




                                                                                                                                      07
the nanosecond is more than most            edits that end up not looking as good
people need, but it’s better to have too    as we thought they would. Pitivi has a
much precision than not enough.             full undo and redo system so that you
                                            can scroll backwards and forwards



04
             Background processing          through the changes you made to get
             Video processing takes a       the project back to the exact state you
             lot of processor power. This   want it in before you start to make
can mean delays as you wait for things      more edits.
to run through. Pitivi does as much as



                                            07
possible in the background, which                         Render to profiles
means that it enables you to continue                     There are hundreds of ways
to work on your project while the CPU is                  to watch a video – just a

                                                                                                                                      08
churning through your data. This            few of the most common are: on a
means that the heavy processing             television in your living room, (in both
demands don’t slow you down.                normal and HDTV flavours), on a phone
                                            on the train on the way to work, on



05
             Keyframes                      YouTube and in a desktop media player.
             When linking effects to a      All of these have different attributes and
             section of video, you need a   show differently rendered videos best.
way to place events at a particular point   Pitivi can render to different profiles so
in time. Using keyframes you can tag        you can output your project so that it’ll
moments in the video and use these to       be at its best on different devices.
inform the effect or transition. These



                                            08
keyframes enable you to precisely                        Scripting
control the way things like fades,                       The Pitivi project has
movements, pans and cuts happen,                         developed both the
and this stays the same if you move the     front-end user interface and a video
video to another point in the project.      editing core called Gstreamer Editing        editing power of Pitivi. By building their
                                            Services (GES). This back-end is             software in this way, the Pitivi project



06
            Full undo/redo                  independent of the user interface and        has vastly reduced the difficulty of
            We all make mistakes, and       enables technical users to build scripts     incorporating non-linear video editing
            we also make intentional        and software that can access the huge        into other projects.



                                                             www.linuxvoice.com                                                       27
     FEATURE THE BIRTH OF LUMO

THE
BIRTH
    OF




Discover games development with the
secret diary of Gareth Noyce, creator of
the superlative isometric platformer, Lumo.


W
            e loved the game Lumo                   Lumo, it’s mostly the product of a
            when we reviewed it a                   single developer: Gareth Noyce. And
            couple of issues ago – it’s a           following in the footsteps of 80s
tough isometric puzzler with 21st                   bedroom programmers like Andrew
century graphics and the soul of a                  Braybrook and Jeff Minter in
game that should take 15 minutes to                 magazines like Zzap!64, we thought
load off a cassette. What’s even more               we’d ask Gareth if he’d consider writing
remarkable is that, like many of the                a diary of his development process.
1980s games that helped to inspire                  And remarkably, he agreed…




  Gareth who?
  Gareth Noyce started his career with Climax Studios Solent,
  first as QA and then as a designer on the Xbox RPG, Sudeki.
  He moved to Climax Studios London as a producer before he
  partnered with Gary Liddon (yes, Zzap!64) as a co-founder
  of Xen Services, and spent several years as a contracted
  producer, working on Crackdown, Too Human, PGR3, Fable
  2, Space Giraffe and the Xbox 360 visualiser, Neon. In April
  2008, Gareth, Gaz Liddon and Billy Thomson (ex DMA Design
  & Realtime Worlds) formed Ruffian Games in Dundee, where
  Gareth worked as development director.
      Over the course of the next five years Ruffian would ship
  another five titles for MS: Crackdown 2, Nike+ Kinect Fitness,
  Kinect Sesame Street, Season 2, Kinect Star Wars & Kinect
  Playfit, and was heavily involved in Crytek’s Ryse during
  pre-production, as well as several unannounced and canned
  projects.
      In April 2013 Gareth moved to Finland and began
  teaching game design, Unity3D programming and business
  & production courses at TAMK Univeristy. Lumo was born
  toward the end of 2013 and is the first project to come out
  via Triple Eh? Ltd. In addition he provided a music track for
  the Llamasoft Playstation Vita hit TxK, as well as music for an
  unannounced PS4 VR game.




28                                                                  www.linuxvoice.com
                                                                                               THE BIRTH OF LUMO FEATURE




                                                                              Lumo’s play mechanic and graphical style was set very early, as
                                                                              these shots from the first couple of days of development show.




29 April 2013                                               this is it. I show my girlfriend and make a quick video        What is Steam
I arrived in Finland to start up a new dev-studio,          to share (https://www.youtube.com/watch?v=uRh_                 Greenlight?
the idea being to make mobile games and learn               yDp3XF4) with Ste, who both make encouraging                   Steam is a digital distribution
from the vibrant development community that had             noises. Arse Over Tit is born, and I have my project!          service for games,
                                                                                                                           applications and even movies
sprung up around companies such as Rovio and
                                                                                                                           that you’re probably familiar
Supercell. That didn’t quite go to plan. In fact, I         December, 2013                                                 with through its support for
ended up doing something completely different and           I’m nearly full-time on Arse Over Tit. The university          Linux via SteamOS. Originally
going it alone. Lumo, my first independent game, was        where I teach is nearing its winter break and the              created as a means for Valve
the result; a modern take on the classic ‘Isometric         short consultancy job I’d picked up has finished. The          to distribute its own games,
                                                                                                                           it slowly opened up to third-
Arcade Adventure’ genre (Head Over Heels, Amaurote,         design ideas have settled very quickly. I know that
                                                                                                                           party games after the release
Knightlore etc) that was a mainstay of the 1980s            I want to ape the kind of world that Head Over Heels           of Rag Doll Kung Fu. Rather
gaming scene. Development took around 2.5 years,            presented, so I’ve settled on the location being a big,        than act as a gatekeeper,
part-time, and the final result was released in May         scary castle, with two or three distinct zones, each           Valve sought to open up the
2016. This is, roughly, how it happened.                    with their own art style and set of toys for the player        process of accepting third-
                                                                                                                           party titles to its community
                                                            to discover. I want the player to feel a little protective
                                                                                                                           of users, and Greenlight
November, 2013                                              of the character and I want them to feel like they’re          was born. In principal the
For the last three months I’ve been working on an           lost, so making the player character small, almost             process is simple: games in
RTS prototype – think Advance Wars, and you’d               childlike, should help both of those feelings. It’ll also      the Greenlight process are
be close – aimed at the tablet market. Something            subtly magnify the environmental dangers.                      publicly displayed and anyone
                                                                                                                           who uses Steam is able to
about it seems like a great fit between game and               The prototype was quite bright and I want more
                                                                                                                           vote ‘Yes’ or ‘No’ to express
form-factor, but it’s becoming increasingly clear that      of a ‘Scooby Doo’ feel, so I buy in some textures              their interest. In reality, what
I’m not going to be able to finish it and release it as     from Gametextures.com and remove all the ambient               happens behind the scenes as
a free-to-play game. I’ve not got the money for user        lighting, settling instead on wall-based torches that          Valve process this information
acquisition (marketing by another name) and I’m             light each room while casting long, dark shadows.              and allows games to be
                                                                                                                           distributed is a little murky,
not sure I can support it with enough content after         This immediately feels better, so I create a room
                                                                                                                           often causing controversy
release. It’s depressing and my constant mooching           where the player spawns in with a big particle effect          as games either avoid the
about is getting on my girlfriend’s nerves: “Why don’t      and link it to another room with musical floor tiles           process entirely, or languish
you just make something you want to do, and forget          that you have to hit in sequence (stolen from the Billy        in ‘Greenlight hell’ for years
about the mobile stuff?!” I think she has a point, but      Jean music video, natch). Even the act of moving               at a time.
I’m still not sure what I can do on my own that I can       between rooms makes it feel like a proper game…
finish to a high enough quality.                               I think I’ll aim for it to be a similar size to Head Over
   I’m at a party, a little worse for wear, idly chatting   Heels – so roughly 150 rooms. My notepad has a list
to Ste Pickford over Twitter. He’s one of the Pickford      of the types of mechanics I’d like to build, so the job
brothers, responsible for many classic games, and           of creating rooms begins in earnest.
we’re watching speed-runs of people playing Equinox,           But there’s another problem. My girlfriend hates
when it hits me… I’ve always wanted to make a               the name Arse Over Tit. I’ve tried explaining that it’s
game like Head Over Heels. It was the first game that       just a pun on Head Over Heels, but it’s not washing,
I actually owned, so there’s a nice circularity to it.      so I need to come up with something better. It seems
They’re reasonably small and I could probably do the        apt to pick a Finnish name given that I’ve just moved
whole thing on my own. Eureka!                              here, so I fire up Google translator and start putting
   When the hangover subsides I get up and start            in words: Magic, Spell, Charm, Enchantment… Bang!
work on a quick prototype. It instantly clicks. I think     There it is: Lumo.



                                                              www.linuxvoice.com                                                                       29
     FEATURE THE BIRTH OF LUMO

                                                                                              jumping, so there’s plenty of footage. The inner DJ in
  Some of the neat gaming elements,                                                           me has taken over. I’ve ended up syncing everything
  such as blocks merging and floating                                                         to the music. Er, don’t do that. If I’m honest, I don’t
  away, needed to be carefully slotted into
                                                                                              have a plan on how to promote the Greenlight, I’ll just
  the level design so as to not break the
  immersive qualities of the game.                                                            see what happens.
                                                                                                 I push the ‘Go’ button on 12 March and Lumo
                                                                                              stays on the front page of the Steam Greenlight
                                                                                              Community for ~5 days before dropping off, along
                                                                                              with most of my traffic. I’ve posted to every related
                                                                                              Facebook group that I can think of, along with G+,
                                                                                              but, predictably, this isn’t making much of a mark.
                                                                                              I’m a bit worried that I’ll be stuck in the process for a
                                                                                              couple of years as I’ve heard some horror-stories…
                                                                                                 And then there’s a bit of luck. Rob Fearon
                                                                                              championed the game in his monthly roundup and
                                                                                              the day after dome.fi – a Finnish game and movie
                                                                                              news site – picks it up. There’s a noticeable spike in
Linux software                                                                                traffic and I make it to the Top 100.
Because Unity3D’s editor          January – March, 2014                                          I’m there for a week when Valve greenlights a
didn’t support Linux when         I’ve been having a bit of fun by sneaking in the            new a batch games, so not being included is a
the project started, most of      odd reference to old developers. I doubt anyone             blow and I have no idea when the next batch will be
Lumo’s development was done
                                  will notice these but they make me chuckle. Some            pushed through. I decide to send out some emails
under Windows. But Free
Software – running on Linux       crates have “A.C. & G. Ltd” on them, as a nod to            to gaming websites in the hope of getting some
– played an important and         Ashby Computers & Graphics Ltd which, it was                news pieces, but I hear absolutely nothing back. The
crucial part. All of the audio,   pointed out to me, became Ultimate Play The Game,           traffic to the Greenlight page starts trending down
from the spot effects to music,   before later turning into Rare. Carpets and curtains        sharply so I begin posting to Reddit and joining the
passed through Audacity.
                                  have borders that mimic the box art of early Ultimate       #screenshotsaturday posts on Twitter. I continue
Krita and Blender were
ever-present. ImageMagik          games (Knightlore and Mire Mare) and there’s a bit          this pattern, every Friday and Saturday, for a month,
was used to bulk-process          of graffiti on the wall saying “JR (John Ritman) &          but I need a new screenshot of the game each week.
textures. The C# classes          BD (Bernie Drummond) Woz Ere” above two little              It puts the pressure on being productive!
containing foreign language       skulls. Head Over Heels made it into the game! I’ve            There’s no obvious end in sight so I try another
strings were generated by a
                                  also taken part in the first, unofficial, Twitter ‘Googly   push with the gaming websites, but this time I
Python script, which parsed a
Libre Office Calc spreadsheet.    Eye Challenge’ after Rob Fearon suggested that my           include a mini CV of the AAA games I’ve made in
The company website and           boxes weren’t ‘Rare’ enough. They’re now walking            the past and a story about how I’ve left the previous
blog is hosted on Ubuntu.         around with eyes that follow the player. Very cute.         studio I was a co-founder of. Within an hour I hear
Git was used for source              Lighting is still in constant flux, but I’m liking the   back from Kotaku, which posts the news to its site
control. Without FOSS Lumo
                                  dark and spooky feel that the castle has, even if I         the same day. The day after, Eurogamer picks it up,
simply couldn’t exist, which
is why my other machine is a      do keep changing the colour palette. The ambient            and then Rock Paper Shotgun. I’m elated and wait
Thinkpad running Linux Mint       audio bed I’ve put in – consisting of little creaks and     for the inevitable bump in traffic to the Greenlight
Cinnamon edition.                 groans – seems to be working well and there’s a             page. Which never comes. Uh.
                                  distinct vibe forming. It’s coming together.
                                     So, I’m going to need to make the game public
                                  (rather than just my Twitter feed), and the quick way
                                  to do that is probably the Steam Greenlight process.
                                  I’m going to need to distribute via Steam anyway,
                                  but in order for this to happen I need to have some
                                  screenshots and a gameplay trailer. The latter is a
                                  problem. I’ll need at least a minute, preferably two,
                                  of gameplay and it’s going to need to show more
                                  than just running and jumping. It’s time to make an
                                  instance of each of the game mechanics that I’ve
                                  scribbled down in my notepad and see if I can chain
                                  them together into something that looks like a game!

                                  March – May, 2014
                                  The first week of March is spent editing together
                                  the Greenlight video (https://www.youtube.com/
                                  watch?v=7yQL8UP0TL0). I have just over 30 rooms             Steam’s Greenlight process is a nerveracking rollercoaster
                                  to choose from, mainly showing running and                  of statistics and publicity opportunities.




30                                                                www.linuxvoice.com
                                                                                           THE BIRTH OF LUMO FEATURE

  The day after the RPS piece I wake up to people
congratulating me over Twitter – for what I have no
idea – until I check my email and see the email from
Valve confirming that I’ve been Greenlit. Phew!
  In the end Lumo was in the Greenlight process
for 35 days. More than 30k people hit the page
and there were 9k Yes votes. It’s the first properly
stressful part of the project, but it’s done.

May–August 2014
I’ve told myself that I’m officially in ‘Production’.                                                                 Each section in the game
That means doing some of the chores I’ve been                                                                        has different textures and
putting off, like front-end, sound effects and actually                                                              a different feeling, like the
settling some of the outstanding design questions.                                                                       parts of a large castle.
What powers will the player have? Will the game be
centred around puzzles or skill-based? Should there
be spells? How is the mouse best used?
   And then I start getting some interesting emails.      church zone, full of cobwebs and spiders! I’ve also
One of the console manufacturers is interested in         made great progress with the warp zone. Three of
Lumo appearing on its platform. They’d like to see        the mini-games are in and I’ve made some crazy
my design docs and have me present my ideas.              little challenge rooms where everything is floating
This is a bit of a problem, because – other than          around the player. I’m really happy with how this
some notes scribbled on paper – there is no formal        part is shaping up (and the fact that there’s a Bubble
design doc. I’ve purposefully not written one. One        Bobble reference in there!)
of the things that’s been so joyous about working             I’ve also got the Linux version working. There were
alone is the lack of paperwork associated with            a lot of shader issues that needed fixing up, so all the
professional game development. For the most part I        hard surface reflective shaders were removed and
just wake up and build whatever is in my head. I put      the water replaced. But it’s rock solid, and performs
a presentation together to start the conversation and     every so slightly faster than the Mac version on the
hope they don’t need too much, too quickly.               same hardware. Happy with that.
   Up to now I’ve only been considering Lumo for PC,
so assumed a mouse and keyboard control system            December 2014
(with the mouse being used to deploy spells, which        I’ve changed the lighting, again. I’ve now got two
I’ve yet to think up). Putting it on console would        ‘suns’ in the world, one for each of the back walls.
mean supporting joypad. This could work; in fact,         These are different tones (one warm, one cold) so
it might actually suit what I’m doing, as the original    everything’s starting to pop a little more. I’m also
8-bit games only had one button. What if I stuck to       colour-grading the final image. This is a lovely little
the genre and made Lumo a one-button game?                trick that takes the colour of the pixel intended for
   By the start of August I have a very rough-and-        the screen and pushes it through a look-up table.
ready build with a first pass at the game flow. I take    The look-up table enables you to
this to Assembly (a demoscene/LAN party held              bake-in adjustments – contrast,
yearly in Helsinki) to show it to a few people and it     saturation, brightness, tone etc
immediately becomes clear that no one has played          – so gives you fine control over
an isometric game in years. Getting through my            the final image, without having
rooms is proving to be too much of a challenge. I         to do work to the individual
need to seriously simplify the start of the game. Gah!    textures. I remake the
                                                          Greenlight video (https://
September–November 2014                                   www.youtube.com/
I’ve entirely re-worked the flow of the game. There’s     watch?v=M7vVXTeCepA)
now a section at the start that focuses on controls,      at 60fps to show this off.
followed by another 30 minutes gameplay where
I’m slowly introducing most of the mechanics that’ll      January–March 2015
be reused throughout the game. I’m not happy              I’ve hit a nice rhythm with
with how linear this has turned out, but I don’t have     what I’m building now –
many options, as anything else has proven to be           ideas are coming thick and
overwhelming to new players.                              fast – but this is the busy
   I’ve also added an entirely new zone. My girlfriend    part of the year for teaching.
and I stumbled on a lovely old church in the country      I’m only getting a couple of
so I snapped a few photos of its walls and made           days work done in between
some textures out of them. I now have my own little       the commuting. I still have a



                                                            www.linuxvoice.com                                                                   31
     FEATURE THE BIRTH OF LUMO

                                                                                      to version 5. In some senses this is an improvement.
 Many of the game elements and                                                        Up to now I’ve had one version of Unity for PC and
 minigames pay homage to some of the                                                  different versions for every console, each of which
 greats, such as the arcade isometric
                                                                                      had its own bugs. With v5 everything should be
 classic shooter Zaxxon.
                                                                                      unified in one editor, with plugins to support console.
                                                                                         But there are other changes under the hood. The
                                                                                      code API has changed. Fortunately none of my
                                                                                      code was affected – I tend not to be fancy and was
                                                                                      already doing the things that the API change was
                                                                                      brought in to solve – but the same can’t be said for
                                                                                      code I was using from the Asset Store. I decide to
                                                                                      re-write all of this. I also bin the stuff used to create
                                                                                      the UI in order to use Unity’s new UI tools. This is a
                                                                                      complete re-write of the front-end, in-game and mini-
                                                                                      game UIs. Ugh.
                                                                                         If that wasn’t nasty enough, the lighting model
                                                                                      has changed. I’m reliably informed that the legacy
                                                                                      deferred pass won’t be optimised on console, so
                                                                                      I have to use the new GI/deferred lighting model.
                                                                                      This isn’t a small change. Every single material and
                           lot of conversations happening in the background           shader in the game needs to be re-done. Every room
                           about how to release the game, which is eating up          needs to be re-lit. I no longer have the old fog model.
                           time. Progress is slow, I’m low on cash and starting       Kill me.
                           to sweat a little.
                              The book model is done, I can animate pages, and        May–August 2015
                           I can render stuff to each of the pages, but this was      This is, by far, the most productive I’ve been on the
                           far more difficult than I expected. And it’s had some      game. The missing mini-games are written, all the
                           nasty side-effects, the biggest of which is pausing        cut scenes are done. I’ve made well over 100 rooms
                           the game. Up to now I was just freezing time, so           during the summer break. The game moves through
                           everything in the world was locked, but I can’t do         the tutorial section, before slowly opening up into
                           that and have animations and particle effects play         the final hub zone, and I think it’s starting to feel
                           reliably as the book moves through the world, so in-       good. The re-factoring for Unity 5 has stabilised and
                           game objects now have to detect they’re paused. I’ll       the three main skus are all running well and in sync.
                           be chasing little bugs around this forever, I know it.     I’ve no major platform-specific bugs.
                              I’ve got a Vita version working, albeit slowly, which      Everything I’ve thought up has worked first time
                           shows some potential, but I don’t really have time to      and I feel like I’m working like a well oiled machine.
                           optimise it. I drop this for now.                          More importantly, I’m finally making the stuff I
                                                                                      envisaged at the start of the project.
                           April 2015                                                    I’ve also signed a publishing deal. This is a much-
                           Unity – the game engine I’m using – has bounced up         needed injection of cash and support, so for once I’m
                                                                                      not stressing about that side of things.

                                                                                      September 2015
                                                                                      The publisher is taking Lumo to the EGX Rezzed
                                                                                      show in London. This will be the first time the game’s
                                                                                      been in other people’s hands since Assembly, a year
                                                                                      ago. I’m nervous as all hell. I also need to make a
                                                                                      specific build for the show and a new promotional
                                                                                      video (www.youtube.com/watch?v=fdK-HlHavM4).
                                                                                         Fortunately the reaction from the show is
                                                                                      amazing. Several people are calling it the game of
                                                                                      the show, which is extremely flattering. Eurogamer
                                                                                      do a video on it and suddenly Lumo’s in the spotlight.
                                                                                      I’m quietly recovering from the palpitations I’ve been
                                                                                      having all month.

                                                                                      October–December, 2015
                                                                                      I’ve agreed to hit content complete by January so
                                                                                      that Just Add Water Developments can begin on the
                                                                                      console ports. I’ve got one section of the game left



32                                                         www.linuxvoice.com
                                                                                           THE BIRTH OF LUMO FEATURE

to do, about 30 rooms, then Steam integration, save
game, map, stuff like that. Seems fine. Of course, it
doesn’t work out like that.
   Most of November is knocked out with travel
to the UK for meetings, bits of PR and teaching. I
get all the rooms done, just, but I need to balance
the game and do all the integration stuff I’ve been
putting off. December becomes an almighty crunch
to get everything done. I’m working every waking
minute and starting to stress a little. The situation’s
not helped by constant bugs in the Unity engine.
Animations are breaking, the particle systems are
not firing, or flicking randomly about the world. UI
rendering picks up random garbage occasionally.
Reflections are dropping the frame rate to                   Even Lumo’s cover design is reminiscent of computer game adverts from the 1980s.
unacceptable levels and I have a crash on Linux that
I can’t debug. I roll back to an earlier Unity version
and things are stable enough to get to content             change to the serialisation order of components. I        Rendering
complete, but I’ve just had a glimpse of life over the     hack around this and I’m back to where I started.         As GPUs have evolved, so has
next four months.                                             It’s not been a good upgrade, but things get worse.    the way we program them. In
                                                                                                                     the early days hardware was
                                                           The specular lighting value in the rendering engine
                                                                                                                     ‘fixed function’ – geometry
January–March 2016                                         has changed. Every single specular material, in-          and materials were passed
This should just be a bugfixing phase, but it doesn’t      game, is broken. I could actually cry at this point.      through the pipeline and
work out like that. I find out there’s a problem with         I fight through the process of re-doing the lighting   processed in a pre-defined
Unity on Xbox One that requires me to pull out all the     and checking the materials in every room of the           way – but that restriction was
                                                                                                                     quickly lifted so programmers
audio using Unity’s in-built system and integrate it       game. It’s a rush job, because I have artists jumping
                                                                                                                     were able to write bespoke
into FMOD. There are thousands of audio instances          up and down at Just Add Water who need the                code (shaders) to define these
spread around the game and after December’s                scenes for the console builds. I get things close, and    operations themselves. This
antics I’m in full ‘Hulk Smash’ mode.                      throw the build over the fence. Looking back I didn’t     allowed for differing ways
   I’m also struggling to find a version of Unity that’s   do a great job at this – some of the rooms don’t look     to handle light in the world.
                                                                                                                     In the fixed-function days
stable across Linux, Mac and PC. Each has different        anywhere near as good as in previous builds and the
                                                                                                                     lighting was inflexible, but
bugs and I have crashes on Mac and Linux. In the           intro scene ends up being flat and lacking contrast.      with the advent of shaders
end I run with three different patch releases of Unity,    None of the metals look good. I’m probably the only       it was possible to process
one for each platform, and I do hacks on my side to        person that’ll notice, but it’s annoying nonetheless.     all the geometry before
get over individual platform bugs. Some of it’s filth.        I head to San Francisco for a PR trip, tired and       calculating the lighting
                                                                                                                     (deferred), reducing the cost
Because of this I also have to move off Unity 5.2.x        worried about how the US press will take the game…
                                                                                                                     and increasing the number
and go to 5.3.x. Another API change has been made,                                                                   of lights you could have in a
which affects a fair amount of my code. All the            April–June 2016                                           scene (with some caveats).
particles need fixing, again, and the scene loading is     We’re due out on the 24 April but we’re not going to      Due to the quest for more
different. This introduces a weird race condition into     hit the date. Unity bugs blocked one of the console       photo-realism, many game
                                                                                                                     engines have moved beyond
the start-up of the game that turns out to be a subtle     versions right from the start and we’re stuck in cert
                                                                                                                     rendering how direct light
                                                           with another. For everyone’s sanity the date gets         affects objects to include
                                                           pushed back a month and I’m in limbo.                     indirect lighting, or ‘light
                                                              In the end we hit the 24 May date with four of the     bounces’, as well. This is
                                                           skus. Xbox one and Vita follow behind. I receive an       called ‘global illumination’, but
                                                                                                                     because of the constraints
                                                           email from Eurogamer to let me know that they loved
                                                                                                                     of having to render a scene
                                                           the game, and finally I get a decent night’s sleep.       in real time, this is often a
                                                              The rest of the month is a blur of interviews,         cheat and may only include
                                                           podcasts, 4am Twitch streams and fixing some              ‘ambient’ light, often taken
                                                           small bugs I notice as people are playing. I also start   from something like the sky
                                                                                                                     that surrounds the world.
                                                           on the Director’s Commentary series for YouTube.
                                                              It’s been a rollercoaster getting to this point, but
                                                           I’ve done what I set out to achieve. Lumo’s a niche
                                                           game, admittedly, but watching the first speed-run of
                                                           the game on YouTube and hearing that people have
                                                           already rinsed it for the achievements is a fantastic
                                                           feeling. Turns out there were quite a few people –
The subtle lighting in the game caused a real problem      like me – who loved those old isometric games.
when a Unity update changed everything as the game         I’m hoping someone else picks it up from here and
neared completion.                                         makes some more.



                                                             www.linuxvoice.com                                                                   33
     FEATURE OLD HARDWARE




                                                                            OLD
                                                                             HARDWARE

                                                                            NEW
                                                                            GNU/LINUX
                             Andrew Conway never throws anything away –
                                  not when he can install Linux on it!


        W
                     hat's the oldest bit of      from overseas. Sadly, it was sick. I     and Gmail duties more capably than
                     hardware you still have in   assumed some hardware had finally        ever before.
                     active service? A few        failed and I would have to say             Us Linux users are loath to
        weeks ago, a laptop I'd given to a        farewell. But no, it turned out that     abandon older hardware because
        relative came back to me. But this        the old version of Firefox shipped       we know that the right distro can
        wasn't any old laptop: I'd bought it      with the ancient version of Linux        breathe life back into it. Here's the
        over a decade ago and it was the          Mint wasn't able to cope with Gmail.     story of a few devices over the last
        very first laptop on which I installed    I installed a more recent distro on it   decade and their journeys from
        Linux myself. Call me sentimental,        and it was soon back at my               Windows through various Linux
        but it was like an old friend returning   relative's house doing its light web     distros.




        MEET THE FAMILY                                                                                             My laptop family
                                                                                                                     and other Linux
        Here's the family photo. Apologies        EasyNote's granddaughter, Dot U,                                          devices
        for it being somewhat dusty but           also of the clan Packard Bell, has
        they're having to pose down the           benefited from a battery transplant
        back of the TV because old Auntie         some years ago. Although her
        Eee PC cannot leave her wired             hardware is in good nick, she's a
        connection as she's gone a bit deaf       little flimsy and developed a nasty
        in the old Wi-Fi department and is        crack at the laptop hinge. The
        busy doing essential server jobs.         whippersnapper, young master Dell
        The handwritten Mattel label was          XPS 13, is fast, elegant and well
        affixed by a jealous MacBook user.        built. Although he had a troubled
        Grandpa EasyNote is the oldest on         childhood which involved major
        show and despite being 11 years           motherboard surgery and some
        old is in rude health except for his      temporary kernel hackery, he's been
        dead battery and a mysterious             a sturdy workhorse for three years,
        scorch mark near his LEDs.                and is helping me write this article.




34                                                        www.linuxvoice.com
                                                                                    OLD HARDWARE FEATURE



PACKARD BELL EASYNOTE
Shipped OS: Windows XP; My OS: Slackware 11,12&14 , Mint 11 ; AMD Sempron
3100+ 800GHz; 45GB HDD; 512MB upgraded to 1.5GB RAM; 3kg; 15.4” screen


In 2005 I spilled a mug of coffee        conundrum to my Dad,                     Packard Bell Easy
over my laptop and it died. I had        who reached into a pile                  Note R0422
urgent work to finish, so I rushed       of DVDs and handed
out to the nearest high street store     me one that had
and bought the cheapest new              Slackware 11 written
laptop I could find: a Packard Bell      on it. I took the DVD
EasyNote for £299. It was only           home, stuck it in my
meant to tide me over for a few          desktop machine
days, and then become the office         and, after reading
spare. But to my surprise it had a       some instructions,
good screen, sturdy keyboard and         managed to get
ran smoothly enough. Under               it installed, dual-
Windows XP, I used Outlook for           booting alongside
email, NetBeans for Java coding,         Windows 2000.
Microsoft Office for documents and           Installing Linux on
Internet Explorer for the web.           the EasyNote was much
                                         less straightforward.
Enter, Linux!                            The first issue was that X
Then over lunch one day soon after,      windows wouldn't start. After
a friend of mine recommended I           some random fumblings, I found X
read The Cathedral and the Bazaar by     windows worked if launched by the
Eric S Raymond. I did, and after         root user, and some web research
reading further afield I found that      told me the problem could be fixed      first issue was that Slackware 11's
Linux was still alive and kicking. You   with a permissions option in a file     2.4 kernel didn't have a driver for it,
see, I'd used Linux on my desktop        called xorg.conf. This was the first    but there was an option to switch to
PC from 1995 to 1999 and for             of many occasions where I'd find        the 2.6 kernel. Doing this provided
scientific data analysis in the                                                  a driver, but still no network device.
following years, but by 2004 I'd                                                 After much searching I found
ended up in Microsoft-land because                 After a bit of                some source code for an updated
I'd left academia and was working in                                             kernel module released by the
                                                 reading around I
a more traditional office                                                        manufacturer. When perusing
environment. Despite my history of
                                               decided to switch to              the various files that came with
Linux use I was quite ignorant about           Linux –Debian – but               it, I found some very handy notes
GNU/Linux's free software                     I got confused by the              made by a chap called Alan Flavel.
underpinnings.                                 various Debian ISOs               By some great coincidence, Alan
   My first step was to replace                                                  shared an office with my Dad many
Outlook with Thunderbird and                                                     years before at Glasgow University,
Internet Explorer with Firefox. Next                                             but the touching aspect to receiving
up was replacing Microsoft Office        myself rummaging around inside          his virtual help was that he had died
with OpenOffice (no LibreOffice back     xorg.conf's innards: sometimes          the year before. Thanks Alan.
then). After a bit of reading around I   just to get X to work, other times          Once I'd got Linux set up, it was
decided to switch to Linux – Debian      to exploit X's flexibility in getting   simply a matter of importing emails
– but I got rather confused by the       unusual display configurations          and bookmarks from Thunderbird
fact there were various different        working. These days xorg.conf gets      and Firefox on windows over to
Debian ISOs to download. The             automatically generated on the fly      Linux. Also, as NetBeans runs on
prospect of installing an operating      and I've not had to edit it in years.   Java, it was easy to get my Java
system was daunting enough for             But the battle with the X server      development environment up and
me without the added confusion of        was minor compared to the beast         running. OpenOffice worked fine too,
understanding what the different         that was the Wi-Fi driver. The          and so I switched to working under
distro editions were for. The matter     EasyNote's Ralink RT2500 chipset        Linux full time and I've never looked
was settled when I mentioned my          was still quite new back then. The      back.




                                                 www.linuxvoice.com                                                        35
     FEATURE OLD HARDWARE



        FROM NETBOOK TO SERVER
        Shipped OS: Xandros; My OS: Slackware 13, Tiny Core, CentOS 6 ; Intel Atom          it suffered from hard drive clicking.
        1.6GHz, single core; 160GB HDD; 1GB DDR2 RAM; 1.45kg; 10" screen; £349
                                                                                            This was caused by its head parking
                                                                                            every eight seconds or so, and as
        The main problem with the                year-old son from school. A                the design lifetime is typically for
        EasyNote was its weight. At over         message to developers: software            300,000 parks, this means that if
        3kg it became a literal pain in the      bugs can lead to tears!                    run 24/7, it would reach its design
        upper arse (lower back) especially                                                  limit in a month or so. The solution
        as I found myself travelling a lot       Time to upgrade                            is to issue this command:
        more for work. For this reason, and      The Eee PC solution served me well         hdparm -B 255 /dev/sda
        because I now understood how to          for some time but eventually the               This tells the first hard drive (sda)
        get the most out of fairly modest        Intel Atom single-core processor           to run without any power saving
        hardware with Linux, I bought a          and 1GB of RAM proved too limited          optimisations and you can ensure
        netbook: the ASUS Eee PC 1000H.          for certain tasks (in particular           it runs on every boot by placing it in
        When on my desk it had a separate        virtualisation). I replaced the Eee        the file /etc/rc.local.
        keyboard, mouse and an external          PC with the Packard Bell Dot U for             Encouraged by this success
        monitor. It got a lot of use on the      daily use and turned the Eee PC into       I installed tt-rss (tiny tiny RSS)
        Glasgow to London train and with         a server.                                  which manages my RSS feeds,
        battery upgrade it was easily                                                       and OwnCloud, which I use mainly
        capable of lasting a five-hour                                                      to manage files. OwnCloud worked
        journey, but working on a 10-inch               The EeePC draws                     well at first but in time problems
        screen presented problems even                                                      emerged with the desktop sync
        with KDE in netbook mode.
                                                       about 12W, which is                  client. It'd report the server giving
          I experimented with a tiling                  not much above a                    mysterious 500 HTTP errors and
        window manager – dwm with                      Raspberry Pi with a                  conflicts were flagged for files
        dmenu – as having each window                  separately powered                   which definitely were not conflicted,
        using the whole screen made a lot                USB hard drive                     ie the local and server files were
        of sense. Alas, although dwm was                                                    identical. This was annoying but
        stunningly fast and worked well for                                                 seemed to be harmless and after
        most things, NetBeans refused to                                                    checking carefully a few times I
        work on it, so I went back to KDE.          I installed a minimal CentOS 6          got into the habit of deleting the
        KDE 4 was still a little buggy at that   on the Eee PC, diverted incoming           pointless conflict files.
        time and it let me down badly one        traffic through my home router to it           But this was a bad idea. It finally
        day when the KDE taskbar crashed         on port 80 and some others (I don't        came to a head when I lost a chunk
        and froze the clock, which made          use 22 for SSH, nor 443 for HTTPS)         of a book I was writing because the
        me late for picking up my six-           and got Apache running. Next,              OwnCloud sync client replaced a
                                                 with the help of some Dynamic IP           freshly edited text file with one from
                                                 services (dyn.com and later noip.          the week before. What's worse is
                                                    com) I set up the DNS for various       that I'd deleted the conflict file with
                                                        domains that I owned so that        the rm command and the OwnCloud
                                                          their websites could run on       directory only got included in my
                                                             the Eee PC.                    weekly, not daily backups. A week's
                                                                 The EeePC draws            work gone. The problem turned out
                                                               about 12W, which is          to be that I'd set SQLite as the back-
                                                                 not much above a           end database rather than MySQL.
                                                                  Raspberry Pi server       The OwnCloud team recommend
                                                                  with a separately         you don't use SQLite on a production
                                                                   powered external         server and I'd just found out why. It's
                                                                   USB hard drive           probably OK for a small set of files,
                                                                    attached. The           but mine had grown to thousands
                                                                    160GB internal drive    of files and GB of data over the
                                                                   is fine for its server   years. Fortunately the OwnCloud occ
                                                                   duties, but I noticed    tool made short work of the SQLite
                                                                                            to MySQL conversion, thus solving
                                                             Asus EeePC 1000H.              the problem.




36                                                       www.linuxvoice.com
                                                                                          OLD HARDWARE FEATURE



   THE YOUNGSTERS
   PACKARD BELL DOT U Shipped OS: Windows 7; My OS: Slackware 13;
   Intel US5400 1.2GHz, dual core; 250GB HDD; 3GB DDR3 RAM; 11.9"
   screen; 1.3kg; £450
   DELL XPS 13 DEVELOPER EDITION Shipped OS: Ubuntu 12.04LTS;
   My OS: Slackware 14.1; Intel i7, 2GHz, dual core, 4 threads; 256GB
   SSD; 8GB DDR3L RAM; 13.3" screen; 1.36kg; £1,100

   The Eee PC's replacement, the             screen and lesser
   Packard Bell Dot U, didn't feel that      weight made it more
   much faster, but the slightly larger      convenient for use on the
                                             move. The extra 2GB of                Packard Bell Dot U.
                                             RAM over the netbook was
                                             also welcome, especially for
                                             running virtual machines, but to
                                              my dismay the Intel U5400 CPU
                                                lacked virtualisation extensions.
                                                  This made a big difference in
                                                   some cases; for example,
                                                    Qemu fell back on emulation          My current laptop is the Dell XPS
                                                     and so ran like a slug on a      13 Developer Edition, which came
                                                     marijuana plant, but             pre-installed with Ubuntu 12.04LTS
                                                     thankfully VirtualBox            but currently runs Slackware 14.1,
                                                     performance wasn't too bad       and will soon go to 14.2. I can safely
                                                    (for reasons I never quite        say that after three years of daily
                                                   understood!). Although I didn't    use – once a few teething problems
                                                  choose this laptop for its Linux    were resolved (see my articles on
Dell XPS 13 developer                           compatibility, it was so easy to      Slackware in LV006 and Kernel
edition (2013).                               install Slackware that it was           Parameters in LV009) – the XPS 13
                                             almost boring. Everything worked         is the best laptop I've ever owned.
                                             out the box.                             It's also the most expensive!




   EMORTALITY
   What will bring these devices to the      updates will end in November 2020.        service as a server, following an
   end of their lives? A failed hard drive   Well before that time, the third-         SSD drive transplant, or else use a
   is probably most likely, but this is      party repositories such as EPEL           Raspberry Pi 3 running Raspbian
   not terminal, as hard drives are          might not provide recent enough           with an external USB SSD drive. My
   reasonably easy to replace, even in       versions of PHP for OwnCloud and          preference though is to keep my
   laptops. In fact, I'm expecting this      other key software. There will be no      old hardware in use for as along
   for my Eee PC, and my plan is to          upgrading the Eee PC to CentOS 7,         as possible with the proviso that it
   replace its aging spinning hard drive     because it is only available for 64-bit   is not too power-hungry relative to
   with a fast SSD one. The bigger           architectures and the Eee PC's Intel      more modern technology. I'd like
   worry is failure of bearings inside       Atom is 32-bit.                           to say it's because I'm conscious
   the fan – if it stops spinning then                                                 that we live on a planet with limited
   the overheated CPU may well suffer        This mortal coil                          resources, which is true, but if
   terminal damage.                          No server lasts forever of course,        I'm honest it's also because I've a
      But there's another issue. CentOS      so at some point in the next two          certain, sentimental attachment to
   6 will stop getting full updates          years I expect I will either press        my aging devices especially if Linux
   by June 2017, and maintenance             my 64-bit Packard Bell Dot U into         can make them useful.




                                                     www.linuxvoice.com                                                        37
     FAQ OSVR




OSVR
MICHEL LOUBET JAMBERT
                        The new standard in Virtual Reality could be open source.


       So what does OSVR stand for
                                             controllers. However, there are a few
                                             caveats, the most striking of which is
                                             that it isn’t available on Linux yet,
                                                                                           will be a number of hardware
                                                                                           manufacturers, the theory goes that
                                                                                           “market logic” will determine which
       and who’s behind it?                  despite it having being designed to           standard drives that hardware. History
       Really? Open Source Virtual           complement the Linux-powered Steam            shows though that, it’s not always the
       Reality… Seemed kind of obvious,      Machines also developed by Valve.             best one that wins, nor is it logic that
though I guess it could have been            Support is expected to arrive at some         determines the winner in many cases.
Operating System Virtual Reality, but        point, but who knows when. The name              Some advances are being made on
that doesn’t make much sense. As for         is also somewhat misinterpretable             the fragmentation side of things
who’s behind it, it’s an open project with   since, though the source code is              though, and Valve has already
a bunch of industry backers, ranging         available to look at, gratis, modifiable      announced that it will be collaborating
from big-name video game industry            and redistributable, it is more restrictive   with OSVR. This could mean any
companies to lesser known                    in the sense that it must retain the          number of things so there’s not much
manufacturers, as well as a few              Valve copyright.                              point in being too speculative, but it
academic institutions interested in the                                                    does show that Valve isn’t intent on
educational and technological aspects               Fair enough, but with Oculus           putting up a fight and possibly willing to
of VR over its gaming uses. If you’re               Rift, OpenVR and a few others,         let the best standard win. However, if I
familiar with game developers, then          isn’t VR already fragmented enough            had to put money on it, I would say that
some well known names are Ubisoft,           considering it hasn’t really reached          some sort of open (or semi-open)
Techland and Gearbox, the latter two of      the mass market in any significant            standard will come out on top,
which have games out on Linux already.       way yet?                                      considering that on the development
                                                    That’s a good point, but then this     and OEM side of things, people will
     That’s great, but isn’t OpenVR                 often happens when a new               want to look at the source code and
     already a thing?                        technology comes out and a standard           make changes to suit their software or
     True. OpenVR is the VR                  gets established. Remember VHS vs             hardware, based on how successful
     ecosystem developed by Valve            Betamax or Blu-ray vs HD DVD? This is         Android has been in the mobile space.
and HTC for their Vive VR headset and        kind of the same thing, and while there
                                                                                                  So what sets this technology
                                                                                                  apart from the rest?
     It’s an open project with a bunch of backers,                                               Well, as I alluded to before, there’s
                                                                                                  the Linux support and the whole
     ranging from big-name video game industry                                             free software licensing thing – more
                                                                                           specifically, OSVR uses the Apache
     companies to lesser known manufacturers                                               Licence. There’s also the hardware, with



38                                             www.linuxvoice.com
                                                                                                               OSVR FAQ

each manufacturer having developed
their own standard to go with it, but
OSVR leaving the door open for anyone
to grab it and sell their own hardware.
Like Valve’s policy of sending advances
of prospective sales to developers,
OSVR also has its own financial
incentive in the form of a $5 million
fund which developers can apply for if
choosing the VR ecosystem, which
could be more attractive since it isn’t
necessarily based on sales.

       What’s the hardware like for
       OSVR then?                                                                                          The Razer HDK2 uses the
       The current offering is a lot                                                                       OSVR standard .
                                                                                                           (photo: OSVR).
       cheaper than the Oculus Rift and
the HTC Vive, that’s for sure. The
second generation HDK2 (Hacker               to get you started as well as guides on        With OSVR, there’s potential for console
Development Kit 2) from Razer sells for      how to use OSVR on some different              manufacturers to use the standard with
around $399, compared to $499 for the        game engines. Speaking of which, it            their own headsets rather than
Rift and $799 for the Vive, so it’s          would also be a good idea to get               developing their own from scratch,
certainly the more accessible option.        yourself a game engine installed to            which is a lot more likely than some
Most reviews do claim it to be not quite     develop on. Currently supported                sort of partnership with the other big
up to standards with the other two in        engines include the Unreal Engine,             companies behind the other standards,
terms of visuals, but then VR as a           Unity, CryEngine and Blender, so there’s       many of which are competitors. This
whole is far from perfect right now, so      already a good mix of gratis and libre         logic also applies to other uses for VR,
that should be taken with a grain of salt.   Linux-supported engines with which to          such as research or more adventurous
  In specific terms, the HDK2 has a          build games and other things, and even         companies looking to create new forms
2160x1200 OLED display refreshing at         create commercial-grade games                  of entertainment. Likewise, the
90hz, an IR camera for position tracking     considering these are among the most           cross-platform nature of an open
and decent user adjustment options.          widely-used out there. If you’re new to        standard such as this one is a huge
On the controller side of things, the        game development, something like               advantage in gaming specifically, since
HDK2 doesn’t have its own, unlike the        Unity would be a good bet, since it’s          developers want to sell as many copies
Vive. However, it has the advantage of       user-friendly and there are plenty of          of a game as possible and being locked
supporting a multitude of different          tutorials and free assets available            out of certain platforms, or having to
devices, ranging from XBox controllers       online, though Blender Game Engine is          incur extra costs of porting to them, is a
to WiiMotes and competing devices,           a great option if you want to stick with       huge drawback.
showing off some of the advantages of        FOSS only.                                        Then again, with that logic, DirectX
an open model and leaving things open                                                       shouldn’t really be as pervasive as it is,
for OEMs to create their own                        How do you see the chances of           which goes back to these things not
peripherals. All things considered, it              success for OSVR as a virtual           always being defined by logic. One
might well be the most appealing             reality standard?                              thing that is certain though is that it will
device out there in terms of cost-                  It’s too early to say with certainty.   come down to a mix of adoption by
performance ratio, and the only device              The cooperation with Valve is a         both consumers and developers, since
usable with Linux. However, given the        good start since, although VR could            people will want the platform with the
small amount of VR titles available as a     have many potential applications,              most games and developers will want
whole and even less using OSVR, none         gaming is likely to be the area in which       the platform with the biggest user base.
of these devices are that appealing right    the teething stages of the technology          Success is also largely tied to the
now to those who aren’t either gaming        are carried out, considering there’s a         success of VR as a whole, since if it
enthusiasts, tinkerers or developers         market for it already, and having the          turns out to be niche, there’s only a
looking to take their first steps into VR.   standard supported by the biggest              small pie for the OSVR standard to take
                                             vendor of PC games in one way or               a slice of.
      So where do I sign up to get           another is a very good start.                     On the flipside, if the VR market turns
      developing with this thing?              Being an open standard also has a lot        out to be larger, then an open project
      A good start would be to order a       of benefits, not just from an ideological      which doesn’t require vast amounts of
      set first – it’s called the Hacker     point of view, but more that it keeps          money being pumped into it has its
Development Kit for a reason. You            doors open for third parties to make           clear advantages. Check back in a year
should also head over to osvr.github.io      their own hardware and adapt it to their       or two for more clarity, but OSVR has a
for some resources and documentation         needs, as we’ve seen with other cases.         fighting chance in the meantime.



                                                               www.linuxvoice.com                                                   39
     INTERVIEW MARTIN WIMPRESS




                                                               “
                                              Maintaining lots of Arch
                                             Linux machines from afar
                                             meant that my Christmases
                                               and Easters and family
                                             holidays were basically me
                                               doing tech support for
                                              everybody in the family




MARTIN
WIMPRESS                                     The man who’s everyone’s Mate


A
       s well as being one quarter of            Ubuntu Mate. It may be new, but it’s already     on the Raspberry Pi, thanks in large part to
       the Ubuntu UK podcast, Martin             made a name for itself as a blend of new         the massive efforts that Martin puts into it.
       Wimpress is also responsible for          technologies with a classic interface. It’s      We caught up with Martin to find out what
the youngest official Ubuntu flavour –           also the first of the desktop Ubuntus to run     to expect in coming versions of the distro.




        Can you tell us a little bit about how   she got her first Android phone, and she did     that time). This got back what she was
        Ubuntu Mate got started?                 everything on the phone. A couple of years       familiar with (because she’d been using
Martin Wimpress: Well, the genesis of the        go by and she really hasn’t used her laptop      Ubuntu since 6.06) and wedded bliss was
project is really that I got involved in Mate    at all, then one evening she decides that it’s   restored. She could organise the photos
itself. Very briefly, I was using Ubuntu but     the time to sort out baby photos and tries to    again because it was all as she expected.
wasn’t happy with the way Unity was going        use Gnome 3 – stern words were                      As I put Mate on, I noticed that there were
in the very early days, so I switched over to    exchanged as she wasn’t familiar with this       some bugs and rough edges, specifically
Arch. I was using Gnome 3 and I switched         new fangled thing. Very hastily, I removed       around the packaging for Arch. I was
my wife’s laptop over to Arch, also using        Gnome 3 from her Arch laptop and put Mate        thinking, “My wife’s happy with this, I need to
Gnome 3 – this is about the same time that       on (I wasn’t involved in the project at all at   fix these things so I don’t have the next



40                                                           www.linuxvoice.com
                     MARTIN WIMPRESS INTERVIEW




www.linuxvoice.com                               41
     INTERVIEW MARTIN WIMPRESS




  Like us, Martin’s a podcaster – tune in to
  ubuntupodcast.org to hear his measured,
  calming tones.


problem and the next problem…” I               environment. The genesis of the project     in this thing. That’s when I stepped
started contributing fixes to Mate and         was Popey making that initial draft.        thought that if there’s potential for it to
working on packaging it for Arch. That’s          Popey and I then took a day off work     be popular, I’m going to go all in – I’d
how I got involved with Arch. Roll on a        – we went over to Popey’s house and         only got my pride to lose.
couple of years, and most of the family        we did a one-day sprint on how this            I started to make alpha and beta
(who I had moved over to Ubuntu in the         was going to work. We basically fleshed     images and the download numbers
6.06 era) are now running Arch with            out the goals of the project and set the    were constantly growing. There was
Mate on their laptops. That wasn’t             wheels in motion on that day. The
working particularly well for them
because Arch Linux is an attention
                                               purpose was to recreate that
                                               experience that my family were familiar
                                                                                              The core team that
whore and maintaining lots of Arch             with, because they’re not technical            contribute regularly is
Linux machines from afar meant that            – they don’t want to re-learn how to use
my Christmases and Easters and                 their computers, they just want to pick        about 7 or 8 people
family holidays and get-togethers were         it up and do what they want to do, put it
basically me doing tech support for            down and forget about it – they’re not      definitely a groundswell of popular
everybody in the family. They weren’t          interested in learning anything new. So,    opinion, and it’s just grown from that.
happy with that and it wasn’t going            that was the origin – making what they
particularly well for me.                      had before a thing again. It sort of              How big’s the team of Ubuntu
   Then I did an interview about Mate          snowballed from there.                            Mate?
on the Ubuntu Podcast long before I                                                        MW: Well, the core team that
was involved in the Ubuntu Podcast. In               When you say that it sort of          contribute regularly is about seven or
this interview I pointed out that Mate               snowballed, was there a lot of        eight people. The lion’s share of the
was completely bust in Ubuntu. Popey           pressure from users to keep                 packaging work is actually done in
[Alan Pope, podcaster and all-round            developing it?                              Debian, so what makes Ubuntu Mate,
nice guy] was just outraged that this          MW: When I started on it, I thought “I      nine tenths of that actually happened in
was the case – this was off the air. A         need people to test it so I don’t give      Debian directly and it just syncs into
couple of weeks later he sent me a link        something to my family that’s               Ubuntu because that’s the relationship
to an ISO image that he’d made that            completely broken. If I give it to people   we have. I do most of my work in
was Ubuntu 14.04 with the Mate                 then I’ll get some feedback about it.” I    Debian – the only work that happens in
desktop stuck on top. It was very rough,       did that just on Google+ initially and it   Ubuntu is branding, artwork, and
but I thought, hmm OK, this could solve        spread like wildfire. Word got around       Ubuntu Mate Welcome, which is our
the problem – it’s a way that I could          and within a few weeks I was very           centrepiece.
give my family back that familiar              aware that there was a substantial            Within the Debian team, there are
Ubuntu platform with that familiar             number of people who were interested        three people (myself and two others),



42                                                              www.linuxvoice.com
                                                                              MARTIN WIMPRESS INTERVIEW

then a lot of the work is driven through
the Mate desktop team itself – there’s a
core team of about five contributors.
   Ubuntu Mate has several
crowdfunding platforms and we try to
push as much of that money as
possible back into development
projects for Mate desktop or Ubuntu.
We draw in money on a monthly basis
and I pay all the hosting and then I work
with the developers and look at the
projects that we’re interested in
developing, and then pay them to work
on specific tasks in a given month. We
pay as close as we can to the market
rate for development time for them to
work on things.
   The Mate desktop team has about
five or six people, then we have a pool
of people specifically on Ubuntu Mate
itself. They are not involved in Mate
upstream, they’re not involved in
Debian, they’re working specifically on
Ubuntu Mate projects. That’s two
people in addition to myself. There’s a
cast of thousands that do artwork and
they look after the forums, and just a
                                                                                                   Hands up who else does pro bono
ton of stuff that I can’t do. I can’t do
                                                                                                  tech support for their family when
anything artistic or creative at all, so I                                                              they’d rather be chilling out?
lean on the community for all that stuff.

       You mentioned that you                  small in Mate. Mostly it’s to do with         modern Linux operating system, but in
       created Ubuntu Mate because             bugfixes and tweaks and very small            terms of what the user sees and gets, it
you wanted a distro that your family           additions, not a wholesale overhaul.          hasn’t changes. We’ve removed a
could use because it was familiar              The UI is buttoned down, it’s defined, it’s   couple of minor things and we’ve added
and unchanging. Is this still how you          as it was documented by the Gnome             a couple of bits and pieces, but over all,
see the future of Ubuntu Mate?                 team all those years ago – we’re not          it’s just as it used to be, and that’s how
MW: Technologies underneath Ubuntu             changing that. What I do in Ubuntu            it continues to go.
Mate are changing rapidly and we’re            Mate is try and build some tools around
moving with those changes. Ubuntu              that to make it a bit more modern and             I believe that Ubuntu Mate was
Mate 16.10 is built entirely against GTK       make some conveniences that a                     the first desktop version of
3. That’s an ambition that we’ve been          modern desktop should have, but that’s        Ubuntu to work on the Raspberry Pi.
pursuing for a few years now, and we’re        not changing the fundamental base.            MW: Yes, it was.
the first distro to say, “right, we’re going
to jump”. We’ve just had 16.04 – a nice               Is this an ongoing commitment                Was that something at you
stable LTS [Long Term Support] – now’s                to not change the way Mate                   pushed?
the time to break all the toys and start       works – how it is now is how it will          MW: Way way back, I made a tool to
again, which is what we’ve done.               be in 10 years time?                          build an Arch Linux installation that
   We’ve invested about €3,000 since           MW: Yes. How it is now is how it will         works on the Raspberry Pi – this is the
16.04 in development projects to drag          always be. It’s a very unglamorous            original Pi with 512MB of RAM. I never
the GTK 3 support up to snuff. We’ve           project to be involved in because if your     quite finished that project and I always
got one outstanding issue at the               user interface is your shop window,           wanted to make a desktop for the
moment that we’ve got somebody                 that’s unchanging. What’s changing is         Raspberry Pi. When the Pi 2 came out,
committed to do the work and the               keeping up with the underlying                Popey said, “you should totally make a
money set aside for. But the move to           technology, so along the way we’ve            version that runs on the Raspberry Pi”,
GTK 3 is not a change in the user              adopted support for thing for things like     and I thought, I’ll do that when I find the
interface or the user experience, it’s just    GSettings and tossed out GConf, and           time. Someone in the community,
using GTK 3 to recreate that user              we’ve adopted support for systemd you         Rohith Madhavan, made the initial port
interface that everyone’s familiar with.       know – these are all things that you          and it was eight tenths of the way there.
The changes, the new features, are very        need to do to make a desktop work in a        Because so much of the work had been



                                                 www.linuxvoice.com                                                                  43
     INTERVIEW MARTIN WIMPRESS

done, I decided to pick it up and run        all of the Python stack and all of the     a H5 device [a low-level
with it, and from that point onwards I’ve    GPIO and all of the SPI and I2C and        communications protocol] but at that
maintained the Raspberry Pi build.           Scratch and MineCraft Pi Edition – all     time they couldn’t get the H5 mode to
   We had a hinkey version for 14.10,        of the things that people expect to be     work and they butchered it to work in
but the first proper version was 15.04,      on the Pi are on the Ubuntu Mate Pi        H4 mode with no flow control at all –
and I’ve really focused on that – it’s our   version.                                   that then requires that you patch Bluez
most popular version now [about half of         The PowerPC port was the same. I        quite heavily. It’s an incompatible patch
all Ubuntu Mate downloads are for the        didn’t create that. Someone in the         set so by building it for the Pi 3 you
Raspberry Pi]. Most people who are           community did the legwork and then I       effectively break Bluetooth for every
running Ubuntu Mate are running it on        was simply able to adopt their work into   other device out there as it’s very
a Pi 2 or a Pi 3. We’ve also made root       the official build system. All the         hardware specific. I now know more
filesystem available for ARMv7 so you’ll     architecture ports have come from the      about Bluetooth than I’ll ever need to!
find it when you ask for ODroid Ubuntu,      community and I’ve adopted them and
it actually comes with a sort of Ubuntu      made them official.                               What can we expect in the
Mate now, and the same on the Banana                                                           future of Ubuntu Mate?
Pi, Pine 64 and so and so on.                      Were the and major technical         MW: I’ve been interested in snaps
   It’s kind of become this ubiquitous             challenges in getting Ubuntu         [Canonical’s container-based packaging
Ubuntu thingy that you can run on all of     Mate to run on the Raspberry Pi?           format] since I first heard about them.
the ARM devices. As a spin-off from          MW: Yes – Bluetooth was a complete         I’ve been poking people at Canonical
that, I’ve become involved with the          pig to get working. I had access to a      saying “is now the time to do more with
Raspberry Pi Foundation and I was an         guy called Phil Elwell at the Raspberry    this?” and for a while it was, “No, this is
insider for the Pi 3. I got a prototype,     Pi Foundation over the course of those     very fast moving, very experimental,
and I was able to do some work so that       four days leading up to the launch and     just learn about the concepts, don’t
on launch day for the Pi 3 we had a          he was providing me with kernel            actually do anything with it”, but around
version of Ubuntu Mate that supported        patches, firmware blobs and what-          the end of last year, the very beginnings
all of the hardware features that the Pi 3   have-you. The Wi-Fi enablement came        of this year, I started poking Will Cook,
had to offer. That’s kind of a pet project   up within minutes – I was really           the desktop manager at Canonical, and
of mine and one that I’m keen to             pleased with that – but getting            saying “I’m really interested in doing
continue ticking over. So Ubuntu Mate        Bluetooth to work was a protracted         more with snaps, what is it you’re
on the Pi is a little different [to the PC   experience. There are some                 planning?” I got involved in the Snappy
version]. It’s the same base but it’s got    complications… Bluetooth in the Pi 3 is    play pens quite early on – making




  “Comparing KDE Plasma, Gnome 3 and Unity
  [on the Raspberry Pi], Unity works the best.”
  Shocking!




44                                                           www.linuxvoice.com
                                                                                MARTIN WIMPRESS INTERVIEW

      snaps for desktop applications – and
      then I’ve been on the Snappy sprint.
      Now I’ve got a good understanding of
      what that road ahead looks like.
         Probably not for 16.10, because
      there’s a lot of work to do for that
      anyway, but for 17.04 onwards, I would
      like to see snaps playing a significant
      role in Ubuntu Mate’s future. Our tag
      line is “for a retrospective future”: the
      retrospective bit is about the classic
      desktop environment, but the future is
      that there are new technologies and we
      have to move with these. We can keep
      our traditional paradigm but we have to
      move with the new technological
      movement – we can’t just be
      languishing.
                                                                               “As a spin off of making Ubuntu Mate for the Raspberry
         What we have now is a classic
                                                                                      Pi, I made a build system that can build all of the
      Ubuntu system that can install and run                                   Ubuntu flavours for the Raspberry Pi. There’s a website
      snaps, but alongside that, I’d like to                                        called ubuntu-pi-flavour-maker.org where you can
      work towards having a fully snapped                                                    download images for the Ubuntu flavours.”
      desktop environment. If we can offer
      both, you can choose a classic install or
      a snapped install. Where the snap           criticisms that snaps are larger than        different versions of the same runtime.
      installs really come into their own is on   they need be because they all carry the      Sometimes there’s a version of an
      things like the Raspberry Pi where you      same stuff over and over again), you         application that’s specific to a version
      can chain what are called gadget snaps      can now say that they need this              of Mate and as we lockstep move the
      and deliver your kernel, your base          platform snap and you don’t have to          desktop along, that application that
      operating system and your application       carry all that common baggage in each        hasn’t been updated doesn’t work any
      stack all as snaps and have atomic          of your snaps.                               more and it would be nice to still have
      updates across the whole thing,                                                          those things work – snaps enable us to
      particularly on ARM devices where                  What are the big advantages           to that.
      you’re targeting a very precise hardware           that you get from snaps?
      architecture and configuration options.     MW: The main one for me is that as                  It sounds like there are some
                                                  Mate upstream, we’re already making                 quite big releases coming up
          In this setup, would the Mate           tarballs with build systems in them, so      for you with GTK 3 and then snaps.
          desktop fit in its own snap?            we’re delivering packages, so of course      MW: Yeah. we’ve done the big work
      MW: Yeah, so this was something we          every distribution under the sun then        with GTK 3 and the snaps will keep us
                                                  has to repackage that. We all sit there,     busy for a little while. Western Digital
I’d like to work towards                          we make these tarballs and test these
                                                  tarballs and within the team we’ve got
                                                                                               are talking to us about making an
                                                                                               Ubuntu Mate device a bit like they have
having a fully snapped                            people from Fedora, Gentoo, Slackware,       with OwnCloud (and they’re also talking
                                                  Arch, Debian, Ubuntu, Linux Mint and         to NextCloud), but that presents some
desktop environment                               some of the more esoteric things like        difficulties with VLC (which we ship by
                                                  Vector. We all go off and package this       default) as they need to know what
      started on at the sprint. A new concept     stuff again for all of these different       their exposure is with the codecs and
      that’s been introduced into snap            distributions and it would be good if we     licensing that they need to cover from
      packaging is platforms – in the             as the upstream we could say ‘here is        that point of view. VLC is snapped so we
      vernacular of Flatpak they talk about       Mate desktop’ – whatever version –           could stodge that and put the VLC snap
      runtimes. Robert Ancell (who’s part of      and we’re able to just deliver it lock,      in the software boutique and then they
      the desktop team at Canonical) has          stock and barrel and everybody gets it.      don’t have to distribute anything that
      started on a GTK 3.20 platform snap         We can deliver the upstream vision and       does incur any licensing difficulties for
      and there’s a new content interface in      everyone can have it and we can spend        them.
      snaps that enable you to do content         more time working on the future rather          On single-board computers in
      sharing, which basically says “in order     than us all reimplementing the same          general, Snaps are are going to be very
      for this application to run, it requires    packaging all over again. That’s one key     strong indeed, particularly when you
      this platform snap.” Instead of having to   thing I really want to see solved.           look at what OpenWRT has done
      duplicate all the common dependencies          The other thing is the update and         supporting both paradigms– that’s
      within every snap (this is one of the       rollback, and being able to have multiple    where snaps are really going to win.



                                                    www.linuxvoice.com                                                                  45
MUGS AND T-SHIRTS!


                 You can drink
                 coffee, tea or
                 champagne.
                  It’s all about
                      choice.




    This mug
 respects your
freedom. Look,
  it even says
  GNU/Linux!




 shop.linuxvoice.com
                                                                                                                         INTRO REVIEWS




REVIEWS
The latest software and hardware, rigorously bashed against a wall by our crack team.

                                               On test this issue . . .
                                               Aftershot Pro                                                                                        48
                                               What a time to ba alive for photography
                                               geeks on Linux. This excellent
                                               RAW image editor
                                               is non-free (boo!)
                                               but is chock-full of
                                               incredibly useful
                                               filters and other
                                               effects. Hurrah!


Andrew Gregory
Has added a new machine to the PC graveyard:
his main Linux box. Time for a new one.




H
            aving just got into the magical
            world of JavaScript
            programming, I’ve come
across the Atom text editor. I know I’m
late to the party (especially so given
that we reviewed Atom on these very
pages in issue 18). Its killer feature is      LibreOffice 5.2                                  49    Stellarium 0.15                                50
that it’s infinitely customisable via CSS.     Now featuring extra collaboration features paid for    Many through the ages have gazed at the stars with
   And, true to form, I haven’t                by the Dutch Ministry of Defence. Dank u wel!          wonder. Now you can do so on your laptop!
customised it one bit. The flexibility
built-in means that it has already
passed in front of many more
aesthetically attuned eyes than mine,
so it’s better that I could ever make it. In
                                               Group test and books
contrast, interfaces that can’t be
modified (Windows 10) or that
theoretically can be modified but
practically are just too damn confusing
(KDE) will always look bad. I don’t need
to do anything to make Atom better; it
matters that I am empowered to do so.
   Extend this logic to web browsers,
image editors, emissions cheat devices
in Volkswagen cars et al and you reach
the point of why Free Software is
important. I’m never going to learn to
write a desktop interface so that I can        Books                                             54   Group test – Social Networks                        56
make it more intuitive – but I appreciate      Learn to write software that’ll take control of        Twitter is a cesspool of idiot-fuelled hatred. Create
that, in theory at least, I could do.          someone’s machine at the OS level, and fix your text   your own, better social network with one of these
andrew@linuxvoice.com                          processing skills in the web-tastic Ruby language.     Free Software systems, for a happier life.



                                                                 www.linuxvoice.com                                                                     47
     REVIEWS PHOTOGRAPHIC EDITOR




AfterShotPro 3
Graham Morrison avoids years of photography theory by using software.


                              A
Web www.aftershotpro.com               fterShot Pro is a product with its sights on     however, these sliders are also intelligently adjusting
Price £69.99                           Adobe’s equivalent Lightroom, which is now       shadow and mid-tone exposure, cleverly balancing the
                                       close to being an industry standard at           processing within the image to keep everything
                              enabling photographers to manipulate the RAW              looking as natural as possible. We’ve found it works
                              image data output from their digital cameras. Both        much better than the equivalent tools in the open
                              these applications let you make poorly taken              source options, and is a genuine rival to similar
                              photographs, such as those taken in bad light, with       facilities in Lightroom. The new blemish removal tool
                              the wrong white balance, and with huge areas of           also works well, and stops you switching applications,
                              contrast, look awesome, and good photographs look         which is almost impossible if you want to keep
                              spectacular. What AfterShot Pro does better than the      working within the RAW domain until the final export.
                              open source tools we’ve tried is use intelligent             This version also promised to be a lot quicker. We
                              algorithms to make these adjustments easy.                needed to install the OpenCL drivers for our graphics
                                The combination of ‘Back Fill’ with AfterShot Pro’s     hardware, but after this, image rendering was snappy
                              new highlight recovery tools is the perfect example       – much quicker than the previous version, and we
                              because they can solve all kinds of common                can imagine better hardware with better OpenCL
                              problems with just three sliders, from under-exposure     acceleration would be very quick indeed. On the
                              to lack of detail. Unlike adjusting brightness in Gimp,   down-side, we didn’t find any options to force the GUI
                                                                                        to adapt to our high-DPI display, which is a promised
                                                                                        feature for other operating systems. If you’re a
                                                                                        professional photographer, it’s likely you need support
                                                                                        and a solid application for managing your library of
                                                                                        photos and processing them for clients. You may even
                                                                                        be tempted to move to Linux after Adobe recently
                                                                                        denied standalone Lightroom users access to updated
                                                                                        features because of ‘SOX and accounting practices’.
                                                                                        For these reasons Aftershot Pro is worth paying for.
The new Blemish tool
                                                                                        A powerful, if non-Free, professional photo
means you don’t need to                                                                 manipulator.
do any final touch-ups with
Gimp.



48                                                           www.linuxvoice.com
                                                                                                             OFFICE SUITE REVIEWS




LibreOffice 5.2
Graham Morrison investigates the new release of the premier FOSS office suite.


L
       ike clockwork, LibreOffice 5.2 arrived in early                                                                  Web www.libreoffice.org
                                                                                                                        Price Free
       August. Whereas the 4.x series of the suite                                                                      Licence MPL v2.0
       focused on cleaning up the code and other
“under the hood” improvements, in 5.x the developers
have paid more attention to the interface, tweaking
menus and toolbars for a smoother user experience.
  So what’s to shout about in LibreOffice 5.2? For
                                                                                                                        In Calc, the status bar can
enterprises, there’s a new document classification                                                                      now show multiple
system based on standards from TSCP, the                                                                                functions – useful for
Transglobal Secure Collaboration Program. This lets                                                                     getting a quick overview of
you mark a document as internal or classified, with an                                                                  data.
appropriate warning and watermark. It’s worth noting
that development on this feature was supported by          added, and a new crash reporter tool (for Windows)
the Dutch Ministry of Defence – LibreOffice is really      should help to narrow down bugs. Then there are the
making inroads in government departments.                  usual updates to file-format compatibility – docs from
                                                           other suites should render better in this release.
More than just .txt                                           LibreOffice remains the flagship FOSS office suite,
There’s also support for multiple document signature       but it really could do with an online “cloud” version.
descriptions, along with import and export of              Progress is being made on this front thanks to
signatures from OOXML files (as used in Microsoft          Collabora, and it’s possible to use a limited version of
Office). In terms of user-facing changes, Writer and       LibreOffice inside Own/NextCloud, but it’s early days.
Calc now have single toolbar modes, while Calc has         Hopefully for the next release of LibreOffice in February
new forecasting functions and the option to enable         2017, it’ll be quick and simple to install on a server and
multiple statistic views in the status bar. Some dialogs   access anywhere in a browser.
have been redesigned to be easier to use, and extra
buttons have been added to toolbars (eg a currency         Not a world-changing release, but taking a step
drop-down selector in Calc) as well.                       in the right direction with lots of small
                                                           refinements.
  Behind the scenes, performance in OpenGL and
OpenCL has been improved, unit tests have been



                                                             www.linuxvoice.com                                                                   49
     REVIEWS ASTRONOMY APP




Stellarium 0.15
Ben Everard lies in the gutter, gazes up at the sky and wonders what he sees.

                               G
Website www.stellarium.org             aze upon the night sky and you’ll see              Even in the space age, the importance of the stars
Developer Fabien Chéreau and           thousands of specks of light. If you’re lucky    cannot be forgotten, as they shine on long after the
contributors                           enough to have dark skies, and bored enough      batteries in an electronic navigation system run flat.
Licence GPL
                               to spend the night counting, you should be able to see   When lightning struck the Apollo 12 spacecraft as it
                               around 5,000 stars at a time. These stars, with a few    launched from Kennedy Space Centre and knocked
The options windows            minor alterations, have been the backdrop of history.    out the power to the command module, it was the
appear in a dark theme so      They’re the same stars that guided Christopher           position of the stars that guided the crew safely into
they don’t ruin your night     Columbus across the Atlantic, Ernest Shackleton          orbit and on to the moon.
vision.                        across the Antarctic and Vasco da Gama to India.
                                                                                        Feel like some watcher of the skies
                                                                                        The ancients saw in the stars the figures of their gods,
                                                                                        while even now, in more prosaic times when we know
                                                                                        that they’re giant balls of hydrogen gas slowly fusing
                                                                                        into helium, we can’t help but wonder if one of those
                                                                                        pin-pricks of light has orbiting around it a giant rock
                                                                                        with some creature upon it gazing back at us.
                                                                                           Stellarium is an interactive guide to the speckled
                                                                                        blue-black dome that hangs over our nights. Start the
                                                                                        application and you’ll get a full screen view of the sky
                                                                                        in your current position (or as close as Stellarium can
                                                                                        tell) at the current time. Move your mouse to the
                                                                                        bottom half of the left-hand edge of the screen and
                                                                                        you can change the location and time to see what the
                                                                                        sky will look like at any place at any point in time
                                                                                        (either in history or in the future). This makes
                                                                                        Stellarium a great tool for planning your stargazing –
                                                                                        just enter the place and time and you can see what
                                                                                        you’ll be in for in real life. The real advantage is not that



50                                                           www.linuxvoice.com
                                                                                                       ASTRONOMY APP REVIEWS

you get a sneak preview, but that you can learn a bit
more about what you’ll see. Move your mouse to the
left-hand side of the bottom of the screen and a menu
will pop up that enables you to select what you want
to display. The first three buttons from the bottom-left-
hand corner are Constellation Lines, Constellation
Names and Constellation Art. With these switched on,
you can get a better understanding of the skies, at
least from an ancient Greek perspective.

It's not all Greek to me
There’s a huge number of things in the night sky, and
only a fraction of them are visible with the naked eye.
If you have a pair of binoculars or a telescope, you can
explore far more than just the constellations. To
change what appears in the sky, press F4 to open the                                                                  If you zoom right out you
Viewing Options window. In the DSO (Deep Space              Plougher and Oxen to the people of Macedonia. There       can see the entire sky in a
Objects) tab, you can configure the various items that      is no other subject that knits together science and       single view.
you want to appear. Check the Labels And Markers            folklore quite as well as the night sky, and Stellarium
box and Stellarium will highlight the most visible of the   does a great job of catering to both areas of interest.
displayed objects in the sky, and you can click on             There is some software that you don’t realise you
these in the main display to get more information           even wanted until you try it, and Stellarium falls into
(including the details to position a telescope at that
item). In the Sky tab of the Viewing Options window,
you can change various settings to make the interface
                                                               Stellarium is an interactive guide to
a little more captivating. If you increase the twinkle         the speckled blue-black dome that
setting and the number of shooting stars, you can
create a backdrop that’s more magical.                         hangs over our nights
   Version 0.15 of Stellarium brings support for remote
controls, which greatly enhances the ability to use the     this category. Even if you’ve never thought you wanted
software for planetariums and other displays. It brings     to zoom in on the finer points of the stars, we
in more data in the form of support for more DSO            recommend you grab this and get better acquainted
catalogues and more folklores. There’s more to              with the night sky. Now, please excuse me, it’s getting
constellations than the Greek one, and Stellarium now       dark outside and Aquarius should be rising over the
supports 26 cultures' views of the stars. Using this, we    back hedge soon.
discovered that the Inuit describe the constellation we
know as the Great Bear (Ursa Major) as the Caribou. It      Discover the universe with the best interactive
                                                            guide to the night sky.
is, though, apparently just this reviewer who knows it
as the frying pan. Orion, meanwhile, is known as the




                                                                                                                      The artwork helps you
                                                                                                                      understand how the
                                                                                                                      constellations got their
                                                                                                                      names.



                                                              www.linuxvoice.com                                                                 51
     REVIEWS GAMING




GAMING ON LINUX
The tastiest brain candy to relax those tired neurons


 TRADE FOLLOWS THE FLAG                     Undertale
                                            Does the indie smash hit live up to the hype?

                                            Web http://store.steampowered.com/app/391540
                                            Price £6.99




                                            I
                                                 t takes about 30 seconds to realise that
                                                 Undertale is very weird. That’s probably what
                                                 made it such a smash hit with users of
                                            YouTube’s Let’s Play services, which hepled it sell
 Michel Loubet-Jambert is our Games
 Editor. He hasn’t had a decent night’s     close to 2 million copies, a figure which many
 sleep since Steam came out on Linux.       games with multi-million dollar budgets would
                                            struggle to hit.


 B
         oth AMD and Nvidia have               The game is an 8-bit RPG with a twist, in that
         released a new generation of       the player can choose to fight or make friends
         graphics cards, which have
                                            with enemies. Making friends means that                 Looks aren’t everything, and Undertale surprises in
 huge performance improvements
 over the last. Linux was not left out in   monsters of the same type can be avoided in the         many ways beyond being better than it looks.
 the cold by either vendor as the           future, but also voids any experience gain, a
 updated drivers which support these        serious drawback in a situation where there is no       to a game where nothing is superfluous. The
 cards were pushed out straight away.       choice but to fight. Friendship can be established      characters encountered in the dungeon are
    On the other hand, users of this
                                            through talking to, petting or even flirting with       humorous, each with their own personality and
 hardware will not see as many
 performance gains as Windows users         enemies, which is all part of the game’s humour,        traits shown through dialogue and during the
 given that most games are not as           often toying with RPG conventions.                      game’s odd minigame battle system.
 well optimised for OpenGL as they             At first glance, Undertale is a very ugly game          The game isn’t all perfect though: its
 are for DirectX. There are signs of        more reminiscent of MS Paint than charming              environments can be bland and its puzzles are
 this getting better as more
                                            8-bit nostalgia. In most games, this would put a        often tedious, but this can be overlooked since it
 developers create games with
 cross-platform support in mind while       lot of people off straight away, but the fact that it   keeps on surprising throughout. Undertale is a
 using engines that are also                manages to keep players interested is testament         unique experience that we highly recommend.
 constantly improving their OpenGL
 and Vulkan support. It’s mostly the
 older games created with a                   Undertale can convey more in a few pixels
 Windows-only development mindset             than many AAA games can in their entirety.
 that have the biggest performance
 gaps. On the Intel side of things,
 Vulkan support from the Ivy Bridge
 architecture onwards has been
 pushed out as part of the Mesa 12
 release, which also saw OpenGL 4.3
 support and other big changes.
    Meanwhile, the itch.io game store
 has brought out a new version of its
 open source store application, with
 improved Arch Linux support and
 much better stability in what has
 become a very mature application.
 This is a great alternative to Steam
 for those looking at less commercial
 games, especially considering the
 delays in GOG’s Galaxy application
 arriving on Linux. Itch.io has been
 making some changes recently,
 including the “refinary”, which is
 similar to Early Access.




52                                                                 www.linuxvoice.com
                                                                                                              GAMING REVIEWS


Haven Moon                                                                                      ALSO RELEASED…
A spiritual successor to Myst.
Web http://store.steampowered.com/app/493720       The sense of intrigue is a prominent
Price £10.99
                                                theme, as the player is dropped into a
                                                solitary and mysterious world full of



I
     t’s been over 10 years since the last      machinery and hidden passages. This
     installment of the hugely popular Myst     experience is further enhanced by the
     series was released, so it seems that      story, which begins with the player finding
now is good time to satisfy people with         a note from the survivor of a cataclysmic
that particular itch. Even on a purely visual   event, wishing to leave behind his life’s
                                                                                                PAC-MAN 256
level Haven Moon gets the nostalgia             treasure. Myst fans are sure to enjoy this      Pac-Man is officially on Linux! The game has
receptors tingling, though in fantastic         game, but it’s also a good game for those       held up extremely well over the years so
real-time 3D. It’s a one-man development        wanting to delve into the series, but put off   younger games shouldn’t dismiss it, more so
effort, and the love for the Myst games         by the dated visuals or wrestling with          given the fact that the PC version lacks the
really comes through.                           DOSBox configurations.                          pay-to-win nonsense of its mobile counterpart.
                                                                                                The 2.5D graphics, power ups and unlockables
                                                                                                give enough new reasons to play while not
                                                                                                sacrificing what made the game great.
                                                                                                http://store.steampowered.com/app/455400




                                                           Haven Moon’s graphics manage         Kelvin and the Infamous Machine
                                                           to take the player back to 1993      After adding some voice acting during a brief
                                                                while still looking modern.     Early Access period, Kelvin and the Infamous
                                                                                                Machine has been released, offering a solid
                                                                                                point-and-click game revolving around time
                                                                                                travel. In the game, Kelvin zips around history,

Day of the Tentacle Remastered
                                                                                                encountering the likes of Leonardo da Vinci
                                                                                                and Isaac Newton while solving their
                                                                                                dilemmas. The game is short, but has nice
A point-and-click classic brought back to life.                                                 visuals and humour typical of the genre.
                                                                                                http://store.steampowered.com/app/376520
Web http://store.steampowered.com/app/388210
Price £10.99




T
        he early to mid 1990s is often
        seen as a golden era for point-
        and-click adventure games, with
Day of the Tentacle being one of its prime
examples. Though this game and others
have been playable up to now thanks to          The new visuals are great for those who like
the open source SCUMMVM software,               retro games without dated graphics.
this version features completely redrawn                                                        The Ship: Remastered
                                                                                                This very eccentric multiplayer game is
high-resolution artwork (no more upscaled       back. Unusually though, a hint system has
                                                                                                currently in Early Access, and is mostly
320x200) and remastered audio, bearing          not been added, despite it being the norm       bug-free. The game throws most of the
in mind the original non-CD versions of         in contemporary adventure games.                conventions of the multiplayer shooter out of
the game had no voiceovers. A nice touch           For those not aware of the story and         the window and instead puts players on an old
is the ability to switch between the old        premise, Day of the Tentacle is the sequel      timey cruise ship in a “whodunnit” situation.
                                                                                                The player must find out who they must murder
and new visuals and audio, to get a more        to Maniac Mansion. There’s a lot of time
                                                                                                and track them down, all the while escaping
nostalgic experience or simply compare          travel involved and constant gags through       from their pursuer. There’s plenty of laughs
old and new to see how much work has            the game’s three varied protagonists and        and very original gameplay.
been done to the game, similar to the           excellent supporting characters, making         http://store.steampowered.com/app/383790
Monkey Island remasters some years              this a must-have for any fan of the genre.



                                                              www.linuxvoice.com                                                                   53
     REVIEWS BOOKS



Designing BSD Rootkits
Ben Everard uses rootkits to avoid having to remember SSH passwords.
Author Joseph Kong
Publisher No Starch Press
Price £21.50
ISBN 978-1593271428




R
         ootkits are bits of software that        C programmer with some knowledge of
         attackers use to maintain access to      assembly language.
         a computer after they’ve broken in.         The main aim of this book is obviously
Essentially, they’re software kits to maintain    to help penetration testers and security
root privileges. A good rootkit has to be         researchers understand how to build
invisible to the system administrator yet at      rootkits for BSD, a Unix-alike alternative to
the same time have complete control over          Linux. There is also a secondary use – in
the machine in question, and the best way         order to build a rootkit, you have to have a
to achieve that elusive goal is by running in     solid understanding of how the kernel works,
the kernel.                                       and a great way to get this understanding
   Designing BSD Rootkits is a book about         is to poke it in ways it’s not designed to be
how to control a running BSD kernel to            poked. In other words, it makes a good, if
allow you to nefariously manipulate data –        highly unorthodox, introduction to the BSD
including core kernel data such as the list       kernel (and, indeed, all Posix kernels).
of open ports. This is obviously a massively
complicated subject, and in order to get          An unusual and interesting way to start
                                                  investigating Unix kernels.
the best out of this book the reader is                                                                No Voodoo Beasties were harmed in the making
expected to be a reasonably competent                                                                  of this book.




Text Processing With Ruby
Ben Everard starts work on a magazine editing robot in the hope of retiring. One day!
Author Rob Miller
Publisher Pragmatic Bookshelf
Price £25.50
ISBN 978-1680500707




T
          ext processing is one of the most       at acquiring text including reading from
          useful skills to have in programming.   files, getting standard input and scraping
          Whether it’s pulling data out of log    websites. The second looks at transforming
files, scraping websites or analysing the         text, which comes down to regular
sentiment in millions of Twitter posts, the       expressions, parsers and natural language
ability to condense a large amount of ASCII       processing. The final chapters explore
(or Unicode) into a useful form is vital.         writing text to files and standard output.
Text’s importance comes from the fact that           This book is thorough, informative but
it is the bridge between computers and            a little unexciting. There are plenty of
humans – it’s the only format that both can       examples to help the reader understand
easily understand. It’s sometimes called          what’s going on, but they’re all a little
the universal format and shows no sign of         contrived. More meaty examples would
becoming less popular despite being one of        help keep us more engaged and help us see
the earliest forms of data representation.        exactly how everything came together.
    Text Processing With Ruby does a good
job of covering the whole area of modern          A thoroughly useful book for new Ruby programmers,
                                                  but it lacks pizzazz.
text processing by splitting the subject into                                                          If you only learn one programming skill, learn
three parts. The first part of the book looks                                                          text processing.



54                                                             www.linuxvoice.com
     GROUP TEST CREATE YOUR OWN SOCIAL NETWORK




GROUP TEST
A serial online socialiser, Mayank Sharma would do anything to avoid real work – even test a
bunch of web apps to deploy his own social network.



On test                                          Create your own social network

                                                 A
BuddyPress                                                 n online social network              social network into your existing
URL https://buddypress.org                                 operates pretty much like its        online infrastructure.
Licence GNU GPL v2                                         physical offline counterpart:          The web apps in this group
Latest release 2.6.1.1                           you meet people, establish                     test help you create focused
Is this the WordPress for social networks?       connections, keep up with the                  social networks as a means of
                                                 contacts, and continue the                     connecting people. You can deploy
                                                 relationship. But social networking            them to bring together students
Community Builder                                on the internet has one major
                                                 benefit over offline ones – it enables
                                                                                                and equip them with the means
                                                                                                of collaborating on projects,
URL www.joomlapolis.com/community-
                                                 you to find like-minded people                 exchanging class notes and even
builder
                                                 beyond your physical network, even             advertising the availability of dorm
Licence GNU GPL v2
Latest release 2.0.14+                           across time zones. Also thanks to              rooms. For businesses, a custom
We know what it does, but is it any good?        the power of keywords and search               social network can be an ideal
                                                 fields, you can skim through the               extension of a bulletin board or a
                                                 noise and find like-minded groups              company intranet. It also helps

Elgg                                             from the comfort of your armchair.
                                                    But why should you go through
                                                                                                bring together physically separated
                                                                                                people who are connected through
URL www.elgg.org                                 the pains of hosting and managing              a strong common thread, like the
Licence GNU GPL v2
                                                 your own social network when you               various campuses of a university, or
Latest release 2.1.2
                                                 can join one instantly for free? For           regional offices of a multinational
Will I let my familiarity with the software
cloud my judgement?                              starters, hosting your own social              corporation. Similarly, a corporation
                                                 network gives you the option to                could deploy such a social network
                                                 customise and brand it as per your             on its intranet as a virtual water
                                                 whims and wishes. This is also                 cooler for its employees and a
Mahara                                           helpful if you want to integrate the           means for them to exchange notes.
URL www.mahara.org
Licence GNU GPL v3
Latest release 16.04                                Hosting your own social network
Can it bid Sayonara to the rest?
                                                    gives you the option to customise
                                                    and brand it as per your wishes
Oxwall
URL http://developers.oxwall.com                   Deploy a server
Licence Common Public Attribution                  Unlike standalone desktop apps, the          out a web server, the exact procedure
Licence                                            web apps tested over the next few pages      depends on the Linux distribution that’ll
Latest release 1.8.3                               are designed to reside on a web server       power it.
Will it make the rest drive up the wall?           that you’ll have to set up before you can       Most web apps will work atop the
                                                   fiddle around with any of these apps.        LAMP platform; some might even allow
                                                   LAMP is the most common platform             you to swap out components for other
                                                   for rolling out server software. It uses a   alternatives. All apps have detailed
Trident                                            Linux distribution as base that has the      installation instructions. The installation
URL www.online.me                                  Apache web server together with the          document will also list the exact libraries
Licence Creative Commons Public Licence            MySQL database, along with support for       that they require and should be one of
                                                   displaying apps written in PHP or Perl.      the first documents you read if you want
Latest release 8.0
                                                   While it doesn’t take much effort to roll    to try out one of these web apps.
Can it poke the competition?



56                                            www.linuxvoice.com
                                                                  CREATE YOUR OWN SOCIAL NETWORK GROUP TEST



What makes a social network?
Tools of the trade.
A social networking website is a Web 2.0 service.          Furthermore, there are certain elements, without    aspect of an online social network. To facilitate the
The term Web 2.0, coined by O’Reilly Media in 2004,     which social networking on the web wouldn’t be         discovery of shared information, the network should
isn’t a technology update to the internet, but rather   possible. User profiles play an important part in      have the provision to assign keywords or tags to
refers to the so-called second generation of web-       helping you find like-minded people. Once you’ve       them. In fact, tags are so popular that they’ve paved
based services that encourages reader participation.    found the people you want to be connected to, the      the way for Folksonomy or collaborative tagging. By
A social network is made up of several such             network should enable you to connect with them and     transferring indexing control to users, Folksonomy
communication tools and services, including blogs       add them as friends. After connecting with friends,    websites incite people to share. To keep its members
for sharing content and forum boards for fostering      you’d want to share information, ideas, pictures, or   updated, the network should also have some form of
discussions.                                            documents with them, which is another important        feed syndication.




Oxwall
Your own Facebook.
Oxwall ships with all the essential
components you need to get users to
interact. Users can blog, share pictures and
videos, discuss via forums, share with wikis,
comment, tag, and rate all types of content,
and a lot more. The core software and the
essential plugins are available gratis, while
additional plugins can be bought for a
one-time fee. Oxwall relies on a simple
step-by-step installation process. At the last
step the installer displays a list of plugins
that you can enable. These can be activated             You can easily monitor active users and maintain decorum by suspending abusive users.
or disabled later from the administration
console.                                                which offers fine control over the CSS style           plugins that you have selected. You can
   Oxwall’s admin interface is pretty well laid         of the theme.                                          rearrange the pages and menus by dragging
out and divided into various sections. While                                                                   and dropping with the mouse. You can also
you edit your network, ensure it’s not visible          Broaden the horizon                                    edit each item to either make them visible
to anyone by disabling the site and putting             In addition to customising the network                 to everyone, to guests, or to every logged-in
up a maintenance page with a personalised               visually you can also make dramatic                    member. You can enable users to customise
message. If you are running a closed                    changes by activating plugins.                         their own page components, but you can
network, or a very specialised one, you might           Some plugins, such as the Activity                     “freeze” certain elements to prevent them
want to make the casual visitor pause and               Notifications and Friends plugins, are                 from being edited or moved by the users.
read about the network they are about to                pretty straightforward and require no
enter by putting up a splash screen.                    configuration. But plugins such as the                 Control your users
                                                        Forum plugin and the Contact Importer offer            Managing users is one of the strong points
Make it your own                                        some additional controls. For example, to              of Oxwall. Before you throw open your
The most convenient way to personalise                  import contacts from Google or Facebook,               network, you should create custom account
your network is to alter the default theme.             you need to equip Oxwall with your Google              types and edit profile questions for each. For
Oxwall ships with a bunch of themes, and                Client ID, and Facebook App ID.                        example, if you’re setting up a network for an
you can grab some more from its website                    Besides the additional plugins that ship            educational institute you can have different
(http://www.oxwall.org/store/list/theme/                with the app, you can fetch additional ones            registration questions depending on
latest).                                                from the Oxwall store (http://www.oxwall.              whether the user is a teacher or a student.
   You can tweak various aspects of the                 org/store/list/plugin/featured). Some                  If this all sounds a little daunting, head to
theme right from within Oxwall’s admin                  plugins are only available for a fee, such             demo.oxwall.com to get to grips with the
interface. Depending on the theme, it might             as the PayPal Billing plugin, which lets               administration of the network.
also take several images, such as for a                 you accept payments from users of your
                                                                                                               Helps roll out a feature rich network that
background and logos, and you can replace               network via PayPal.                                    can be customised to the hilt.
them by uploading custom graphics. The                     Oxwall also lets you rearrange the default
theme customiser also includes a CSS tab,               layout of the dashboard depending on the



                                                                     www.linuxvoice.com                                                                          57
     GROUP TEST CREATE YOUR OWN SOCIAL NETWORK


Mahara
The LinkedIN for education.
Unlike the other social networking            which can hold everything that can be
software in this group test, Mahara           stored digitally. These components are
caters to a particular demographic. It’s      individually known as artefacts. Multiple
designed to allow users to demonstrate        artifacts are collated into pages and
their skills and work by creating digital     you can have as many pages as you
portfolios. Additionally you can also use     like, either with a different number of
the platform as a social networking           artefacts, or different purposes and
system to enable users to interact with       audience. For example, you can have
their friends and create their own online     a page for your family that includes
communities. Mahara includes tools            holiday photos. Similarly, you can
and services such as blogs, custom            create a page to showcase your work          You can export your portfolios as HTML sites or in a
pages, a resume builder, and can also         and a resume to potential employers.         format that can be imported into another Mahara install.
be hooked with the Moodle learning            If you want people to see your page
platform. Mahara is a popular tool            you can add them as individuals or as                       hang of the administration interface.
among universities all over the world         a member of a group, and pages can                          You can choose the layout of the page
that use it to record achievements and        even be made publicly available.                            and drag and drop everything from
assist with personal career                                                                               blocks of plaintext to recent forum
development of their pupils.                  Admin panel                                                 posts, PDF files, images and a lot more.
   While installing, Mahara shouldn’t         Besides the Dashboard, Mahara’s                             Mahara hosts a demo (http://demo.
throw any unexpected issues, don’t            administration interface includes tabs                      mahara.org) to tinker with its back end.
make the mistake of using the software        for uploading and editing content,
                                                                                                          Helpful for creating a network that shows
without first spending some time              arranging them into portfolios, and                         off the user’s achievements.
with its documentation to grasp its           defining groups. Creating a portfolio is a
true potential: Mahara ePortfolios,           fairly intuitive process once you get the




Trident
A good beginning.
Trident bills itself as a social CMS, and     extensions (both free and paid-for) from
had its first stable release late last year   Trident’s marketplace. The software
after half a decade of development. It        is made up of two main components.
offers several unique features, such as       There’s a content management
the ability to create multiple profiles for   interface for managing the installation,
a user’s different personas. Trident has      which can be handled by appointed
the usual slew of social networking           admins and moderators. Then there’s
features, such as the ability to make         the Studio, which helps you design and
friends, communicate with them, share         extend Trident’s functionality.
and like content, and more. To the
admin it offers tools such as custom          Initial minimalism                           You can use the pages module to customise the content,
page builders, navigation menu                There aren’t many components inside          visibility settings and layout of a page.
builders, permissions control and             Studio on a fresh installation. You get
several other common content                  a tour of the default core components                       their visibility for different members.
management functions. The developers          and can start building your network by                      Then there’s the designer, which helps
boast of testing the app on all form          customising them, such as your profile,                     you change the site’s logo, design
factors and claim that its typography,        the site’s homepage and other pages.                        and manage the cover image as well.
link targets and navigation are all           You can then download more apps                             Once you get familiar with Trident, you
optimised for touch devices.                  from the marketplace, which lists free                      can use the forms tool to customise
   Before you install Trident, you’ll need    and paid-for apps.                                          Trident’s database and forms.
to register for a free account with its          Studio makes it straightforward to
                                                                                                          One of the easiest networks to configure,
commercial developer BoonEx and               customise your Trident installation.                        but it ships with a limited set of functions.
grab a set of keys. You’ll need these         For example, you can build a page by
to download additional apps and               picking the right blocks and configuring



58                                                             www.linuxvoice.com
                                                               CREATE YOUR OWN SOCIAL NETWORK GROUP TEST


Elgg                                                                                            Diaspora:
Old but still going strong.
                                                                                                the distributed
                                                                                                social network
                                                                                                Unity in diversity.
                                                                                                Diaspora is a unique social network. It works and
                                                                                                behaves like the popular ones and lets you add friends
                                                                                                and follow hashtags and displays updates in your
                                                                                                stream. As a social network, Diaspora is very capable
                                                                                                and some even credit its Aspects feature as the
                                                                                                inspiration for Google+’s circle.
                                                                                                    However, the biggest advantage of Diaspora is that
                                                                                                it’s open source and federated, which liberates it from
                                                                                                the control of any one organisation. The Diaspora social
                                                                                                network is made up of a number of servers called pods
                                                                                                that connect to each other. The pods are independently
                                                                                                operated, and anyone can set one up and connect
                                                                                                it to the Diaspora network. Pods can be private to a
Elgg users can also use the built-in messaging capabilities to send messages to other           particular group, or open and allow anyone to join – so
registered users on the network.                                                                to join the Diaspora you can get an account with a
                                                                                                publically listed pod. Alternatively, you can also set up a
                                                                                                Diaspora pod for your organisation.
Elgg is one of the most versatile pieces of       to revamp the front page, enable the Front
                                                                                                    A couple of years after crowdfunding the
software that offers almost everything you        Page Demo plugin. Elgg ships with over 30     development, the Diaspora developers passed on
need to start a social networking site such       plugins, such as blog, bookmarks, pages,      the development baton to the community under the
as a blog, filesharing features and a             notifications, etc. Some of the plugins       guidance of the Free Software Support Network. But
Twitter-like service. Setting it up is a pretty   that you might want to activate includes      this had no effect on the hosting of the network, since
                                                                                                the actual hosting of the pods is done by individuals
standard affair.                                  Site Pages, which lets you create simple
                                                                                                around the world. To join Diaspora you can sign up with
  The administrator dashboard divides             web pages, and Tag Cloud for displaying       any of the public pods listed at http://podupti.me. For
the settings under two major heads,               all tags. Furthermore, Elgg has an active     more information about Diaspora, read our FAQ on this
namely Administer and Configure. The              plugin community that churns out plugins      social network from Issue 8 (https://www.linuxvoice.
options under the Administer category             by the hundreds. In the Elgg world, themes    com/faq-diaspora).
give you various statistics about the             are also treated as plugins. Some of the
server, lets you view online users, add new       popular third-party plugins include Profile
users and put the network in maintenance          Manager for creating custom profile fields,
mode while you’re setting it up. The              Tidypics photo gallery plugin, and the
Configure category houses quite a lot             Chat plugin for adding instant messaging
of functionality. The Settings section in         functionality.
particular is useful for altering options that       All users on Elgg get a profile page and
affect the entire Elgg deployment. From           a landing page, known as the dashboard.
here you can change the name of your              Both areas can be populated with widgets
social network that you specified in the          that pull data from various sources to
wizard while deploying Elgg.                      show the user’s activity. You, as the
                                                  administrator, can set up a default layout
Customisation galore                              for all users that the individual users can
The default Elgg-fuelled network is very          then rearrange as per their preferences
barebones. You can start by customising           and requirements. Users can write blogs,
the order of the menu items displayed at          create and participate in groups, and can
the top and can also add custom menu              also host their own pages, upload all kinds
items. You can also modify the default            of multimedia content and link them along
profile fields. If the existing items in the      with the text content. Elgg also has an
profile don’t work, you can easily replace        impressive access permission system
them with something that suits your               that lets you define parameters for
requirements, and can even create your            accessing a particular type of content.       Follow the detailed installation guide
own custom fields.                                                                              on Diaspora’s website (https://wiki.
                                                  Create a simple-to-administer network with
   For more flexibility in designing a            all the features you’d need.                  diasporafoundation.org/Installation) to easily set
custom profile page you can use the                                                             up your own pod.
popular Profile Manager plugin. If you wish



                                                                  www.linuxvoice.com                                                                   59
     GROUP TEST CREATE YOUR OWN SOCIAL NETWORK


BuddyPress vs Community Builder
Battle of the extensions.
WordPress and Joomla are two very
popular content management systems.
Both have elaborate extensions
mechanisms for fleshing out the base
installation. BuddyPress and Community
Builder are two different plugins that
equip social networking features to
WordPress and Joomla respectively.
   BuddyPress is developed by
Automattic, which makes it the
official extension to turn a simple
BuddyPress blog into a social network.
The extension adds core networking
functionality such as the ability to
create profiles, add friends, create
groups and message people.
   BuddyPress’s configuration options
are housed under the Settings section
in the WordPress administration              BuddyPress is designed to be modular. So while it includes the core networking features, for other social
panel. Several configuration options         functionality, you’ll have to install other plugins such as bbPress for forums.
for BuddyPress also extend existing
WordPress configuration settings: for        the website to communicate among                              Community Builder menu in the Joomla
example, the Users settings in the           themselves. There’s also a useful                             components menu. The plugin draws a
WordPress administration screen gets         notifications system for everything                           handful of its own menus that can be
a new section called profile fields that     from friend requests to whenever                              controlled from under the existing
you can use to let users share all types     someone tags you.                                             Joomla menus section.
of information on their profiles.                                                                             On the front-end you get a CB login
   The plugin also associates certain        Foster a community                                            form in addition to the Joomla login
WordPress pages with BuddyPress              If your website is powered by Joomla,                         form. Unlike BuddyPress however, which
pages. This enables you to create            you can use the Community Builder                             takes over the registration process
custom registration and activation           plugin to create a social network for                         from WordPress after installation, you’ll
pages. If you’re installing it on a live     your users. Installation is again pretty                      have to manually turn off the Joomla
WordPress website with registered            straightforward, and once activated the                       registration form else your website will
users you’ll appreciate the fact that the    plugin shows up as an additional                              have two registration boxes.
plugin automatically syncs WordPress         drop-down menu in the Joomla                                     CB lets you customise the look and
user profiles with BuddyPress profiles.      administration panel. Some settings are                       feel of the user’s profiles through fields,
BuddyPress enables members on                also available from under the                                 tabs, add-ons, and more. The plugin
                                                                                                           make things easier to find by organising
                                                                                                           multiple profile data fields into tabs.
                                                                                                           You can also create custom profile
                                                                                                           fields that can be of any of the 23 built-
                                                                                                           in field types including text, checkbox,
                                                                                                           image, video, file, etc. There’s also a tool
                                                                                                           that’ll sync the Joomla user table with
                                                                                                           the CB user table. You can get more
                                                                                                           community features via plugins.

                                                                                                           BuddyPress
                                                                                                           The official mechanism for helping users
                                                                                                           socialise on a wordpress website.



                                                                                                           Community Builder
                                                                                                           The BuddyPress alternative for Joomla-
                                                                                                           powered installations.
Head to http://demo.cbdemosites.com to get to grips with the administration of a
Community Builder-infused Joomla installation.



60                                                             www.linuxvoice.com
                                                                     CREATE YOUR OWN SOCIAL NETWORK GROUP TEST



  OUR VERDICT
Create your own social network
Community Builder and BuddyPress                    software. Despite being available for
aren’t standalone options for creating              no cost, the software isn’t of much use
social networks. Rather they are both               if you don’t use the keys handed out
designed to extend networking features              freely by its corporate overlord. If you          Oxwall lets you customise all aspects of your social
to members on their respective base                 don’t have any issues with this, you’ll           network including the layout and appearance without
                                                                                                      dabbling with HTML or PHP.
websites without setting another one                find Trident easy to customise and
up from scratch. Both fit snugly into the           flesh out. The Dashboard is very user-
back-end of their respective content                friendly and the Studio offers a unique
management system. installation of                  mechanism to shape the look and feel                         1 Oxwall
both is simple, so if you’ve got a                  of the installation.                                         Killer feature Easy to administer
WordPress or a Joomla website setup,                                                                             URL http://developers.oxwall.com
you don’t really need to consider any of            Our winner                                                   Create a social network that’s intuitive to
the other solutions on offer.                       This leaves us with Elgg and Oxwall,                         administrate and flesh out.
   The other four solutions are                     both of which trump the others for
standalone options and can be better                offering the most functions and
compared to each other. Of these,
Mahara will appeal to the least number
                                                    flexibility. They both ship with a good                      2 Elgg
                                                    number of plugins and offer many
of users since it’s designed with a very            more, including several paid ones, on                        Killer feature Twitter-like service
                                                                                                                 URL www.elgg.org
particular use case in mind. Mahara                 their respective websites. Straight out
                                                                                                                 Useful for creating a user-centric social
excels at creating a network that                   of the box, Oxwall has a more appealing                      network.
enables your users to showcase their                admin interface, which pips it over
achievements and engage with others                 Elgg, which by default creates a rather
based on this. Forums and groups are                uninteresting-looking landing page.
Mahara’s two main networking tools.                    Elgg has a Twitter-like service and                       3 Trident
Its administrative interface is logically           you can control its character-limitation.                    Killer feature Studio
divided into tabs, and you can have it up           Oxwall, on the other hand, lets you edit                     URL: www.online.me
and running in no time.                             its interface for mobile devices as well.                    Offers a unique network editor but is too
   Then there’s Trident, which is young             Once you’ve set up an Oxwall-powered                         dependant on its corporate sponsor.
in terms of stable releases but comes               website you can either open it up to
from developers who have a strong                   public, or restrict access to it behind a
pedigree of creating social networking              walled garden.
                                                                                                                 4 Mahara
   Elgg and Oxwall both ship with a good                                                                         Killer feature Digital portfolios
                                                                                                                 URL www.mahara.org
   number of plugins, and offer many more                                                                        Show off your work by creating a merit-based
                                                                                                                 network.
   on their respective websites

  Ready to deploy                                                                                                5 BuddyPress
  Once you’ve decided to roll out your custom       appliances are self-contained systems that                   Killer feature Impressive profiles
  social network it’ll be a good idea to leverage   run atop Just enough Operating System                        URL https://buddypress.org
  the expertise of others. Depending on the         (JeOS) components that are required to                       The best mechanism to add social networking
  scale and size of your network you can            power that particular app. The project
                                                                                                                 function to a WordPress blog.
  deploy them with ready-made appliances            currently produces such an appliance for
  as well as on specially-tuned web hosts.          Elgg. Bitnami on the other hand produces
  Virtually all projects including Elgg, Oxwall     self-contained applications that include
  and BuddyPress collaborate with multiple          all the libraries and runtimes. While the
  web hosting providers and offer quick             project currently supports none of the social                6 Community Builder
  deployment and assistance.                        networking platforms covered in this group
                                                                                                                 Killer feature Plugins
     Another deployment option is in the            test, Elgg and Oxwall are in its upcoming list.
                                                                                                                 URL www.joomlapolis.com/community-
  form of prefabricated appliances. The             Furthermore, you can use its LAMP stack as
  Turnkey Linux and Bitnami projects are            the base on top of which you can roll out all
                                                                                                                 builder
  two popular examples of these. Turnkey            of the mentioned web apps.
                                                                                                                 An extensive plugin to transform a Joomla
                                                                                                                 installation into a social network.



                                                                        www.linuxvoice.com                                                                     61
     SUBSCRIBE




Subscribe
shop.linuxvoice.com
                                                                          Introducing Linux Voice,
                                                                          the magazine that:
                                                                            Gives 50% of its profits
                                                                          back to Free Software
                                                                            Licenses its content
                                                                          CC-BY-SA within 9 months

                                                                          12-month subs prices
                                                                          UK – £55
                                                                          Europe – £85
                                                                          US/Canada – £95
                                                                          ROW – £99

                                                                          7-month subs prices                              DIGITAL
                                                                          UK – £38                                         SUBSCRIPTION
                                                                          Europe – £53
                                                                          US/Canada – £57
                                                                                                                           ONLY £38
                                                                          ROW – £60




         Get 114 pages                                     Access our                                         Save money on
          of tutorials,                                  rapidly growing                                       the shop price
      features, interviews                            back-issues archive                                    and get each issue
          and reviews                                 – all DRM-free and                                        delivered to
          every month                                  ready to download                                         your door

               Payment is in Pounds Sterling. 12-month subscribers will receive 12 issues of Linux Voice a year. 7-month
            subscribers will receive 7 issue of Linux Voice. If you are dissatisfied in any way you can write to us to cancel your
                      subscription at subscriptions@linuxvoice.com and we will refund you for all unmailed issues.


62                                                         www.linuxvoice.com
                                                                                                                                            NEXT MONTH



                           NEXT MONTH IN



ON SALE                                                                                      EVEN MORE AWESOME!
  THURSDAY
                                                                                                                                               Ubuntu Snappy
22 SEPTEMBER                                                                                                                                   Snappy packages
                                                                                                                                               – they’re the hot new
                                                                                                                                               thing from Canonical
                                                                                                                                               that’s going to end
                                                                                                                                               dependency hell
                                                                                                                                               forever. At least,
                                                                                                                                               that’s the theory…



                                                                                                                                               Linux everywhere
                                                                                                                                               In one shape or form,
                                                                                                                                               Linux is on the ISS,
                                                                                                                                               powering the
                                                                                                                                               SpaceX Falcon 9
                                                                                                                                               rocket and running
                                                                                                                                               servers in the frozen
                                                                                                                                               wastes of
                                                                                                                                               Antarctica.

                                                                                                                                               Cloud storage
                                                                                                                                               If you fear the


 SECURITY
                                                                                                                                               mega-corporations
                                                                                                                                               snooping on your
                                                                                                                                               precous collection of
 Learn the essential steps that you should                                                                                                     cat videos, why not

 be taking to stop bored kids messing with                                                                                                     host it yourself with
                                                                                                                                               a bespoke cloud
 your Linux machines.                                                                                                                          storage server?




       LINUX VOICE IS BROUGHT TO YOU BY
 Editor Ben Everard                 Editorial consultant Nick Veitch                through the use of advice in this magazine.   Copyright Linux is a trademark of Linus
 ben@linuxvoice.com                 nick@linuxvoice.com                             Experiment with Linux at your own risk!       Torvalds, and is used with permission.
 Deputy editor Andrew Gregory                                                       Distributed by Marketforce (UK) Ltd, 2nd      Anything in this magazine may not be
 andrew@linuxvoice.com              All code printed in this magazine is licensed   Floor, 5 Churchill Place, Canary Wharf,       reproduced without permission of the editor,
 Editor in hiding Graham Morrison   under the GNU GPLv3                             London, E14 5HU                               until May 2017 when all content (including
 graham@linuxvoice.com                                                              Tel: +44 (0) 20 3148 3300                     our images) is re-licensed CC-BY-SA.
 Editor at large Mike Saunders      Printed in the UK by                                                                          ©Linux Voice Ltd 2016
 mike@linuxvoice.com                Acorn Web Offset Ltd                            Circulation Marketing by Intermedia Brand     ISSN 2054-3778
 Creative director Stacey Black                                                     Marketing Ltd, registered office North Quay
 stacey@linuxvoice.com              Disclaimer We accept no liability for any       House, Sutton Harbour, Plymouth PL4 0RA       Subscribe: shop.linuxvoice.com
                                    loss of data or damage to your hardware         Tel: 01737 852166                             subscriptions@linuxvoice.com

                                                                       www.linuxvoice.com                                                                                  63
     FOSSPICKS




FOSSpicks                                                                                                          Sparkling gems and new
                                                                                                                   releases from the world of
                                                                                                                   Free and Open Source Software

                Our benevolent editorial overlord Graham Morrison tears himself away
                from updating Arch Linux to search for the best new free software.
Software planetarium


Stellarium 0.15.0
S
        tellarium has always been our           window, which means if it’s                                                   you’ll even see the objects move as
        favourite Free Software                 daytime, the only stellar objects                                             you watch, including phases of the
        astronomy application. It’s             you’ll see are the sun and moon.                                              moon, the angles of planets, solar
also hugely successful, available for           Press Alt and ‘+’ on your keyboard                                            eclipses and even shooting stars.
Windows, OS X and even Android.                 to advance time an hour and watch
But the thing that really grips you             how the horizon darkens through                                               Distant stars
about Stellarium, and what we’d                 twilight and the encumbrance of                                               This releases uses Qt 5.6, which ran
argue has made it so popular, is                the heavens present themselves.                                               faultlessly even on our modest Intel
that even from the first screen you               Press + alone, and the view will                                            GPU. This is important because
see, it always looks gorgeous. The              skip ahead 24 hours – a brilliant                                             almost every element within the
default view launches full-screen               way of watching the phases of the                                             main user interface is accelerated
(press F11 for windowed mode)                   moon, or the orbits of Venus and                                              through your graphics hardware,
and places you in the middle of a               Mercury playing with the sun. Click                                           often generating 60 frames per
photorealistic meadow. The                      on any object to see detailed                                                 second even when updating the
ambient light within this scene will            real-time statistics on your                                                  details on stellar bodies in real time.
be similar to the light outside your            selection, and zoom in enough                                                    The quality is good enough for
                                                                                                                              projection in planetariums, and a
                                                                                                                              new addition is a plugin for remote
                                                                                                                              control use like this, where a guide
                                                                                                              4               can take an audience on a virtual
      1
                                                                                                                              tour. Our second favourite feature is
                                 2
                                                                                                                              the additional sky cultures, now
                                                                                                                              including sky art for Macedonian,
                                                                             3
                                                                                                                              Ojibwe and Dakota/Lakota/Nakota
                                                                                                                              constellations, projected into the
                                                                                                                              sky. But behind this graphical
                                                                                                                              stardust, Stellarium is also a serious
                                                6                                                                             tool capable of helping study and
                                                                                                          5                   observations. There’s initial support
                                                                                                                              for the Washington Double Star
                                                                                                                              Catalog, for example, and you can
                                                                                                                              now create bookmarks for places,
      8                                                                                                                       plus there are new functions in the
                                                                                                                              wonderful scripting engine and
                                       7                                                                                      additions to the powerful AstroCalc
                                                                                                                              utility, brilliant for planning an
                                                                                                                              outside viewing session. Plus, the
1  Object details When an object is selected, real-time in-depth statistics and details appear here.                          User Guide has been completely
2  Sky art The constellation art of lots of different cultures are embedded within Stellarium.                                overhauled. Stellarium is one of
 3 Shooting stars Stars twinkle, deep space objects are newly textured, and both atmospheric fog and light pollution help
                                                                                                                              those brilliant examples of what
render either a realistic or a Spielberg-esque view of the sky. 4 Ocular views Limit your view to that of your telescope or   open source can do. It’s great.
camera, for accurate predictions. 5 Backgrounds Import your own garden, or enable one of the new 3D environments for
terrestrial viewing. 6 Starlore Alongside the excellent User Guide, there’s also excellent background info on sky art
cultures and other viewable elements. 7 Toolbox Easily turn on and off viewable elements, include satellites and labels.      Project website
 8 Configuration Place your viewer anywhere on the globe, or even in space, at any time.                                      www.stellarium.org



64                                                                      www.linuxvoice.com
                                                                                                                                 FOSSPICKS


Filesystem


ciopfs
We’re used to the idea that if you       The same files’ or folders’
don’t know what you’re doing, you        destination can be addressed as
shouldn’t play with the filesystem.      games/SystemShock2, GAMES/
But there’s one exception to this,       SYSTEMSHOCK2 or games/
and it’s thanks to the wonderful         systemshock2, for example. And
FUSE (filesystem(s) in userspace).       we’ve just given a great big hint at
FUSE lets you – an ordinary user         how this can be used: cheap Wine/          IF CAPITAL LETTERS IN FILE PATHS CAUSE YOU PROBLEMS
– create, mount and play with            Windows games conversions,                 INSTALL CIOPFS.
filesystems on your own, without         where the case of paths within the
messing up the integrity of the          executable are wrong and yet                                            to use. With both FUSE and Ciopfs
Linux system you’re running on.          hard-coded.                                                             installed, type ciopfs source
   FUSE is great for mounting                                                                                    destination, just like mounting any
experimental write-enabled Apple or      An easy fix for lazy paths                                              other filesystem, and you’ll be able
NTFS partitions, for instance, as        Pointing Wine at a game installed                                       to freely navigation within the
well as experimental or                  within a Ciopfs mount point will                                        destination mount point either
development filesystems. Which is        avoid any conflict, as both types of                                    lowercase paths, uppercase paths,
definitely the category that ciopfs      file paths will work. It’s a brilliantly                                or a mixture of both. You can then
falls in to. Ciopfs is old (the last     simple idea, and almost as simple                                       supply this path to any problematic
update was from 2011), but we’ve                                                                                 application having trouble with its
already found a great use for it. It’s
a FUSE filesystem that mounts
                                            FUSE is great for mounting                                           capitalisation.

your own filesystem within itself,          experimental filesystems –                                           Project website
only the files and folders within
ciopfs are no longer case-sensitive.        such as Ciopfs                                                       http://www.brain-dump.org/projects/ciopfs




CLI status bar


Monky 2.0
Tmux, the tool that enables you to       requirement, but with similarly
run multiple consoles alongside          complex configuration potential.
one another, has become the                 What makes Monky particularly
standard way we interact with most       powerful is that it uses Haskell for
of our Linux systems, and one of its     its configuration file, effectively
best features is the plugin system.      turning what are normally static
This enables you to easily install       parameters into dynamic functions
modifications to your environment        you can embed into your own
without even restarting Tmux,            status display. Fortunately, there
adding the ability to suspend and        are plenty of examples and enough          Monky is a little like
resume, for example.                     modules to play with that you don’t        Conky without the            update has changed most
  One of the best plugins turns the      have to understand too much                dependency on X.org.         modules, and as such, older
bottom line of your console into a       Haskell, but getting a decent              It’s also difficult to get   examples will need some
status bar, where you can add any        configuration is still a challenge,        running.                     modification to work, or you can
details you choose with other            even when a little copy and paste                                       start afresh. But using the modules
plugins, such as Git branches, the       and a few parameter edits are                                           to display details on disk usage,
date or unread emails, and if you        usually all that are required. This                                     network usage, wifi strength and
have the skill, building your own                                                                                CPU usage to build your perfect
plugins to display and do exactly
what you need is one of of the most
                                            What makes Monky so                                                  status utility is a project worthy of
                                                                                                                 any elite hacker’s time.
unexpedidly powerful aspects of             powerful is that it uses
Tmux. Monky does a similar job,
only without the Tmux and console           Haskell for its config file                                          Project website
                                                                                                                 https://github.com/monky-hs/monky



                                                                www.linuxvoice.com                                                                       65
     FOSSPICKS


RSS reader


FeedReader 1.6 beta
Like many, we’re still mourning the      interface from the comfort of your
loss of Google Reader, despite it        own desktop. Its web-centric
being three years since its demise.      interface links to popular services
Google Reader was one of Google’s        like Feedly, and even OwnCloud,
best web apps, pooling whatever          and presents your stories in the
RSS feeds you subscribed to into a       mixed hierarchy of your own
single place, and it’s almost            categories and sub-categories just
impossible to write anything about       like Google Reader.
RSS aggregation without                     The application is great for
mentioning it. It was the best way       in-place readability, but we really like   Thanks to its web-based UI, FeedReader gets very close to
of keeping abreast of 100s of            its ability to push stories you’re         approximating the functionality of ye olde Google Reader.
stories, and nothing has come            interested in to Pocket, perhaps for
along to replace it.                     later reading on the train journey                                    you of their status. This is
   While a few services, like Feedly,    home, as well as Instapaper and                                       something the web apps can’t do
have started to compete, nothing         Readability for non-web formatting.                                   well, and helps if you’re serious
really gets close to that old            There’s also a daemon that runs                                       about your news feeds. We typically
functionality. Offline applications      silently in the background, updating                                  navigate 600 stories a day, and we
were always an important part of         stories and occasionally notifying                                    found FeedReader more than
the same ecosystem, and since                                                                                  capable of helping us navigate the
Google Reader, many seem to have
gone cold.
                                            FeedReader's interface links                                       mess of updates (mess should be
                                                                                                               the collective noun for news).
   FeedReader is an exception               to popular services like
though, and is one of the best tools
for recreating a good online                Feedly and even OwnCloud                                           Project website
                                                                                                               http://jangernert.github.io/FeedReader



RSS reader


QuiteRSS 0.18.5
And still RSS won’t die. Despite the     exported OPML file spat out by our
social networking revolutions            web client, and QuiteRSS read this,
supposedly replacing the need for        updated stories and populated the
syndicated content from boring old       various categories quicker than the
websites, many of us depend on           online equivalent, without any
RSS to get updates on sites we           noticeable hit on system
trust, outside of their own need to      performance.
‘push content’. This is what makes
FeedReader (above) so interesting,       This is the news
and why there are still other            Reading quality didn’t suffer either,
applications being developed, such       as the stories themselves are              Penguins, the Olympic games and Donald Trump – all will be old
as QuiteRSS.                             rendered using an embedded                 news by the time you read this.
   Almost at the opposite end of the     WebKit core browser, with layout
scale to FeedReader, QuiteRSS is a       identical to the online versions.                                     any catch your interest. You can
great little utility recommended to      Adblock is even included. It’s also                                   quickly disable images, which is
us by podcast listener zmoylan. It       quick and easy to filter and search                                   useful if you’re tethered to your
features no background daemon, or        through your stories, and we liked                                    phone’s data allocation, and stories,
integration with cloud services, and     the way you can switch the story                                      feeds and categories can all be
it can’t push news stories back to       view into ‘newspaper’ mode.                                           opened in separate tabs, like a
Pocket. But it’s very fast (not just        Each story in your selected                                        finely tuned web browser.
‘quite’ fast as its name implies), and   category is listed in a single page
does everything you need perfectly.      one after the other, so you can                                       Project website
We imported our feed list from an        scroll through them quickly to see if                                 https://quiterss.org



66                                                             www.linuxvoice.com
                                                                                                                                          FOSSPICKS


Text editor


GhostWriter 1.4.0
We obviously do a fair bit of writing.
And for us, at least, there is no
one-size-fits-all text editor for the                                              2
various things we do. Some writing              1
is done in Vim, for example,
especially when working with                                                                                                                               4
                                                                                                 3
GitHub’s Markdown and writing to a
specification. Other writing is done
in FocusWriter, which is currently
our favourite distraction-free editor
for writing more descriptive text.
   GhostWriter, as its name implies,
                                                                    8
is designed more for creative
writing rather than documenting
APIs or writing tutorials, but it still                                                                                                             5

has a unique take on this that
makes it worth a look. What makes                                                                       7
GhostWriter different from                                                                                                          6
something like FocusWriter is that it
uses Markdown within the main
editing window so you can add
                                           1 Outline As you write headings and subheadings, they appear in the outline view. 2 Markdown Using the Markdown
things like titles, subheadings and
lists without reverting to menus or       syntax (and there’s an included cheat sheet), you can mark which parts of your document are important. 3 Task List Add
                                          things that need to be done within the text, and mark them finished when complete. 4 HTML preview See how your
keyboard shortcuts, and without           writing will look after being exported to a web page. 5 Themes Light and dark themes are included, and you have full font
needing a special file format. As         control. 6 Hemingway mode Disable the Delete key for writing streams of consciousness. 7 Word count Simple but
we’ve mentioned in previous issues,       essential when you write words for print.
Markdown is a simple syntax for
marking bits of your text document          Apart from the menu, there are                                              statistics overview for when you
– using # for titles, for instance,       three things you can click on in the                                          need more details, and settings for
only without all the hassle of            writing window – an icon to make                                              how much or how little of your
opening and closing brackets, as          the application full-screen or                                                writing is highlighted.
with HTML or XML.                         windowed, an icon to highlight only                                               Pandoc, which we looked at last
   We really like GhostWriter. While      the line you’re writing on and an                                             month, is used for the output, which
we understand the overall ethos of        icon to enable Hemingway mode.                                                means everything from HTML to
‘distraction free’ – presenting           Hemingway mode? This is a mode                                                PDF looks fantastic. Font and UI
nothing but a typing-and-words            we’ve seen in a few distraction-free                                          rendering is excellent too, especially
interface to the writer – our             editors over the last few years, and                                          on high DPI displays and a desktop
practical needs outweigh our                                                                                            with Qt 5.6 or higher. This may
creative needs, and it’s good to see                                                                                    seem superficial, but readability and
GhostWriter starting with things like        Like Hemingway, the                                                        crispness of text is one of our main
the menu being visible, as well as
indicators for editing mode and
                                             features in GhostWriter are                                                reasons for using a high-DPI display
                                                                                                                        in the first place, and it’s a pleasure
word count. It’s amazing how                 few but expertly chosen                                                    to type things into GhostWriter.
important word count is to most                                                                                             This may also be subjective, but
writers, and yet it’s often almost        it disables to the Delete key. This                                           it’s quick too – characters appear
impossible to find an editor that         may work for some writers perhaps                                             almost instantly (as they do in
makes this visible all the time           too troubled with perfection, but we                                          FocusWriter), which is something
without eating great swathes of           find the Delete key useful.                                                   you only really notice when you
screen. Even with FinalWriter you            Perhaps more like the real                                                 type lots of things. The only thing
have to drag the cursor to the            Hemingway, the other features in                                              missing from FocusWriter we can
bottom border of the screen, which        GhostWriter are few but perfectly                                             think of is the typing sound.
is more of a distraction than the         chosen. In particular, there’s an
hopes of being distraction-free by        outline window that shows heading                                             Project website
not showing it by default.                and subheadings, a document                                                   http://wereturtle.github.io/ghostwriter



                                                                  www.linuxvoice.com                                                                              67
     FOSSPICKS


PulseAudio mixer


PAmix
There are almost as many software           Each application that’s sending
audio mixers as there are audio         audio to PulseAudio is listed
subsystems for Linux. There are         vertically, and alongside each of
even a few for the command line.        these there’s a volume slider. Each
We’ve always relied on alsa-mixer,      audio source also has a bouncing
for example, when our machines          volume indicator, just like the VU
are making a sound we just can’t        meter on an 80s stacking Hi-Fi, and       The build pamix executable is a mere 56k in size.
stop any other way.                     it’s very quick and easy to see
  PAmix is an ncurses-based mixer       what's responsible for whichever                                      audio issues, and the clarity of the
for PulseAudio that has no              sound you want to control.                                            output and control is better than
dependencies (other than ncurses            Pressing M will mute or unmute                                    you find in desktops like KDE, for
and PulseAudio) and gives you           the audio source, and you can                                         instance, although this has
instant access to the audio output      control the volume with the H and I                                   improved drastically over the last
on your hardware. It’s not powerful     keys. J and K are used to switch                                      six months. If you ever need more
and it’s very simple in its             between inputs and Q to quit. That’s                                  control, there’s always pavucontrol
functionality, but it’s also tiny and   almost all there is to this small tool,                               and even PulseAudio on the
runs instantly. It was quicker to       but it’s about all you need 90% of                                    command line, but if you want
build the entire project from its       the time when dealing with normal                                     quick visualisation over a remote
source code that waiting for the                                                                              Raspberry Pi audio client, or you run
graphical pavucontrol mixer for
PulseAudio to load on the desktop,
                                           PAmix provides all you need                                        everything from the terminal, PAmix
                                                                                                              is an excellent addition.
for example, and it provides just          90% of the time when
enough functionality for the
majority of users.                         dealing with audio issues                                          Project website
                                                                                                              https://github.com/patroclos/PAmix



Games controller config


SC Controller
Valve’s Steam Controller has now           SC Controller is a brilliant utility
been out for almost a year, and the     that enables you to create profiles
verdict is still undecided. It does     and reconfigure every aspect of the
away with the traditional dual          Steam Controller, without ever
analogue sticks, and replaces them      having to launch Steam. This is
with circular touchpads and clever      particularly useful if you want to
haptic feedback, the intention being    use the controller on a computer
that they can act as sticks if you      that doesn’t have Steam installed,
want them to, but they can also act     or a computer where you don’t             Turn your Steam Controller into a keyboard and mouse, all without
more like a mouse, which is             want to install Steam.                    Steam (thanks Ioangogo!).
essential for FPS games, for               It supports the redefinition of the
example. We use ours alongside a        single analogue stick, the pads and                                   thresholds, analogue output (great
regular controller for playing games    the orientation input, as well as                                     for mouse control) and even the
such as Kerbal Space Program – a        emulation of other controllers such                                   ability to trigger scripts and
game that otherwise requires a          as a real 360 controller, a mouse, a                                  commands. It takes Steam
mouse and keyboard.                     trackball and a regular keyboard.                                     Controller out of the world of niche
  Steam Controllers work with           You also have control over pressure                                   gaming and into a world of huge
Valve’s Linux-based Steam Boxes,                                                                              potential, especially if you can pick
and SteamOS, where the                                                                                        up a Steam Controller in one of
community have created profiles            SC Controller enables you                                          Valve’s famous seasonal sales.
for most games, but they’ve also           to reconfigure every aspect
been difficult to use outside of
                                           of the Steam Controller
                                                                                                              Project website
Valve’s ecosystem. Until now!                                                                                 https://github.com/kozec/sc-controller



68                                                            www.linuxvoice.com
                                                                                                                                 FOSSPICKS




FOSSpicks Brain Relaxers
Space adventure


Oolite 1.84
We’ve of course covered Oolite             genuine alternative, although it’s
before. It’s absolutely one of the         much more like Elite than Elite
best open source games you can             Dangerous, and some players will
play, and has been the best                prefer it for this.
interpretation of the 1980s classic,
Elite, for over a decade. Elite, for the   Right on, commander!
uninitiated, was a game set in the         Updates come few and far between
vastness of space. You could be a          – the last one was in May 2015, but
trader, a pirate, a mercenary, or a        each one is a signification
mixture of all three.                      improvement over the previous
   The 3D graphics were also               version. In particular, the game’s AI
revolutionary, helping pull the player     and combat have become a lot            If you don’t have the        example, has been enhanced to
                                                                                   latest PC (and
into a world that felt infinite. David     more satisfying.                                                     make it more like the pseudo-
                                                                                   Windows!) for running
Braben, one of the original                  Version 1.84 makes a few              Elite Dangerous, Oolite is   random of the original BBC version,
developers of Elite, is now head of        important changes, such as putting      a brilliant alternative      and there are many, many bugfixes
Frontier Developments, a games             HUID messages under the console,        that's more true to the      too. Fundamentally, it’s a brilliant
company that has spent the last            and allowing all ships to carry         original.                    game and Oolite is the best version.
couple of years developing Elite           multiple lasers, but it’s never lost
Dangerous, though sadly there’s no         the attention to detail. Even the                                    Project website
Linux version. This makes Oolite a         movement of the tumbling ship, for                                   http://www.oolite.org




2D platformer


ReTux
Despite being completely Free              code, or re-distribute it themselves,
Software and proud of it –                 there aren’t any obvious mirrors
declaring itself as a “100% libre          offering the same files.
software and libre culture action
platformer loosely inspired by the         La mode classique
Mario games,” this cute old-school         On first glance, the game looks a lot
game has taken an unusual                  like the old Linux platform game
approach to distribution. All              SuperTux. But ReTux isn’t a copy.
                                                                                   ReTux may look like
downloads, including source code,          The visual similarity is because                                     and the way you navigate the island
                                                                                   SuperTux, but that’s only
are encrypted.                             ReTux has taken the art assets and      because reTux has            setting will feel very similar to Super
   You need to pay $4.99 USD or            used them within its own game           borrowed some of the         Mario or The Great Giana Sisters, as
more to receive the password that          engine, implementing its own            same images.                 will the coin collecting, jumping and
unlocks the files and gain access to       gameplay mechanics such as                                           throwing things as you attempt to
either a set of executable binaries,       infinite lives, defaulting to running                                reach the flagpoles at the end of
or the full Git log and source code        rather than walking, super-powers                                    each level. It’s now a classic game
from the development repository.           that come from special items and a                                   mechanic and it’s obvious a lot of
There isn’t even a demo version you        colour palette that is apparently                                    thought and appreciation of the
can try. But we respect the                accessible to colourblind people.                                    genre has gone into the game.
developers for trying a different             There are 41 levels, plus a level
funding strategy, and while anyone         designer, with some puzzle                                           Project website
can presumably ask for the source          elements. The way you progress                                       www.nongnu.org/retux



                                                                www.linuxvoice.com                                                                  69
                                                                                                                    INTRO TUTORIALS




TUTORIALS
Warning: excessive Linux knowledge may lead to fun and more efficient computing.

                                              In this issue . . .
                                                                                         72                                                         74




                                              Boinc: Help scientists do                              Encryption with
Mike Saunders
Finds too many TLAs a PITA.                   science more betterer                                  Veracrypt
                                              Advance the world of science with Boinc, and           Nate Drake checks out the key features of the
                                              become a scientist without even leaving your desk.     latest fork of Truecrypt, employing military-level



O
         ne of the terms we often use in      Ben Everard explains all.                              encryption for your data.
         Linux Voice is FOSS, for “Free
         and Open Source Software”. It’s
a useful shorthand way of expressing a                                                   78                                                         82
couple of philosophies in our
community, but it’s also a bit of a
cludge. Can’t we settle on one simple
description? I understand that from the
perspective of GNU founder Richard
Stallman, the “free” highlights freedom
more than low cost or practicality. But it
can be misinterpreted – for instance          Raspberry Pi: Physical                                 Photography: image
with dodgy Windows “freeware”.
   Indeed, I asked Richard about this a
                                              computing                                              processing
few years ago: whether, looking back,         Go back to basics with Les Pounder and discover        Apply smart fixing, processing and storing
another word like “libre” may have made       physical computing with Python, a Raspberry Pi,        techniques to your images. Alexander Tolstoy
more sense. He seemed to agree that           and a bunch of LEDs.                                   saves you time, so you can watch more cat videos.
“free” has led to ambiguities, but
hammering home the “free as in
speech, not beer” line has helped to          Coding
explain. Personally, I like to use the term
“Free Software” as the freedom is
                                                                                                                                    Get access to ev
incredibly important to me – the                                                                                                                      ery
                                                                                                                                Linux Voice tuto
freedom to use, share and modify                                                                                                                  rial ever
                                                                                                                                 published in ou
software. Freedom from spying                                                                                                                    r digital
                                                                                                                                 library of back-i
governments and companies. Freedom                                                                                                                 ssues
                                                                                                                                available exclus
to keep software and hardware running                                                                                                            ively to
                                                                                                                                 subscribers – tu
for as long as its users wish, without                                                                                                             rn to
                                                                                                                                   page p56 to join
enforced obsolescence. I’ve nothing           Solr                           86   Build packages                  90                                 .
against the term “open source”, but I do      Add some order to the chaos that    Valentine Sinitsyn explains the
share Stallman’s concerns.                    is the Linux Voice back catalogue   tech and tricks behind creating
mike@linuxvoice.com                           with a search engine.               nicely wrapped-up packages.



                                                               www.linuxvoice.com                                                                         71
     TUTORIAL BOINC




ADVANCE THE WORLD OF
SCIENCE WITH BOINC
Ben Everard gets a labcoat and becomes a scientist without ever leaving his desk.


                         B
BEN EVERARD                       oinc is a bit of software that lets you pass on       power to try to improve the sum of human knowledge.
                                  your spare CPU time to projects that need the         There are a huge range of projects on Boinc, including
Why do this?                      computing power. By dividing a task between           analysing data gathered by telescopes, building our
• Help scientists do     thousands of Boinc users – each of whom contribute             understanding of diseases and investigating the
  science                some of their spare CPU cycles – research                      structure of proteins. By working with this software,
• Put spare computing    institutions can get a huge amount of computing                you’re contributing to these highly worthwhile fields.
  power to work
• Save the polar bears

                         STEP BY STEP: SOLVE CLIMATE CHANGE
                         1
                             Install software                                           2
                                                                                            Select a project – Climateprediction.net
                         If Boinc isn't in your distro's repositories, you’ll need to   There are a huge range of Boinc projects, most run by
                         grab it from the project’s website: https://boinc.             researchers at universities around the world; we’ll use
                         berkeley.edu. This will download a shell script that           the climateprediction.net project, as it runs on Linux
                         you need to run to create the BOINC directory. Inside          and it’s a project that we think is important. Open up
                         this directory you’ll find two programs called run_            Boinc and go to Tools > Add Project, search for
                         client and run_manager. Run these with:                        climateprediction.net, and then press Next. For the
                         ./run_client --daemon                                          first use, we recommend not joining a team or adding
                         ./run_manager                                                  extra details, as you can do this later if you choose.
                           There’s detailed troubleshooting information at
                         https://boinc.berkeley.edu/wiki/Installing_BOINC.




                         3
                             Advanced mode                                              4
                                                                                            Will it gobble your CPU? Nice!
                         Boinc's default interface is designed to make it easy          All Boinc processes have a nice value of 19. The nice
                         for non-technical people to join projects, but we prefer       value is used to determine what processes to run on
                         the Advanced View. Go to View > Advanced View (or              the CPU at a given time. The higher the nice value, the
                         press Ctrl+Shift+A) to switch the interface. The               less likely the process is to run, and 19 is the
                         Advanced View gives you a tabbed interface where               maximum they can be. In other words, the nicer a
                         you can see much more about what’s going on                    process is, the more it lets other processes run first. If
                         including the specific tasks that are running, the             there are any other processes that need to run, the
                         amount of storage that’s being used and statistics for         kernel will select those rather than the Boinc ones, so
                         how things are running. Different projects run in              your machine's performance shouldn’t suffer.
                         different ways, so it can be interesting to see how they
                         make use of your computer.




72                                                         www.linuxvoice.com
                                                                                                                  BOINC TUTORIAL

5
    Adding more projects                                   6
                                                               Set up a team
You can add as many projects to Boinc as you like, but     Teams in Boinc are used to report where the
since you only have a set amount of computing              computing resources have come from. They’re not
power, the more projects you add, the less CPU time        important in the grand scheme of things, but enable
each one gets. Boinc will, by default, split your          people to show how much computing resources
computing power evenly between all projects you add.       they’re contributing as a group. For example, you can
  You can control the share of your computing power        see the most active teams on Climateprediction.net
that each project gets in the project’s settings.          here: http://climateapps2.oerc.ox.ac.uk/cpdnboinc/
Highlight a project in the Projects tab and click Your     top_teams.php. You can apply to join a team by
Account. This will open your web browser and take          searching for a team, and clicking ‘Join This Team’ on
you to the project’s settings page where you can           their webpage. Alternatively, if none of them are a
configure all your settings. Go to the project’s           good fit, you can create your own team by going to
Preferences link (eg ClimatePrediction.net                 the Teams website (for climateprediciton.net, this is
Preferences), and click Edit. You can now increase or      http://climateapps2.oerc.ox.ac.uk/cpdnboinc/team.
decrease the share of your CPU that this project gets.     php), and clicking Create A Team. Creating a team
The higher the number, the more CPU time it gets.          could be a good option if you have several computers
                                                           that you contribute from and you want to see how
                                                           powerful they are.




7
    Settings                                               8
                                                               Boinc mobile
In the default setup, Boinc should stay out of your way    Most people have a low-power computer that runs all
and just run in the background when you have spare         day every day – their smartphone. Although the
CPU cycles. However, if you do encounter a slow-           computing power of a single phone is quite low when
down, there are configuration options that you can         compared with a desktop, the combined power of
use to tweak the way the software runs.                    thousands or millions is still significant. At present, the
   Under Options > Computing Options you can set           software’s only available for Android, and you can find
limits on the amount of computing power that can be        it in the Google Play Store.
allocated to Boinc projects such as a limit on the total       The obvious concern with sharing your phone’s
amount of CPU time or CPU cores. The Disk And              computing power is that it will drain the battery or use
Memory tab in this options screen is particularly          up mobile data. Boinc on Android will only start
useful, as these are often the resources that Boinc can    processing if the device is connected to the mains
cause problems with. Another way of limiting Boinc is      and fully charges, and it will only transfer data over
getting it to stop when particular software is running     Wi-Fi. For most people, this means that it’ll happily
– this is great if you have some software that requires    share your phone’s computing power overnight, but
plenty of computing horsepower that you don’t want         not run when you’re out during the day.
to slow down.




                                                               www.linuxvoice.com                                                  73
     TUTORIAL VERACRYPT




ENCRYPT YOUR FILES
WITH VERACRYPT
Explore the features of the latest fork of the Truecrypt safekeeping solution to
employ miltary-level encryption on your data.


                              T
NATE DRAKE                             ruecrypt is dead. Long live Veracrypt! On 28        using it to protect your most sensitive personal
                                       May 2014, the developers of the handy               information.
Why do this?                           encryption program Truecrypt suddenly
• Use multiple                announced that they would no longer continue                 Three cheers for cascades
  encryption ciphers          maintaining the software.                                    Most popular distros of Linux, including Ubuntu and
  simultaneously to              The mysterious programmers behind the project             Linux Mint, now offer system encryption by default as
  protect files in case
  any one is broken.          recommended switching to Bitlocker instead. This             well as the option to encrypt your home folder.
• Use plausible               came as a bitter blow to those who had previously            Gnome’s disk utility has the option to format a drive
  deniability to keep         used this cross-platform utility. Truecrypt’s popularity     with LUKS so it requires a password to access. This
  your data safe even if      stemmed from the fact that it provided a simple GUI          begs the question why there’s any need for additional
  you’re forced to hand
  over a password.            to create encrypted containers of any size wherein           encryption software.
• Combine passwords           files could be placed. It also enabled users to quickly         Aside from the benefits of being cross-platform, the
  with keyfiles to            and easily encrypt an entire USB stick or hard drive.        answer is that Veracrypt employs cascades of ciphers.
  strengthen hugely           Users of the Windows version also had the option to          In addition to the default encryption algorithm used
  the protection of
  you encrypted               encrypt their entire operating system.                       by LUKS, which is AES, Veracrypt also offers Serpent
  information.                   For Linux users, there were few viable alternatives       and Twofish (Twofish was developed by security guru
                              that allowed such powerful encryption to be employed         Bruce Schneier, and is based on Bruce’s previous
                              so easily, which is perhaps one of the reasons why           block cipher Blowfish, which was developed in 1993
                              French IT security consultant Mounir Idrassi decided         but is still very widely used). Most crucially, Veracrypt
                              to fork the Truecrypt project and create Veracrypt.          allows creation of encrypted file containers or drives
                                 Version 1.17 of Veracypt was released in February         using any one of these drives or a combination such
                              2016 and continues to be maintained. Although the            as AES-Twofish-Serpent.
                              GUI is not particularly intuitive (as with Truecrypt) it        The degree to which using cascades of ciphers
                              only takes a matter of minutes to install and start          protects your data rather than relying on just one
                                                                                           really can’t be overstated. For instance, if you choose
                                                                                           AES-Twofish-Serpent, each 128-bit block of data is
                                                                                           first encrypted with Serpent, then with Twofish , and
                                                                                           finally with AES. Each of the cascaded ciphers uses its
                                                                                           own key. All encryption keys are mutually independent
                                                                                           so that all three ciphers must be broken without the
                                                                                           correct key to access your data.
                                                                                              There is no need to remember this however, as
                                                                                           the volume creation wizard explains each cipher
                                                                                           when selected in the drop-down menu as well as
                                                                                           how each cascade of ciphers operates. Naturally
                                                                                           employing multiple ciphers will also come at a cost
                                                                                           in processing speed, so it’s best to make use of the
                                                                                           handy ‘benchmark’ button to test the speed of each
                                                                                           algorithm in RAM.
                                                                                              The volume creation wizard also enables you
                                                                                           to choose your own hash algorithim; currently the
                                                                                           options are SHA-256, SHA-512 and Whirlpool. One
                                                                                           of the criticisms of Veracrypt’s predecessor Truecrypt
                                                                                           was that it used the rather dated RIPEMD-160.
The volume creation wizard helpfully explains how each encryption algorithim is applied.   Veracrypt can open old Truecrypt volumes using this



74                                                             www.linuxvoice.com
                                                                                                                          VERACRYPT TUTORIAL


                                                                                                                                        Use entropy from the
                                                                                                                                        mouse to generate random
                                                                                                                                        keyfiles. You can also
                                                                                                                                        randomise their size.




hash, but for security reasons no longer employs it to              this also enables multiple people to access the
create new volumes.                                                 same encrypted volume. The veracrypt volume
                                                                    can be created using only a keyfile to open it, and
Keyfiles knowhow                                                    each person can then encrypt said keyfile with the
If cascade ciphers and more secure hashes don’t tip                 password of their choice.
the balance in Veracrypt’s favour, the volume creation                 Veracrypt has a built-in generator for random
wizard also enables the use of keyfiles in addition to a
password. In simplest terms a keyfile is a file whose
content is combined with a password to open a
                                                                       Without both the keyfile and the correct
volume. Without both the keyfile (or keyfiles) and the                 password, the encrypted Veracrypt
correct password, the encrypted Veracrypt volume will
not open.                                                              volume will not appear
   This provides a huge benefit firstly in that it will
become much harder to ‘brute force’ your password                   keyfiles, using entropy gained from wiggling your
as the encryption key will be combined with the data                mouse within its window. The downside of using
in the file. Secondly, it is more in keeping with the               Veracrypt’s own keyfiles is that they are quite obviously
modern standard of two-factor security such as a                    just random data, so would be easy to detect.
password combined with a security token or smart                      One way to increase security is to generate a
card. If the keyfile itself is protected by a password,             number of keyfiles but only use a certain number


  Getting started
  Head over to https://veracrypt.codeplex.com/releases/             Veracrypt you’ll need to run the script ‘veracrypt-uninstall.sh’.
  view/619351 to download the Linux version of Veracrypt. The          If you prefer to download and compile the source code
  more security-minded might also wish to verify the download       yourself, download it from https://veracrypt.codeplex.com/
  via the PGP signature. The user guide can also be downloaded      wikipage?title=Downloads extract it and open README.md
  from this page.                                                   in your favourite text editor. Scroll down to the section titled
     Use your favourite archiving program to extract either         ‘Instructions for Building VeraCrypt for Linux and Mac OS X’
  ‘veracrypt-1.17-setup-gui-x64’ or ‘veracrypt-1.17-setup-          and follow the steps there.
  gui-x86’ depending on your processor architecture. If in doubt,      If you’re using a GNOME Desktop Environment, veracrypt
  choose the second of the two.                                     should appear right away in your Accessories post-install.
     Next in Terminal run                                           Otherwise you can run it from terminal with
  chmod a+x                                                         sudo veracrypt
     code plus the filename to make it executable and run it.          Veracrypt needs admin rights to be able to mount an
  You’ll be welcomed to the installer. Choose to run ‘Install       encrypted volume so may ask for your password if you choose
  Veracrypt’ rather than extract the Tar Package and agree to       to run without
  the terms and conditions. You’ll also be told that to uninstall   sudo




                                                                      www.linuxvoice.com                                                                     75
     TUTORIAL VERACRYPT

                                                                                           from the Linux command line or the free erasure
                                                                                           software Darik’s Boot and Nuke.
                                                                                              While this may be true theoretically, key disclosure
                                                                                           laws in many jurisdictions place the burden of proof
                                                                                           upon the suspect. An unscrupulous adversary may
                                                                                           also employ ‘rubber hose cryptography’ ie torture
                                                                                           or coercion to obtain a password from a volume
                                                                                           they suspect to be encrypted. Moreover, if you use
                                                                                           Veracrypt to create an encrypted file container rather
                                                                                           than encrypt an entire drive, there is really no plausible
                                                                                           reason for you to have a large block of useless
                                                                                           random data on your computer.
                                                                                              For this reason, Veracrypt has an option to create a
                                                                                           hidden volume inside your main encrypted container
                                                                                           or drive. As the name suggests, the hidden volume
                                                                                           is created within the free space of another Veracrypt
                                                                                           volume (the ‘outer volume’). When the outer volume
                                                                                           is mounted, it is impossible for an adversary to be
                                                                                           certain that there is a hidden volume inside, as any
The hidden volume lies
                              of them, eg only the last three files of a group of 10.      free space is always hidden with seemingly random
inside the outer volume.
Veracrypt will let you know   It’s also possible to use any kind of file as a keyfile,     data anyway. Even the headers to the hidden volume
the maximum possible size     such as an MP3 or JPEG. Provided there are enough            are encrypted, so there is no way to determine if they
to avoid overwriting data.    picture/music files on your system, an adversary             are valid data without the correct password.
                              would have a much harder time divining which one                When using the volume creation wizard, you have
                              is the keyfile. If you choose to use an ordinary file to     the option to create a hidden volume with a separate
                              do this, however, bear in mind that if even one of the       password and/or keyfiles to the outer volume.
                                                                                           Once your outer volume is mounted, copy some
                                                                                           plausible-looking files there and make a note of the
     Veracrypt has an option to create a                                                   password. This is the password that you would give
     hidden volume inside your main                                                        up if compelled to provide one, which would lead
                                                                                           your adversary only to the dummy files. The hidden
     encrypted container or drive                                                          volume would be mounted separately with a different
                                                                                           password, and would contain your truly personal files.
                              first 1024 kilobytes of your file changes, the key will no      When the outer volume alone is mounted, even
                              longer be valid.                                             Veracrypt cannot determine if a hidden volume exists,
                                                                                           and if you copy data to it, it may overwrite files already
                              Plausible deniability                                        in your hidden volume. Fortunately Veracrypt has a
                              Although any file can be a keyfile, it’s not easy to hide
                              the fact that you are employing encryption in the first
                                                                                             Volume creation
                              place. Gnome’s disk utility, for instance, makes no
                              effort to hide the LUKS header if used to encrypt a            To create an encrypted volume on Veracrypt, head over to
                                                                                             the Volumes menu then Create New Volume.
                              drive, so while it may not be possible to access your
                                                                                                 You’ll first be asked to choose whether to create a file
                              data, it may be clear to your adversary that you have          container which can be mounted as a virtual drive and have
                              something to hide and you may run afoul of your                files placed inside it, or to encrypt an entire non-system
                              country’s key disclosure laws.                                 partition such as a USB stick. Choose accordingly and
                                  In the UK for example, the Regulation of                   then click ‘Next’. Choose your volume type, in this case,
                                                                                             Standard. You’ll next be asked to choose the location
                              Investigatory Powers Act (2000) requires members of
                                                                                             of your file container, so click on Select File to choose a
                              the public to provide their passwords when requested           location and a name eg myfiles.vc. Clicking Next will let
                              to the police. Failure to comply can result in up to two       you choose your encryption algorithim and hash. If you're
                              years in prison. In 2010 a 19-year-old in Lancashire           stuck, stay with the default options (AES + SHA-512), then
                              was sentenced to 16 weeks in a young offender’s                click on Next.
                                                                                                 You’ll be asked to specify the volume size. Veracrypt will
                              institution for refusing to cooperate with a formal
                                                                                             also state how much free space is available. Click on Next
                              order to hand over his password.                               to choose a password and add any keyfiles. Once these
                                  Veracrypt encrypts all volume headers, so by               are entered, click Next to choose a filesystem. The default
                              analysis of a drive alone, it’s not possible from a            of FAT is probably best provided you don’t plan on storing
                              technical perspective to determine that the data on            files larger than 4GB. (You can choose Linux formats and
                                                                                             even NTFS if you wish though.) Finally you’ll be asked to
                              it is encrypted. The data appears to be random and
                                                                                             move your mouse inside the Veracrypt window to gather
                              could be there as a result of a secure wipe of the drive       randomness. The longer you do this, the harder it will be to
                              by using                                                       brute-force your volume password.
                              dd



76                                                             www.linuxvoice.com
                                                                                                                       VERACRYPT TUTORIAL


  Plausible deniability
  Although it can be difficult to convince a shadowy
  government organisation that your encrypted files are really
  just random data, the first step is to use an external drive,
  rather than create a file container. The Veracrypt project
  recommends drives that don’t implement wear-levelling
  such as SSD’s and USB sticks, as traces of a hidden volume
  may remain, so consider using an old-school hard drive with
  magnetic storage if available.
      Once inserted, head to the Volumes menu on Veracrypt
  and Create New Volume. Next choose to ‘Create a volume
  within a partition/drive’. Click on Next then on Hidden
  Veracrypt Volume. Click Next then Select Device, then the
  main partition of your external drive eg /dev/sdb1.
      You’ll be asked to choose the outer volume encryption
  algorithim and hash. You can then specify an outer volume
  password and/or keyfiles. Remember these must be
  plausible, so choose a secure password (20+ characters).
  Click Next to start generating randomness from your mouse
  movements, then Format to begin creating the volume. Any
  files already on the volume will be lost.
      Once volume creation is complete, you’ll see it’s been
  automatically mounted. Click on Open Outer Volume and
  copy some plausible-looking files into it. Click on Next
  when you're done to begin creation of the hidden volume.                                                                               Example of a Cold Boot
  Choose whatever Cipher and Hash Algorithm you wish, then           Many of the updates made to Veracrypt have been
                                                                                                                                         attack. Cooling RAM
  click next. You’ll then choose the size of the hidden volume.   done to simplify the original Truecrypt code used                      chips with compressed air
  Veracrypt will tell you the maximum possible size. Choose       as well as make it easier for users to download,                       preserves data in virtual
  Next and then Format to create the hidden volume.               verify and compile the source code themselves as                       memory, like such as
      It’s highly advisable to visit Veracrypt’s wiki and read
                                                                  any privacy-minded person should. Some of the                          encryption keys, which can
  Security Requirements and Precautions Pertaining to
  Hidden Volumes for some help on best practices for              improvements made by Veracrypt have resulted in                        then be harvested with
  plausible deniability.                                          longer access times to mount encrypted volumes,                        specialised pen-testing
                                                                  although this has been cut in half with the most                       software.
                                                                  recent release of the software.                                        Source: https://www.ethicalhacker.
feature named ‘Hidden Volume Protection’ To prevent                  Mounir was kind enough to take time to speak                        net/features/root/using-cold-
                                                                                                                                         boot-attacks-forensic-techniques-
this when mounting the outer volume on Veracrypt,                 to Linux Voice about the Veracrypt project. Of late,                   penetration-tests
click Mount Options when accessing the outer                      the main focus has been on developing support
volume and enter the password there to your hidden                for Windows UEFI encryption, as he claims that
container. In this way, the data inside your hidden               currently there is no open source software available
volume will not be affected.                                      for this. Nevertheless the Linux version is under active
   Plausible deniability will naturally only be effective if      development, and anyone interested in finding out
the data in the outer volume is something you would               more or devoting their time is welcome to contact the
genuinely wish to hide, so placing vintage episodes of            project on veracrypt@idrix.fr.
the TV show Blockbusters in there, for example will be               Veracrypt also will not protect against so-called “Evil
unlikely to impress an adversary.                                 Maid" or “Cold Boot” attacks, whereby an adversary
                                                                  has physical access to the machine on which you
Veracrypt viability                                               mount the volumes. This vulnerability isn’t unique to
No security solution is perfect. While accessing an               Veracrypt but can be reduced by employing keyfiles
encrypted volume in Veracrypt for instance, the                   and keeping your machine physically secure.
operating system may write to unencrypted volumes.                   Finally, given the extensive security features already
The existence of a hidden volume may be revealed by               listed, it should be obvious that failure to put in the
analysing an encrypted drive or container at different            correct password and provide all the correct and
stages eg if you place it inside a cloud storage service          unaltered keyfiles will result in the encrypted volume
like Dropbox. The Veracrypt website recommends                    failing to open. Either make sure to write these down
storing encrypted data offline and accessing via a live           or use a password manager like KeePass.
Linux CD where possible. Some of the wariness of                     Whether you’re a hardened security guru or a
Veracrypt stems from the Truecrypt project. In April              beginner, Veracrypt offers some dazzling security
2015 a full security audit of the 70,000 lines of code in         features. As with all security issues, it’s important
Truecrypt was completed by the Open Crypto Alliance               to explore these yourself and invent a solution that
Project. The full results of their findings are available         works for you.
from the Alliance’s website, but in brief no evidence of
any deliberately coded backdoor was found, nor were               Nate Drake is the author of "Locking Down Facebook", a free guide to
any major vulnerabilities.                                        protect your privacy while using the social network.



                                                                    www.linuxvoice.com                                                                                 77
     TUTORIAL LINUX FOR LEARNERS




PYTHON AND PHYSICAL
COMPUTING
Go back to basics and introduce physical computing using the Raspberry Pi.


                             T
LES POUNDER                            aking your first steps into coding and physical
                                       computing can be a little daunting. Even the
Why do this?                           relatively simple task of turning on an LED can
• Learn electronics          fill a new user with dread. But this challenge is
• Learn the basics of        immensely rewarding and will unleash a new way of
  Python                     thinking – the way a maker thinks! So to ease you into
                             the new world of the maker we shall use three
You will need
                             projects, each of which will build upon the last and
• Any model Raspberry
                             introduce new programming concepts. The goal of
  Pi running the latest
  Raspbian release           these projects is to get ourselves familiarised with
• A mixture of female        hardware components and how we can control them               Our project uses one simple circuit built upon a
  to male and male to        in different, and relatively simple ways.                     breadboard to demonstrate essential coding concepts
  male jumper wire
                                 For all of the projects we shall use one simple           and maker skills using Python.
• 3 x LED (red, amber,
  green)
                             circuit. The basic circuit comprises an LED that is
• A breadboard
                             connected to the GPIO of the Raspberry Pi. The long           It encourages the learner to attempt it and rewards
• 3 x 330Ω
                             leg, the anode, is connected to a specific GPIO pin; this     them quickly with a view to further challenges.
  resistor (orange,          is set in the code for each project later in this tutorial.      In this first project we shall flash each of the LEDs
  orange,brown)              The short leg, the cathode is connected to a ground           present on the breadboard. Each LED will flash three
• 3 x momentary              rail on our breadboard via a 330Ω resistor. This circuit      times in rapid succession before moving on to the
  switches (buttons)
                             is replicated so that there are three occurences on the       next. Via this project we shall learn to import libraries
                             breadboard. A push button is also inserted into the           to enhance our code. We also learn about variables
                             breadboard, so that the legs of the button are across         and two types of loops.
                             the centre channel of the breadboard. The button                 To get started, open the Python 3 application from
                             is also connected to a specific GPIO pin, and to the          the Programming menu, found in the top-left of the
                             common ground rail of the breadboard.                         Raspbian desktop. Once this is open click on File >
                                 Please refer to the diagram at https://github.com/        New to create a new blank document. Now click on
                             lesp/LV31-Python-Basics/archive/master.zip for a              File > Save and call the file Project-1-LED-Flash.py.
                             detailed overview of the circuit.                             Subsequent saves will be instant.
                                                                                              Our first two lines of Python will be to import
                             Project 1 – Flashing an LED 1001                              external libraries into our code, namely the GPIO Zero
                             We start our projects using a simple flashing LED as a        and Time libraries. Importing libraries is a way of
                             means of output. In this era of virtual reality and high-     adding extra abilities to your code. For example, by
                             definition gaming, the humble LED is still seen as the        adding the GPIO Zero library we can now interact with
                             “Hello World” of physical computing. The first project        the GPIO pins. There are many libraries for Python and
                             with hardware and software should always be simple.           we go into detail via the boxout in this tutorial.
                                                                                              From the GPIO Zero library we import LED, which
                                                                                           this will enable us to interact with the LEDs. From the
                                                                                           Time library we import sleep, which will enable us to
                                                                                           control the pace of our project.
                                                                                           from gpiozero import LED
                                                                                           from time import sleep
This circuit diagram shows
                                                                                             The next section of code contains four variables.
where every component
needs to be placed. We                                                                     Variables are containers for information. They can
used Fritzing (http://                                                                     store anything that we need to store, from a person's
fritzing.org/home) to draw                                                                 name to sensor data. A variable is given a name,
the diagram.                                                                               typically one that reflects the expected content. In



78                                                            www.linuxvoice.com
                                                                                                       LINUX FOR LEARNERS TUTORIAL


this project we create four variables:, the first three                                                                                   The Raspberry Pi website
(red, amber and green) are used to store the number                                                                                       has plenty of resources for
of the pin that will be connected to the long leg of our                                                                                  you to investigate at your
LED. We use the GPIO Zero LED function to call and                                                                                        leisure. They cover most
                                                                                                                                          topics and ability ranges.
store the location, which is then neatly wrapped up
                                                                                                                                          www.raspberrypi.org/
in our variable. The fourth variable, flashes, stores an                                                                                  resources.
integer value, a number that has no decimal place.
This integer will control how many times each LED will
flash, hence its name.
red = LED(17)
amber = LED(27)
green = LED(22)
flashes = 3
  We now move on to the main loop that will control
our project. To run the code indefinitely we use a
while True loop. This is an infinite loop that will run the               sleep(0.5)
code contained therein forever. As you can see in the                   Once the red LED has finished flashing, the for loop
code, after starting the loop the code underneath is                 ends and returns to the next line in the main loop. The
indented. Python uses indents to identify where code                 next line in this example is another for loop that will
belongs. In this case the code belongs in the infinite               flash the amber/yellow LED in the exact same fashion
loop.                                                                as the red LED. This code is indented in the exact
while True:                                                          same manner as the previous red LED sequence.
   We now start a new loop inside the main loop. The                   for i in range(flashes):
new loop, a for loop, will use a range to control how                     amber.on()
many times it goes round. The range is a number that                      sleep(0.5)
we want to count to. In this case we use the variable                     amber.off()
“flashes” to control the number of times that we wish                     sleep(0.5)
to flash the LED, the default value being three times.                   We repeat the same code for our green LED,
  for i in range(flashes):                                           replacing amber.on() with green.on().
   The code now indents a further four spaces as we                      With this code complete, save your work and
have just created a new for loop and now we need                     click on Run > Run Module to start the LED flashing
to write the code that will be actioned for a certain                sequence. Now watch your LEDs and count how
number of times. This is the code that will flash                    many times they each flash. An extension activity for
our LED on and off. Earlier we named each variable                   this project would be to change the number of times
after the colour of LED we wish to use. So we need                   the LED will flash, and then change the speed at which
to turn on each colour, wait for half a second using                 it flashes. To stop the code at any time press Ctrl+C
sleep(0.5), then turn off the colour before another
sleep is used. This last sleep is important, otherwise               Project 2 – Random choice LED 989
we will not see the flash effect. So here we see the                 For project 2 we add a random element to our code.
code that will flash the red LED, and this is inside of a            In this project we reuse the same circuit as Project 1
for loop that will iterate three times before it exits.              but this time we introduce user input in the form of a
    red.on()                                                         button. Once the button is pressed it triggers the code
    sleep(0.5)                                                       to choose an LED at random and then flash the LED.
    red.off()                                                           Click on File > New, to open a new blank document.


  Python libraries
  In this tutorial we lightly touched upon Python libraries,         in the shell. Once you're done with the help tool press Ctrl+D to
  sometimes referred to as modules. Libraries are a great way of     exit back to the Python shell.
  adding extra functionality to your code, but what libraries are       If you need to install a particular library then you'll need to
  included as standard? Well if you would like to find out, open     open the Linux Terminal, the icon for which is located in the
  the Python 3 shell by clicking on Run > Python Shell. In the       top-left of the Raspbian desktop. In the new terminal window
  shell type this command followed by Enter.                         type
  help()                                                             $ sudo pip3 search NAME OF THE LIBRARY
      You will now see a helpful message giving instructions on        If you don't know the library name just type a keyword, for
  how to use the tool. We're interested in the modules, so type      example “twitter” to show all the Twitterrelated libraries. Once
  modules and press Enter. It may take a few seconds for the         you have found a library to install, in the terminal type
  list to appear but it will show a complete audit of every Python   $ sudo pip3 install NAME OF THE LIBRARY
  library installed and ready for use. If you're interested in a       This will install the library and further enhance the
  particular library then you can learn more by typing its name      possibilities of your projects.




                                                                       www.linuxvoice.com                                                                         79
     TUTORIAL LINUX FOR LEARNERS


If you are a little baffled                                                                    We now enter into an infinite loop, while True, which
by the GPIO pins, fear not:                                                                 is identical to what we created in Project 1.
http://pinout.xyz, Written                                                                  while True:
by Phil Howard from                                                                            Our next line of code is a conditional statement, in
Pimoroni, is your single                                                                    this case it simply asks whether the button has been
resource for all of the pins.                                                               pressed, (remember that “button” refers to the variable
                                                                                            we created earlier). When the button is pressed
                                                                                            the GPIO Zero library understands that the button
                                                                                            changes the state of the GPIO pin it is attached to.
                                                                                            When left unpressed the GPIO pin connected to the
                                Immediately save your work as Project-2-Random-             button is pulled high, meaning that it is turned on and
                                LED.py and remember to save regularly.                      flowing with current. When we press the button we
                                  We start in the same manner as Project 1, by              connect this high pin to the GND, pulling the GPIO pin
                                importing a series of libraries to add functionality to     low and triggering a change of state which GPIO Zero
                                our code. But in this project we import Button from         uses to identify a button press.
                                GPIO Zero. This will enable us to use any free GPIO           if button.is_pressed:
                                pins that we wish as a button. We also import the             We now need to write the code that will be actioned
                                choice function from the Random library, a function         when the button is pressed; as with Project 1, any
                                that enables us to introduce a random choice element        code that belongs to a loop or a conditional is
                                to the project.                                             indented to identify where it belongs. So when the
                                from gpiozero import LED, Button                            button is pressed we create a variable called colour
                                from time import sleep                                      that will store the answer to a random choice of the
                                from random import choice                                   LED colours in the LEDS list we created earlier. We
                                  Just as in Project 1 we declare variables to handle       then print this to the Python shell for debug purposes.
                                the locations of our LEDs, which are attached to            Remember that printing output to the shell is a great
                                specific GPIO pins. But in this project we introduce a      way to understand how the project works, and it helps
                                button, sometimes called a momentary switch. This           when debugging a problem.
                                                                                                colour = choice(LEDS)

     Printing output to the shell is a great                                                    print(colour)
                                                                                               Just as in Project 1 we create a for loop that will
     way to understand how the project                                                      iterate for the number of times stored as an integer

     works, and it helps when debugging                                                     in the flashes variable. But what's different this time
                                                                                            is that we use the colour variable that we have just
                                                                                            created. The colour variable stores the colour of the
                                button is attached to pin 2 of the GPIO and so using        LED that has been randomly chosen. So rather than
                                the GPIO Zero library we declare that there is a button     explicitly call the LED by its colour we just use the
                                attached to said pin. Our last variable, flashes, handles   colour variable and add on() or off().
                                how many times the chosen LED will be flashed.                  for i in range(flashes):
                                red = LED(17)                                                     colour.on()
                                amber = LED(27)                                                   sleep(0.5)
                                green = LED(22)
                                button = Button(2)
                                flashes = 3
                                   Our next line of code requires an introduction.
                                LEDS is a list, data that is stored as a list of comma
                                separated values. In other languages a list is
                                sometimes called an “array”, but they all work in much
                                the same manner. A list can be used to store lots
                                of values, in this example we use a list to store the
                                variable names used for our LEDS. Lists are indexable,
                                meaning that we can retrieve data from any part of
                                a list, and we can also add and delete data in a list.
                                Our list contains three items of data, numbered 0,1,2,
                                as Python starts counting from zero. So red is 0, and
                                if we wanted to print that value of red we would use
                                print(LEDS[0]) and it would print the content of the
                                variable red. We cover more about Lists in the boxout.
                                So now we create our LEDS list and use it to store the
                                LEDs we have attached.                                      Components such as buttons, resistors and LEDs are
                                LEDS = [red,amber,green]                                    cheap and plentiful.


80                                                              www.linuxvoice.com
                                                                                               LINUX FOR LEARNERS TUTORIAL

      colour.off()                                                                                                                 Once you have mastered
      sleep(0.5)                                                                                                                   this project you are ready
                                                                                                                                   to move on to our Biscuit
    And with this last section of code completed we
                                                                                                                                   Security System project
should now save our work, then click on Run > Run
                                                                                                                                   https://www.linuxvoice.
Module to start the code. Now press the button next                                                                                com/raspberry-pi-simple-
to the red LED to start the random choice. Due to                                                                                  forms-of-input.
the small selection of options you will see the same
colour chosen quite often – it only has a 1 in 3 chance
of being chosen. An extension activity for this project
would be to add more LEDs and create a lightshow
that runs before the colour is chosen to give the
illusion of lots of options being computed.
                                                             our LEDS are turned off before we turn any more on.
Project 3 – Conditional LEDs 891                             This loop iterates through all the colours in the LEDS
For our final project we shall adapt our code to create      list we created, turning each of them off.
a function, a method of running a sequence of code             for led in LEDS:
by calling its name. The goal of this project is to press        led.off()
a button and have a corresponding LED light up.                 We next break out of the for loop, but remain inside
   Click on File > New to open a new blank document.         the function. Our next six lines are a conditional
Immediately save your work as Project-3-Pick-A-              statement that will test to see if the argument passed
Colour.py and remember to save regularly. We start           to the function is one of the three LED colours that we
our code by importing the libraries that will provide        have used. If the colour passed is not red then the test
the GPIO functionality for our LEDs and buttons and          is repeated for amber and green. For each condition
control the pace of our project. These are the same as       we indent the code to show what will happen if the
in Project 2.                                                condition is true.
from gpiozero import LED, Button                               if colour == "red":
from time import sleep                                           red.on()
  As with our previous projects we create variables to         elif colour == "amber":
state the GPIO pin used for our LEDs.                            amber.on()
red = LED(17)                                                  elif colour == "green":
amber = LED(27)                                                  green.on()
green = LED(22)                                                The final part of this project is to create an infinite
  Next we create three new variables; these are              loop that will constantly run a conditional statement
used for our three buttons, which represent each of          to check which button has been pressed. When a
the coloured LEDs in our diagram. Each button is             button is pressed it triggers the code for that condition
attached to a specific GPIO pin which we now declare.        to be executed. In this case it will print the colour of
red_button = Button(2)                                       the LED to be lit (we do this for debugging purposes).
amber_button = Button(3)                                     We then call the lightup function and pass the
green_button = Button(4)                                     argument, being the colour of the LED to be lit.
  The list that we created in Project 2 is re-used to          if red_button.is_pressed:
contain the names of the LEDs that we have created               print("RED")
as variables.                                                    lightup("red")
LEDS = [red,amber,green]                                       elif amber_button.is_pressed:
   Our next section of code is where we create a                 print("AMBER")
function. A function is a sequence of code that we               lightup("amber")
can execute by calling its name in the main body of            elif green_button.is_pressed:
code. Functions come in two forms, a basic function              print("GREEN")
that when called will execute the code contained                 lightup("green")
within. But the most useful is a function that takes an        Our last line of code is outside of the conditional
argument, an extra parameter/instruction that it can         statements but is still inside the main loop. It simply
act upon. We are going to write a function that will         instructs the code to sleep for a tenth of a second
take the colour of the LED that we wish to illuminate        between checking the status of the buttons.
as an argument.                                                sleep(0.1)
   We start by defining the name of the function, in           With the code now complete, ensure that you save
this case lightup. Inside of the brackets we give a          your work. Once it's ready, click on Run > Run Module
placeholder name for the argument, which is “colour”.        to launch the code and press one of the buttons on
def lightup(colour):                                         the breadboard to trigger the light of your choice.
  So now our code is indented to signify that it is
part of the function. Our first two lines of code in the     Les Pounder makes things, breaks things, and spends the rest of his
function are a for loop. This loop will ensure that all of   time teaching teachers about the new IT curriculum.



                                                               www.linuxvoice.com                                                                         81
     TUTORIAL PHOTOGRAPHY




IMAGE PROCESSING,
FIXING AND STORING
Apply smart fixing, processing and storing techniques to your images.


                              T
ALEXANDER                              he days when digital cameras produced
TOLSTOY                                terrible results with noise, blur and pale
                                       colours – which led us more often than not to
Why do this?                  Gimp to fix things – are gone. Now when most people
• Perform mundane             take point-and-shoot photos with their smartphones,
  tasks with batch
  processing                  most of the work is performed automatically –
• Clean up dust and           cameras apply smart logic to produce perfect JPEGs
  scratches                   while various cloud services (starting with Google)
• Save space with             upload your gallery online. But there are still other use
  sensible file formats
                              cases where manual intrusion is needed – scanning
                              and restoring old photographs, playing with creative
                              collages, photo retouching, backing up huge amounts
                              of graphic data and so on. In this tutorial we'll take a    The healing brush in Krita is easy to set up, and it
                              look at certain techniques that will help you apply an      produces great results in retouching skin defects.
                              action to many images at once, fix specific image
                              defects and optimise your storage.                          ratio and angle of the brush right in the clone options.
                                 When it comes to image editing, the undisputed           Hardness and shape should be adjusted in the brush
                              king of the hill is Gimp. Here we can do almost             catalogue, which can be invoked also from within the
                              anything with bitmaps, and we'll start with the clone       clone tool options. It's best to press the Edit button
                              tool. Click its icon on the toolbar (it's depicted as a     and adjust all available brush parameters to match
Overlap dust and scratches
with patches of the           stamp), then Ctrl+click the source area (which the tool     your liking.
'healthy' neighbouring        will copy pixels from), move your mouse to the target         Cloning lets you fix certain defects, like dust and
pixels – that's the essence   area and start painting by clicking and holding the left    scratches, but it is also useful for removing undesired
of the new method.            mouse button. Gimp lets you adjust the size, aspect         objects from a photo. Say, you've got a marvellous
                                                                                          portrait taken on a sea shore, but people on the
                                                                                          background deflect the attention of the viewer. Playing
                                                                                          with the brush settings for the clone tool in Gimp
                                                                                          you can gradually remove strangers by accurately
                                                                                          cloning sand, water and sky parts and make your
                                                                                          photo perfect. By the way, you can do the same in
                                                                                          other Linux software too. For instance, Krita – a part
                                                                                          of the KDE-centric Calligra office suite – has the Edit
                                                                                          Brush Settings button on its top toolbar, where you
                                                                                          can select the clone brush engine and proceed with
                                                                                          stamping exactly the same way you did in Gimp.

                                                                                          Photographer, heal thyself
                                                                                          Krita and Gimp are the most bold and feature-rich
                                                                                          Linux graphics applications; now, let's look at their
                                                                                          healing capabilities. The healing brush is an advanced
                                                                                          version of the standard clone tool. It can be found as a
                                                                                          separate tool at the Gimp toolbar (it looks like a yellow
                                                                                          adhesive bandage), or as an option in Krita's brush
                                                                                          engine settings (Painting Mode > Healing). Either
                                                                                          application you choose, healing is preformed in the
                                                                                          same way as cloning – you set the source area and



82                                                            www.linuxvoice.com
                                                                                                     PHOTOGRAPHY TUTORIAL


transfer it to the target are – but unlike plain cloning, a
healing brush respects surrounding pixels and lets
you carefully recover texture and colour tone in
damaged areas. When working with skin defects
healing performs noticeably better than cloning and
lets you avoid blurred areas caused by a soft brush.
   The next big thing we'll do in this section is
removing dust and scratches – very common defects
that frequently occur in digitised historic pictures.
The problem is that you can hardly automate dust
removing routines, and in most cases you'll need
to diligently remove each spot with dozens (if not
hundreds) of cloning or healing actions. Luckily, there
exists an original technique that greatly reduces the
amount of work. Again, we'll be using the best image
editor for Linux – Gimp.

Logical programming
The idea comes down to the following steps. First
create a copy of the current layer, desaturate it and
increase the brightness and contrast to much higher
                                                                                                                       Batch processing is easier
levels, so that dust and scratches will turn to exactly       routines by hand. Luckily, they need not, and in the
                                                                                                                       than you might think.
white spots, but midtones will remain at their shades         following examples we’ll find out how to automate        Don't do so many recurring
of grey – you'll need to play with brightness and             bulk actions.                                            actions by hand!
contrast sliders to achieve the best result, as it will be       The first common action is resizing. Say, you need
individual for each image. Now choose the Select by           to attach 20 images to the email, but the recipient
Colour tool and click anywhere on a dust or scratch.          doesn’t need that many megapixels in each photo,
Hold down Shift and click on a lightest grey pixel            while the web server would simply reject the very
somewhere nearby to add more area to your                     big attachment. The easiest way to scale down
selection. You now have a mask of defects, which
includes some undamaged areas as well – don't
worry, we'll deal with it later. Now extend your
                                                                 We'll remove dust and scratches – very
selection by one pixel (Select > Grow) and soften it by          common defects that frequently occur
some more pixels (Select > Feather). You can now
delete the current overburned layer safely – look how            in digitised historic pictures
your selection matches dust and scratches of the
original image Now here's where the magic happens.            your photos is to install the dedicated plugin for
   Select the Move tool and (important!) change its           the Nautilus file manager. In Fedora, do it with the
mode to Selection. It means that when you move                following command:
anything now, only the selection itself will be moved,        $ sudo dnf install nautilus-image-converter
but not image content. Move your selection sideway              There's a very similar (yet different) extension in
by few dozen pixels, so that the selection now covers         Ubuntu, which you can get this way:
mainly 'healthy' areas to the neighbouring damaged            $ sudo apt-get install nautilus-image-manipulator
spots. Do the copy-paste sequence, change the Move               Whichever you’ll install, don’t forget to restart
tool mode back to Layer and drag your pasted bits             Nautilus (or simply log out and then log back in) in
back to their original position. How do you know when         order for the changes to take effect. Once you do
you're back in the right place? Well, change the              that, select the scope of images you’d like to resize,
blending mode for the pasted bits from Normal to              right-click any of them and select Resize Images.
Difference and let it guide you. When your patches are        Both Ubuntu and Fedora-centric Nautilus extensions
in place, use the Eraser tool with a reasonably large         provide nearly the same features: they let you specify
soft brush to remove false-triggered patches. Finally         the new size in pixels or percent, choose to save new
bring back the Normal blending mode and press the             files along with the originals (non-destructive mode)
Anchor icon to merge your patches with the                    and also apply a prefix to filenames. As the names
background. It all may sound complex, but once you            suggest, you can also mass-rotate images in the
do at least one iteration of such 'patching', you'll love     same way – just choose the appropriate item from
this method because it really saves you a lot of time.        the Nautilus right-click menu.
   Sometimes you need to apply an edit or                        If you need more features for bulk actions, try
transformation to a lot of images, and it makes some          Phatch — a photo batch processor for Linux. Phatch
users believe they need to do a huge number of                can batch resize, rotate, apply shadows, perspective,



                                                                www.linuxvoice.com                                                            83
     TUTORIAL PHOTOGRAPHY

                                                                                                    tags and do image transformation with a few mouse
                                                                                                    clicks. Don’t forget to put the Save action at the end
                                                                                                    of the queue in order to keep the original images safe
                                                                                                    and secure.
                                                                                                       In fact, you don’t have to use any desktop
                                                                                                    environment in order to process images in Linux: In
                                                                                                    cases when you want to escape from a heavyweight
                                                                                                    GUI desktop, you can happily deal with images using
                                                                                                    command line tools. Once you have ImageMagick
                                                                                                    installed on your system, you can manipulate images
                                                                                                    however you want. Start with the display command to
                                                                                                    view images, like this:
                                                                                                    $ display path/to/picture.jpg
                                                                                                      Convert images from one format to another using
                                                                                                    the following syntax:
                                                                                                    $ convert sunrise.tif sunrise.jpg
                                                                                                       Explore the depth of the $ convert --help command
                                                                                                    and find out how to resize and rotate images as well.
                                                                                                    In the following example we’ll convert, resize, rotate
                                                                                                    our test image and also apply the charcoal filter to it:
                                                                                                    $ convert sunrise.tif -resize 1024x768 -rotate 180
Squeeze extra disk space
                             rounded corners, duplicate directory hierarchies                       -charcoal 4 -quality 80 sunrise.jpg
by using the latest next-
gen file storage formats.    and much more. Phatch is available in many Linux                          If you need to perform bulk actions on the
Everything is open source!   distributions, including Ubuntu and Fedora, so install                 command line, feel free to use Bash as a means for
                             it in a convenient way via apt-get/dnf or from within a                applying a command to multiple files. For example,
                             graphical package manager. Keep in mind that Phatch                    let’s rotate all images in the current directory while
                             also has a special Nautilus integration extension called               retaining the original files:
                             nautilus-phatch. Install it as well in order to access                 $ for file in *.tif; do convert $file -rotate 90 rotated-$file;
                             extra bulk actions from images’ context menu.                          done
                                                                                                      Or maybe we want to convert files to another
                                                                                                    format and resize them within one command:
     In real life most photos are stored in                                                         $ for i in $( ls *.tif); do convert -resize 50% $i $i.jpg; done

     JPEG, whereas screenshots and web                                                              Use advanced image formats
     graphics look best in PNG                                                                      There are dozens of graphic file formats, but in real life
                                                                                                    most photos are stored in JPEG, whereas screenshots
                               In Phatch, press the big + sign to add actions to                    and web graphics look best in PNG. Let's skip other
                             the queue. The list of actions is quite extensive and                  specialised file formats such as TIFF or numerous
                             you can also put several actions in one queue in any                   RAW flavours from different camera vendors for the
                             combination. Phatch lets you be more creative with                     sake of brevity. Historically JPEG compression was
                             your images and add, say, a watermark, special EXIF                    developed as an optimal trade-off between higher


                               Sorting and tagging
                               There are some great open source applications that can               an hierarchy. If you select a tag and create another tag in its
                               help you store and tag images – it's fairly useful once you          context menu, it will be placed inside that parent tag, so that
                               photo library grows large. The most well-established photo           you can create complex trees, like People > Relatives > Family
                               organizers are Digikam and Shotwell. These are desktop               > Brothers, or, say, Places > Vacation > Summer > America. Of
                               heavyweights and thus are shipped with almost any Linux              course, it takes a certain amount of time and diligence to add
                               distributions. Let’s have a look on how to sort and tag images       tags manually, but it is worth it. Tags add extra features to
                               in Digikam.                                                          your library and simplify image searches: you can browse the
                                  When browsing your images in Digikam, select at least             convenient list of date-based subdirectories with your images,
                               one of them, right-click and go to Assign Tag > Add New Tag.         but once you need to perform custom searches (eg ‘show me
                               Enter the name of the new tag and optionally set the keyboard        all pictures of my dad’), tags are your best friends.
                               shortcut, which will let you seamlessly assign/clear that tag            Shotwell has a very similar approach to managing tags, and
                               later on. When you’re done, you tag will appear in the Recently      it also has a very useful left-side panel with events, folders
                               Assigned Tags of an image’s context menu. Sooner or later            and tags tree. Anyhow, Shotwell is believed to be a lot simpler
                               you will have many tags that need to be properly managed             than Digikam, while being more suitable for novice users.
                               and reviewed. You can see the full tags tree either through          Shotwell is more user-friendly and robust, while Digikam sports
                               the context menu at Assign Tag > More Tags, or by clicking on        some pretty snazzy features that other photo applications do
                               the tiny Tags button at the left side panel in Digikam. Initially,   not, such as automatic face recognition and grouping photos
                               tags form a plain list, but in fact they are designed to form        by depicted people.




84                                                                 www.linuxvoice.com
                                                                                                             PHOTOGRAPHY TUTORIAL

quality and smaller file size, which used to be a
headache in the days of dial-up internet and small
hard drives. JPEG is lossy, but it delivers very natural-
looking images even with agressive compression
ratios. On the other hand, the PNG (Portable Network
Graphic) gracefully solved the problem of transferring
lossless bitmaps graphics across networks thanks to
its built-in compression.
   In modern days the technology has advanced even
further and now we have two projects on GitHub
that outperform the above two formats in terms of
compression efficiency: Lepton and FLIF.

What the flif?
FLIF is a new lossless image format based on
MANIAC compression (Meta-Adaptive Near-zero
Integer Arithmetic Coding), which outperforms PNG,
FFV1, lossless WebP, lossless BPG and lossless
                                                                                                                                   Digikam is versatile image
JPEG2000 in terms of compression ratio. Let's see            file smaller. Dropbox published a comprehensive
                                                                                                                                   sorting machine. Provide
how we can use it. Download the code snapshot                article that describes how the algorithm works (http://               it with your images and
from the project's website, make sure that you have          bit.ly/29VqPnT), pointing out optimisations they                      get the neat subdirectory
the libpng-dev package (or similar) and then type $          implemented in encoding 8x8 pixel blocks – these are                  structure with few mouse
make. In a few seconds you'll get the compiled flif          used in JPEG compression.                                             clicks.
binary, which acts as an encoder and decoder of FLIF
images. The syntax is very simple:                           Store images more efficiently
$./flif input.png output.flf                                 Building Lepton from source is very straightforward.
and the traditional ./flif --help for the list of options,   Download the sources and execute the well-known
such as interlacing, palette, quality and more. Keep in      sequence:
mind that FLIF currently can convert only PNG, PAM           $ ./autogen.sh; ./configure; make; make check
and PNM file formats, so it makes sense to compare           $ sudo make install
FLIF outputs with the PNG as the most widespread               Lepton has a very simple syntax and while you can
format from the above list. In our tests, lossless FLIF      enjoy many of its advanced features, you can start
output was smaller than PNG with the highest                 with this template:
compression ratio and comparable with JPG in terms           $ lepton input.jpg output.lep
of file size. The only problem is that you cannot view         If your JPEG file uses progressive encoding (eg
.flf files, so right now you can only use the flif binary    Gimp does it by default when exporting to JPEG), you’ll
to archive images and recover them later using the           need the appropriate extra option:
$ ./flif -d input.flf output.png command. However, it        $ lepton -allowprogressive input.jpg output.lep
is possible to view the FLIF-encoded images using the           To restore (decompress) your file, use the same
separate tool called UGUI_FLIF (https://github.com/          command but switch the .lep and jpg order. Lepton is
FLIF-hub/UGUI_FLIF), which is based on HTML and              quite effective: it can trim down your files by 15–20%
JSON. Once the FLIF file format is finalised there will      without losing quality.
be a more appropriate viewer – because files encoded            The reason why you might want to use FLIF, Lepton
with an older FLIF binary will not be compatible with a      or both is precisely one. Despite the fact that most
newer one.                                                   people have at least 1TB of storage in their desktop
   Lepton is a compression and decompression                 machines, the sheer volume of images that have to
algorithm that was open source by the Dropbox                be stored is growing even faster than most people
company. This cloud-based storage provider has               can reasonably store themselves. Converting some
proprietary code in its core, but otherwise it is very       thousands JPEGs to the new Lepton format lets you
friendly to the Linux community. Lepton does with            free extra disk space. Lepton files are about 20%
JPEG what FLIF does with PNG, and as long as the             smaller than their source JPEGs, so saving can be be
two image formats are completely different, we               very noticeable. Both Lepton and FLIF are in an early
cannot compare their performance directly. Perhaps           development state, but this only means that we don't
you might want to use PNG for screenshots and                have ready-to-use viewers and a desktop integration
JPEG for photos, and now there are finally two open          yet. The core feature — encoding and decoding works
source projects for that. Lepton offers a lossless           flawlessly, so you may want to use Lepton and FLIF
compression for JPEGs, which resembles convenient            as archive tools.
archiving. But unlike putting a JPEG file to a ZIP or
TAR.GZ archive, which makes very little sense in             Alexander Tolstoy stores his library of over a hundred thousand cat
saving the disk space, Lepton really makes the output        photos on a single floppy disk.



                                                               www.linuxvoice.com                                                                          85
     CODING SOLR




BUILD A SEARCH ENGINE
WITH APACHE SOLR
Add some order to the chaos that is the LV catalogue with a Python search engine.


                              W
                                           e’re producing vast quantities of data.        one on port 7574. We’ll be interacting with them via
BEN EVERARD
                                           Some of this is nicely structured in           HTTP, so let’s start with the most usual HTTP client,
                                           spreadsheets and databases, but there’s        the web browser. You can see details of the install
Why do this?                  also lots in less computer-friendly formats such as         by going to: http://localhost:8983/solr/#/. We don’t
• Build powerful search       PDF and MS Word files. In this code concepts we’re          need to change anything here for our purposes, but
  tools using the
                              going to take a look at using the Apache Solr search        if you have any problems, you can see the logs in the
  technology behind
  some of the web’s           platform to sift through a trove of PDF files to find       Logging tab.
  biggest sites               exactly what we’re looking for.                                Solr works with collections. These are groups of
• Obsessively tag,               The first step is to grab the software. The version      data a little like individual databases in a MySQL
  index and organise
                              in most distros' repositories is out of date, so the best   instance. Data is added to a particular collection, and
  all your things
                              option is to download the latest version from http://       queries are run on collections rather than all the data
• Use Python to access
  RESTful JSON APIs           lucene.apache.org/solr. Click on the Download Binary        in the instance. By default, there’s a single collection
  over the internet           link and you should be presented with a list of mirrors.    called gettingstarted. We’ll use this for our project.
                              The file you need should be called solr-6.1.0.tgz (or          Now we have our server and our collection, the only
                              possibly a newer version). As the filename suggests,        thing we need is data. Solr is designed to work with a
                              this is a tarball, so save it to your machine and           diversity of datatypes including PDF files, so for our
                              decompress it.                                              project, we’re going to work with Linux Voice PDF
When you start Solr, you
                                 You can start Solr without installing it fully by        files. We release these both for the full issue and for
also get a web interface
                              running the following command in the directory you          individual articles. We’re going to use the individual
where you can see how
everything’s running. Point   created by unzipping the download:                          article files from issue one of Linux Voice, which you
your web browser to http://   bin/solr start -e cloud -noprompt                           can download from https://www.linuxvoice.com/
localhost:8983/solr/#/ to       This command will start two instances of Solr (it’s       download-linux-voice-issue-1-with-audio/. You’ll
get started.                  designed to be run as a cluster), one on port 8983 and      need to download these and save them to a directory
                                                                                          that only contains these files. The following command
                                                                                          will enter them into the Solr data store:
                                                                                          bin/post -c gettingstarted <directory containing the
                                                                                          files>
                                                                                            You can check that everything’s worked by querying
                                                                                          the search engine via curl. The following code should
                                                                                          return all the articles that contain the word Linux:
                                                                                          curl "http://localhost:8983/solr/gettingstarted/select?wt=
                                                                                          json&indent=true&q=linux"
                                                                                             This should output a lot of data formatted in a way
                                                                                          that makes it hard to read. In order to make our search
                                                                                          engine useful, we need to create a human-useable
                                                                                          interface for it, and we’ll do this with a Python script.
                                                                                             The primary interface for Solr is a RESTful API
                                                                                          that serves JSON over HTTP. Let’s just go back
                                                                                          to that previous sentence and pick apart the
                                                                                          acronyms before going any further. REST stands
                                                                                          for Representational State Transfer, which in itself
                                                                                          doesn’t tell us much, but it’s a style of Application
                                                                                          Programming Interface (API) based on the way the
                                                                                          world wide web works. Perhaps the most important
                                                                                          thing to understand about RESTful APIs is that the
                                                                                          server is stateless – that means that all the details



86                                                            www.linuxvoice.com
                                                                                                                               SOLR CODING


needed for the request are in the request itself
(including any login or session information).
   The request is served over HTTP, which is the same
protocol that web browsers use to get data from web
servers, so we can use exactly the same tools. In the
first example, we used Curl, but we can also use a web
browser. Most programming languages have a library
for getting things via HTTP (in Python it’s urllib), and
you should be able to use any of them if Python isn’t
your thing.
   JavaScript Object Notation (JSON) is a way of
structuring data in key-value pairs in plain text that
looks remarkably similar to Python’s dictionary
format – so similar in fact that we can use a module
called simplejson to convert the text returned by the
RESTful API directly into a Python dictionary.
   Using this RESTful API, we can build a really simple
                                                                                                                               Solr is designed to be
query interface with Python:                                       Python code above you can see that we print out two
                                                                                                                               scalable to huge instances
import urllib2                                                     items that are returned in JSON: the resourcename           so it runs with shards
import urllib                                                      and the xmptpg_npages – the name of the file and            by default. In the basic
import simplejson                                                  the number of pages. Rather than just searching             setup, two shards run on
                                                                   through the text of the article, we can focus our           the same machine, but
base_url ="http://localhost:8983/solr/gettingstarted/              search on one particular attribute. For example, if you     in production there could
select?wt=json&q="                                                 enter the following query when running the Python           be multiple shards across
                                                                   program above, you will get only the articles with two      many data centres.
while True:                                                        pages:
           query = raw_input("Query:")                             Query: xmptpg_npages:2
           result = urllib2.urlopen(base_url+urllib.                 You can chain parts of your queries together by
quote(query))                                                      separating different search terms with spaces. By
           result_openned = rsp = simplejson.load(result)          default, Solr will return results that match any one of
           for doc in result_openned["response"]["docs"]:
                       print "file" + doc["resourcename"][0]
+ " pages " + str(doc["xmptpg_npages"])
                                                                      Solr is a search engine that works
This builds a HTTP request using input from the                       with text documents, but it can handle
user, then formats the returned JSON data nicely for
printing out.                                                         a wide range of different bits of data
  So far, we’ve used the query to search through
the article text and find things related to our search             the search terms. So the following query will match
term, but we can do more than this. Solr is a general              anything that is about either LUGs or FOSDEM:
search engine that works with text documents (like                 Query: lugs fosdem
the PDFs we’re using here), but it can handle a wide                  Adding a plus sign to the start of a search term
range of different bits of data. Each different type of            tells Solr that you only want results that include that
data contains different attributes. For example, in the            particular term. If you want only those articles that are
                                                                   two pages long and about FOSDEM, you can use the
                                                                   following query:
  Apache Lucene and Solr
                                                                   Query: +fosdem +xmptpg_npages:2
  If you’re just after a text search library to add to your
                                                                     By default, Solr will see how well each document
  project, you can use Apache Lucene, which powers the
  search in Solr. Although it’s written in Java, there are         matches the search query and return the results
  Lucene bindings for other languages including Python that        based on their relevance. We can find out just how
  enable you to bring in just the searching power to your          good a match each document is by getting Solr
  project. The advantage of Solr is that you get the full server   to return the value for score with the fl (field list)
  – with the ability to run in a distributed manner – to store
                                                                   parameter to our request. We want all the fields that
  your data and handle queries.
      Solr itself started as an internal project by CNET           exist (which we get with the * wildcard), and the score
  Networks, which donated the code to the Apache Software          pseudofield. In your Python program, change the
  Foundation in 2006. Under Apache the software has                base_url line to the following:
  developed significantly particularly in its ability to handle    base_url ="http://localhost:8983/solr/gettingstarted/
  huge numbers of queries very efficiently. It’s proved itself
                                                                   select?wt=json&fl=*,score&q="
  on some of the internet’s biggest sites including the
  Internet Archive (archive.org), DuckDuckGo and Netflix.            You can now include the score in the final print line
                                                                   of the script:



                                                                     www.linuxvoice.com                                                               87
     CODING SOLR



                                         Total score of each distro in issue one of Linux Voice




                                                                                                                                     LV Prattle Factor




Fedora was the most
                                print "file: " + doc["resourcename"][0] + " pages " +       base_url ="http://localhost:8983/solr/gettingstarted/
relevant distro to issue 1 of
Linux Voice.                    str(doc["xmptpg_npages"][0]) + " relevance " +              select?wt=json&fl=*,score&q="
                                str(doc["score"])                                           while True:
                                   This is a useful way to find out just how good a                     lv_prattle_factor = 0
                                match a particular page is, and it can also be useful                   query = raw_input("Query:")
                                in determining how predominant a particular word                        print base_url+urllib.quote(query)
                                or phrase is in your collection. If we add up the score                 result = urllib2.urlopen(base_url+urllib.
                                from every document returned by Solr, this will give        quote(query))
                                us an idea just how dominant that word was in issue                     result_openned = rsp = simplejson.load(result)
                                one of Linux Voice. We’ll call this the LV Prattle Factor               for doc in result_openned["response"]["docs"]:
                                because it says how much we prattle on about it. The                                 print "file: " + doc["resourcename"][0]

The Solr web interface          code to add this feature is:                                + " pages " + str(doc["xmptpg_npages"][0]) + " relavence "
includes a query builder to     import urllib2                                              + str(doc["score"])
help discover the various       import urllib                                                                        lv_prattle_factor += doc["score"]
options to the HTTP API.        import simplejson                                                       print "Linux Voice Prattle Factor: " + str(lv_
                                                                                            prattle_factor)
                                                                                               We can now use this to work out one of the age-old
                                                                                            questions: just which distros get the most coverage
                                                                                            in Linux Voice? You can see the results of this in the
                                                                                            graph above – and Fedora was the most talked about
                                                                                            distro for us back in February 2014.
                                                                                               Hopefully, you’ve now got an idea of how to start
                                                                                            working with Solr, but it can do far more than we’ve
                                                                                            had a chance to look at here. As well as searching,
                                                                                            you can look at aggregate data, and perform more
                                                                                            complex inquiries using more specialised data, such
                                                                                            as location tagging. If you need a customisable
                                                                                            search engine, Solr is a great place to start.


                                                                                            Ben Everard, Linux Voice's editorial overlord, is probably breeding an
                                                                                            out-of-control slug plague as you read this.



88                                                                 www.linuxvoice.com
                     ELIXIR CODING




www.linuxvoice.com                   89
     CODING PACKAGING




FLATPAK: BUILD A CROSS-
DISTRO PACKAGE
Why rely on a distro's package maintainers when you can package software yourself?


                         L
VALENTINE                          inux is diverse, and so are its packaging
SINITSYN                           technologies. We aren't going to cover all of
                                   Deb, RPM, Pacman, Flatpak, Snap etc in this
Why do this?             tutorial. It wasn't planned as a definitive guide to these
• Understand the         technologies either. Instead, we'll focus on typical
  twisted logic behind
                         approaches and concepts, using two popular
  dependency hell
                         implementations. A package is essentially an archive
• Make it easier for
  users to get hold of   (often a tarball) containing binary and data files which
  your software          constitute an application, along with some metadata.
                            Metadata carries essential information about
                         a package. For instance, it tells us the package
                         name, author, and version. Using these, package
                         management tools (such as rpm, dpkg/apt or
                         pacman) can tell if there is a newer version available
                         in the distribution repositories. If you're downgrading
                         a package, the system also understands it and acts
                         accordingly. Metadata can also tell us to which              From time to time, package managers grab remote
                         category the package belongs, much like a "Shelve            repositories listings, and check if there's anything new.
                         into" hint on a book back cover, and what the package
                         priority is. But most importantly, metadata conveys          install all the dependencies, of course. This is tedious
                         dependency information.                                      and error-prone, so most distributions and even third-
                            The software you write (or use) doesn't exist in          party vendors such as Atlassian or Dropbox build
                         a void. If it's compiled, it often relies on libraries. If   package repositories, which are generally reachable
                         not, it obviously wants an interpreter. For example,         over the internet.
                         you'll need a web server, a database and PHP 5.4 or             Official repositories are usually self-contained; that
                         better to run OwnCloud. Exiv2 and an LDAP server             is, they provide all dependencies for any package
                         aren't strictly necessary, yet they add some features        hosted. From time to time, your Linux system grabs
                         (namely, Exif and centralised authorisation support).        the list of packages from every repository you have
                            Metadata encodes all this information in a                configured and suggests that you install updated
                         machine-readable way. The OwnCloud package will              ones. You may also want to refresh package lists
                         depend on the PHP package (exact names differ                manually, for instance, if you configured a new
                         per distribution) with the version not less than             repository. This is what happens when you type apt-
                         5.4. Both Apache and Nginx can run OwnCloud, so              get update on a Debian-based system.
                         the web server dependency may come through a
                         metapackage. This is a virtual package (think alias)         Debian way
                         that many real ones may choose to provide. Both              Perhaps that's enough theory for now, and it's time to
                         Exiv2 and the LDAP server may come as optional (or           get your feet wet. Though I'm reluctant to offend the
                         suggested) dependencies. When you instruct your              Red Hat users, I'd still say that Debian's packaging
                         package manager to install OwnCloud, it pulls in PHP,        format (Deb) is predominant in Linux landscape at the
                         a database, and whatever web server you choose               moment. So, let's spend a minute learning how you
                         automatically. This is not the case with optional            package your code for Debian and its derivatives.
                         packages; the tool would normally list them for you            Before we proceed with our experiments, we need
                         after installing OwnCloud, and if you'd like any of them,    an application to package. Recently I stumbled upon
                         issue a separate command.                                    QOwnNotes (www.qownnotes.org). If you ever tried
                            It is fully possible to download a package file and       to use Evernote in Linux, you'd probably agree that
                         install it manually. It implies you'll also download and     the experience could be better. Evernote forces you



90                                                        www.linuxvoice.com
                                                                                                                PACKAGING CODING


to store documents in the cloud, with all the usual
concerns about privacy. And it has no native Linux
client. QOwnNotes may have fewer features, but it's
free (as in speech), it runs on Linux, and it plays well
with OwnCloud. If something doesn't work for you,
you can just go and fix it rather then grumble on the
Evernote forums. In other words, it's not a drop-in
replacement for Evernote, but it looks promising.
   Moreover, QOwnNotes is already packaged for
many Linux flavours, including Debian. We'll study this
Debianisation and discuss alternative ways where
appropriate. I also suggest you look in QOwnNotes/
build-systems at its GiHub page (https://github.com/
pbek/QOwnNotes) to check how the same concepts
are applied across different packaging tools.
                                                                                                                            Not an Evernote, or a clone,
   Grab the latest sources as described on QOwnNotes'         supports (any means it should compile on any host).
                                                                                                                            but it still looks interesting
installation page (http://www.qownnotes.org/                  In rare cases when the program is hardware-specific,          to try. Or, at minimum, to
installation). Debianisation lives under debian/, which       you should provide an architecture string like amd64          package.
contains a handful of files.                                  or arm here. Architecture-independent packages such
   Let's start with debian/control. It can be rather long     as your Python code can use all instead.
and describe multiple packages, but for QOwnNotes, it            Depends lists runtime dependencies. Note
spans only 18 lines. A blank line splits this file into two   there are no -dev packages here anymore. Version
paragraphs referring to the source package and the            requirements come in parenthesis: foo (>=1.0) pulls
only binary package it creates.                               foo 1.0 or higher. Optional dependencies may use
Source: qownnotes                                             Suggests or Recommends. Add Provides if you
Priority: optional                                            provide some virtual package (aka metapackage).
Maintainer: Patrizio Bekerle <patrizio@bekerle.com>               ${} is the control file syntax for substitutions.
Section: editors                                              shlib:Depends runs the dh_shlibdeps tool to calculate
Build-Depends: debhelper (>= 9), cdbs, qt5-qmake,             shared libraries' dependencies of your application.
qtbase5-dev, libqt5svg5-dev, qtdeclarative5-dev               You'd want to include it unless you build a static
  Source and Maintainer define the package and the            executable. In a similar vein, misc:Depends accounts
maintainer names. Both are mandatory. You also see            for the additional packages that debhelper may have
qownnotes is an optional package that belongs to the          decided to pull behind the curtains.
editors category. Other priority levels include required         debian/control is perhaps the most important
(absolutely necessary) or important (expected on any          piece of package metadata, but not the only one. Did
self-respecting Unix system).                                 you notice it doesn't tell the package version? This
  Build-Depends lists packages that are required              comes through debian/changelog. This file follows
to build QOwnNotes. They aren't necessary in the              a strict format described in the Debian Policy Manual
the same you need to run it. Remember that Debian
puts header files and alike into -dev packages.                  A Debian source package is just a
Neither qmake nor the Qt headers are essential for
QOwnNotes to run, but they are required for the build
                                                                 tarball or two along with a .dsc file
process. If you wonder what on Earth debhelper is,               storing the metadata
we'll get on it shortly.
  A Debian source package is just a tarball (or two)          4.4 (https://www.debian.org/doc/debian-policy/ch-
along with a .dsc file storing the metadata. The exact        source.html#s-dpkgchangelog). Usually, you update
format is usually set via debian/source/format.               the changelog with dch tool to avoid pitfalls. Last but
QOwnNotes uses 3.0 (quilt). It was designed for               not least, each package must contain a copyright
official packages which separate upstream sources             notice – this is stored in debian/copyright, which is
and local Debian changes. For us, it's not the best           both machine and human-readable, like Markdown.
choice, so set the format to 3.0 (native) now.
  A binary package paragraph looks very similar:              Building binaries
Package: qownnotes                                            Now, your package wants a recipe to build the code.
Architecture: any                                             The main build script for a Debian package resides in
Depends: ${shlibs:Depends}, ${misc:Depends},                  debian/rules. In a nutshell, it's just a Makefile, which is
libqt5core5a, libqt5gui5, ...                                 the de-facto standard to convey build instructions in
...                                                           Linux. Here, it's executable and carries a #!/usr/bin/
   Package is the binary package name. Architecture           make -f shebang. Packaging tools expect you provide
tells us what hardware architecture the package               some predefined targets in this file, such as build to



                                                                www.linuxvoice.com                                                                    91
     CODING PACKAGING


QOwnNotes comes through                                                                         Building the package is just a matter of typing
Flatpak; everything else is                                                                 dpkg-buildpackage -us -uc. The switches ask not
from native packages. Can                                                                   to sign anything with GnuPG. Recall that the code
you tell the difference?                                                                    compiles against the libraries (and architecture) you
                                                                                            have on your build system. That's how the package
                                                                                            is built for the particular distribution, and that's why
                                                                                            it's important to have a clean reference environment.
                                                                                            Tools like Pbuilder or sbuild do so via chroots.
                                                                                                Baking Debs is quite easy, but creating proper
                                                                                            Debian packages could be tricky. Be sure to read the
                                                                                            Debian New Maintainers' Guide (www.debian.org/
                                                                                            doc/manuals/maint-guide), if you're seriously into it.

                                                                                            All in one
                                                                                            You might call traditional packaging dependency-
                                                                                            centric. The idea is to have all the required bits only
                                                                                            once per system. This sounds reasonable: why do you
                                                                                            want multiple copies of the same library consuming
                                                                                            disk space? What if the library appears vulnerable?
                              prepare and compile the sources, or binary to create a        Keeping track of these multiple copies and updating
                              binary package. The Debian Policy Manual, 4.9 has a           them is tedious, at best.
                              complete list.                                                   The coin is double-sided, though. In the real world,
                                Thanks to Autotools, CMake and friends, most Linux          libraries have bugs, and different minor versions aren't
                              applications build in standard ways. This means               necessarily interchangeable. Imagine you have AppA,
                              nearly identical debian/rules, each taking time to            which wants libfoo=1.0.2, and AppB, which pulls
                              author and debug. Reinventing the wheel is hardly             libfoo=1.0.1. This is a famous dependency hell, a rare
                              an option, so Debian introduces debhelper tool to             situation which is nevertheless hard to resolve.
                              automate standard bits. Debhelper comes with many                Storage is cheap these days, and isolation
                              dh_* commands to wrap up the process. You just                mechanisms in recent Linux kernels limit potential
                              need to call them from your debian/rules.                     damages in case of vulnerability exploitation (but see
                                In the case of QOwnNotes, this file is even simpler:        the boxout). This gave rise to technologies that build
                              #!/usr/bin/make -f                                            self-contained, distribution-neutral packages.
                              #export DH_VERBOSE = 1                                           Flatpak (http://flatpak.org), formerly xdg-app, is a
                              DPKG_EXPORT_BUILDFLAGS = 1                                    good example. Flatpak aims at desktop applications
                              include /usr/share/dpkg/default.mk                            and uses much the same sandboxing mechanisms
                              export QT_SELECT=qt5                                          as in container virtualisation.
                              include /usr/share/cdbs/1/rules/debhelper.mk                     The self-contained application model could be
                              include /usr/share/cdbs/1/class/makefile.mk                   interesting to proprietary software vendors, but also
                              include /usr/share/cdbs/1/class/qmake.mk                      to complex open source projects such as LibreOffice
                                 Basically, this just includes the CDBS (Common             (https://www.libreoffice.org/download/flatpak).
                              Debian Build System) components needed to build a             We've introduced Flatpak back in LV030, and this time,
                              QMake-based application. CDBS is a Makefile "library"         we'll walk through the package building process.
                              which complements debhelper. Qt 5 is selected if
                              there is more than one version of the library installed.      Pack with Flatpak
                              DPKG_EXPORT_BUILDFLAGS tells us to export                     Before we proceed, make sure you have Flatpak
                              CFLAGS, CPPFLAGS and alike. Uncomment the DH_                 installed. (Traditional) packages are already available
                              VERBOSE line to make debhelper more chatty.                   for some distributions. We'll stick to Arch, which has
                                 From time to time, backwards-incompatible                  Flatpak in the official repositories. If you use Fedora or
                              changes are made to debhelper (and most other                 Debian, the differences would be minimal.
                              software as well). So packages should tell which                Flatpak runs applications on top of shared runtimes
                              debhelper "compatibility level" they expect. It comes         and uses SDKs to build packages. There is an official
                              through debian/compat, and packages set it to 9.              Gnome runtime, but QOwnNotes is a Qt application.
                                 Some parts of your package may not come                    The experimental Qt 5/KDE Frameworks 5 runtime
                              as a build process artefact. Imagine you want                 and SDKs are available at https://community.kde.
                              some custom config file or an icon: you can use               org/Flatpak. Follow the instructions on the page to
                              debian/install, or its per-package equivalent,                install them: it's easy. Remember, Flatpak sandboxes
                              debian/<package name>.install, to put arbitrary files         everything, so it doesn't matter if you have KDE or not.
                              into the package. Similar mechanisms exist to create            There are two approaches to Flatpak packaging.
                              empty directories, install init or cron scripts, and so on.   Large real-world applications use flatpak-build and



92                                                             www.linuxvoice.com
                                                                                                                               PACKAGING CODING


JSON manifests to automate the process. QOwnNotes
is not that big, so we'll do everything manually with
flatpak build. First, create a directory where you'll
build the package. Then, untar QOwnNotes' sources
and initialise the build process with flatpak build-init:
$ flatpak build-init qownnotes org.qownnotes.
QOwnNotes org.kde.Sdk org.kde.Platform
  This will create the qownnotes staging directory
for package files. Each Flatpak application must
have a unique name consisting of three or more
dot-separated alphanumerics. Otherwise, it could
be anything, yet "reversed DNS" notation is most
common. Then we specify an SDK and the runtime
                                                                                                                                        It's sooo cuuute… and
the application will use. Confusing their order leads to          system:
                                                                                                                                        steals your passwords (red
cryptic error messages, so be careful.                            $ flatpak build-finish ../qownnotes --socket=x11                      line) even if running in a
  Now you can start a build process. Issue                        --share=ipc --share=network --filesystem=home                         sandbox. Thank you, X11.
commands you'll normally need to build the                        --command=QOwnNotes
application, but prefix them with flatpak build <path                QOwnNotes draws windows over the X11 protocol,
to the staging directory>:                                        thus the first two switches. Besides, it will need
$ cd qownnotes-X.Y.Z                                              network access for OwnCloud integration, and you'll
$ flatpak build ../qownnotes qmake PREFIX=/app                    want to store notes in your home directory as well.
QOwnNotes.pro                                                     The final switch tells Flatpak which command
$ flatpak build ../qownnotes make                                 it should execute in the sandbox. Flatpak stores
$ flatpak build ../qownnotes make install                         packages in OSTree repositories, which are in turn
  QOwnNotes employs a QMake-based process. Note                   modelled after Git. The next command creates one
we instruct it to install the application under /app              under repo and commits the application:
inside the sandbox. This is a requirement.                        $ cd .. && flatpak build-export repo qownnotes
  Some changes are due before you can wrap up the                   If you receive complaints about desktop file
build. Certain files, such as desktop entries or icons,           contents, just do the changes as requested. It's
are exported to the host filesystem for integration.              possible to wrap the repository into a single-file bundle
Flatpak expects them to begin with an application                 (see flatpak build-bundle). We don't want to do this,
name to ensure uniqueness. flatpak-builder handles                as we can get QOwnNotes directly from the repository:
the renaming for you, but we're on our own:                       $ flatpak --user remote-add --no-gpg-verify --if-not-
$ find ../qownnotes/files/share/{applications,icons} -type        exists qownnotes repo
f | perl-rename 's/QOwnNotes\./org.qownnotes.                     $ flatpak --user install qownnotes org.qownnotes.
QOwnNotes./'                                                      QOwnNotes
  perl-rename may come as rename, if you are not                     We configure `repo` "remote" repository under the
on Arch. You'd also want to adjust the icon name                  qownnotes name and install the application from it.
inside the desktop file. Then you'll need to decide               --user tells Flatpak this should be done for the current
which resources the sandbox will share with the host              user, not system-wide.
                                                                     That's it! You can now run QOwnNotes with flatpak
                                                                  run org.qownnotes.QOwnNotes. It should also be
  In security, there is no silver bullet                          available in your desktop application menu.
  Shortly after Ubuntu 16.04 LTS, featuring the Snap package         Universal packages may help vendors to reach
  manager, was released, a proof of concept exploit was           wider audiences. Opponents argue that they make
  published: a cute teddy bear silently grabs your keystrokes
                                                                  pushing adware or other malware to users easier.
  in an X11 environment. If it were real, an attacker could use
  it to steal your passwords or credit card numbers, not to       Moreover, Linux distributions are diverse for a reason.
  mention personal messages.                                      They target different users, and maintainers oversee
      With a few tweaks, you can run the same exploit under       this process. Maintainers help to keep software in
  Flatpak (see the screenshot). It doesn't play well with         distributions consistent. And they mediate between
  Chromium-based browsers though – you always patch
                                                                  users and developers. This is a social role that a
  Linux viruses to make them work for you, you know. But it's
  just a proof of concept, after all.                             technology is hardly able to take.
      The problem isn't in Snap (or Flatpak). The vulnerability      Perhaps the best thing universal and traditional
  is in X11 itself, which officially allows any application       packaging can do is to complement, not to substitute
  to receive keystrokes or inject events into any other           each other. And now you have some grounds to put
  application. So, the exploit would work in a traditional
                                                                  both in your arsenal.
  package as well, yet such package would hardly get past
  the "maintainer barrier". The bottom line: nothing protects
  you, if you don't protect yourself.                             Valentine Sinitsyn is a university professor, Mandriva contributor,
                                                                  physicist and Linux systems developer.



                                                                    www.linuxvoice.com                                                                         93
      CORETECHNOLOGY EXTENDED ATTRIBUTES




                                  CORE
Valentine Sinitsyn develops
high-loaded services and
teaches students completely
unrelated subjects. He also has
a KDE developer account that
he’s never really used.
                                  TECHNOLOGY
                                  Prise the back off Linux and find out what really makes it tick.

                                  Network Addresses Assignment
                                  V
                                           irtually all PCs (and some toasters) seem to     OUI Lookup Tool found at https://www.wireshark.org/
                                           have an IP address today. Computing devices      tools/oui-lookup.html.
                                           aren't born with an IP address (neither v6 nor      MAC addresses aren't what you use on the internet,
                                  v4). Before they connect to the outside world, they       though. They naturally depend on the underlying
                                  need this address configured somehow. In the              technology, and would be a pain to use in the diverse
                                  simplest case, you assign it manually. This isn't very    world that is the internet. Another abstraction layer
                                  convenient from the end-user perspective, however.        (IP) is needed. MAC addresses are good to deliver
                                  When we connect to a Wi-Fi hotspot, we expect to          data to their ultimate destination in local networks.
                                  start browsing and chatting, not changing settings.       This suggests there should be some means to
                                  Assigning an address can be a convoluted process,         convert between IP and MAC addresses.
                                  and this is what we'll speak about today.                    Address Resolution Protocol, or ARP (RFC 826)
                                                                                            serves these purposes. Hosts learn IP addresses
                                  Prehistoric RARP                                          of their neighbours via broadcasting. An everyday
                                  Now, have a look at your home router's back cover,        equivalent of this would be a delivery boy shouting
                                  flip your laptop or take the lid off your smartphone.     "Who is Joe Doe here?" in a crowded open space
                                  Chances are, you'll see a sticker with the device's MAC   room. This procedure happens regularly on any
                                  (Media Access Control) address. Usually, it looks like    network, as tcpdump may show you:
                                  six colon-separated octets: `70:5a:b6:59:c4:5d`. Both     $ sudo tcpdump -n arp
                                  Ethernet and 802.11 (Wi-Fi) devices have it. The first    ...
                                  three octets tell you the manufacturer; for example,      14:32:23.852185 ARP, Request who-has 192.168.101.149 tell
                                  `00:05:5d` is D-Link. These octets are often called       192.168.101.44, length 28
                                  the OUI, or Organizationally Unique Identifier. The       14:32:23.853860 ARP, Reply 192.168.101.149 is-at
                                  manufacturer further assigns the remaining three          74:d4:35:56:7d:ed, length 46
                                  octets, so that each device on the planet gets its own    ...
                                  unique MAC. Even virtual network adapters have their      Remember not to run network sniffers on corporate or
                                  own MAC addresses:                                        public networks – this could be deemed illegal.
                                  $ ip -o link show dev docker0                               When a reply is received, the requesting host
                                  6: docker0: ... link/ether 02:42:11:c8:7c:c4 ...          remembers it in a cache. This helps to avoid
                                  Here the `02:` prefix designates a locally administered   broadcasts for known addresses, thus saving you
With Wireshark's OUI
Lookup Tool, you can              address, which doesn't constitute an OUI.                 some bandwidth.
check the manufacturer of           There are many services that let you look up the          What's in that cache on your local system? The
any network card straight         manufacturer for OUI straight in your browser. Being a    arp command knows, and it can also manage the
from the browser.                 Free Software proponent, I recommend the Wireshark        cache (which is rarely needed). By default, arp prints
                                                                                            hostnames. If you want the raw IP addresses, add -n
                                                                                            to the command line:
                                                                                            $ arp -n
                                                                                            Address     HWtype HWaddress          Flags Mask Iface
                                                                                            192.168.101.44 ether 90:4c:e5:c7:89:69 C     enp1s0
                                                                                            192.168.101.1 ether 04:8d:38:c2:88:b3 C     enp1s0
                                                                                              Any user can list ARP cache entries, as they are
                                                                                            no secret. You'll need root permissions to set (-s)
                                                                                            or delete (-d) them, however. Try it. You'll notice
                                                                                            that some entries, such as the one for your default



94                                                                     www.linuxvoice.com
                                                                         EXTENDED ATTRIBUTES CORETECHNOLOGY

gateway, aren't easy to remove. This is because your
PC communicates with these hosts quite often. So, it
learns the address back before you type arp, making
an entry re-appear.
   ARP maps IP addresses (which are configurable)
to MAC addresses (which are built-in). What if we
look at this from another angle? Can't you build an
inverse of this mapping to obtain IP addresses by the
given MAC? Reverse ARP (RFC 903) was historically
first to implement this idea. If you think about it for a
moment, you'd agree this protocol already handles
automatic IP address assignment. An administrator
may configure reverse ARP mapping on the router,
and network hosts will be able to learn their IP
addresses via RARP requests. This works, and early
Sun workstations happily followed this approach. Yet
it wasn't very flexible. In plain RARP, you can't learn
anything but your own IP address: no hostname, no
routes, no other settings. Moreover, it's IPv4-only and
low-level. For a diskless workstation, knowing the
IP address alone won't be sufficient to boot it: you'd
                                                                                                                           The "DHCP Offer" message
also want a path to the boot image. A more advanced          it sets its own address to zero and the server IP
                                                                                                                           provides a client with a
protocol was due to solve these issues.                      address to 255.255.255.255. The latter is a special           range of IP settings the
                                                             address that all hosts respond to. Of course, if the          server can assign him.
Medieval BOOTP                                               client has its server IP address pre-configured, it may
One of the first attempts to build such a protocol was       use it instead. The server won't be able to resolve the
BOOTP (RFC 951). BOOTP is a simple client–server             client IP address via ARP unless the client already
protocol that builds on UDP as a transport. Clients use      knows it. However, the server knows the client's MAC
UDP port 68, whereas servers listens on port 67.             address, so it can add a corresponding entry to the
   As the name suggests, BOOTP was conceived to              ARP table "manually". Broadcasting is also an option.
facilitate bootstrapping. It defines two message types       Clients also use randomly assigned identifiers to
(or opcodes): BOOTREQUEST for client requests and            match responses to requests. When a client receives
BOOTREPLY for server responses. Both are using               BOOTREPLY, it installs the IP address it contains and
the same package format. In the request, the client          continues as normal.
says what its hardware address is. In the reply, the
server tells the client what IP address it should use.       Modern DHCP
The server also specifies the boot image that the            BOOTP already handles centralized IP address
client can download via TFTP. Moreover, the packet           management, yet it is rather static. The assumption is
structure allows for optional extension fields, which        hardware addresses map to IP addresses 1:1. This is
may carry additional bits of data.                           not enforced, and the server is free to take addresses
   The client can also build a request the way it will       out of some pool. However, the protocol provides no
be handled by the specific server. BOOTP messages            way to tell the server that the client is not interested in
carry the server's name, and if the server accepts a         his address anymore. So, sooner or later this pool will
packet with a name different from its own, it silently       be exhausted.
discards it. This adds some flexibility, but it is another      In other words, a dynamic address assignment
bit of data that must be pre-configured on the client.       protocol should only "lend" IP addresses for a limited
   In a similar fashion, BOOTP supports clients which        time. When it elapses, the client must renew its lease.
already know their IP addresses. This may sound              Otherwise, the address is considered free. Of course,
ridiculous, but remember that it's a bootstrapping,          a client may terminate his lease prematurely – this
not an address assignment protocol. Dispatching              is useful if the system is going to shut down, for
boot images is another task it tackles, and IP address       instance. The procedure is in principle no different
makes a good key to it. That is, the server can use          from what you normally do in a car rental service.
an IP address as an identifier to send different boot           The protocol that implements it is called Dynamic
images to different clients.                                 Host Configuration Protocol, or DHCP (RFC 2131). It's
   If you think about BOOTP carefully, you'll quickly        ubiquitous, and when the network "just works" for you,
come across a "chicken or the egg?" sort of problem:         DHCP is what makes it happen. DHCP and BOOTP run
how does a client send a UDP datagram to the                 on the same UDP ports and use the same message
server if he doesn't know his IP address yet? And            layout. You may think of BOOTP as a "stripped-down"
how is it expected to receive the reply? The answer          DHCP, for the purposes of bootstrapping only. This
is broadcasting. When a client crafts the request,           is like TFTP relates to "full-fledged" FTP. DHCP is an



                                                               www.linuxvoice.com                                                               95
     CORETECHNOLOGY EXTENDED ATTRIBUTES

                                                                                                     Dynamic nature of DHCP doesn't mean the
                                                                                                  addresses themselves must be variable. Most DHCP
                                                                                                  servers support so-called "static leases", which can
                                                                                                  assign a permanent IP address to specific hosts. This
                                                                                                  could be useful, say, for your home server or NAS.
                                                                                                     A few parameters are usually required to connect
                                                                                                  your PC to the internet. Besides an IP address, you
                                                                                                  need to know your local network mask. You'd want
                                                                                                  the gateway address to route traffic outside the
                                                                                                  local network, and at least one DNS server to resolve
                                                                                                  domain names (LV024). In some cases, you'd also
                                                                                                  need a web proxy or some custom routes.
                                                                                                     In BOOTP, this sort of configuration was conveyed
                                                                                                  via Vendor Extensions, which become Options in
                                                                                                  DHCP. The reason is perhaps they are not vendor-
                                                                                                  specific anymore. DHCP Options are standard.
                                                                                                  Moreover, one of them is always present and carries
                                                                                                  the message type we've just spoken about. IP address
                                                                                                  lease time is also a DHCP Option.
The "DHCP Ack" message
                            extension to BOOTP, and most DHCP servers are                            You can distinguish DHCP Options by their
is an acknowledgement
that the server has         compatible with BOOTP clients.                                        numbers. Say, Option 1 sets a subnet mask, while
committed IP settings for      DHCP introduces several new message types.                         Option 3 stores the list of routers, in order of
the client.                 When a client wants to allocate an IP address, it                     preference. DHCP Option 6 is for the DNS server.
                            broadcasts the DHCPDISCOVER message to discover                       Web Proxy Auto Discovery (WPAD) works via DHCP
                            DHCP servers nearby. Each server receiving this                       Option 252, which contains a URL of the Proxy Auto
                            message replies with DHCPOFFER, containing an                         Configuration (PAC) script.
                            IP address along with other IP settings. At this point,                  DHCP Options look nice and convenient, but
                            the address isn't assigned yet. The client may receive                remember that clients may ignore settings that you
                            multiple DHCP offers. It chooses one and replies                      push to them this way. For tricky stuff, like WPAD,
                            with a DHCPREQUEST message to the originating                         this is rather possible. Better treat DHCP Options
                            server. This way, all other servers know their offer was              as recommendations. If you need these settings
                            rejected.                                                             enforced, you want something else.
                               Now the server commits the configuration and                          Now, look at two Wireshark screenshots we have
                            replies with DHCPACK. If things don't go well, a                      here. They capture a DHCP client address assignment
                            negative response (DHCPNACK) is sent, and the                         procedure I triggered with dhcpcd (see below). All
                            procedure restarts. Upon receiving DHCPACK, the                       messages share a Transaction ID because they
                            client also does its final checks and replies with                    belong to a single session. Unsurprisingly, everything
                            DHCPDECLINE if it detects any problems.                               starts with the "DHCP Discover" message sent to
                               Otherwise, the address is considered assigned.                     255.255.255.255, an IPv4 broadcast address. The
                            The lease time is sent along with other DHCP options                  server replies with "DHCP Offer" sent to yet-unknown
                            (see below) in DHCPACK. When this time is about to                    to the client unicast address, 192.168.101.37. This
                            elapse, the client sends another DHCPREQUEST to                       works, as the server already knows the client's
                            renew the lease. If the client decides to relinquish the              hardware address, and no ARP request is needed.
                            lease, a DHCPRELEASE message is sent instead.                         The lease time is two hours. The client responds with

                              IP configuration, the DIY way
                              Just because you can have your IP address assigned                     It is up to you to ensure that the IP address you've chosen
                              automatically doesn't mean you need to. Good old static             is not conflicting with anything else on your network. You may
                              network configuration still works in 2016.                          also notice a CIDR notation, addr/mask. It allows you to assign
                                 Linux provides several approaches to manual network              both the IP address and the netmask in a single command.
                              configuration. The one is via ifconfig and route. Another is        mask is the number of bits set in the network mask, so /24 is
                              using the single ip tool, which is more versatile.                  equivalent to `255.255.255.0` in ifconfig's parlance.
                                 The roadmap is as follows. You bring the device online,             Next step is adding the default route:
                              assign it an IP address, then add some routes (at least,            # ip route add default via 192.168.1.1
                              the default one) and configure DNS. Imagine you want to               Any valid destination (host or network) is acceptable where
                              configure the network on eth0 device. Then start with the           default is. You need to substitute 192.168.1.1 with your
                              following (as root):                                                gateway address, which needs to be on the same subnet as
                              # ip link set up dev eth0                                           you are. Your final step is to tell Linux the DNS server to use:
                                This brings the device "up", that is, to the active state. Now,   # echo 'nameserver 8.8.8.8' > /etc/resolv.conf
                              assign it an IPv4 address with:                                       Things are trickier if your system uses resolvconf or similar
                              # ip addr add 192.168.1.5/24 dev eth0                               management framework. In this case, refer to the man pages.




96                                                                    www.linuxvoice.com
                                                                               EXTENDED ATTRIBUTES CORETECHNOLOGY

"DHCP Request", asking the server to commit the
suggested configuration. "DHCP Ack" completes the
sequence.

Server side
There are many good DHCP servers available for
Linux. A de-facto standard is dhcpd from the Internet
Systems Consortium (ISC). For smaller networks,
there is often a simpler alternative called dnsmasq
(http://www.thekelleys.org.uk/dnsmasq/doc.html).
You may already run dnsmasq without being aware: it
comes pre-loaded on many home wireless routers.
    Strictly speaking, dnsmasq isn't a DHCP server. It is
an all-in-one solution, providing caching DNS server,
DHCP, network booting and everything else you may                                                                           You'll often find dnsmasq
want for you home or small office network. Of course,           dhcp-host=bert,192.168.0.70,infinite                        (or dhcpd) running behind
it's free, and you'll probably find it in your distribution's   This also shows you may use client-supplied names           the facades of modern web
package manager. dnsmasq uses a single                          as identifiers instead of their hardware addresses.         browsers.
configuration file. Typically, it's /etc/dnsmasq.conf,            It is also completely possible to set the DHCP
and it comes with a lot of comments. The parameters             options you want. dnsmasq already fills some of
we are interested in start with the dhcp-range= line.           them with sane defaults. For instance, the daemon
This enables the DHCP server and supplies it with a             assumes that the default gateway and DNS servers
pool to assign addresses from. Optionally, you may              are on the same machine as itself. If it's not the case,
also specify the lease time here:                               the following should help:
dhcp-range=192.168.0.50,192.168.0.150,12h                       dhcp-option=3,192.168.0.254
  That's it – now your clients will get dynamic                 dhcp-option=6,8.8.8.8
addresses from the supplied range. Of course, you                     An alternative syntax uses symbolic names, like so:
can do some fine-tuning, if you want to. Say, this is           dhcp-option=option:router,192.168.0.254
how you assign a given client a static IP address               dhcp-option=option:dns-server,8.8.8.8
along with the hostname:                                           Now, run dnsmasq with an init script, systemd unit
dhcp-host=11:22:33:44:55:66,fred,192.168.0.60                   or whatever else your Linux uses, and start serving
  Again, you may append a comma-separated                       your clients. Note that it is generally not a good idea
lease time. It makes sense to set it higher than for            to run two DHCP servers on the same subnet if
ordinary clients, as there is no point in re-acquiring the      they have their address pools intersecting. As you
same IP address every few minutes. dnsmasq even                 likely already have DHCP enabled on your router,
supports `infinite` lease time, if you want to make the         experiment carefully. In any case, if your network
assignment permanent:                                           starts to misbehave, just tear down dnsmasq.




Command of the month: dhcpcd
ISC's dhcpd is a de-facto standard DHCP server.                 forked to background, child pid 2069
No wonder its counterpart, dhclient, is the de-facto            ...
standard DHCP client. But Linux is all about choice,               dhcpcd is quite chatty by default, at it tells you
and there is one other thing: dhcpcd.                           which offers it got and what it decided to do about
   Personally, I tend to use dhcpcd whenever I want to          them. When the process finishes, the command forks
initiate a DHCP procedure manually. It's simple: you            into the background and keeps running silently to
just type dcpcd and tell it which interface you want to         renew the lease when the time comes. The command
configure:                                                      also accepts numerous arguments. For instance, you
# sudo dhcpcd wlan0                                             can send arbitrary DHCP options with -v. When you
DUID 00:01:00:01:1f:13:91:56:90:4c:e5:c7:89:69                  decide you no longer want to use your address, run
wlan0: IAID e5:c7:89:69                                         dhcpcd -k to relinquish the lease.
wlan0: soliciting a DHCP lease                                     Tools like dhcpcd are rarely useful in modern
wlan0: offered 192.168.101.44 from 192.168.101.1                desktop environments with their graphical network
wlan0: ignoring offer of 192.168.101.44 from 192.168.101.1      setup tools. However, they may come handy in
...                                                             disaster recovery systems, or otherwise less user-
wlan0: leased 192.168.101.44 for 7200 seconds                   friendly Linux distributions. It's good to be aware of
wlan0: adding route to 192.168.101.0/24                         them just in case you'll need to negotiate a DHCP
wlan0: adding default route via 192.168.101.1                   server manually someday.



                                                                      www.linuxvoice.com                                                          97
     LINUX INSIDE




LINUX INSIDE:
ROBONAUT R2
Robonaut R2 is a humanoid robot that lives           this form-factor is that it can interact with   either on earth or in space can operate
on the International Space Station. Initially        parts of the space craft that have been         Robonaught by wearing a visor, vest and
designed as an earth-based prototype, R2             designed to be used by humans.                  pressure-sensitive gloves.
proved so capable that it was launched into            The brains of the machine are actually           Initially, R2 was just a torso, but legs
space on 24 February 2011 on what was                located where its stomach would be if it        have been added to enable it to move more
the Space Shuttle Discovery’s final                  had one. 38 Power PC processors                 easily and NASA even hope that in the
mission. It is, at the time of writing, the only     controlled by a Linux kernel control the        future it will be able to perform space walks
humanoid robot in space. The advantage of            movement and communications. Users              more effectively that human astronauts.


                           Nick Veitch
                                                     proper tools, resulted in a lot of writing      be resilient to reboots (which happened
                           was the original editor
                           of Linux Format, a        things out by hand, converting instructions     frequently in some missions) and the
                           role he played until he   into numbers and writing a Basic program to     software implemented a very basic form of
                           got bored and went        ‘Poke’ the values into memory.                  multitasking so that important things (firing
                           to work at Canonical         It was a tiresome and error-prone process.   the engines) always happened on time
                           instead. Splitter!
                                                     I always remember thinking “they said this      irrespective of what other processes were
                                                     computer was more powerful than the ones        running. The available storage memory
                                                     used in the US space program, I bet they        (actually, wire-wound ferrite core storage)
                                                     didn’t write their code like this”. Well…       was so small that many spaces had to be



I
    learnt to program on the ZX80. I don’t              Recently great chunks of the original code   used for multiple variables depending on the
    remember how long it took to give up on          for many of the Apollo missions systems         phase of the mission – some slots were
    ZX Basic – do remember trying to                 has been uploaded to GitHub (https://goo.       used for up to seven different variables.
convert listings printed for other computers         gl/p5pccF). Aside from just the curiosity of       It is a remarkable achievement (and if you
to ZX Basic, but ultimately, it wasn’t enough        leafing through the annotated source, it is     are curious you can also find online
space to realistically do much in Basic, So I        amazing to see how tightly coupled this         emulators for the different computers and
eventually had to work out how to use Z80            code was with the hardware – every cycle        the DSKEY interface used by astronauts
assembly, which with no room for any                 needed to be accounted for, and needed to       (www.ibiblio.org/apollo).



98                                                               www.linuxvoice.com
This is what we’ve done in the last 24 issues.
  Subscribe to the next 12 from just £38.




Every subscription includes access to every PDF, ePub and audio edition we’ve ever published.




              shop.linuxvoice.com