Home Blog Page 290

Linux timeout Command Explained for Beginners (with Examples)

Sometimes, when you execute a command in Linux, you might want to run it for a set amount of time. There exists a command line utility – timeout – that’s specifically developed for this purpose. In this article, we will discuss the basics of this command using some easy to understand examples.

But before we do that, it’s worth mentioning that all examples in this tutorial have been tested on an Ubuntu 18.04 LTS machine.

Linux timeout command

As the name suggests, the timeout command in Linux allows you to execute a command with a time limit. Following is its syntax:

timeout [OPTION] DURATION COMMAND [ARG]...

And here’s how the tool’s man page explains it:

timeout - run a command with a time limit
Start COMMAND, and kill it if still running after DURATION

Following are some Q&A styled examples that should give you a better idea on how this tool works.

Read more at HowToForge

MIPS Joins RISC-V as Second Open Source Alternative to Arm

The open source silicon space has suddenly become more crowded. Shortly before Christmas, Silicon Valley AI startup Wave Computing, which is developing hardware for running deep learning applications in data centers and offices, announced plans to open source its MIPS instruction set architecture, or ISA, under what it’s calling the “MIPS Open” program. When the process is completed in the first quarter, participants will have full access, with no licensing fees or royalties, to the most recent versions of the 32-bit and 64-bit MIPS ISA, along with licensing for MIPS’s “hundreds of existing worldwide patents.”

According to Wave, open sourcing the design will open the door for semiconductor companies, developers, and universities to adopt and innovate using MIPS for next-generation system-on-chip (SoC) designs.

Read more at Data Center Knowledge

Troubleshooting Hardware Problems in Linux

It can take some time to troubleshoot and solve hardware-related issues on Linux. Even highly experienced sysadmins sometimes spend hours working to solve mysterious hardware and software discrepancies.

The following tips should make it quicker and easier to troubleshoot hardware in Linux. Many different things can cause problems with Linux hardware; before you start trying to diagnose them, it’s smart to learn about the most common issues and where you’re most likely to find them.

Quick-diagnosing devices, modules, and drivers

The first step in troubleshooting usually is to display a list of the hardware installed on your Linux server. You can obtain detailed information on the hardware using ls commands such as lspcilsblklscpu, and lsscsi.

Read more at OpenSource.com

Firejail – Securely Run Untrusted Applications in Linux

Sometimes you may want to use applications that have not been well tested in different environments, yet you must use them. In such cases, it is normal to be concerned about the security of your system. One thing that can be done in Linux is to use applications in a sandbox. “Sandboxing” is the ability to run application in a limited environment. That way the application is provided a tighten amount of resources, needed to run.

Thanks to an application called Firejail, you can safely run untrusted applications in Linux.

Firejail is a SUID (Set Owner User ID) application that decrease the exposure of security breaches by limiting the running environment of untrusted programs using Linux namespaces and seccomp-bpf.

It makes a process and all its descendants to have their own secret view of the globally shared kernel resources, such as the network stack, process table, mount table.

Read more at Tecmint

The Linux Foundation in 2019: Can’t-Miss Educational Programs, Events, and Training Opportunities Offer Something for Everyone

TL; DR: The Linux Foundation helps open-source communities accelerate technological development through a support system where they can share, learn, and collaborate. The nonprofit works to train the next generation of open-source developers while uniting their interests with those of corporate executives. With a comprehensive slate of events and a forward-thinking focus on the 5G revolution and emerging tech regions, the Linux Foundation is prepared to support open-source communities into 2019 and beyond. 

There’s a pervasive myth surrounding open-source software, and squashing it will unlock incredible opportunity, said Clyde Seepersad, General Manager, Training & Certification at the Linux Foundation.

“We have to let go of this strange, almost macho, idea that you’re a weakling in open-source if you have to be trained on it — that you’re supposed to figure it out yourself,” he said. “Open-source software is just like any other software: You learn it best if you’re actually taught it. If we expect our employees to magically figure it out on nights and weekends, we’re fooling ourselves.”

Clyde said Linux Foundation is maniacally focused on hands-on skills development. “We focus hard on activities and labs, and our courses don’t feature a lot of videos,” he said. “I get flack for that sometimes, but we’re here to teach you how to use software, not entertain you. It’s about rolling up your sleeves because the only way to learn is to do.”

Read more at HostingAdvice

10 React Native Libraries Every React Native Developer Should Know About

If you are starting out a new app development project, chances are pretty high that you have already decided writing it with React Native. React Native gives you benefit of leveraging a single codebase to produce two different kind of apps.

In order to make React Native app development simpler for you and spare you the time you would spend composing certain parts for your application, you can take the assistance of some magnificent React Native libraries that do the hard work for you, making it simple to integrate the basis or some newest features in your app.

