<<

FOSSPICKS

Sparkling gems and new releases from the world of FOSSpicks Free and Open Source Software Mike Saunders has spent a decade mining the for treasures. Here’s the result of his latest haul…

Programming language nuBASIC 1.18 e’re spoilt for choice with 13.10 test box. Source code is also programming languages available of course – the main Won , with every dependency when you’re building it paradigm under the sun is SDL v2. Annoyingly, the packaged represented, and returning to the version doesn’t come with a clumsy spaghetti code of 80s manual page, nor with any home seems bonkers. examples, so you have to grab So we’re not advocating that people those via examples_1.13.tar.bz2 write large-scale programs in BASIC from the project’s website. And then today. But nuBASIC still fills a niche: you might get stuck when trying to for those who fancy a trip down run a program; it turns out that you memory lane, for need to use the -e flag, otherwise who want to see how a language is you’re dropped into an interactive implemented (the is session. So, run a program like so: You can write simple 3D games, as the raytracing demo shows. written in C++), and for children nubasic -e breakout3.bas looking for an easy path into the But! There’s another hitch: the see what the language can do. The world of programming. You could default window size is too small for examples bundle includes three argue that kids are better off many of the supplied examples, so versions of the classic block- learning Python, but the BASIC you’ll have to resize it before you bashing Breakout game; the first implementation here actually has use the programs. uses the hideous GOTO-laden elements of structured Take a look at the examples to line-numbered programming programming, and it makes it easy approach of Speccy-era machines, to handle keyboard input, graphics “The BASIC implementation here while breakout2.bas and and so forth. breakout3.bas demonstrate the nuBASIC is provided in RPM and makes it easy to handle keyboard interpreter’s ability to use more Deb formats, the latter of which input, graphics and so forth.” advanced programming methods. worked perfectly on our Other examples include ray.bas, an impressive (albeit slow) 3D-esque raytracing demo, along with minehunter.bas, a clone of the classic Minesweeper. The examples show many aspects of the language, from reading keyboard and mouse input to plotting pixels and working with files. nuBASIC is well documented, with an extensive programming guide and language reference explaining the interpreter’s capabilities using copious examples. Here’s Minehunter in action, along with one of the more complicated PROJECT WEBSITE snippets from its https://sites.google.com/site/ nubasiclanguageinterpreter source code.

68 www.linuxvoice.com FOSSPICKS

Operating system OS 2014-08-31

