What is ZFS? Why People Use ZFS? [Explained for Beginners]

Today, we will take a look at ZFS, an advanced file system. We will discuss where it came from, what it is, and why it is so popular among techies and enterprise.

Even though I’m from the US, I prefer to pronounce it ZedFS instead of ZeeFS because it sounds cooler. You are free to pronounce it however you like.

Note: You will see ZFS repeated many times in the article. When I talk about feature and installation, I’m talking about OpenZFS. ZFS (developed by Oracle) and OpenZFS have followed different paths since Oracle shutdown OpenSolaris. (More on that later.)

History of ZFS

The Z File System (ZFS) was created by Matthew Ahrens and Jeff Bonwick in 2001. ZFS was designed to be a next generation file system for Sun Microsystems’ OpenSolaris. In 2008, ZFS was ported to FreeBSD. The same year a project was started to port ZFS to Linux. However, since ZFS is licensed under the Common Development and Distribution License, which is incompatible with the GNU General Public License, it cannot be included in the Linux kernel. To get around this problem, most Linux distros offer methods to install ZFS.

Shortly after Oracle purchased Sun Microsystems, OpenSolaris became close-source. All further development of ZFS became closed source, as well. Many of the developers of ZFS where unhappy about this turn of events. Two-thirds of the core ZFS devlopers, including Ahrens and Bonwick, left Oracle due to this decision. They joined other companies and created the OpenZFS project in September of 2013. The project has spearheaded the open-source development of ZFS.

Let’s go back to the license issue mentioned above. Since the OpenZFS project is separate from Oracle, some probably wonder why they don’t change the license to something that is compatible with the GPL so it can be included in the Linux kernel. According to the OpenZFS website, changing the license would involve contacting anyone who contributed code to the current OpenZFS implementation (including the initial, common ZFS code till OpenSolaris) and get their permission to change the license. Since this job is near impossible (because some contributors may be dead or hard to find), they have decided to keep the license they have.

What is ZFS? What are its features?

ZFS filesystem

As I said before, ZFS is an advanced file system. As such, it has some interesting features. Such as:

  • Pooled storage
  • Copy-on-write
  • Snapshots
  • Data integrity verification and automatic repair
  • RAID-Z
  • Maximum 16 Exabyte file size
  • Maximum 256 Quadrillion Zettabytes storage

Let’s break down a couple of those features.

Pooled Storage

Unlike most files systems, ZFS combines the features of a file system and a volume manager. This means that unlike other file systems, ZFS can create a file system that spans across a series of drives or a pool. Not only that but you can add storage to a pool by adding another drive. ZFS will handle partitioning and formatting.

Pooled storage in ZFSPooled storage in ZFS

Copy-on-write

Copy-on-write is another interesting (and cool) features. On most files system, when data is overwritten, it is lost forever. On ZFS, the new information is written to a different block. Once the write is complete, the file systems metadata is updated to point to the new info. This ensures that if the system crashes (or something else happens) while the write is taking place, the old data will be preserved. It also means that the system does not need to run fsck after a system crash.

Snapshots

Copy-on-write leads into another ZFS feature: snapshots. ZFS uses snapshots to track changes in the file system. “The snapshot contains the original version of the file system, and the live filesystem contains any changes made since the snapshot was taken. No additional space is used. As new data is written to the live file system, new blocks are allocated to store this data.” It a file is deleted, the snapshot reference is removed, as well. So, snapshots are mainly designed to track changes to files, but not the addition and creation of files.

Snapshots can be mounted as read-only to recover a past version of a file. It is also possible to rollback the live system to a previous snapshot. All changes made since the snapshot will be lost.

Data integrity verification and automatic repair

Whenever new data is written to ZFS, it creates a checksum for that data. When that data is read, the checksum is verified. If the checksum does not match, then ZFS knows that an error has been detected. ZFS will then automatically attempt to correct the error.

RAID-Z

ZFS can handle RAID without requiring any extra software or hardware. Unsurprisingly, ZFS has its own implementation of RAID: RAID-Z. RAID-Z is actually a variation of RAID-5. However, it is designed to overcome the RAID-5 write hole error, “in which the data and parity information become inconsistent after an unexpected restart”. To use the basic level of RAID-Z (RAID-Z1) you need at least two disks for storage and one for parity. RAID-Z2 required at least two storage drives and two drive for parity. RAID-Z3 requires at least two storage drives and three drive for parity. When drives are added to the RAID-Z pools, they have to be added in multiples of two.

