Skip to main content

Linux News

Text Processing in Rust

Linux Journal - Mon, 03/18/2019 - 08:07
by Mihalis Tsoukalos

Create handy command-line utilities in Rust.

This article is about text processing in Rust, but it also contains a quick introduction to pattern matching, which can be very handy when working with text.

Strings are a huge subject in Rust, which can be easily realized by the fact that Rust has two data types for representing strings as well as support for macros for formatting strings. However, all of this also proves how powerful Rust is in string and text processing.

Apart from covering some theoretical topics, this article shows how to develop some handy yet easy-to-implement command-line utilities that let you work with plain-text files. If you have the time, it'd be great to experiment with the Rust code presented here, and maybe develop your own utilities.

Rust and Text

Rust supports two data types for working with strings: String and str. The String type is for working with mutable strings that belong to you, and it has length and a capacity property. On the other hand, the str type is for working with immutable strings that you want to pass around. You most likely will see an str variable be used as &str. Put simply, an str variable is accessed as a reference to some UTF-8 data. An str variable is usually called a "string slice" or, even simpler, a "slice". Due to its nature, you can't add and remove any data from an existing str variable. Moreover, if you try to call the capacity() function on an &str variable, you'll get an error message similar to the following:

error[E0599]: no method named `capacity` found for type ↪`&str` in the current scope

Generally speaking, you'll want to use an str when you want to pass a string as a function parameter or when you want to have a read-only version of a string, and then use a String variable when you want to have a mutable string that you want to own.