inux on the desktop is a haiku-os.org for more details.) curious beast: there’s no Haiku boots impressively quickly, Lsingle team in charge of it all. even inside a virtual machine, and We have the kernel hackers working displays a bare desktop that harks in one group, X being developed by back to the days of Windows 98. another, the Gnome and KDE There’s little visual glitz here, as the coders busy elsewhere, and so Haiku team is focused on usability forth. Distribution vendors fit it all and performance. Click on the leaf together, and the end result is a icon in the top-right to open the hugely versatile desktop OS. main menu; this includes a number Now, imagine an OS created from of submenus, such as Applications the ground up that focuses entirely and Demos, where you can play on the desktop. Unlike Linux, it around with the included software. Haiku doesn’t sport doesn’t have an interest in also until now – and that version of the wobbly windows or working on big-iron mainframes or What’s in the box? fancy drop shadows, but is 13 years old. GCC 4 is postage stamp-sized embedded If you’re running in VirtualBox, it runs at a blistering available though, for those not devices. Everything is developed in networking should be enabled pace. interested in backward unison – the kernel, the graphical automatically. WebPositive is a compatibility. The API is well layer, the toolkit, the desktop and WebKit-based browser that runs at documented, and if you’re a dab the core applications. This is Haiku a decent lick, while additional apps hand at C++, it doesn’t take much OS, an open source implementation are included for accessing mail effort to knock together a quick of BeOS, a scorchingly fast (IMAP and POP3) and playing Hello World app. Various third-party multimedia OS that gained some media files. You’ll even find a applications are available at small scale popularity in the late terminal running Bash, but note that www.haikuware.com, although 90s (and became defunct in 2001). this is not a -like system. the selection is very small when It’s been a while since the last Switch into the /boot/system compared to the big-name distros. alpha release, so we fired up a directory and run ls, for instance, Haiku’s progress has been slow nightly development snapshot, and you’ll see that the filesystem in recent years, but we still cheer it which is available as a .vmdk virtual layout is completely different. on as an alternative to Linux, hard drive file, ready to use in Haiku aims to be compatible with especially on older PCs. There’s VirtualBox or VMware. Download the the last release of BeOS, although room in the market for a svelte Zip file, extract it and in VirtualBox, this has meant sticking with GCC 2 low-latency OS with a razor-sharp go to Settings > Storage and focus on desktop computing – choose it as the drive image for “Haiku is a svelte low-latency especially if it can bring new your virtual SATA controller. (It’s features to the table. also available in other formats, eg with a razor- for writing to a USB key – see the PROJECT WEBSITE sharp focus on desktop computing.” www.haiku-os.org bottom of http://download.

How it works: The Haiku desktop

1 Boot 2 Run programs 3 Install Boot the hard drive image in VirtualBox (or the When you start each program, it will be added You can perform a native hard drive alternative image from a USB key on a real PC) and underneath the leaf button and system tray in the installation under Applications > Installer. Note that you’ll arrive at the desktop. Click on the leaf icon to top-right. This is like a taskbar – click on buttons to this is still alpha software, so back up important data explore software. close apps (or use the buttons in their titlebars). and don’t install it on a production machine!

www.linuxvoice.com 69 FOSSPICKS

Video downloader youtube-dl 2014.08.29

ouTube might go down in home directory like so: history as the biggest ./youtube-dl “” Ytime-waster ever created. Replace here with the full Sure, there are some genuinely address of the YouTube video, as useful videos on there, but in all displayed in your browser. As you honesty we spend 99% of our time can see in the screenshot, youtube- there watching cat videos and dl grabs the page and parses it for people playing games that we used the video content, before to play (but can’t be bothered downloading the media. In many loading up now). It’s possible to cases this will be a Flash (.flv) file download videos from YouTube, – but some videos are provided in Store videos locally but some of the browser extensions MP4 format. A decent media player and password, and even download (and avoid dodgy that do this are rather dodgy, like MPlayer or VLC should be able browser plugins) with adverts, if you feel guilty about not possibly sending your browsing to handle both formats. this handy script. giving enough money to Google. history to unknown third parties. But youtube-dl can do a lot more: The program also works with We Linux users have a better it can extract the audio from a video video sites such as Vimeo, Vine and solution in the form of youtube-dl. and convert it into a different LiveLeak, and because these sites This is a (large!) single Python script format (providing you have the right often change their underlying HTML that takes a URL and spits out a tools installed), which is great if (causing youtube-dl to break), you video file. It’s remarkably easy to you’ve found a music video and can always upgrade to the latest install; just grab the file from the want to keep the song on your version in-place with the -U flag. Downloads section of the website, MP3/Ogg player. You can ask it to it executable (eg chmod +x embed subtitles into video files, log PROJECT WEBSITE http://rg3.github.io/youtube-dl youtube-dl”) and run it from your in to YouTube using a username

Lightweight static content web Filed 1.8

icture the scene: you’ve editor and change the MIMETYPES resurrected an old PC to see line to point to /etc/mime.types Pwhat it’s still capable of. You instead of the default location. Run want to share some files over your make again, followed by sudo make home network from it via HTTP, so install, and you’re ready to go. you install Apache and… it crawls. By default, Filed should be run as You try another web server from the root user, and it serves up your the repositories, but it’s equally root (/) directory. Obviously this isn’t sluggish on such limited hardware. very useful, and potentially You try yet another, and this time dangerous; to change the user (via you end up getting bamboozled by chroot) and directory that’s served its configuration files. up, run it like so: Filed’s all-caps log format (background terminal) is a bit painful on In these cases, you want the filed --user nobody --root /var/www the eyes, but at least there’s plenty of info. simplest, fastest, no-nonsensest Filed doesn’t generate directory HTTP server possible, and Filed is listings and instead attempts to serving a single concurrent client. just that. It’s a single 64k binary, with serve up index. by default. To Various extra options are available no configuration file – everything is boost performance, Filed is to bind to a different address or set at the command line. multithreaded with every operate on another port, and To build it, you’ll need Tcl installed, instead of logging to the terminal and when you run make you might you can redirect the output to a file. see an error message about a “Filed is the simplest, fastest missing mime.types file. In this PROJECT WEBSITE HTTP server possible.” http://filed.rkeene.org/fossil/index case, open the Makefile in a text

70 www.linuxvoice.com FOSSPICKS

Book writing assistant Plume Creator 0.67

hey say that everyone has a (eg a short novel), and you can in them, but have you choose how many chapters and Tever tried writing one? It’s all scenes it should contain here – but fun and games at the start, when don’t worry if you’re not sure, as you you’re concocting plots, scenes and can modify them later. From here characters, but as the story onwards, Plume works a lot like a progresses, managing everything regular editor, except it helps you to can become a nightmare. You can manage different scenes and try to structure things in a word chapters. A tree list down the processor, but a better solution is to left-hand side lets you quickly use a dedicated novel writing tool switch between different parts of Plume’s interface could like Plume Creator. the book, while additional tools are what items he/she had, to avoid do with some Plume’s website is pretty rubbish, available such as a note-taking refinement, but after 10 continuity errors. Once you’re happy with little documentation on using panel and a timer. minutes of exploring with your work, you can export it in the program. But it does show you The mise-en-scène panel is you’ll get the hang of it. a variety of formats, including ODT how to install it: 32-bit and 64-bit especially useful, letting you keep (as used by LibreOffice), HTML and packages for Ubuntu and Mageia track of characters, items and plain text. There are still plenty of are available, along with the source places. You can note here where a unfinished bits in Plume, but by code. You’ll need version 4 of the character was at a certain time, and version 1.0 it should be a great app libraries to install it, as the interface for aspiring writers. is built with that toolkit. Start Plume and you’ll be “Plume helps you manage different PROJECT WEBSITE prompted to create a new project. http://www.plume-creator.eu/site/ scenes and chapters of your book.” index.php/en You’re asked for the type of book

Convert ANSI codes to readable text Ansifilter 1.9 ere’s something interesting Now, say you have an important to try: in a terminal window, file containing these codes, eg from Hin a directory with various a log, and you want to make the files and folders, enter ls --color > information human-readable. list.txt. This redirects the output of Ansifilter is a godsend here: it the ls command (with all its colour converts the file into a better goodness) to the file list.txt. Now format, such as plain text, HTML, open that file in a , or view Latex, RTF or even BBCode (very it with less list.txt. Notice useful if you want to paste the something strange? The colours output of a command into a forum aren’t there – just some weird post). It’s supplied as two ANSI codes in their raw characters like: programs, the first of which runs at change the text encoding, along format, and how ESC[01;34mfolderESC[0m the command line, and the second Ansifilter interprets with the line wrap settings and font Ugh. What’s happening here? of which uses Qt to produce a them. that should be used. Well, colours and effects (like bold simple but pleasant little GUI app. Ansifilter isn’t a tool you’ll use on a text) are created in the terminal via To convert file.log into a HTML daily basis, but it can save your life ANSI codes, which involve the version called file.html, you’d run: if you have a log file peppered with escape character and . ansifilter -T file.log > file.html control codes and you desperately Any good terminal can interpret Alternatively, run ansifilter-gui need to get information out of it. these in command output and file.log to get a of the display them properly, but when you output, then click Save As to PROJECT WEBSITE redirect the output to a file, it just choose one of the formats www.andre-simon.de/doku/ansifilter/ en/ansifilter.php becomes plain text. mentioned previously. You can even

www.linuxvoice.com 71 FOSSPICKS

Spreadsheet app mtCellEdit 2.4

he flagship spreadsheet Start the program and you’ll see program for Linux and other that mtCellEdit’s interface is as bare TFOSSy systems is as they come: you have a grid for LibreOffice Calc. We already have a entering data, a drop-down list to lighter alternative in the form of switch between different sheets, , which is darn good by the and a handy list in the top-right way – but mtCellEdit is even showing values for selected cells smaller. It’s a very basic (eg sum, maximum, average). spreadsheet program, lacking many mtCellEdit refers to individual cells of the features and frills you’ll find in by their row and column numbers, the bigger tools, but for basic so if you want to display the sum of There are plenty of calculation jobs it’s great. columns 1 and 2 in row 1, you’ll use we found this cumbersome, options to tweak, but What’s not so great, though, is this command: they’re not presented in requiring copying and pasting the compilation . When you =r1c1+r1c2 the most human- chunks of data into a text file, and extract the tarball you’re faced with That’s rather different to the A1, friendly fashion. having to do a lot of manual fiddling a bunch of directories containing B2 etc system used by other to get it right. mtCellEdit can open different parts of the program , and takes a while to and save CSV and TSV (comma – and a README.txt that doesn’t get used to. It’s possible to generate and tab separated value) files, provide much info. It does, however, bar charts in the program, although though, so it’s easy to share data point you at the project’s HTML with other apps. documentation, which explains the order in which you need to compile “For basic calculation jobs, the components. The GTK 2 toolkit PROJECT WEBSITE mtCellEdit is great.” http://code.google.com/p/mtcelledit/ is the main dependency.

Scripting language PHP 5.6.0

HP gets a lot of flak from now do this: many developers; they const ONE = 1; Pregard it as a toy language const TWO = ONE * 2; that has become ugly and bloated You can use them in other places over the years, lacking logical like default function arguments too design and consistency. Even – the idea is to make code easier to Rasmus Lerdorf, the creator of PHP, read and more expressive. Then said that he had “absolutely no idea there’s better handling of variable how to write a programming length argument lists for functions, language” at the beginning. On the so instead of messing around with As usual, PHP’s new other hand, it’s useful for cooking func_num_args() and the like, you Many other improvements and features are well up quick websites on a LAMP stack, can start a function like so: documented, with tweaks have been made around the and many well-known web apps function sum(...$numbers) { examples showing how codebase too: the phpdbg such as WordPress are built with it. Thanks to the … token, this you can incorporate debugger has been integrated into Anyway: PHP 5.6.0 was released places all the arguments into an them into your own the core function and constant at the end of August, and it brings a array called $numbers, over which code. importing is now possible with the bunch of improvements, many of you can iterate using foreach. use keyword; and file uploads of which have been in discussion for a Exponation using the ** operator larger than 2GB are now supported. while. High up on the list is support is now supported in PHP 5.6.0, This release might not win over all for constant scalar expressions, which means you can do this: the naysayers, but it’s a solid job. where you can use expressions in $c = $a ** $b; which PHP previously expected Where $c contains the result of PROJECT WEBSITE www.php.net static values. For instance, you can raising $a to the $b’th power.

72 www.linuxvoice.com FOSSPICKS https://launchpad.net/pybik/FOSSPICKS Brain Relaxers

Space trading/combat game Oolite 1.80

e at Linux Voice HQ all ./oolite-1.80.linux-x86_64.run have misspent youths We asked for the game to be Wthanks to David installed in our home directory, and Braben and Ian Bell. While other a menu icon was created under kids were being cool, playing Games. (The installer also tells you sports and chasing girls, we were how to run it manually.) perfecting docking sequences There are three main modes to and selling robots on the black Oolite: Normal is the full game, market in Sol. Yes, we loved Elite taking the core gameplay of Elite (and its sequel Frontier), and as and adding lots of extra goodies. Elite: Dangerous is getting There’s a tutorial mode for new tantalisingly close to release, players, along with a Strict mode, The HUD is almost identical to Elite’s, but the planets and we’ve been playing some open which aims to ape the original as spacecraft look a jillion times better. source Elite-ish games too. closely as possible. Oolite is the arguably the best, Version 1.80 brings about more your way. It’s also now easier to and recently received a major variety in the galaxy maps, and install expansion packs – a darn update, bringing it to version 1.80. more combinations of non-player good thing, given that there are You can grab it in 32-bit or 64-bit characters, such as packs of over 500 of them… versions from the game’s website pirates working together. You, as – we did the latter, and installed it the player, now have a reputation, PROJECT WEBSITE like so: so if you’re a skilled bounty hunter www.oolite.org tar xfv oolite-1.80.linux-x86_64.tgz then many pirates will stay out of

Board/puzzle game Pentobi 8.1 ooking at the screenshot, replace CPU players with real-life you might be tempted to human ones.) Lthink that Pentobi is yet The rules are like so: each colour another Tetris rip-off, and fair takes it in turns to place a piece on enough - the formula has been the board, starting with the blue done to death. But although player. On the right-hand side is a Pentobi uses similar shaped palette of pieces from which you pieces, it’s a very different game. can choose – ranging from For starters, it’s based on a board single-block pieces to five-block game called Blokus that was ones – and you can only use each invented in 2000, and it’s great piece once. You place your first It’s early days, but blue fun in multi-player mode. piece in your designated starting many of your pieces as possible. is getting trapped here, Pentobi’s main dependency is corner, and subsequent pieces have thanks to sneaky CPU The game ends when nobody Qt; usefully, it can be built with to touch the same colour on the opponents… can place anything else, and a version 4.x or 5.x of the toolkit. corners, but not directly on the score is totalled based on how When you start the game, you’re edges. So you end up building a many pieces you didn’t place. It’s presented with a blank board, and construction out of your corner. challenging, addictive, and gets by default it’s you vs three However – as the other players the brain ticking over... CPU-controlled opponents. (Click build their constructions, there’s on the Colours button less and less space on the board. PROJECT WEBSITE http://pentobi.sourceforge.net at the top of the window to You have to plan ahead to place as

www.linuxvoice.com 73