However, choosing the best React Native library for your project can be of much hassle for you since there are thousands of libraries out there. Henceforth, here I am mentioning 10 best React Native libraries that you may find useful while developing an app with React Native.

1) Create-react-native-app

Establishing the Initial setup for your React Native app can be much of time consuming especially if you are just starting out to develop your first app. Create-react-native-app is a library that comes handy if you want to develop a React Native app without any build configuration. Create React Native App enables you to work with a majority of Components and APIs in React Native, and in addition the greater part of the JavaScript APIs that the Expo App gives.

2) React-native-config

If you are a developer than you might already be familiar about an XML file which basically represents your app’s configuration file. The file stores any setting that you might want to change between deploys such as staging, environment variables, production or others. By default, some apps store this config as constants in the code which is a serious violation of 12 factors. Henceforth, it is very important to separate the config from the code. It is important to note that your app’s config may vary substantially across various deploys.

React-native-config is a cool library which makes it easier for you to stick and adhere to the 12 factor code while effectively managing your app config settings.

3) React-native-permissions

React-native-permissions allows you to implement check and request users permission anywhere in a React Native app. Currently, it offers you an easy access to the following permissions:

  • Location
  • Camera
  • Microphone
  • Photos
  • Contacts
  • Events
  • Reminders (iOS only)
  • Bluetooth (iOS only)
  • Push Notifications (iOS only)
  • Background Refresh (iOS only)
  • Speech Recognition (iOS only)
  • Call Phone (Android Only)
  • Read/Receive SMS (Android only)

4) React Navigation

Widely known as one of the most widely used navigational library in the React Native ecosystem, React Navigation is an enhanced version of Navigator, NavigatiorExperimental and Ex-Navigation.

It’s written completely in JavaScript which has a gigantic upside in its own sense since you can transport updates to it OTA and you can submit patches without having to know Objective C/Java and the stage’s individual route APIs.

5) React-native-Animatable

Looking for a kickass library for implementing Animations in React Native? React Native Animatable is here to help you with just that.

React-native-animatable can be used in two ways to add Animations and transitions in a React Native app development: Declarative and Imperative.

When it comes to Declarative usage then its as simple as it sounds. Whatever name of pre-built animation will be declared in your code, animation will only be applied on the element for which it has been declared. Pretty straightforward! Right?

6) React Native Push Notifications

This library is very useful to implement push notifications in a React Native app. With some additional features such as schedule notification, repeat notification based on the day, week, time etc., the library stands out from all other libraries for push notifications in React Native.

7) React Native Material Kit

React Native Native Material Kit is a magnificent help for Material Design themed applications. The library gives you customizable yet ready made UI components such as buttons, cards, loading indicators, and floating label text fields etc.  Furthermore, there are numerous approaches to build every segment: pick either the constructor or JSX procedure to best fit the structure of your venture. This library is certain to spare a huge amount of time and styling exertion for any engineer with application plans established in Material rules.

8) React Native Code Push

Codepush let you deploy your React Native code over-the-air without much of hassle. Moreover, you will find codepush as a great deal for pushing bug fixes to your app without having to wait for your user to update their existing app’s version.

9) React-Native-Map

React Native Map is an awesome component which helps you to avoid necessary complications in case of apple and google maps. You will have a flexible and customizable map that can be zoomed or panned with markers by just using one simple <MapView> tag in your code. Moreover, the map which is rendered will feel smooth, native and high performant.

10) React Native Vector Icons

You might be well aware of the fact that how Icons contribute to improve user experience of an application. React Native Vector Icons may come last but it is definitely not the least in my list of Top 10 React Native libraries.  It boasts over a myriad number of well crafted icons which are contributed by renowned publishers. You can seamlessly integrate them to your app through the elegantly designed API provided by the library.

Conclusion

Aforementioned are some popular React Native libraries that deserves your utmost attention in React Native app development. 

Rakshit Soral is Technical consultant at Simform, a React Native app development company. he helps Fintech startups, agencies, and SMBs in adopting complete life-cycle management of apps from inception to design and development. Bitten by the Startup Bug, Rakshit is extremely passionate about authentic, innovation-based startup ideas including Growth hacking and Digital Marketing.

Linux Hacker Board Trends in 2018 and Beyond

When I read Brian Benchoff’s recent claim in Hackaday that the maker board market was stalling, I had a sense that there might be some truth to it. The novelty of community-backed, open-spec SBCs has worn off, and there were few new boards in 2018 that seem destined to become Raspberry Pi killers. Yet, the more I researched open-spec Linux/Android maker SBCs for LinuxGizmos’ New Year’s edition SBC catalog, the more I realized that the sector was very much alive — just a bit quieter than before.