Huge Storage potential

When ZFS was created, it was designed to be the last word in file systems. At a time when most file systems where 64-bit, the ZFS creators decided to jump right to 128-bit to future proof it. This means that ZFS “offers 16 billion billion times the capacity of 32- or 64-bit systems”. In fact, Jeff Bonwick (one of the creators) said that powering a “fully populating a 128-bit storage pool would, literally, require more energy than boiling the oceans.”

How to Install ZFS?

If you want to use ZFS out of the box, it would require installing either FreeBSD or an operating system using the illumos kernel. illumos is a fork of the OpenSolaris kernel.

In fact, support for ZFS is one of the main reasons why some experienced Linux users opt for BSD.

If you want to try ZFS on Linux, you can only use it as your storage file system. As a far as I know, no Linux distro give you the option to install ZFS on your root out of the box. If you are interested in trying ZFS on Linux, the ZFS on Linux project has a number of tutorials on how to do that.

Caveat

This article has sung the benefits of ZFS. Now let me tell you a quick problem with ZFS. Using RAID-Z can be expensive because of the number of drives you need to purchase to add storage space.

Have you ever used ZFS? What was your experience like? Let us know in the comments below.

If you found this article interesting, please take a minute to share it on social media, Hacker News or Reddit.

About John Paul

My name is John Paul Wohlscheid. I’m an aspiring mystery writer who loves to play with technology, especially Linux. You can catch up with me at my personal website

Source

Linux apps on Chrome OS: An easy-to-follow guide

Linux apps can expand your Chromebook’s capabilities and open up all sorts of interesting options — but first, you have to know where to begin.

JR Raphael

By JR Raphael

Contributing Editor, Computerworld | Oct 22, 2018 3:00 AM PT

Google’s Chrome OS platform sure isn’t what it used to be.

The software that started out as a strictly web-centric entity — with everything revolving around the Chrome browser and apps that could operate inside it — is now one of modern computing’s most versatile operating systems. Contemporary Chromebooks still run all the standard web-based stuff, of course, but they’re also capable of connecting to Google’s entire Play Store and running almost any Android app imaginable. And if that isn’t enough, many models have recently gained the ability to run Linux apps as well.

Linux, for the uninitiated, is a free and open-source operating system (well, technically a series of operating systems) adored by developers, privacy advocates, and plenty of other technically inclined hominids. Despite its geeky reputation, Linux is actually used for a variety of everyday purposes, even in the enterprise. When you hear people talk about Ubuntu, Mint, or Raspbian — the software associated with the ultra-affordable Raspberry Pi computers — you’re hearing the names of specific flavors, or “distributions,” of Linux. Even Chrome OS and Android have Linux-based technology at their cores.

For all of its utility, though, Linux isn’t always the most intuitive operating system. In fact, it can be downright confusing — especially when you have to head into the terminal, its powerful command-line interface, which is the only way to install Linux apps on a Chromebook. (Some forms of the OS allow you to stick with a more traditional graphical user interface and avoid the overwhelming vastness of the command line, but that’s not possible within the current Chrome OS implementation.)

linux apps chrome os terminalJR Raphael/IDG

Meet the oh-so-friendly face of Chrome OS’s Linux terminal.

So if you want to take advantage of Linux apps on a Chrome OS device, you’re gonna have to roll up your sleeves and learn a little good old-fashioned geek-level knowledge. Let’s take it one step at a time, shall we?

Part I: Why you’d want to use Linux apps on a Chromebook

First things first: Why bother? If you’re like most Chrome OS users, a Chromebook is perfectly fine for you as-is — and Linux apps are part of a virtual Bizarro World, with foreign-seeming titles and interfaces just different enough from familiar terrain to require a learning curve.

Well, the truth is that if your Chromebook already does everything you need, you probably don’t need to mess with Linux apps. Linux app support on Chrome OS isn’t really meant to be for everyone; it’s intended to fill in the gaps of what a Chromebook can accomplish for a specific subset of advanced “almost there” users — folks who are just about able to get by with a combination of cloud-centric software and Android applications but who have one or two specific lingering needs those categories of programs can’t address.