The good thing is that a function that accepts &str parameters can also accept String parameters. (You'll see such an example in the basicOps.rs program presented later in this article.) Additionally, Rust supports the char type, which is for representing single Unicode characters, as well as string literals, which are strings that begin and end with double quotes.

Finally, Rust supports what is called a byte string. You can define a new byte string as follows:

Go to Full Article
Categories: Linux News

Weekend Reading: Tor and Tails

Linux Journal - Sat, 03/16/2019 - 09:04
by Carlie Fairchild

Tails is a live media Linux distro designed to boot into a highly secure desktop environment. Tor is a browser that prevents somebody watching your internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location.

Learn why anonymity matters and how you can protect yourself with this Linux Journal Weekend Reading.

Tor Hidden Services 

Why should clients get all the privacy? Give your servers some privacy too!

Tails above the Rest: the Installation

How to get and validate the Tails distribution and install it. We will follow up with what Tails can and can't do to protect your privacy, and how to use Tails in a way that minimizes your risk. Then we will finish with some more advanced features of Tails, including the use of a persistent volume (with this feature, depending on your needs, you could conceivably use Tails as your main Linux distribution).

Tails above the Rest, Part II

Now that you have Tails installed, let's start using it. Read on to find out how to get started.

Tails above the Rest, Part III

In the first two parts on this series, we gave an overview of Tails, including how to get the distribution securely, and once you have it, how to use some of the basic tools. Here, we cover some of the more advanced features of Tails, such as some of its log-in options, its suite of encryption tools and the persistent disk.

Tor Security for Android and Desktop Linux 

The Tor Project presents an effective countermeasure against hostile and disingenuous carriers and ISPs that, on a properly rooted and capable Android device or Linux system, can force all network traffic through Tor encrypted entry points (guard nodes) with custom rules for iptables. This action renders all device network activity opaque to the upstream carrier—barring exceptional intervention, all efforts to track a user are afterwards futile.

A Bundle of Tor

The best way to set up Tor on your personal machine.

Dolphins in the NSA Dragnet

Go to Full Article
Categories: Linux News

The JS Foundation and Node.js Foundation Have Merged to Form the Open JS Foundation, GNOME 3.32 Now Available, Qt 5.12.2 Patch Release, Kernel Update for Ubuntu 14.04, Debian GNU/Linux Project Leader Nominations

Linux Journal - Fri, 03/15/2019 - 09:01

News briefs for March 15, 2019.

The JS Foundation and the Node.js Foundation are merging to form the OpenJS Foundation. ZDNet reports that the Linux Foundation made the announcement this week at the Open Source Leadership Summit in Half Moon Bay, CA. The OpenJS Foundation's mission " is to support the growth of JavaScript and related web technologies by providing a neutral organization to host and sustain projects, and fund development activities. It's made up of 31 open-source JavaScript projects including Appium, Dojo, jQuery, Node.js, and webpack."

GNOME 3.32 Taipei was released this week. This version represents 6 months of work by the GNOME Community and includes many improvements and new features. The visual style has been refreshed with an brand-new set of app icons. It also "introduces an experimental feature for Wayland desktop sessions that enables fractional scaling". And, data structure improvements in the GNOME desktop have caused a " faster, snappier feel to the animations, icons and top 'shell' panel". See the release notes for more details on all the changes and enhancements.

Qt 5.12.2 was released today. This is the second patch release of Qt 5.12 LTS and contains more than 250 bug fixes. See the Change Files for the full list of changes.

Canonical yesterday released a new Linux kernel update for Ubuntu 14.04 LTS (Trusty Tahr) to fix a recently discovered vulnerability. According to Softpedia News, the security issue affects Linux kernel 3.13 and is "race condition (CVE-2019-6133) discovered by Jann Horn of Google Project Zero in Linux kernel's fork() system call, which could allow a local attacker to gain access to services storing cache authorizations and run programs with administrative privileges." Users should update immediately.

The Debian GNU/Linux project has extended the date for nomations for the leader post. One nomination has come in so far, Joerg Jaspert, part of the Debian Account Managers team. ITWire reports that nominations were initially slated to close March 16.

News The Linux Foundation JavaScript OpenJS Foundation GNOME qt Canonical Ubuntu Debian
Categories: Linux News

Chasing Linux Kernel Archives

Linux Journal - Fri, 03/15/2019 - 07:00
by Zack Brown

Kernel development is truly impossible to keep track of. The main mailing list alone is vast beyond belief. Then there are all the side lists and IRC channels, not to mention all the corporate mailing lists dedicated to kernel development that never see the light of day. In some ways, kernel development has become fundamentally mysterious.

Once in a while, some lunatic decides to try to reach back into the past and study as much of the corpus of kernel discussion as he or she can find. One such person is Joey Pabalinas, who recently wanted to gather everything together in Maildir format, so he could do searches, calculate statistics, generate pseudo-hacker AI bots and whatnot.

He couldn't find any existing giant corpus, so he tried to create his own by piecing together mail archived on various sites. It turned out to be more than a million separate files, which was too much to host on either GitHub or GitLab. He asked the linux kernel mailing list for suggestions on better hosting opportunities. Although he acknowledged, "It's possible I'm the only weirdo who finds this kind of thing useful, but I figured I should share it just in case I'm not."

Joe Perches suggested plumbing the archives at kernel.org/lore.html, which go back decades. But Joey said he'd tried that, and he found it all but impossible to convert those archives to the Mailbox format he wanted. Instead, he'd spent the previous several weeks scraping the lkml.org archive and scripting his own conversion routines.

Konstantin Ryabitsev remarked:

The maildir format is kind of terrible for LKML, because having millions of messages in a single directory is very hard on the underlying FS. If you break it up into multiple folders, then it becomes difficult to search. This is the main reason why we have chosen to go with the public-inbox format, which solves both of these problems and allows for a very efficient archive updating and replication using git.

Meanwhile, Jasper Spaans raised his eyebrows at Joey's statement that he'd gotten more than a million separate files by scraping lkml.org. Jasper said:

First of all, there are more than 3M messages stored in the lkml.org database, so I guess you've missed some messages or something is really broken. Besides, unless you figured out how to get to the raw data, you've just scraped a rendering which discards stuff like pgp signatures etc and has very incomplete headers. Unless you don't care for those of course.

Go to Full Article
Categories: Linux News

Tetrate Launched, Google Chrome 73 Released, Godot 3.1 Is Now Available, Enroll to Try Android Q Beta, and Pi Day Live Stream Event and Contest

Linux Journal - Thu, 03/14/2019 - 08:39

News briefs for March 14, 2019.

Tetrate, a new enterprise-grade service mesh from the creators of gRPC and Istio, launched yesterday. Varun Talwar, CEO of Tetrate and formerly co-creator of Istio at Google, says "Tetrate's mission is to create a secure and flexible application networking layer to help enterprises transition from their decades-old rigid networking stack. Our tools and technologies will help customers with availability and manageability of their applications as they undergo this transformation." In addition, "Tetrate is launching with $12.5 million in funding from Dell Technologies Capital, as well as from participating investors 8VC, Intel Capital, Rain Capital, and Samsung NEXT." It also plans to use the funding to "extend its open-source leadership and further contribute to the open-source community". See this ITOps Times article for more information.

Google Chrome 73 was released this week for Linux, Mac and Windows. Chrome 73.0.3683.75 includes 60 security fixes and many other improvements. You can see the full list of changes in the log.

Godot 3.1 was released yesterday. This new version of the open-source game engine includes the OpenGL ES 2.0 renderer, optional typing in GDScript, a revamped inspector, revamped 2D editor and much more. You can download it from here and view the release trailer here.

Android Q Beta was released yesterday. From the Android Developers Blog: "Building on top of efforts like Google Play Protect and runtime permissions, Android Q brings a number of additional privacy and security features for users, as well as enhancements for foldables, new APIs for connectivity, new media codecs and camera capabilities, NNAPI extensions, Vulkan 1.1 support, faster app startup, and more." Enroll here to get Android Q Beta updates over the air on any Pixel device.

In honor of Pi Day, the folks at RaspberryPi.org are holding a Raspberry Pi 3B+ live stream event on YouTube featuring "hours upon hours of our favourite Pi in all its glorious wonderment". And there's more: at some point today, they’re "going to add a unique hashtag to this live stream, and anyone who uses said hashtag on Instagram and/or Twitter* before midnight tonight (GMT) will be entered into a draw to win a Raspberry Pi Model 3B+ and an official case signed by Eben Upton himself."

News Tetrate Networking Chrome Godot Android Mobile Raspberry Pi
Categories: Linux News

Antennas in Linux

Linux Journal - Thu, 03/14/2019 - 07:00
by Joey Bernard

For this article, I want to introduce a piece of software I've actually used recently in my own work. My new day job involves studying the ionosphere using an instrument called an ionosonde. This device is basically a giant radio transmitter that bounces radio waves off the ionosphere to see its structure and composition. Obviously, an important part of this is knowing the radiation pattern of the various transmitters and receivers.

Several methods exist for modeling the electromagnetic fields around conductors, but here I'm covering one called NEC2 (Numerical Electromagnetics Code). It originally was developed in FORTRAN at the Lawrence Livermore National Laboratory in the 1970s. Since then, it's been re-implemented several times in various languages. Specifically, let's look at xnec2c. This package implements NEC2 in C, and it also provides a GTK front end for interacting with the core engine.

xnec2c should be available in most Linux distributions. In Debian-based distributions, you can install it with the command:

sudo apt-get install xnec2c

Once it's installed, you can start it with xnec2c. The default display doesn't show anything until you actually start using it.

Figure 1. Launching xnec2c gives you a pretty boring starting point.

xnec2c's history still affects how it behaves to the present day. This is most clear when you look at the input file's format. The basic structure is based on the idea of a punch card, where each "command" to xnec2c is given by a command card—a definite holdover from its FORTRAN roots. Luckily, the GTK front end to xnec2c provides a reasonably functional way of building up these input files.

Several example files should be available with your installation of xnec2c. In my Ubuntu distribution, they're located in /usr/share/doc/xnec2c/examples. These input files have a filename ending of ".nec". Select one as a starting off point to play with xnec2c, and then go ahead and make the required alterations necessary for your own project.

Figure 2. Loading an input file, you begin with a geometric view of the relevant antenna wires, other conductors and any ground planes.

The central window pane provides a geometric view of the actual antenna structure in three dimensions. You can click and drag the diagram to rotate the view and see it from all angles. There are two larger buttons at the top of the window, named Currents and Charges. Selecting them alternately will show either the distribution of currents or the distribution of charges caused by the driving current.

Go to Full Article
Categories: Linux News

Sortie de SFLphone 0.9.7

Savoir-faire Linux - Fri, 12/11/2009 - 13:47
<img src="uploads/RTEmagicC_logo_phone_02.gif.gif" style="width: 200px; height: 59px; float: right;" alt="" /> C'est une étape importante que vient de franchir le projet SFLPhone avec la sortie cette semaine de la version 0.9.7. En plus des traditionnels bugfixes, cette version introduit de nouvelles fonctionnalités très attendues par les professionnels de la téléphonie IP, comme le support des conférences, plusieurs codecs haute définition, et le support des principaux protocoles de chiffrement des communications (TLS, SRTP/ZRTP). Publié sous licence GPLv3, le projet SFLphone, développé par...
Categories: Linux News

Séminaire gratuit : La solution Business Intelligence Open Source SpagoBI, le 6 novembre à Montréal

Savoir-faire Linux - Mon, 09/28/2009 - 10:45
<p><a href="http://www.spagobi.com" target="top"><img src="/fileadmin/user_upload/partenaires/SpagoBI.png" align="right"></a>SpagoBI et Savoir-faire Linux ont le plaisir de vous inviter à un séminaire de présentation consacré aux solutions de business Intelligence SpagoBI le vendredi 6 novembre à Montréal de 9h00 à 12h00.</p><p>Fin 2008, une étude Gartner identifiait SpagoBI comme l'une des technologies les plus prometteuses en matières d'informatique décisionnelle. La sortie de SpagoBI 2.2 en 2009 validait cette analyse et confirmait la place de chef de file incontesté des solutions de...
Categories: Linux News

Séminaire gratuit : Les Infrastructures à Clés Publiques (PKI) Open Source, le 4 novembre 2009 à Montréal

Savoir-faire Linux - Thu, 09/24/2009 - 09:01
<a href="http://www.ejbca.org"><img src="fileadmin/user_upload/partenaires/ejbca.png" height="60" width="157" align="right" alt="" /></a>PrimeKey Solutions et Savoir-faire Linux ont le plaisir de vous inviter à un séminaire de présentation de l'infrastructure à clés publiques Open Source EJBCA le mercredi 4 novembre à Montréal de 9h00 à 12h00. Après la Société Générale, le GIE Cartes Bancaires, la Police de Suède (30 000 utilisateurs), Daimler AG, Liechtensteinische Landesbank AG, Bankgirocentralen BGC AB, LM Ericsson AB, l'infrastructure à clés publiques EJBCA a été selectionnée par la...
Categories: Linux News

Framakey Ubuntu Remix, un tour de force !

Zone libre en éducation - Mon, 06/29/2009 - 16:27
La Framakey Ubuntu Remix offre le mode nomade sous trois OS : Windows, Mac et Linux.
Categories: Linux News

Accès libre aux documents et aux logiciels de l'État de New York

Zone libre en éducation - Mon, 06/29/2009 - 15:51
Le Sénat de l'État de New York libéralise l'accès à ses documents et aux logiciels qu'il produit.
Categories: Linux News

Edulibre est porté sur les fonts baptismaux

Zone libre en éducation - Thu, 06/25/2009 - 14:31
Une forge pédagogique vient d'ouvrir sur le Web. Souhaitons-lui longue vie.
Categories: Linux News

Accord entre l'UNESCO et Sun Microsystem en faveur du libre en éducation

Zone libre en éducation - Fri, 06/05/2009 - 13:30
Au Sommet mondial sur la société de l'information, l'UNESCO et Sun ont décidé d'unir leurs efforts pour renforcer l'éducation et le développement communautaire par le biais des technologies open source.
Categories: Linux News

Supprimer un bruit de fond avec Audacity

Zone libre en éducation - Mon, 06/01/2009 - 08:51
Apprenez à supprimer les bruits de fonds de vos fichiers sonores à l'aide d'Audacity
Categories: Linux News

KeepNote, pour organiser vos idées et vos notes

Zone libre en éducation - Fri, 05/22/2009 - 14:41
Un logiciel pour organiser vos notes de toutes sortes (texte, URL, multimédia, etc)
Categories: Linux News

Droit d'auteur 101 pour le Web

Zone libre en éducation - Wed, 05/20/2009 - 13:09
Ce que vous voulez savoir sur le droit d'auteur en rapport avec le Web.
Categories: Linux News

Le Libre Graphics Meeting 2009 : les conférences en ligne

Zone libre en éducation - Fri, 05/15/2009 - 13:37
Vous n'avez pu vous rendre au Libre Graphics Meeting, assistez aux conférences en ligne.
Categories: Linux News

Ce qu'OpenOffice.org offre de plus que la concurrence

Zone libre en éducation - Tue, 05/12/2009 - 10:48
Raymond Ouellette compare OpenOffice.org avec MS-Office. Verdict ? Il préfère OpenOffice.org
Categories: Linux News

Libérez la puissance d'OpenOffice.org

Zone libre en éducation - Fri, 05/08/2009 - 12:27
Raymond Ouellette nous montre comment exploiter toute la puissance d'OpenOffice.org
Categories: Linux News

Convertir des fichiers audio avec VLC

Zone libre en éducation - Tue, 05/05/2009 - 12:45
Apprenez à utiliser VLC pour convertir les formats de vos fichiers audio.
Categories: Linux News
Syndicate content