There were 19 new SBC entries since our June roundup of 116 SBCs (compared to 13 new products that appeared in that reader survey catalog since the January 2018 New Year’s hacker catalog roundup of 103 boards). Despite the removal from market of several older products in Q2 2018 and the dissolution of The Next Thing and its Chip board — and even after we eliminated several older boards with fading communities, such as the 86Duino and PCDuino8 — we ended up with 122 boards, six more than in June.

Benchoff’s speculation that fewer maker boards were sold in 2018 may well be correct, but I have seen no proof of it. If there has been a slowdown, Benchoff nailed the reason: poor documentation. Other drawbacks to the hacker board scene include buggy software and less frequently, hardware. In many cases, the documentation and images are fine, but by the time they arrive, your shiny new SBC is already halfway to obsolescence.

Many of the casual, Raspberry Pi home automation hobbyists who experimented with faster, but not always reliable Banana, Orange, and NanoPi’s and other more obscure bargain-basement SBCs in recent years have returned to the fold. And why not return to the very capable Raspberry Pi 3 Model B+ — the SBC of the year and the winner of our June reader survey — or the smaller new RPi 3 Model A+? The RPi 3B+ is only a modest improvement over the 3B, but it is close enough to the competition in price, features, and performance to shift the comparison to software and support issues. If the Raspberry Pi Foundation had been faster to transition from ARM11 to Cortex-A SoCs, the hacker board market might be considerably smaller than it is today.

Despite the atypically buggy PoE board for the RPi 3B+, which was quickly resolved with a refund and a reboot, things tend to work more smoothly in Raspberry land. Most buyers are more interested in solid community support and no-doubt software and HAT compatibility than they are in having full schematics.

Yet, there’s a second trend that is leading us toward more diversity: The maker board movement continues to merge with the commercial SBC industry. There appears to be significant growth in small manufacturing customers using open-spec boards with a variety of special features ranging from AI to voice control to Time Sensitive Networking. These technically knowledgeable buyers need solid documentation and schematics for prototyping new products but are usually less interested in other community resources. More to the point, they are tired of the high prices charged by commercial vendors, which only make sense with huge volumes.

New maker SBCs and trends in late 2018

Many of the new boards we’ve seen since June are aimed at relatively niche applications rather than trying to beat the Pi at world domination. There are new router boards such as the Banana Pi BPI-R2, as well as an increasing number of extended temperature SBCs such as the Firefly-PX3-SE. We’ve seen industrial focused newcomers such as the HummingBoard CBi (CAN bus interface) and novel sandwich-style module/carrier board combos like the Khadas Edge. Seeed has introduced a ReSpeaker v2.0 model aimed at far-field voice control applications.

The trend toward Power-over-Ethernet (PoE) continues with products like the Renegade Elite. (The RPi 3B+ may now have a PoE option, but it’s hobbled by a Gigabit Ethernet port that is limited to 300Mbps.)

We’re seeing more SBCs with built-in cellular modems or mini-PCIe and M.2 slots capable of supporting them. FriendlyElec has jumped on this trend this year with 2G, 3G, and 4G themed NanoPi IOT models.

The still fledgling x86 hacker board arena continues to grow with the Intel Gemini Lake based Odroid-H2 board, which appears to be the most powerful hacker SBC in history. The Odroid-H2 is the first hacker board to feature an Atom processor from a recently released Atom/Celeron product family.

Another new Intel-based board — Aaeon’s Apollo Lake based Up Core Plus — is one of several new entries since June designed for machine learning and neural network processing. These AI contenders include the Allwinner V5 based Lindenis V5 and Bitmain Sophon BM1880, which uses a novel TPU-enhanced Arm SoC of Bitmain’s own design. Khadas is selling a version of the Khadas Edge with the AI-enhanced Rockchip RK3399Pro SoC.

Among more mainstream boards, we saw a continuing shift from Allwinner SoCs to the high-end, hexa-core Rockchip RK3399. In early 2018 we saw a lot of RK3399 entries in the $110 to $150 range, but newer models are more affordable.

The new Khadas Edge, Renegade Elite, and 96Boards form-factor Rock960 all start at about $100, and others have been cheaper. FriendlyElec introduced a $65 (2GB) and up NanoPi-M4 and followed up with a compact, $45 NanoPi Neo4. The Neo4 is an impressive feat despite the limitation of only 1GB of RAM, which isn’t enough for the RK3399. Also in this range is Pine64’s $60 (2GB) and up RockPro64, which shipped earlier this year.