With Linux app support, for instance, you can install Photoshop-caliber image editing software onto a Chromebook. You can run robust audio- or video-editing software that exceeds the capabilities offered by web-based or even Android-based tools in that area. And perhaps most significantly, from a big-picture perspective, you can run code editors — including Google’s own official Android Studio development tool — which opens the world of Chrome OS up to Android developers.

As Google works to turn Chrome OS into a broadly viable all-purpose computing platform and Android desktop companion, eliminating these sorts of niche-level asterisks goes a long way in expanding the ecosystem’s appeal and shedding its longstanding limitations.

Part II: How to get started with Linux apps on a Chromebook

If you think you’d stand to benefit from using a Linux app on your Chrome OS device — or if you just want to explore and see what’s out there — the first step is to see if your Chromebook supports Linux apps in the first place.

Linux app support rolled out to Chrome OS’s main stable channel with Chrome OS 69 in September, but certain hardware and software requirements are attached — which means not all devices are eligible. The simplest way to see if your device has Linux app support is to open up the Chrome OS settings (by typing chrome://settings into the address bar of a browser window) and then type Linux into the search box at the top.

If you see a section appear with the label “Linux (Beta),” you’re good to go. If not, your device isn’t supported, and you’ll have to upgrade to a newer or more powerful model in order to use Linux software.

Provided you see the Linux-related section, click on it and then follow the steps that appear to enable Linux apps for your Chromebook. The system will take a few minutes to install all the necessary elements:

linux apps chrome os installing linuxJR Raphael/IDG

Hang tight while the Linux virtual machine is downloaded and installed.

When it’s done, you’ll see a terminal window like the one shown earlier in the story. Take a moment to celebrate: Your Chromebook is officially ready to run Linux apps. And now the real fun begins.

Part III: How to install Linux apps on a Chromebook

That same terminal window is where you’ll go anytime you want to install a new Linux application. You can always find it by opening your device’s app launcher and looking for the “Terminal” entry inside.

Once you’re in the Linux terminal, the specific command you’ll enter for installing an app is sudo apt-get install followed by the app’s official name. (Told ya this wasn’t exactly intuitive, right?)

So if, for instance, you wanted to install LibreOffice — a popular and fully featured open-source office suite — you’d open the terminal and type in:

sudo apt-get install libreoffice

A quick tip: While normal commands for pasting text (such as Ctrl-V) won’t work in the terminal window, you can copy text from anywhere and then right-click (or two-finger click, on a trackpad) in the terminal to make the text appear.

Once you hit enter, the system will put a bunch of info on your screen and ask you to confirm the installation. Don’t freak out; just type the letter y and hit enter again, then wait while the installation occurs.

linux apps chrome os installationJR Raphael/IDG

Get ready for a lot of fast-scrolling text when you install a Linux app onto your Chromebook.

You’ll see a ton of text scroll down the screen while components are downloaded, unpacked, and installed. Be patient — it may take a while! When the scrolling stops and the terminal returns to the green-colored command prompt, you can safely close it (by typing exit into the prompt and then hitting enter) and go look in your Chrome OS launcher to find your freshly installed application.

linux apps chrome os launcherJR Raphael/IDG

Once installed, Linux apps live inside the regular Chrome OS launcher — alongside Android apps, web apps, and anything else on your device.

At that point, you can use the app like any other program on your device. The one caveat is that for security reasons, Linux apps can’t access your Chromebook’s full file system; they can see only a special “Linux apps” folder within the local storage. So anytime you need to pull up an existing file — be it from your local storage, an external drive, or any connected cloud storage services — you’ll first need to open the Chrome OS Files app and copy the file into that “Linux apps” area.

Part IV: How to update or uninstall Linux apps on a Chromebook

Next in our list of not-so-user-friendly considerations to remember: Linux apps won’t automatically update themselves or necessarily even notify you about available updates; instead, it’s up to you to periodically check in for updates via the terminal. On the plus side, you can search for updates to all your Linux apps at once rather than having to check individually.

To do so, open that Terminal app in your Chromebook’s launcher and type in:

sudo apt-get update && sudo apt-get upgrade

The first part of that command searches for updates to all your Linux apps; the second part downloads and installs them. All that happens once you enter the command, without any further input required. Isn’t Linux odd?

If you ever need to uninstall anything, meanwhile, use the following terminal command (substituting “libreoffice” with whatever app you want to uninstall):

sudo apt-get remove libreoffice

Part V: An easier option

Does all of this sound like an awful lot of work? It kind of is — but take heart: There’s a simpler option, though it, too, requires you to use some of the foundational knowledge we’ve just established.

Employing the above mechanisms, you can install what’s called a Software Center — basically, an app store for Linux apps. It gives you a graphical interface for finding programs, installing or uninstalling them, and even updating them down the line.

First, however, you have to install the Software Center, and the process is exactly like installing any other Linux app. So go back to your terminal and enter the following command:

sudo apt-get install gnome-software gnome-packagekit

Press enter and confirm as needed. Once the process is finished, you’ll see a new item in your Chromebook’s app launcher called “Software.”

You aren’t finished yet, though. (See? Nothing’s truly simple in this domain.) Odds are, when you first open the Software Center, you’ll find very little on its virtual shelves. You can try rebooting your Chromebook to see if that fixes things, but if that doesn’t work, you’ll need to go back into the terminal to force an update. First, type:

sudo apt-get update

Press enter and allow that process to finish. Then, type:

sudo apt-get dist-upgrade

Once more, press enter and let the system do its thing. When it’s done, reboot your Chromebook — and then you should see the fully stocked Software Center, ready to handle all your Linux app needs with relative ease:

linux apps chrome os software centerJR Raphael/IDG

A Software Center makes the act of managing Linux apps much simpler — once you get it installed, that is.

And with that, my geek-card-carrying friend, allow me to welcome you to the world of Linux apps on Chrome OS. As you can see, this setup certainly isn’t intended for everyone at this point — but for those of us who need it and are brave enough to pursue it, ample rewards await.

Which Linux apps are worth your while? Stay tuned for my collection of Linux-on-Chromebook recommendations, coming soon to Computerworld.com.

Source

Block Countries With Nginx and GeoIP

You can use nginx to either allow or deny certain countries from accessing your site using the GeoIP database which maps IP addresses to the origin country.

Nginx GeoIP Requirements

Nginx Installation – Nginx must already be installed on your server if it is not yet. Please see How to Install Nginx

Nginx must also be compiled with –with-http_geoip_module

To make sure type the following

nginx -V 2>&1|grep –color=always with-http_geoip_module

You should see the returned output contain with-http_geoip_module

If it does not, you will need to change to the source direct copy the entire configuration line and append –with-http_geoip_module to reconfigure

./configure –user=nginx –group=nginx –prefix=/etc/nginx –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –pid-path=/var/run/nginx.pid –lock-path=/var/run/nginx.lock –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –with-http_gzip_static_module –with-http_stub_status_module –with-http_ssl_module –with-pcre –with-file-aio –with-http_realip_module –without-http_scgi_module –without-http_uwsgi_module –with-http_realip_module –with-http_geoip_module

Then

make && make install

Install the GeoIP Database

Create a new directory for the GeoIP database to go:

mkdir /usr/share/geoip

Change to that directory:

cd /usr/share/geoip

Get the latest GeoIP database, this is the free ‘lite’ version. MaxMind also offers paid versions as well.

wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

Gunzip the database:

gunzip GeoIP.dat.gz

Configure Nginx

Nginx needs a global configuration and then to be told in each server block to restrict IP access.

nano /etc/nginx/nginx.conf

You will want to insert the following in to the http{} block

geoip_country /usr/share/geoip/GeoIP.dat;
map $geoip_country_code $allow_country {
default yes;
EG no;
FR no;
FI no;
}

Each country code you want to block would be indicated above. This wont create the actual block it will just create the map. Next you will want to edit the server{} block and add the following

if ($allow_country = no) {
return 403;
}

You will then save the file and restart nginx

service nginx restart

Now any countries you have set to ‘no’ will receive a 403 forbidden page. This could be switched to only allow certain countries, by setting the default to no and entering each country with a yes next to it that you wanted to allow.

Jun 13, 2017LinuxAdmin.io

Source

Amazon Connect Now Supports Service-Linked Roles

Posted On: Oct 19, 2018

Today, Amazon Connect is introducing support for using AWS Identity and Access Management (IAM) service-linked roles, a new type of IAM role that allows you to easily delegate permissions to AWS services.

These service-linked roles are predefined by Amazon Connect and include all the permissions that the service requires to use other AWS services on your behalf. Examples include the permissions that Amazon Connect requires to use Amazon S3 for call recordings, Amazon Kinesis for streaming data, or Amazon Lex to invoke a chatbot.

Unlike a normal IAM role, you cannot delete the service-linked role if it is still in use by an Amazon Connect instance. This protects you from inadvertently revoking Amazon Connect’s required permissions to your resources. The addition of service-linked roles to Amazon Connect also helps with monitoring and auditing requirements in AWS CloudTrail by logging actions performed by Amazon Connect against the respective service-linked role.

Service-linked roles are available in all AWS regions where Amazon Connect is offered. There is no charge in addition to standard pricing for service usage and associated telephony rates. To learn more about Amazon Connect, the AWS service for self-service contact centers in the cloud, please visit the Amazon Connect website.

Source

Essential System Tools: Alacritty – hardware-accelerated terminal emulator

The first tools under the spotlight were ps_mem, a small utility that accurately reports memory consumption of software, and gtop, a system monitoring dashboard. The third tool we showcased was pet, a simple command-line snippet manager. These utilities are console-based. This time we switch to a graphical utility. It’s a terminal emulator called Alacritty. But it’s different to most terminal emulators.

Linux has lots of terminal emulators. What distinguishes Alacritty from the vast majority of terminal emulators? It differentiates itself by offering GPU-acceleration combined with a minimal feature set.

The software is written in Rust, a popular programming language among developers. For example, Rust won the most loved language in Stack Overflow’s Developer Survey for the past 3 years.

Installation

My preferred way of installing software is to compile a program’s source code. For my Arch Linux distribution, I installed a few packages first.

sudo pacman -S cmake freetype2 fontconfig pkg-config make xclip

Then it’s just a matter of cloning the software’s repository and building the software with cargo, Rust’s package manager. Cargo makes it easy to get up and running by downloading a Rust project’s dependencies, compiling the project, making packages, and more.

git clone https://github.com/jwilm/alacritty.git
cd alacritty

cargo build –release

If you’re so inclined, there’s a snap available. And many popular distributions carry a package for the software.

In operation

Let’s go through a simple test to see how Alacritty performs in practice. Alacritty boasts that it’s the fastest terminal emulator available. Defining ‘fastest’ is subjective. Are we measuring the software’s latency? Or the completion of a basic test such as the ability to scroll text in the shortest time?

For simplicity, I compared the software with other popular terminal emulators, seeing how long it takes each emulator to scroll through 100MB of text. Here are the results:

AlacrittyClick image for full size

As you can see, Alacritty completes the test in the quickest time. It’s about twice as quick as kitty, another GPU based terminal emulator. Most non-hardware accelerated terminal emulators lag behind in the test, although there are a few notable exceptions. I also tested a dozen other terminal emulator (results not shown, which were comparable with the results for Terminator and GNOME Terminal etc.), and Alacritty remains top. Different types of text manipulation tests also yielded similar results.

With the same set terminal emulators, let’s see how much memory each emulator consumes at startup in their default configuration, using the ps_mem utility.

AlacrittyClick image for full size

Alacritty consumes the most memory. The default installation sets the scrollback buffer to hold 10,000 lines. You can reduce the software’s memory consumption by lowering the number of scrollback lines. Ideally, we’d like to see dynamic memory allocation, as it can be helpful to have a large scrollback buffer in some situations while minimizing memory consumption.

Features of Alacritty include:

  • The software deliberately pares features to the bone. For example, tabs or splits are not offered. There’s no audio bell.
  • Uses a system’s dedicated GPU to improve performance.
  • Supports scrollback with definable number of lines to scrollback, together with control of the number of lines scrolled (faux scrolling).
  • Option to open URLs on click.
  • save_to_clipboard configuration option for copying selected text to the system clipboard.
  • Support for the LCD-V pixel mode (vertical screens).
  • Supports scancode-based key bindings.
  • Support for bitmap fonts.
  • Preliminary support for Wayland.
  • Cross-platform support – runs under Linux, macOS, FreeBSD, and OpenBSD. Windows support is planned.

Summary

Alacritty is a useful terminal emulator. While its features are frugal, it’s designed to be used together with other software such as tmux. It supports the Unix philosophy of composability, where components can be selected and assembled in various combinations to meet a user’s preferences.

It’s important to remember that Alacritty is in a fairly early stage of development. The developers consider the code to be alpha quality.

Website: github.com/jwilm/alacritty
Support: Wiki
Developer: Joe Wilm, Christian Duerr, and many contributors
License: Apache License 2.0

Source

Linux Today – IPFire Hardened Linux Firewall Distribution Is Now Available on Amazon Cloud

Oct 21, 2018, 14:00

(Other stories by Marius Nestor)

IPFire 2.21 Core Update 124 is now available with Linux kernel, OpenSSH, and Unbound hardening. It ships with Linux kernel 4.14.72 LTS, a release that improves support for network adapters and enables built-in kernel security features to further harden IPFire against various attack vectors, and Unbound 1.8 DNS proxy hardened to reduce the load on DNS servers. This is also the first release of IPFire to add support for booting in EFI (UEFI) mode on x86_64 computers that support the standard. However, the developers noted the fact that to benefit of EFI support, users will have to reinstall IPFire. Due to software running underneath IPFire, which could expose the firewall to more attack vectors, it is recommended to disable EFI in BIOS if possible.

Complete Story

Source

Nano 3.0 Released! Reads Files 70% Faster

A new major release of open source text editor GNU nano is here. GNU nano 3.0 reads files 70% faster and brings several other features.

GNU nano logo

GNU nano is one of the most popular terminal based text editors. Those who keep forgetting how to exit Vim, seek refuge with GNU nano. It’s a godsend for beginners who have to deal with editing in the command line while the experienced nano fans just swear by it.

GNU nano 3.0 has just been released. Let’s see what new features it brings.

New features in GNU nano 3.0

Some of the main new features in GNU nano 3.0 are:

  • Reads files 70% faster
  • Speed of handling ASCII text has been almost doubled
  • New shortcuts: Ctrl+Delete erases the next word and Ctrl+Shift+Delete erases the preceding word
  • Many other keybinding changes
  • Shows the correct number of lines on the status bar when opening multiple files
  • Ignores any presses of before a valid command keystroke
  • Recognizes more escape sequences
  • Avoids a possible hang during a Full-Justify

You can read the release note for GNU nano 3.0 here.

Getting GNU nano 3.0

Nano is the default text editor on Ubuntu. It comes preinstalled with many other distributions. You can find it in the main repository of almost all Linux distributions.

But when it comes to installing nano 3.0, you should wait for your distribution to provide this update. It will take some time before you’ll see this in your system updates. Arch users should be getting it before everyone else, as always.

If you are one of the few who likes installing software from its source code, you can get it from its download page.

Excited about GNU nano 3.0?

Are you one of the nano fans? Are you excited for this new release? Why do you use nano over the likes of Vim? Share your views with us in the comment section below.

About Abhishek Prakash

I am a professional software developer, and founder of It’s FOSS. I am an avid Linux lover and Open Source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mysteries. I’m a huge fan of Agatha Christie’s work.

Source

Restart Nginx on Ubuntu, Centos and Docker

linux restart nginx

How often do you restart ngnix service on Linux webserver? This blog post will cover various ways to restart Nginx on a Linux system via command line and on Nginx running in a docker container. I have covered on both on a Systemd server and SysV init/Upstart system.

Open your terminal and login with root/sudo user to run below shown commands.

Restart Nginx HTTP server

CentOS 7, Ubuntu 18.04 and Ubuntu16.04 are a systemd operating system. To restart nginx service, you’ll need to use systemctl command line tool.

It is recommended to check syntax before restarting nginx service,

$ sudo nginx -t
$ sudo systemctl restart nginx

If you’re restarting after modifying nginx service unit file, you need to reload systemd first

$ sudo systemctl daemon-reload

Then restart nginx

$ sudo systemctl restart nginx

If you want to reload the configuration without restarting the service, i.e maintain current sessions, use

sudo systemctl reload nginx

Restarting Nginx on Upstart/SysV init system

If you’re running a system with upstart or SysV init system. e.g Ubuntu 14.04, CentOS 6, you need to manage nginx service using the servicecommand.

$ sudo service nginx restart

You can also use an absolute path to init script, e.g

sudo /etc/init.d/nginx restart

Restarting Nginx inside docker container

For nginx running inside a Docker container, it is advisable to reload the configuration instead of restarting the service.

docker exec <nginx-container-name-or-id> nginx -s reload

If you must restart the nginx process, then consider restarting the container using the command:

$ docker restart <container name|id>

Example

$ docker restart nginx

Where nginx is the name of nginx container.

Restarting nginx is a simple process but you need to be careful to ensure that any change made has correct syntax to avoid failure during a restart. The command used to check for configuration syntax is nginx -t

Read Also:

Source

The Performance & Power Efficiency Of The Core i7 990X vs. Core i9 9900K

With my initial Core i9 9900K benchmarks out there following Friday’s embargo expiration, for some weekend benchmarking fun I decided to pull out the old Core i7 990X to see how it compares to the new 9900K… The Gulftown and Coffeelake processors were compared not only on raw performance but also overall power consumption and performance-per-Watt.

 

 

The Core i7 990X was the Extreme Edition processor back from 2011 codenamed “Gulftown” (Westmere microarchitecture), the 32nm generation before Sandy Bridge. Granted the announced but not yet released Core i9 9900X X-Series CPU will be more akin for comparison to the 990X, and I will at such time that it is available, but just for some extra benchmark runs over the weekend I was curious to see how the 990X and 9900K compare…

 

 

Here’s a look at how the i7 990X stacks up to today’s i9 9900K in some key areas as well as the yet-to-ship Core i9 990X:

 

 

For this fresh benchmarking, the i7 990X was running with the MSI X58M motherboard and 3 x 4GB DDR3-1066 per the rated specifications. The Core i9 9900K was running with the ASUS PRIME Z390-A motherboard and 2 x 8GB DDR4-3200 memory. Both systems were tested with a Samsung 860 EVO SATA 3.0 solid-state drive and Sapphire Radeon RX 560 graphics card.

 

 

Both systems were running the newly-released Ubuntu 18.10 x86_64 Linux with the 4.18 kernel and its latest Spectre/Meltdown mitigations, GCC 8.2.0 compiler, EXT4 file-system, and other default software components.

 

Via the Phoronix Test Suite a range of benchmarks were run on each system. The AC system power consumption was being polled in real-time by the Phoronix Test Suite with a WattsUp Pro power meter interfacing over USB for being able to generate accurate performance-per-Watt metrics on a per-test basis. Enjoy these results as you wish for just some interesting Intel performance figures from the 990X to the 9900K. See my launch day Core i9 9900K Linux benchmarks for the 15-way AMD/Intel CPU comparison against more modern CPU targets.

Source

MongoDB basics — Create, Show and Drop Collections

MongoDB basics — Create, Show and Drop Collections

MongoDB is a NoSQL database. This means that unlike relational databases there’s no set in stone schema with various row and columns or fields with well-defined data types. Analogue to traditional SQL database tables, MongoDB has collections. Where there were once rows in a SQL table, MongoDB has documents. Data is queried across all collections and documents using key-value pairs, which you will soon see.

The utility of MongoDB is its ease of use, scalability and the JSON like syntax with which the stored data is represented. On the other hand, if you wish to do crazy operations on your datasets like JOINs you may find MongoDB cumbersome and traditional SQL databases are better suited for that.

In any case, this article would not presume any familiarity with databases whatsoever. We will just assume that you have MongoDB installed on your server/desktop (it is available on Windows, Mac and Linux). With that installed we will create our sample database and see MongoDB in action.

Prerequisites

  1. MongoDB installation. You can follow the official documentation to install your current Operating System. OR
  2. Optionally, you can sign up for MongoDB atlas. They offer a free tier with 512MB of persistent storage. Perfect environment for experimentation or small projects.
  3. If you wish to not install any software whatsoever, you can visit Katacoda and use their web-based interface as an ephemeral sandboxed environment.

Getting Started

Assuming you have MongoDB server installed and a shell connected to the server we can start exploring a few features of it. But first a few terminologies — A mongodb server has a list of databases dbs in it. Each database can have multiple collections in it.

So for example, a University can have a personnel database which can then have various collections for different departments like one collection for Mathematics, one for Biology and so on.

Source

WP2Social Auto Publish Powered By : XYZScripts.com