Linux Format 217 (Sampler)

Page 1

TESTED: the best Single board PCs

65

Pages of tutorials and features Record live TV on Ubuntu Multi-boot USB drives Fire up Wordpress 4.6 Coding Academy: Recreate the Enigma code encryption

Get into Linux today!

The infrastructure guy Bash. It’s ubiquitous, you can rely on Bash being available wherever you run it.

Toby Jackson running Future Plc on open source Roundup

Gaming

Talk and share online without the spooks listening in on you

The smash hit online game comes to Linux!

Secure chat

Rocket League

CCTV

the Linux way

Build an open source home security system


This ISSUE: Lenovo loves Linux?

Italian army loves Linux

NextCloud loves boxes

Hardware news

Did Lenovo block Linux?

Malice, stupidity or something else? Lenovo and Microsoft accused of blocking Linux on new laptops, but there may be another culprit…

T

here has been recent controversy over Lenovo Signature PC laptops apparently denying owners the ability to install Linux or other non-Windows 10 free operating systems. Lenovo hasn’t been in the community’s good books for a while now, thanks to a number of high-profile issues, such as shipping laptops with malware contained in pre-installed software. In fact, Lenovo’s insistence on cramming bloatware into its new laptops made its Signature PCs so appealing—as they were promised to ship free from that sort of unwanted software. The only problem is that it now appears difficult to install Linux on these machines. People were quick to take to Reddit (http://bit.ly/ RedditMSSig) and the Lenovo forums to voice their anger, and two familiar scapegoats were brought up: Lenovo and Microsoft. It didn’t help that overzealous moderators on the Lenovo forums were silencing people who were complaining about the issue or making reference to a Change.org petition insisting that Lenovo provides a BIOS update to enable Linux installations. The flames were further fanned when a ‘Lenovo Product Expert’ left this comment under a review of a Lenovo product on Best Buy’s website: “This system has a Signature Edition of Windows 10 Home installed. It is locked per our agreement with Microsoft.” The story was picked up by many news organisations, including the BBC, and many people saw this as proof that Microsoft was working with computer manufacturers to block Linux installations, despite the fact that this ‘Lenovo Product Expert’ didn’t provide any verification that they worked for, or had anything to do with,

6 LXF217 November 2016

Lenovo at all. It’s now become apparent that this presumed collaboration between Lenovo and Microsoft isn’t what happened at all. The actual cause of users not being able to install Linux on Lenovo Signature PCs is that Lenovo has new firmware that uses the NVMe RAID mode in its BIOS. This is a new mode that locks the SSD of the laptop to RAID mode. This is a move by Intel, and while there is a workaround to allow Windows 10 to see the hard drive in RAID mode, there’s currently no Linux support, which means it can’t see the drive and therefore can’t be installed. A Lenovo spokesperson explained to The Register (http://bit.ly/ NoLenovoPlot2BlockLinux) that “To improve system performance, Lenovo is leading an industry trend of adopting RAID on the SSDs in certain product configurations. Unsupported models will rely on Linux operating system vendors

Lenovo denies it worked with Microsoft to block Windows 10 installations.

recriminations against Lenovo and Microsoft appears to be a distraction from the real issue and ‘villain’ of the piece, which sadly appears to be Intel and its tardiness in making sure Linux and other free operating systems work well on its hardware – especially on the consumer side of things. It’s up to Intel to provide information on how these operating systems can support the NVMe Raid mode, something it appears to be rather relaxed about. If Intel had been more quicker to support free OSes, this problem may never have occurred. However, the idea of some grand conspiracy between Microsoft and Lenovo is a lot more interesting to enraged denizens of the internet than a driver support issue, so Intel seems to be surviving this controversy unscathed.

“If Intel had been more willing to support free OSes, this problem may never have occurred.” releasing new kernel and drivers to support features such as RAID on SSD.” What this means is you’ll need a Linux distro with a kernel that contains the new drivers. This misplaced anger and

www.linuxformat.com


Reviews Linux distribution

Elementary OS 0.4 Like Norse mythology’s Loki, Jonni Bidwell is a bit of a prankster and a mischief maker. He’s also quite simple, like Elementary OS Loki. In brief... A stylish, easyto-use distribution that’s easy to install and easy to use. It’s probably closer to Mac OS than any other Linux desktop, and that, combined with the many instances of configurability being sacrificed in favour of simplicity, will likely put off many LXF readers. See also: EndlessOS, KaOS, Linux Mint.

I

t’s been about a year and half since the last major Elementary OS release (Freya). That version, while a little rough around the edges (some of which were smoothed with a couple of point releases), showed immense progress and promise, so we were excited to see what this incarnation brings. For those unfamiliar with Elementary OS, it aims (and succeeds) to be pretty and easy to use. It’s even a little coy about the fact that it’s a Linux distro – its website describes it only as ‘a fast and open replacement for Windows and Mac OS’ – and it’s so simple your granny could use it. But Linux it is – hiding under that desktop veneer is Ubuntu 16.04, a welcome update to the previous 14.04 base, which is beginning to show its age. In some ways our initial excitement was met with an anticlimax – it’s not that Loki is a worse release than Freya, and it’s not for any lack of tangible change, it’s just that we were expecting so much more. The Pantheon desktop still looks beautiful and runs slickly, there are some lovely wallpapers (but really), it’s easy to install, and comes

Features at a glance

[Even if you despise the lack of configurability, there’s no denying it’s a good-looking desktop.

18     LXF217 November 2016

with a good (if sparse) selection of preinstalled apps. Perhaps we’re being harsh, but it seems like many of the visible changes are merely catching up with other desktops, rather than being genuine innovations. The Applications menu search bar is improved (you can search by keywords, rather than just names), notifications are stored (Windows 10 style) and the volume applet can control playback for many music programs (like Mint 18).

Browser bonus

A clean install gives you 16 applications in this menu, exactly enough for one to spill over to page 2.

Pantheon desktop

The Terminal gets a nice colour scheme with this release, although Gentoo Linux has been doing this since 2003… [Show off! - ED]

System Settings

[The Settings dialog has been rewritten and looks somewhere between that of Gnome and Mac OS.

One resounding criticism that has been addressed was the choice of Midori as the default web browser. It was prone to crashing and did not play nicely with some sites. Of course, users were free to install Chrome(ium) or Firefox, but these days one expects a decent browser out of the box. In Loki, the web browser is Gnome’s Epiphany, a more robust choice, but one which many users will still prefer to overrule. One criticism which hasn’t (and perhaps won’t) be addressed is the file manager’s simplicity. You can’t open multiple instances, precluding dragging files between windows, so expect to be copying and pasting more than usual. You only get three options: grid, list and multicolumn view. The latter makes things very Mac OS Finder-like. Indeed, once you start looking, you begin seeing Mac-isms everywhere. Firstly, there’s the dock at the bottom

www.linuxformat.com

of the desktop. Then, in the shortcut key configuration dialog, we find the Windows and Alt keys referred to by the command and option symbols one finds on Mac keyboards. In general, everything looks modern and minimal, and the distro showcases some nice innovations. Its mail client, in particular, is a fork of the nowdefunct Geary, which showed great promise before its demise. You can connect your email accounts and the rest of your online life to your desktop, although many will prefer not to. New software and updates are handled from the AppCenter, where libraries and technical gubbins are lumped together under the amorphous title ‘Operating System Updates’ to protect you from their scary names, presumably. LXF

Verdict Elementary OS 0.4 Loki Developer: Elementary Web: https://elementary.io Licence: Various (optional codecs)

Features Performance Ease of use Documentation

7/10 8/10 9/10 8/10

Continues its march towards being the premier pretty and simple distro. But you can’t right-click on the desktop.

Rating 8/10


Reviews Linux game

Rocket League With jumpers for goalposts and butter in frying pans, Matt Elliott has no shortage of metaphors when it comes to this beautiful game. Specs Recommended: OS: Steam OS, Ubuntu LTS CPU: 2.5GHz+ quad-core Mem: 4GB GPU: Nvidia GTX 660 or better, ATI 7950 or better HDD: 5GB Comms: Broadband Extras: Gamepad or controller

Who needs football boots – or even feet – to play football?

L

et’s not waste energy exploring why football should replace its paper chain of squalid billionaires with cars, and accept it as fact. A fact which Rocket League proves with ease. We’ve never played a game that needed a tutorial less. Association football, soccer, wendyball – whatever you want to call it, it’s that, but on wheels. Drive car at giant ball; hit ball into net; score points. Rocket League’s competitive core has existed for centuries, and this helps make a preposterous concept feel primal. Like dry martinis and genitalia scribbled in an unattended notebook, Rocket League is a celebration of simplicity. Driving is delicious. You accumulate boost by driving over markers on the arena floor, and unleash it in a thunderous rush that fires you across, over and around the pitch. Matches take place in smooth, enclosed spaces, where you can drive up walls and across ceilings. Cars can also jump and dodge, both of which can be used defensively and offensively. The weight of the cars, as well as your ability to apply unruly boost to jumps, adds a pleasingly haphazard element; like athletic footballers leaping to header high balls, but with less shirt-pulling and zero chance of flattening a £2,000 hairdo. Vehicles feel light and buzzy – somewhere between Micro Machines and those swift, slidey remotecontrolled cars, which only seem to appear on Christmas Day. This contrasts nicely with the fat, beefy bounce of the ball, which gormlessly invites impact like a punchable cousin. And that’s it. We feel almost guilty

22     LXF217 November 2016

Cars ease around like butter in a heated pan, but always feel under your control.

reducing a review to “ball” and “car”, but there are only ever those two things in the field of play, and they both feel great. There are no weapons, but certain markers fill your boost and let you obliterate other players. Mercifully, it’s the generous, instantly-respawning type of obliteration, but in most of the games we played, it was rare; certainly never frequent enough to be irritating. Destroying other vehicles is one of many actions that accumulate points; imagine Burnout, but with awards for skill, not speed. You receive points for things such as clearing the ball from your goal line, spectacular saves and overhead bicycle kicks. Giving everything a points value means it’s about more than scoring goals. It stops players from clustering in the same spots and reinforces the concept that Rocket League is a team game. Except when it’s not, such as when duelling against a single opponent. Alternatively, you can set teams of four against each other, in matches that become so frantic that they’re less like footy, more like a lost, confused beach ball bashed between bumper cars. Playlists of duels, doubles, standard 3v3 matches and the appropriately named Chaos 4v4 mode are all available online, with ranked playlists limited to duels, doubles and 3v3. There’s a reason why online play is the first option on the menu: Rocket League is designed to be played with

www.linuxformat.com

people, and this is where it thrives. Our experience was marvellously robust. We rarely had to wait long for a game, and if players dropped out mid-session, they were immediately replaced by AI bots. If playing online isn’t your thing, there are exhibition matches and full seasons you can solo. The offline modes do reveal the game’s minor inadequacies, however: team AI can be flaccid and unreliable, especially against tougher opponents, and the same simplicity that makes Rocket League immediately playable can cause things to get repetitive when played alone; a criticism that only becomes apparent because it’s so damn addictive. It’s a simple thing done brilliantly well, kept interesting by the thrill of competition. LXF

Verdict Rocket League Developer: Psyonix, Inc Web: www.rocketleaguegame.com Price: £14.99

Gameplay Graphics Longevity Value

9/10 8/10 10/10 9/10

Fast, fun and relentlessly enjoyable. The best football game without feet. And it plays beautifully on Linux.

Rating 9/10


Roundup Roundup Office Xxxxxxxxxxxxxxxx suites

Every month we compare tons of stuff so you don’t have to!

Secure chat

While not particularly paranoid, but Mayank Sharma wouldn’t want anyone to eavesdrop on his playful banter with his mates.

How we tested... We’ll look at each instant messager’s mechanisms for enhancing security and privacy, and whether any of these has a negative effect on the usability of the application. We’ll also keep an eye out for applications that are cumbersome to use and ruin the user experience in their efforts to ensure privacy. Some users that are exchanging sensitive information probably won’t mind taking a hit on usability if it ensures stronger privacy, but the majority are unlikely to want to jump through too many extra hoops. We’ll also keep an eye out for IMs that offer the same convenience and features as their popular counterparts. On a related note, an IM’s repository and its supported platforms can be a key deciding factor. Similarly, you can’t get anyone to switch to a new app if the installation is long and drawn out.

O

Our selection CryptoCat Goldbug Jitsi qTox Retroshare

ver the years, instant messaging (or IM) has evolved into a full-fledged, feature-rich medium for communication. Besides simple text messages, a typical IM session includes the exchange of images, audio and even video streams. While the primary users of IM are home users, IM has also been adopted for use by companies behind corporate firewalls. Both kinds of users have a different set of requirements and a plethora of messaging services have popped up to satiate the growing demand for instant messaging.

24     LXF217 November 2016

In their bid to outdo the competition, virtually all of the popular IM services use their own home-brewed proprietary protocol. However, one thing many of them overlook is security. To offer a better communication experience to their users, these publicly accessible services route all your private exchanges via central servers that can

be subpoenaed. So while IM clients and services are a dime a dozen, many of them don’t offer the level of security and privacy that makes good sense in this post-Snowden era. In this Roundup, we’ll look at some of the best options available to users that are looking to converse online without the fear of being snooped.

“Publicly accessible services route all your private exchanges via central servers.” www.linuxformat.com


Super Pi

T

he Raspberry Pi has transformed the way we look at computers and computing. Thanks to its ridiculously low cost of ownership, you can build a fully functional computer for under a tenner and put it to all kinds of uses. But sometimes that choice can be overwhelming – this is a computer that has gone into space for goodness sake – but that shouldn’t stop you finding new and exciting ways to use it. The Pi’s versatility makes it the perfect tool for just about any task you could think for it to do. Looking for a replacement desktop for your PC? The Pi 3 has just about enough oomph – with the right support – to do that. How about using it as a portable device? A laptop maybe?

Or at the very least as a portable touchfriendly unit? No problem. In this feature, we explore how to build the ultimate Pi for use in a number of essential and common roles. We’ll show you how to set it up as a desktop replacement or portable computer, capable of being powered by batteries.

media wherever you are in the home (or even further afield). But who needs a quad-core Pi when the Pi Zero can perform sterling service as an audiophilefriendly music player or full-blown streaming stick? And last, but not least, the Internet of Things is all the rage, but there are so many gaps and shortcomings in existing ecosystems that the Pi is an almost obligatory addition to your IoT setup. We’ll show you the key hardware considerations you need to follow, reveal a clever way of powering your Pi from up to 100 metres away and deliver you a softwarebuilding solution that will put you on the road to developing your own IoT applications. Enough preamble, let’s get stuck in…

“We explore how to build the ultimate Pi for use in a number of essential and common roles.”

32     LXF217 November 2016

Then we’ll reveal two great ways in which it can be put to more specific uses. First, as a media centre or server the Pi’s lowpower demands coupled with its new quad-core processor make it a great tool for serving your music, video and other

www.linuxformat.com


Super Pi

The ultimate IoT Pi Build a cheap and effective IoT device using a Pi Zero.

W

Credit: Pi-Supply.com

e’re still waiting for a single Internet of Things standard to emerge and chances are it never will. In the meantime, each time you purchase a piece of IoT kit from one manufacturer, be it a motion sensor, security camera or smart lighting, you’re gambling that it will not only work with your current ecosystem but also prove flexible enough to work with others should the horse you’ve currently back fall out of favour. And let’s not talk about updates that break compatibility with older devices, eh SmartThings?

The PoE Switch Hat powers your Pi using an Ethernet cable— but you’ll need a suitable PoE injector or switch.

Services like https://ifttt.com go a long way to helping bridge the digital divide between devices, but why rely on a manufacturer’s piece of expensive kit when you can custombuild your own versatile IoT gadgets using a Pi or Pi Zero? In this project, we’re going to reveal the kit you need to build a core IoT device, then look at ways of adding to it and integrating it into various ecosystems.

Build your base unit The key consideration for your IoT device is which model of Pi you want to build it around. The Pi Zero is – on the surface – the obvious choice due to its small size and low cost of entry, although you need to factor in additional effort and cost: in particular, you’ll need to be confident using a soldering iron to add on much-needed functionality, such as the GPIO pins and even an alternative power source as we’ll see shortly. At the other end of the scale, the Raspberry Pi 3 has the added advantages of built-in Wi-Fi and Bluetooth, and the extra processing power may be vital depending on how much functionality you want to pack into a single unit. It’s also easier to add HATs including one that provides you with the means to power your Pi from its Ethernet port. Next, consider your device’s main purpose. If you want to use it as a camera, for example, then ask yourself whether you want a camera for daytime or night-time use—pick the Pi-NoIR model for the latter, paired with an infrared light source. If you plan to use the camera with your Pi Zero, don’t forget to purchase the required cable (an extra £4). Also take the time to examine what cases are out there—two in particular caught our attention. The ZeroView (£7, https://

Build your own software projects You’ve set up your hardware, but how do you go about integrating them into your IoT infrastructure? While extensively documented and supported, your hardware usually requires some Python programming skills to make use of its extensive libraries. If you’re just starting out with programming, or want more flexibility, you should take a look at the open-source Wyliodrin IDE. Wyliodrin is a web-based platform that tries to simplify the programming process by supporting a wide range of languages in a platform-agnostic way to let you put your projects together using a more user-friendly building-block approach called ‘Visual Programming’ while the code is written for you in the background. First, you’ll need to start by signing up for a free account at https://www.wyliodrin.com, then input the basic details of your Pi—its type and network connection (wired or wireless). Next, download the pre-built Raspbian image

40     LXF217 November 2016

to a suitable microSD card—you can also add accessible way into coding, and the dashboard Wyliodrin to an existing installation via a helps to visualise what you’re actually doing. lengthy script, but it takes hours to complete. Of course, if you’re already a programming Once done, embed a custom .JSON file that whizz you can easily switch to code view if links your Raspberry Pi to your Wyliodrin you prefer. account and reboot. As soon as you’re logged in, your Pi should appear online in your Wyliodrin web console, ready for you to program. From here the simplest approach is to install the Wyliodrin STUDIO Chromium extension. This extension supports JavaScript and Python, but it also gives you Visual Get started programming your IoT device in Wyliodrin STUDIO by Programming as an using the Visual Programming component.

www.linuxformat.com


Toby Jackson

Infrastructure Ingenuity and Nginx Jonni Bidwell convinces coworker Toby Jackson to join him in the pub for an afternoon and more or less gets away with the resulting expenses claim.

42     LXF217 November 2016

www.linuxformat.com

Many thanks to the Bath Brew House for letting us conduct this interview. www.thebathbrewhouse.com


Single board computers

Single-board

computers There are many alternatives to the Raspberry Pi and Arduino, but which one do you invest in to get the best support? Les Pounder investigates.

F

ew would have foreseen the rise of the single board computer (SBC) in the mid-2000s or its close relative the microcontroller. It all started from humble beginnings with the Arduino dominating the market and enabling artists to integrate technology into their art. It also kickstarted the organic creation of the maker community which has now become a billion dollar industry. But the dominance of the Arduino was challenged in 2012 by a new kind of platform,

46     LXF217 November 2016

the Raspberry Pi. Created by Dr Eben Upton CBE to meet the Computer Science needs of new students at Cambridge University, the

Trading had sold its 10 millionth board, which means the Pi board has set the standard for hardware and support, which other boards try to emulate. But there are now other boards appearing in this busy market and while they bring with them more power, greater flexibility and lower prices they don’t yet have the support or user base of the others. In this feature, we take a look at new microcontrollers and SBCs, and discuss how to pick the right board and ensure your choice meets the needs of your projects.

“There are now other boards with more power, greater flexibility and lower prices.” board was released to the public on February 29 2012, and all 10,000 of the initial allocation were sold in minutes. Fast forward to 2016, and in September this year Raspberry Pi

www.linuxformat.com


Mr Brown’s Administeria

Mr Brown’s Jolyon Brown

Administeria

When not consulting on Linux/DevOps, Jolyon spends his time bootstrapping a startup. His biggest ambition is to find a reason to use Emacs.

Esoteric system administration goodness from the impenetrable bowels of the server room.

I dream of AI

T

his monthly column has talked about ‘artificial intelligence’ before (and I’ve covered the subject in a few related stories) over the last year. I suppose you could say that it has grown into a fascination of sorts. I’m writing tonight having just plonked my pre-order for one of Amazon’s Alexa-backed products into a database somewhere in the vast (AWS) ether. I’ve been attempting to squeeze in enough study time to do one of the many available online courses or read one of the myriad books about this compelling subject. It’s the first time in a while that a technological advance like this has caught my attention in such a strong way (I’ve been devouring fistfuls of blog posts like the one seen here at OpenAI.com (https://openai.com/blog/ infrastructure-for-deep-learning). While the noise around machine learning is unbelievably over hyped and the inevitable backlash is undoubtedly winging its way around the next corner, it does feel as though the threat of another ‘AI winter’ is as far away as it has ever been.

PR problem What enthuses me most though is the open source nature of these new developments. I think the rise of our favourite model for knowledge sharing has hugely accelerated the capabilities and adoption of this whole branch of computer science (along with the web, of course). There is still somewhat of an image problem to be addressed of course. I did like a quote from Dan Kaminsky (of DNS exploit fame) that I saw this week that suggests that AI/Machine Learning could be called Automated Statistics: “Nobody’s afraid of computers being better than them at statistics”. Personally, I don’t think I could consider any machine intelligent unless it could teach me how to use Emacs. Then I’ll start to worry. jolyon.brown@gmail.com.

50     LXF217 November 2016

Attack of Things Botnet of IoT devices responsible for huge DDoS attacks has malware released to the public.

A

plethora of internet-attached devices were responsible for several large distributed denial of service (DDoS) attacks in September 2016, including a high profile attack on the website of security journalist, Brian Krebs. This attack caused Krebs to request that Akamai, a firm specialising in defending this type of scenario, take his site down (it later reappeared hosted on Google’s cloud infrastructure). The CTO of OVH, the French hosting firm, then posted a screenshot of an attack on its network on Twitter. This seemed to come from the same collection of devices, peaking at a

The attack relied on devices using default usernames and passwords as detailed in the files uploaded to GitHub.

www.linuxformat.com

reported 990Gbps. Incredibly, the software behind the botnet which carried out the attacks was released to the public and subsequently uploaded to GitHub (https:// github.com/jgamblin/Mirai-Source-Code). The claimed author of the code, nicknamed Anna-senpai, said on hacking community website, Hackforums that “When I first go (sic) in DDoS industry, I wasn’t planning on staying in it long, I made my money, there’s lots of eyes looking at IoT now, so it’s time to GTFO”. The code relies on default usernames and passwords to be in place on devices it looks to exploit, many of which are running embedded Linux of one sort or another. Anna-Senpai stated that following the Krebs attack, ISPs had stepped up their efforts against compromised devices and as such, the number of cameras and other systems that were responding to commands to join attacks was dropping daily. The SANS institute has called (http://bit.ly/ExploitedDVRs) for sysadmins to assist in the fight against such devices by running a ‘cowrie’ honeypot and reporting changes in behaviour and any attempted break-ins. Tests carried out by SANS showed that devices attached to the internet were targeted almost instantly and quickly compromised if their credentials hadn’t been changed from factory settings. Sadly, this is too often the case with IoT devices which sit online and are rarely updated or patched to protect either their owners or the targets of DDoS attacks that they take part in.


Tutorial USB boot Xxxx ISOs Grub Boot multiple Live distro

images from a USB stick

Grub: Boot ISOs from USB Neil Bothwick avoids a bag full of DVDs by copying them all to one USB stick, along with a convenient menu to pick which one to boot.

files possible. The main disadvantage of this approach, at least for the poor sap having to get the DVD working, is that different distros need to be treated differently and the options to boot from them as ISOs is rarely documented. In the next few pages, we will show you how to do this; how to set up a USB stick in the first place and the options you need for the favourite distros. We will also show you how to deal with less co-operative distros.

Our expert Neil Bothwick

Setting up the USB stick

has a great deal of experienced with booting up, as he has a computer in every room, but not as much with rebooting since he made the switch to Linux.

A

lmost all of the distribution (distro) ISO files on our cover DVDs are what are known as hybrid files. This means that not only can they be written to a CD or DVD in the normal way but they can also be copied to a USB stick with dd. The USB stick will then boot as if it were a DVD. This is a handy way of creating install discs for computers that don’t have an optical drive, but it has one significant drawback: Each ISO image requires a USB flash drive to itself. With USB sticks holding tens or even hundreds of gigabytes costing only a few pounds, and small drives becoming harder to find, this is a waste of space both on the stick and in your pocket or computer bag. Wouldn’t it be good to be able to put several ISO files on the same USB stick and choose which one to boot? Not only is this more convenient than a handful of USB sticks, it’s both faster and more compact than a handful of DVDs. The good news is that this is possible with most distros, and the clue to how it’s done is on our cover DVDs each month. We used to laboriously unpack distro ISOs onto the DVD so that we could boot them and then we had to include scripts to reconstruct the ISO files for those that wanted to burn a single distro to a disc. Then we started using Grub to boot the DVD, which has features that make booting from ISO

68     LXF217 November 2016

www.linuxformat.com

First, we need to format the stick. We will assume that the stick is set up with a single partition, although you could use the first partition of a multi-partition layout. What you cannot get away with is a stick formatted with no partition table, as some are. If that’s the case, use fdisk or GParted to partition the drive, then you can create the filesystem. The choice of filesystem is largely up to you, as long as it is something that Grub can read. We’ve used FAT and ext2 (there’s no point in using the journalling ext3 or ext4 on a flash drive). Use whatever fits in with your other planned uses of the drive, we generally stick with FAT as it means we can download and add ISO images from a Windows computer if necessary. Whatever you use give the filesystem a label, we used MULTIBOOT, as it will be important later. In these examples, the USB stick is at /dev/sde (this computer has a silly number of hard drives) and the filesystem is mounted at /media/sde1, amend the paths to suit your circumstances. First, we install Grub on the stick to make it bootable:

Use GParted or one of the command-line tools to prepare your flash drive. Giving the filesystem a label is important for booting some distros ISOs.


Python

Python: Build an Enigma box Nate Drake explores how to set up an authentic version of the Enigma Cipher machine used by the German military during World War II.

Image credit: Greg Goebel, Public Domain

Our expert Nate Drake

Nate wants to thank his longsuffering girlfriend, who had to forego​ her TV time while he sent streams   of gibberish from his Enigma machine across the screen.

A four rotor Enigma machine. Different machines were used by different branches of the German military.

A

Quick tip A working replica of the Turing-Welchman Bombe is at the Bletchley Park Museum – http:// bit.ly/TuringWelchmanBombe.

lan Turing famously said: “Some people thought we were at war with the Germans. Incorrect. We were at war with the clock” or at least that’s what Benedict Cumberbatch says as Alan Turing in the 2014 film, The Imitation Game. Regardless, Cumberbatch (as Turing) was referring to the Enigma machine which was being used by the Germans to encode military radio messages during World War II and to date had proved near impossible for the Allies to crack. In technical terms, Enigma machines were known as ‘electro-mechanical rotor cipher machines’. They resembled large typewriters and an operator would configure the machine according to pre-agreed settings and encode a message using the keyboard. For each letter that was pressed the mechanical parts would complete an electric circuit. The corresponding encoded letter would then light up on the machine. Each key press shuffles at least one rotor one place forward, which means the same letter is never encoded the same way twice. Thanks to programmer Brian Neal’s py-enigma library, it’s now possible to reproduce the machine using the programming language, Python. The Raspberry Pi is perfect

84     LXF217 November 2016

www.linuxformat.com

for running as an Enigma machine due to the fact it supports Python and has a hardware random number generator. In this project, we will explore how to download the py-enigma library to the Raspberry Pi as well as how to configure the Engima machine in a way similar to the operators in World War II. We will also explore the workings of Enigma devices in order to understand how the Pi will encode your messages.

Enigmatic myths The Enigma machine was invented sometime after World War I, although its inventor, German engineer Arthur Scherbius, initially saw only lacklustre interest from private companies. With the advent of World War II, the military of several countries started taking an interest in the machine and began adapting it by beefing up its security. Just as different countries adapted Enigma to their needs, different military departments within Germany used variations of the machine as well. The py-enigma library is capable of emulating the German ‘Heer’ and ‘Luftwaffe’ (Army and Airforce respectively) Enigma machines, by default. It’s also capable of emulating the Kriegsmarine (Naval) Enigma, which had a more sophisticated design. For the purposes of this project, we are going to concentrate on the simplest implementation of Enigma used by the Army and Airforce. Another common misconception about Enigma is that it was single-handedly


Got a question about open source? Whatever your level, email it to lxf.answers@futurenet.com for a solution.

This month we answer questions on:

1 Installing extra languages 2 Hacking fears 3 Using Coreutils and dd 4 Mounting

1

Windows partitions 5 Scripting KDE5 wallpapers ★ Secure web connections

Language lapse

I installed Linux Mint 18 Cinnamon from LXF214 on a HP 8440n without any trouble and Windows 7 also exists without trouble. But when it come to installing another language, Swedish, the setup language, English, starts to get mixed up. All the menus and map names are in Swedish but my keyboard flips between Swedish and English when Mint 18 starts. Now it’s stuck in English. What should I do? What command should I use in Terminal to have Mint 18 to stay in Swedish?

After installing extra languages, Mint will let you know if any other language packs are needed.

Bengt Eriksson It sounds like you have installed and selected the Swedish language packs for your desktop, but the system locale is still set to English, as that was the language you used for installation. Linux is a multi-user system, so when

Enter our competition Linux Format is proud to produce the biggest and Get into Linux today! best magazine that we can. A rough word count of LXF193 showed it had 55,242 words. That’s a few thousand more than Animal Farm and Kafka’s The Metamorphosis combined, but with way more Linux, coding and free software (but hopefully less bugs). That’s as much as the competition, and as for the best, well… that’s a subjective claim, but we do sell

Win!

way more copies than any other Linux mag in the UK. As we like giving things to our readers, each issue the Star Question will win a copy or two of our amazing Guru Guides or Made Simple books – discover the full range at: http://bit.ly/LXFspecials. For a chance to win, email a question to lxf.answers@futurenet.com, or post it at www.linuxformat.com/forums to seek help from our very lively community. See page 94 for our star question.

you set a language in your desktop preferences, you set it for the current user only. The first step is to install language-packgnome-sv using the Synaptic package manager. This should pull in all the desktop language packs needed to run a Swedish desktop. Then you can select Swedish from the Preference > Languages option in the main menu, In the Language Settings window, click on ‘Install/Remove Languages’ and check whether the Swedish entry is marked as ‘Fully Installed’. If not, select it and press ‘Install Language Packs’ to install any missing Swedish packs. You may need to log out and back in to apply the changes. To change the system locale you can either go back into Preference > Languages and press the ‘Apply system-wide’ button. This will ask for your password as you are modifying a system setting, unlike the other selections. Alternatively, you can use localectl in a terminal. If you run it with no arguments, it will show the current setting. To see the list of available locales, run $ localectl list-locales . Then you can set the one you want with: $ sudo localectl set-locale LANG=sv_SE.utf8

2

Hacking fears

I appear to have been hacked. I don’t know if it was a direct (my PC) or indirect (associated sites: e.g. Gmail, Amazon et al). They had the essential credit card information to conduct fraudulent transactions. I was notified of as much by my bank. I’m running Ubuntu 16.04 LTS and I try to keep up with updates.

92     LXF217 November 2016

www.linuxformat.com



Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.