No single Raspberry Pi killer emerged in 2018. Yet, the collective group of RK3399 vendors appear to be acting as a counterpoint in the Pi. The RK3399 is fast and offers x86 like technologies such as PCIe, SATA, and HDMI 2.0, and it has better Linux mainline support than the still-improving Allwinner SoCs.

2019 SBC trends

So what can we expect in 2019’s board market? The Raspberry Pi Foundation has already said that it is done with the Raspberry Pi 3 line and that it will upgrade from the current 40nm process for the next model. In March 2017, a year after the launch of the original Raspberry Pi 3, Raspberry Pi Trading CEO Eben Upton told ITPro that the RPi 3 successor would be at least three years away, pegging it at March 2019 at the earliest. It would not be surprising if the Raspberry Pi 4 didn’t arrive until late 2019, or even 2020. If there’s a major recession, we will likely see fewer SBC introductions. Otherwise, however, the growth in niche applications will probably block consolidation for the time being.

With TI’s new quad-core Cortex-A53 Sitara AM65x, it might be time for a BeagleBone reboot, and we should see more NXP i.MX8M boards such as TechNexion’s new sandwich-style PICO-PI-IMX8M spin on the Wand-Pi-8M. In the x86 world, meanwhile, a community-backed SBC based on the AMD Ryzen Embedded V1000 chip may arrive, although it may not clear our $200 limit.

So far, no RISC-V based SBCs have slid under our $200 limit, but one is likely to arrive in 2019. We could even see a low-cost Google Fuchsia hacker board. Meanwhile, you can check out the new Linux supported C-SKY ISA for as little as $6 with the new C-SKY board.

Overall, we’ll see a growing focus on 5G and edge analytics. In 2019 we are likely to see at least one 5G-ready board, and many more high-end edge IoT boards with NPUs, VPUs, and smartened up GPUs. So get ready to start talking TOPS and deep learning frameworks.

Sounds like fun. Let’s go.

Linux Technology for the New Year: eBPF

eBPF is “Linux’s newest superpower,” said SAP Labs’ developer Gaurav Gupta, during a talk that he gave about using the technology for low-overhead tracing at KubeCon in Copenhagen earlier this year.

A virtual machine for the Linux kernel, eBPF could set the stage for advanced, low-overhead tracing inside the kernel itself, offering insight into I/O and file system latency, CPU usage by process, stack tracing and other metrics useful for debugging. It could also play a role in system security, potentially offering a way to thwart DDOS attacks, to monitor for intrusion detection, and even replace IPtables. It also offers a cleaner alternative to installing drivers.

“In the future, you will see a lot more eBPF programs instead of kernel modules,” said Netflix Kernel and Performance Engineer Brendan Gregg, at the All Things Open conference held in Raleigh, North Carolina in October.

Read more at The New Stack

The Top 5 Linux and Open-Source Stories of 2018

Last year was among the best of times for Linux and open-source. It was also the worst of years. The top five Linux and open-source stories tell it all.

SPECTRE/MELTDOWN

First, last January there were a lot of exhausted and angry Linux kernel developers. That’s because a fundamental chip design mistake led to Linux and all Intel-based operating systems having to deal with the Spectre and Meltdown major security problems.

Linus Torvalds, Linux’s master developer, added, that with the “security issues kept under wraps, we couldn’t do our usual open methods. This made fixing the bugs much more painful than it should be.”

IBM BUYS RED HAT

I didn’t see this coming. IBM made the biggest software company acquisition of all time when it paid $34 billion for Red Hat. This deal wasn’t about Linux. It was about IBM wanting Red Hat’s cloud, container, and Kubernetes expertise.

Read more at ZDNet

Confused Deputies Strike Back

A few weeks back Kubernetes had its first really severe security issue, CVE-2018-1002105. For some background on this, and how it was discovered, I recommend Darren Shepherd’s blog post, he discovered it via some side effects and initially it did not appear to be a security issue just an error handling issue. Of course we know well that many error handling issues can be escalated, but why was this one so bad?

To summarize the problem, there is an API server proxy component, that clients can use to talk to other API endpoints. As the postmortem document says

  • Kubernetes API server proxy components still use http/1.1 upgrade-based connection tunneling, which does not distinguish between request data sent by the apiserver while establishing the backend connection, and data sent by the requesting user

  • High and low-privilege API requests to aggregated API servers are proxied via the same component with the same high-permission transport credentials

Well, this security issue is actually well known enough to have its own name, it is the confused deputy problem, originally written about by Norm Hardy in 1988 although referring to an original example from the 1970s. The essence of the problem is that there are three parties involved, a user, a proxy or deputy type component and an object or service that needs to be accessed, or a similar set of endpoints. 

Read more at CloudAtomic